As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [iteration]

The tag has no usage guidance.

26 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
125 views

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

Are there any configurations to fix it? Test code: ...
AsukaMinato's user avatar
  • 7,629
2 votes
0 answers
55 views

Recursively create Graph from seed and Nest GraphUnion, keeping VertexStyle, EdgeLabels, VertexCoordinates, EdgeShapeFunction

TL;DR; GraphUnion does not preserve properties of the input Graphs. How do I combine two ...
rhermans's user avatar
  • 35.6k
1 vote
0 answers
102 views

FoldList with Composition and parameter

Good day to everyone! I have two (just for simple example) functions and they compose a map: ...
macros's user avatar
  • 99
1 vote
0 answers
59 views

Find parameter ranges of a function whose value is within a window by sampling points

Problem: I want to find the ranges of the parameters for a function $f(x,y,z)$ when $0.9 < f(x,y,z) < 1.1$. All parameters are bounded $x , y, z \in [0,1]$. In the real problem the function ...
anecdote's user avatar
  • 111
1 vote
0 answers
84 views

Recursion depth of 1024 exceeded during evaluation of ... when importing a directory with many files

I'm doing this: Import["/Volumes/Transcend2/images/", "*.jpg"]; And getting these errors: Then, after it's done, when I type "images" and shift+enter, I just ...
Youssef A's user avatar
0 votes
0 answers
85 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: ...
Charmbracelet's user avatar
0 votes
0 answers
43 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$,...
Dan1618's user avatar
  • 101
0 votes
0 answers
23 views

Difference between SubstitutionSystem and StringReplace

I'm examining two-step substitution model: First step, division: {"A" -> "BC", "B" -> "AC", "C" -> "AB"} Second step, merging: {&...
lesobrod's user avatar
  • 859
0 votes
0 answers
64 views

Solving numerically Pdes and Odes and Iteration processes

Dears, I have the following equations: $x^{\prime\prime}(t)=\frac{3}{2}x(t)^{2}$ with $x(0)=4$ and $x(1)=1$. The exact solution is $x(t)=\frac{4}{(1+t)^{2}}$. Now the corresponding operator is $ Px=x+\...
Junaid's user avatar
  • 161
0 votes
0 answers
84 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 ...
physgj's user avatar
  • 109
0 votes
0 answers
143 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 ...
Ben's user avatar
  • 453
0 votes
0 answers
81 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 ...
Aschoolar's user avatar
  • 883
0 votes
0 answers
42 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. ...
Timevortex's user avatar
0 votes
0 answers
154 views

Iteration limit exceeded

I am trying to adapt the following piece of code (coming from this answer): ...
mattiav27's user avatar
  • 6,434
0 votes
0 answers
74 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,...,...
Delaram Nematollahi's user avatar
0 votes
0 answers
45 views

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

I wrote the following: K = DihedralGroup[5]; K = GroupGenerators[K]; y = K[[1]]; x = K[[1]]; l = NestList[PermutationProduct[x, y], x, 4] But Mathematica gives me ...
Red Banana's user avatar
  • 5,111
0 votes
0 answers
51 views

Iterating MovingMap with Nest

I am trying to create a background correction inspired by the PyMca strip background method. The data I'm trying to correct is a HPLC chromatogram in the form of a ...
rowsi's user avatar
  • 395
0 votes
0 answers
76 views

How to update a function with previous iterate?

I'm trying to solve a differential equation numerically, and it has led me to a non-linear system of equations which I wish to solve using Newton's Method, which, for systems, is given by (for 3 ...
Sandwiches29's user avatar
0 votes
0 answers
65 views

Avoiding Tables, Do and other loop construction

In my work I have a lot of cases, where I should calculate non-listable functions for a quite large number of points. To be more concrete, consider first listable function ...
Artem Alexandrov's user avatar
0 votes
0 answers
159 views

Nested for loop with variable length

I am new to mathematica and I want to create the set of all n-tuples whose sum is less than a fixed number $N$. My idea would be to do a for loop where I choose first number $k_1$ in between 0 and N, ...
Ivan Burbano's user avatar
0 votes
0 answers
119 views

FindRoot not recognising replaced symbol in nested function

I have the following example FindRoot function as part of a Nest function. ...
Archie Watts-Farmer's user avatar
0 votes
0 answers
55 views

Iterating over a list and defining the range accordingly

I have the following list, l = {{"a", "b"}, {"a", "b"}, {"c", "d"}, {"e", "f"}, {"e", "f"}, {"x", "y", "z"}, {"m", "n", "o"}, {"p", "q", "s"}}; for each ...
Wiliam's user avatar
  • 2,766
0 votes
0 answers
94 views

How to save a all matrices renewed in each iteration?

I have a (n by m) matrix , in which the elements are recalculated and replaced by new ones in each iteration. (In other words I have a loop in which the elements of the mentioned matrix are being ...
Delaram Nematollahi's user avatar
0 votes
0 answers
146 views

How can I make my code containing a For loop more Mathematica-style?

I know there are a lot of questions on this site regarding the use of For loops and how to avoid them in Mathematica. However, in my case I believe it is justified,...
Klangen's user avatar
  • 947
0 votes
0 answers
147 views

How to give a function multiple variables in a mapped and nested list?

I come from python (not advanced tho), and have been learning mathematica. I'm currently struggling with the following code: This is a basic version of what i wanted to implement: ...
jenny's user avatar
  • 41
0 votes
0 answers
136 views

Dummy variable in nested integral operator

I am trying to make a nested integral operator where the output function of one step must be applied to the dummy variable to be integrated in the next step. Here my code: ...
Pierre's user avatar
  • 101