Questions tagged [iteration]

The tag has no usage guidance.

29 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
126 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
  • 9,318
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
  • 36.3k
1 vote
1 answer
103 views

A way to generalize my code for this non linear ODE problem

I am trying to solve the differential equation $y''(x) = y(x)+\sin[y'(x)]$ using "Fixed Point Iteration" over the interval $[0,1].$ Now using central difference method I arrived at the ...
Learner's user avatar
  • 219
1 vote
0 answers
104 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
87 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
32 views

How to find clear solution for iterative problem by condition $<v_k ,v_n>=0$ If $k!=n$

I want to find x[n] by v[n] values without x[n] in solution by iterative below problem: <...
user68119's user avatar
0 votes
0 answers
45 views

FindMinimum with many Sums and NIntegrates is very slow

I want to calculate the global minimum of an equation which has several hundred Sums (I used 300 in this code), but the calculation is very slow. My code is as ...
user43830's user avatar
  • 101
0 votes
0 answers
65 views

Successive multiplications using Mathematica tools

Successive rotations on the unit circle Given an arbitrary starting point $z$ on the unit circle in the complex plane, the goal is to compute a cycle of rotations by $\pi$/2 with successive ...
dantopa's user avatar
  • 1,060
0 votes
0 answers
51 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
  • 1,491
0 votes
0 answers
69 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
89 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
  • 141
0 votes
0 answers
186 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 ...
lumw's user avatar
  • 583
0 votes
0 answers
107 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
44 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
207 views

Iteration limit exceeded

I am trying to adapt the following piece of code (coming from this answer): ...
mattiav27's user avatar
  • 6,637
0 votes
0 answers
78 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
47 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,203
0 votes
0 answers
52 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
79 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
180 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
127 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
57 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,946
0 votes
0 answers
101 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
147 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
  • 999
0 votes
0 answers
149 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
167 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