# Questions tagged [iteration]

The tag has no usage guidance.

151 questions
Filter by
Sorted by
Tagged with
1 vote
42 views

### How do I construct and plot functions properly using NestList?

I am trying to construct a function using NestList and plot the values. Although the individually used and defined functions in my notebook seem to do the right ...
80 views

### Two variable recursive integral equation

I'm trying to improve the question posted in Solving an integral vectorial equation by iterations but when the iterations are for two variables. I mean, suposse that I have the following integral ...
113 views

### Solving an integral vectorial equation by iterations

I'm triying to solve a problem like the following: $$\binom{f(t)}{g(t)}=\binom{f_0(t)}{g_0(t)}+\lambda\int_0^t ds\hat{A}(s)\binom{f(s)}{g(s)},$$ where $f_0(t),g_0(t)$ and $\hat{A}(t)$ (a $2\times2$ ...
51 views

### Integration does not converge in iteration

I have the following code to find a numerical solution for a singular BVPas attached in the picture. I have the following Mathematica code: (This code of this question can be found at Mathematica does ...
1 vote
84 views

### Using Loop to find a specific Energy

I am given a Hamiltonian: ...
103 views

This code ...
193 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} ]
98 views

119 views

### Mathematica does not show anything after running for higher iterations

Consider a BVP: $y^{\prime\prime}=\frac{3}{2}y(t)^{2}$ with the boundary conditions $y(0)=4$ and $y(1)=1$. The exact solution is $y(t)=\frac{4}{(1+t)^{2}}$ and the initial guess is $y(t)=4-3t$. Now I ...
85 views

### Implementing While loop in module that will iterate correctly

I am attempting to write a module that prints an optimal path from a starting node to a destination node. The first node is 1 and the final node is 100 (though when module prints these they should be ...
49 views

261 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 ...
72 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 ...
80 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 ...
49 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 ...
37 views

### Flatten a pair of matrices within a list of matrices

I have a list of matrices, which I think is better to give an example using the code. ...
36 views

### Force list of colours to have same grayscale value, maintaining hue

A sketch of what I'd like to achieve is given by ...
513 views

### Best way to count nest depth in e.g. f[f[f[...[f[x]]...]?

What is the best way to count nesting depth in e.g. f[f[f[...[f[x]]...]? In other words, what function func is good for giving ...
1 vote
52 views

### How to do simple list traversal? And how do I insert this in a function?

I want to make a function that takes as input a list of numbers and returns a list of 4 lists; the first returned list holds all positive real; the second returned list all negative real; the third ...
134 views

### How to use NestList for coupled equations?

I have a code that works for a single equation. How to I use NestList for two equation that are coupled? Below is the code for single equation, ...
137 views

### Repeating and Sequencing Procedures with two Do-loops

I have a Do loop where I'm looking for the value of certain parameters that respect the conditions inside an If, and with those values, a run another Do to make another calculation of an expression ...
118 views

### Using the Fold function with multiple parameter inputs [closed]

I want to construct something like: f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, f[a, b, c, x]]]]]]. I believe this can be done using the Fold or Nest ...
96 views

### Iteration limit exceeded

I am trying to adapt the following piece of code (coming from this answer): ...
64 views

### How to use NestWhile to get it to work the way I want?

I have a vector th={0,0,...,1.57}. Now I want to choose the second element and change it by stepsize 0.2 until it is less than 1.57, I need these set of vectors: th={0,0.2,0,...,1.57} th={0,0.4,0,...,...
294 views

### Heat transfer with functions defined on different domains

I'm attempting to model a situation in which a polymer initially at a higher temperature is sandwiched between two cooler metallic mold pieces with conductive boundary conditions in between the ...
279 views

### How to recreate this complex iteration

I came across this image in a book Im reading: (taken from Rational Iteration Complex Analytic Dynamical Systems from Steinmetz. I hope it is okay to share it here) and I try to recreate it in ...
79 views

### RecurrenceTable and While

Good day. Let's take an example from Help on RecurrenceTable: ...
122 views

### NestList in 12.1/12.2 is 10x slower than 11.3/12.0

Are there any configurations to fix it? Test code: ...
1 vote
103 views

### FoldList and Compile [closed]

Let me elaborate my previous question about Foldlist and Composition. ...
1 vote
94 views

### FoldList with Composition and parameter

Good day to everyone! I have two (just for simple example) functions and they compose a map: ...
124 views

### Generating a lattice by $𝑁^{𝑡ℎ}$ iteration of unit cell

This question is in continuation of the my previous question that was not clearly presented by me at all. I have a unit cell, and I would like to generate a lattice but in iterative order. For ...
57 views

### Functional iteration of list of functions

I'm getting completely stumped on writing a function makeIterate that constructs an iterated structure out of a list of functions e.g. ...
1 vote
91 views

### How do I correctly iterate using Outer when an argument / slot is a nested list?

I have the following complex nested iteration situation. I begin with a list, data, that comprises 16 TemporalData objects Each TemporalData object contains 2 ...
44 views

### Why Mathematica doesn't compute the permutation products in my NestList[]?

I wrote the following: K = DihedralGroup; K = GroupGenerators[K]; y = K[]; x = K[]; l = NestList[PermutationProduct[x, y], x, 4] But Mathematica gives me ...
73 views

### n-dimensional recursion [closed]

I am trying to set up a recursive function that generates n number of differential equations for Subscript[y, n][t] This ...
1 vote
70 views

### Iterative and recursive approach to generate Fibonacci sequence

I'm new to use Mathematica and using this demo project to understand Mathematic demo example. I modified example code to only plot the runtime of recursive version of Fibonacci sequence runtime: ...
1 vote
54 views

### Plotting iterates of a piecewise defined map

This is a follow up question to the one I asked here. I’ve succeeded in figuring out how to plot the first image of my piecewise defined transformation $T: [-1,1]^2 \to [-1,1]^2$, but now I want to ...
1 vote