# Questions tagged [iteration]

The tag has no usage guidance.

173 questions
Filter by
Sorted by
Tagged with
84 views

### How to find the minimum at each iteration?

I would like to iterate the table for {Q,0,3,1}, {R0,1,5,1}, the values of m=[3.83171, 7.01559, 10.1735, 13.3237, 16.4706, 19.6159, 22.7601, 25.9037] and calculate the corresponding k and Ra. Also, I ...
213 views

### Solve can’t solve this… is there a way to approximate it?

I've been toying around with mortgage/loan calculations and spreadsheeting. The loan formula is as follows: A = p * r *(1+r)^n / ((1+r)^n - 1) A: payment per period p: principal r: interest rate n: ...
91 views

### Wolfram Alpha simplifying $\sqrt{1+x^\sqrt{1+x^\sqrt{1+...}}}$ incorrectly [closed]

I am pretty new to Wolfram Alpha. I want Wolfram Alpha to find the derivative of $\sqrt{1+x^\sqrt{1+x^\sqrt{1+...}}}$. At the moment, I am having trouble with Wolfram Alpha simplifying it incorrectly. ...
1 vote
46 views

### CPU time in iteration process

Let $Tx=\frac{x}{2}$ for all $x\in[0,1]$. Let $x_{0}\in[0,1]$ and set an iterative sequence $\{x_{n}\}$ by the method $x_{n+1}=Tx_{n}$. Now if $x_{0}=0.8$, then I get a convergent sequence towards the ...
91 views

### List operation for beginner Usage of #1 and #2 (in stead of using for loop)

I have trouble using list operation of #1 and #2. Could you please tell me how to make it? I prepared the list as below, ...
• 99
731 views

### Create a regular polygon with n vertices given two points

I want to create a regular polygon from the initial two points $A$, $B$ and number of vertices $n$, regularPolygon[{0, 0}, {1, 0}, 3] gives ...
• 5,404
36 views

### function with parallel iterations

coprimesParallelIter[n_] := DistributeDefinitions[GCD]; ClearAll; ParallelTable[If[GCD[i, n] == 1, i, Nothing], {i, 1, n - 1}] // Flatten // DeleteCases[Nothing] ...
• 493
37 views

### Mathematica script not running properly on remote server

I am trying to run a mathmatica script on an hpc. First I converted the .nb into a .m file and changed the cell properties to initialization. But I am getting several errors while submitting the job ...
• 107
392 views

### Better way to do such iteration

Consider such an iteration function ...
• 6,625
72 views

### Implement of Euler Method of Parabolic PDE

I'm experimenting with different schemes for numerically solving PDEs in Mathematica. I use NestList to implement the Euler Method for 1-D PDE, the code is concise: ...
1 vote
476 views

### How to plot an imaginary number, i, power tower as done in the following way?

Can somebody explain what two variables exactly they have plotted against each other to get such graphs, and how one would go about getting this graph in Mathematica?
• 43
104 views

### How do I create cobweb iterations or stair steps **WITH ARROWS** to show attractive and repulsive fixed points for a graph? [closed]

I'm new to Mathematica, so I would appreciate any help. How do I create cobweb iterations or stair steps WITH ARROWS to show attractive and repulsive fixed points for this graph? I want it to look ...
• 43
87 views

### How to plot an iterative function of y(n+1) against y(n) in order to analyze the convergence of real power towers? [closed]

I'm new to mathematica and was wondering how to plot an iterative graph for power towers. If there is a power tower y= x^x^x^x^x^x^... we can rewrite it as an iterative equation in the following way: ...
• 43
111 views

### How can I nest a complex function?

I am examining the mandelbrot set so I need to iterate the function f[z_Complex, c_] := (z)^2 + c Besides, I want to choose the complex numbers dynamically from ...
1 vote
86 views

### Iterative method for fixed point of a mapping with domain and range contained in $\mathbb{R}^{2}$

Let $X$ be a metric space and $T:X\rightarrow X$ be a function. A point $x\in X$ is called a fixed point of $T$ if $x=Tx$. For example, if $X=[0,1]$ and $Tx=\frac{x}{2}$ then $T$ has a unique fixed ...
181 views

### How to do a Picard iteration on a Volterra equation? [closed]

I want to approximate the solution of a Volterra integral equation using the Picard method, and plot the approximated solutions. For this I have the equation: where the functions and coefficients are:...
• 989
1 vote
41 views

### How can I define an operator and plot its iterates?

I am trying to define a function (an operator) that "integrates then translates" a function. More specifically, for an input f[x], I want to integrate it as \int_0^x f[t] dt, then translate ...
• 113
37 views

### Iterating an operator on a polynomial

I want to be able to build an operator $S$, on a polynomial in multiple variables which does something like this $f[x,y] =$ some polynomial $S[f][x,y] = y*f[y,x]$ And then for a specific choice of $n$,...
• 101
1 vote
97 views

1 vote
92 views

### Using Loop to find a specific Energy

I am given a Hamiltonian: ...
• 689
107 views

This code ...
• 682
295 views

### What's a functional alternative to nested Do loops?

How can I use functional code to achieve the same effect as the following procedural code Do[ Do[ f[i,j], {j,1,m} ], {i,1,n} ]
• 359
205 views

• 161
134 views

### FixedPoint not working, despite quick convergence of sequence [closed]

Trying the computation below, with Mathematica 13.0.0, I am not getting a result returned. FixedPoint[Cos, 0.85] This appears in the 3rd edition of "...
• 315
286 views

### ParallelDo barely faster than Do

I am new to parallel computing, so I am trying to get a grasp as to how this works. Many posts seem to indicate that overhead (like here) is a common pitfall, but I do not see why this would be the ...
• 1,317
266 views

### Nested floor functions

I would like to compute a limit involving a particular nested floor function. For example: ...
• 139
354 views

### Defining a function iteratively without Mathematica getting stuck in a recursion loop

I have the following code: ...
• 636
1 vote
68 views

### Digits product and an iteration process

I would like to create a code which gives me the square of the product of the digits of a number, with the only rule that if a number has a 0, then it doesn't count in the product (for example, if the ...
• 139
182 views

### I'm beginner and do not how to plot the Basins of attraction by the methods

For a complex polynomial $P(z)$, define $T$ by $T(z)=z-\frac{P(z)}{P^{\prime}(z)}$, where $P^{\prime}(z)$ is the first derivative of $P(z)$. We consider Newton method for finding the roots of ...
• 161
178 views

### How to use for loop in Mathematica?

in most of my job I have to repeat something for different part of data, for example making plot, usually the only thing need to change is index. Below is the example of the code which I have to ...
• 383
1 vote
62 views

### Why each iteration takes longer than previous one when using VariationalD in this loop?

I have a function $f$, and I would like to modify it iteratively to approach another one called $a$ (not because I think this is the best way to do anything, but for experimentation). For this, I use <...
524 views

### What is the most efficient way to define a Loop until function?

Mathematica has the While function which is very convenient when we need to process some code until the attainment of a certain state (identified with a condition). ...
• 1,089
122 views

### Spurious renaming in nested Function construct

From the documentation of Function, I take this example (slightly simplified). Renaming the dummy or bound variable (y->y\$ in the inner ...
462 views

### Replacing elements at a single level in a nested list

I want to replace all instances of 0 in the outer most level of a nested list with 1. However, when I use ReplaceAll as ...
• 973
82 views

### FindRoot doesn't find root

I am facing a problem that my FindRoot doesn't find the actual roots. I am trying to make a loop that iterates my parameter sets (U0,X0,\Sigma0) to find sets that satisfy some conditions. Here is my ...
• 109
127 views

### The use of NestList

After read Michael answer, code use NestList to compute and feed in numerical integration. I want to learn this idea into my code. In the ...
• 443
75 views

### Converting 1D map into first order differential equation for bifurcation diagram code

I have existing code to plot bifurcation diagram for coupled first order differential equations. It seems to work for coupled differential equations. To test the code further, I use the simplest ...
• 883