Questions on using and specifying iterators used in Mathematica functions.

learn more… | top users | synonyms

4
votes
0answers
64 views

Can a single Sum with multiple iterators be different from nested Sums?

Multiple sums are documented with two or more iterators, for example: Sum[1/(j^2 (i + 1)^2), {i, 1, Infinity}, {j, 1, i}] however the same answer can be ...
0
votes
1answer
32 views

Iterating KroneckerProduct[] and returning the result from a function

I am trying to write a function which will take a matrix m and an integer i as inputs. Then it will compute the Kronecker product of m with itself i times and return the result. The code is as follows....
1
vote
1answer
63 views

How to write a loop to run iterations of functions to obtain different values? [closed]

I am trying to iterate the function a, b and td2 (10 times) inside a For loop. This will gives me 10 different values of td2 which eventually gives me 10 different values of fullData2. In another ...
1
vote
1answer
67 views

Plotting Invariant Manifolds of the Henon Map

Given the following map: \begin{align} & x_{n+1}=-y_n+2x_n^2 \\ & y_{n+1}=\beta x_n \end{align} for $β \in (0,1)$, $x_n \in \mathbb{R}, y_n \in \mathbb{R}$ (which is a one parameter version ...
5
votes
1answer
141 views

Calculating the Feigenbaum Constants

I would like to calculate the $δ$ and the $α$ Feigenbaum constants for the Logistic Map: \begin{equation} x_{n+1}=4μx_n(1-x_n)=f(x_n) \end{equation} as part of an undergraduate assigment of mine. I ...
1
vote
1answer
102 views

PerfectNumber messes with my iterator

I am using Mathematica 10.4 (sorry bbgodfrey) (temporary message) Let mmVerbose = 10^2000 + 123123798797192983712873198273122323; kkVerbose = 10^7; The ...
6
votes
2answers
123 views

How to introduce two successive points inside the FixedPointList for each cycle?

If we want to draw the attraction basins of an iteration function of the following type $$x_{k+1}=x_k-\frac{f(x_k)}{\frac{f(x_k)-f(w_k)}{x_k-w_k}},$$ where $w_k=x_k+b f(x_k)$, $b\in R-\{0\}$, we can ...
3
votes
1answer
95 views

Manipulating the elements of a list

Let's create some sample data tab = Table[{i, j, k}, {i, -3, 3}, {j, -3, 3}, {k, -3, 3}]; ICs = Flatten[tab, 2]; Nt = Length[ICs]; A $3\times3$ system of ...
0
votes
0answers
52 views

Splitting an Array

Background: I'm a fairly experienced programmer, but new to Mathematica I have an image analysis function I have created, which returns a multidimensional array that I do some processing on. I want ...
1
vote
1answer
52 views

Define a function interactively with sum

I have to define a function which has 1e4 terms added up together. f(x1, x2) = (sum i, j, k, l from 1 to 10) (C(i) * C(j) * C(k) * C(l) * exp( (alpha(i)+alpha(j)) * x1 + (alpha(k)+alpha(l)) * x2 )...
4
votes
2answers
95 views

Finding the smallest starting number producing a Collatz sequence of length 125 which ends with a value > 4

I'm supposed to do a Mathematica function that selects the smallest number not less or equal to 4 after 125 iterations. I am not good at coding, so some help/advice would be awesome. My code so far. ...
-1
votes
1answer
275 views

Tweaking a code for basins of attraction

NOTE: Whoever finds a working way for obtaining the basins of attraction in the $(x,\mu)$-plane will add his/her name along with @Quantum_Oli in the list of the acknowledgements of the resulted ...
2
votes
3answers
145 views

What is the correct way to perform the Gram-Schmidt process?

Im trying to do a simple processing in Mathematica. My original code was in Matlab. Part of the computation is Gram-Schmidt process, which is an iterative calculation. Every vector is changed ...
1
vote
1answer
259 views

Basins of attraction of equilibrium points

The Henon-Heiles potential is the following V = 1/2*(x^2 + y^2) - y*(1/3*y^2 - x^2); which has four equilibrium points ...
0
votes
0answers
30 views

Problem using an iteration in a product

I'm trying to solve a general solution for this productive iteration, but the program gets stuck in the calculation and says:$RecursionLimit::reclim: Recursion depth of 1024 exceeded. >> Here is the ...
4
votes
2answers
137 views

ReplaceRepeated as a Looping construct?

There are a lot of discussions about looping constructs (notable example here). Wolfram language guides, as usually, contain most relevant links. Looping constructs guide has the following part on ...
3
votes
3answers
265 views

How would I write iterative code to try multiple coefficients for an equation?

So, I'm trying to solve a class of equations, and get all the solutions in a list. The general form looks like this: c == a*Sqrt[1-n] PlusMinus[b * Sqrt[n]] ...
8
votes
5answers
335 views

How to iterate over the columns of a Dataset?

I have a Dataset with a simple structure, like this: ...
1
vote
1answer
83 views

Tiny question about Indexed[x,n]

Maybe I should apologize for this silly question, but the documentation for Indexed is very short and not explicit. I have an equation with variables ...
1
vote
0answers
64 views

Problems with indexes in a Do-cycle and CoefficientArrays

I have a system of linear equations with variables $A_n$ and need its coefficients in a matrix form (Transform linear system into a matrix form). I'm trying to do that through a ...
3
votes
1answer
51 views

Reals in Range; unexpected result for non-standard Precision

I think I have encountered advice against using inexact numbers in specifications of ranges and iterator many times. I don't think I ever saw an example of unexpected results though, but today I found ...
4
votes
3answers
119 views

How to evaluate an expression over a particular list of tuples?

NOTE: This question is very similar to this one but I realized reading at the answers that I made a mistake in the equation AND I was not clear enough about what I need (my apologies): I want to ...
1
vote
3answers
110 views

Use Do to evaluate an expression over two indices $i \ne j$ (over a list of tuples)?

I have an expression of the form: expr1[i_,j_] = Sum[\[Beta][j]*\[Phi][i, j]* C[i] I would like to evaluate this expression over i=1:4, j=1:4 with i!= j. One ...
0
votes
1answer
62 views

Beginner: Iterative Sequence for Vector Function

I want to create an iterative sequence for two Vectorfunctions, where both are dependent on the same variables and i represents the vector. For simplicity let's ...
2
votes
1answer
107 views

Generating by plots by rerunning code

I am new to Mathematica. I created a code where I can evaluate a parameter (denoted by PoA) for a random instance of a directed acyclic graph. The code is below. ...
2
votes
1answer
84 views

Abstract iterator in Do

I'm trying to write a module. Its input is a matrix (tensor), the module should return new tensor with increased rank with 1. The new tensor is defined as $$ O \Rightarrow N_{\alpha \beta \ldots \...
0
votes
1answer
53 views

Folding 3-variate function with 2 iterator

I have a function say $f$ and some initial point $x$ and pairs of iterators $\{\{a_1,b_1\},\{a_2,b_2\},...\}$ I want to foldlist as follows: $\{x,f[x,a_1,b_1],f[f[x,a_1,b_1],a_2,b_2],...\}$ can ...
3
votes
1answer
89 views

How do I make Mathematica nest argument changes?

I want something like Nest[f,x,n], but what where f is an argument change like a pushforward and x[t] is a function, for example, symbolically, and not in any sort of code: $$ F{x[t]} \equiv x[2t + 1]...
1
vote
4answers
131 views

NestWhileList, control to show the second sequence

For example,each number will end up with 89 or 1, however , How can I generate a sequence with two sub sequence. f[n_] := IntegerDigits[n]^2 // Total One sub ...
3
votes
1answer
152 views

Parallel Apply on a deeply nested expression

I have a deeply nested expression, i.e. something like {{{{...}..}..}..}, and I'd like to use Apply in a parallel fashion, e.g. <...
2
votes
3answers
99 views

Perform For-loop and show output which meets a certain criterion

I am new to Mathematica and I have a For loop like so: For[i = 0, i < 15, i++, PowerMod[i, -1, 15]] Currently it doesn't output anything. The calculation I am ...
0
votes
1answer
104 views

How to obtain a convergent solution iteratively for a linear system of equations

I am working on a problem that requires an iterative procedure to solve a linear system of equations, the system of equations in matrix form is: $$\underbrace{\begin{bmatrix} r_{11} & r_{12} &...
0
votes
1answer
1k views

How do I write nested for-loops?

Looking through the reference.wolfram, I couldn't see an example of how to write a multiple line "for" loop in Mathematica. I need to nest many for-loops in such a way I can do many things in the ...
0
votes
1answer
90 views

I'm trying to iterate a function with two variables [closed]

I have a function that calculates temperature that is dependent on both temperature and time. I want to be able to iterate the function to calculate a new temperature and then use that as the next ...
5
votes
4answers
665 views

Plotting piecewise functions

I have a list of N functions called functionList. N can be any number. Also, I have a list ...
4
votes
1answer
123 views

Iterating `Log` infinitely

How is it possible to find the limiting value of Log[x Log[x Log[x Log[...]]]] in Mathematica? Apparently, it should give ...
1
vote
1answer
87 views

How to make a table of successive values

I want a list, where each entry is of the form {x,y}. I want x to go from $-\pi / 2$ all the way up to $\pi/2$. I also want <...
2
votes
0answers
66 views

How to use nest to reduce the memory eatting of mma?

I enconter a problem about number: If we have 5+3+2=151022 9+2+4=183652 8+6+3=482466 5+4+5=202541 then 7+2+5=? It is easy to get the first two group of numbers? for the ...
1
vote
1answer
86 views

Importing data from files designated in an InputString dialog box

I want to use a loop to input several strings which will be used to import a file. The number of strings to be imported will vary, so the loop should recognize the number of strings and stop after ...
1
vote
2answers
105 views

Generating a table with two entries for each i

Disclaimer: I'm not a mathematica expert, I have some programming experience but am still learning how to work mathematica. Also, some of the code from the first block here is not my own, copied/...
2
votes
1answer
190 views

Dynamic process on graph

I have a question, which I failed to find an answer to myself. I'm a casual user of Mathematica, but do have some knowledge about Dynamic module and other "Advanced" features. My problem is ...
0
votes
1answer
280 views

How can I resolve the insufficient memory to complete the computation problem for solving function with iterated variables?

I am trying to solve for a value x in a function where the variables varies with iterations of K. Also, there is one variable called "rvsum" which is updated with a certain formula as well. I have ...
2
votes
2answers
170 views

How to get the current index during a Scan iteration?

Is there a special keyword to get the current index in Scan ? For example, let say I have the following code : ...
3
votes
2answers
121 views

How to modify the elements of a list in a loop?

I have a list with points coordinates. And I'm trying to traverse it and perform some matrix operations on each point. But I have a problem with storing modified points in the initial list instead of ...
4
votes
3answers
440 views

Skipping over iterator values in a Table

I have been using the built-in function Table for some computations. (The following is not an actual representation of the equations I am using). $$\text{Table}[f[...
5
votes
2answers
340 views

Table with multiple iterators running parallel

I want to use Table to generate a list, but it only allows one iterator to increment at a time. So in ...
1
vote
2answers
119 views

How to use Fold with 3 variables [duplicate]

Suppose I define f[x_,y_,z_]:=x+y+z I wish to apply the Fold function to f along the lines of Fold[f,1,2,Range[10]] In ...
5
votes
1answer
222 views

Procedural to functional style

The following code generates an iterative mapping of some trigonometric functions. I have a couple questions about it. The first question is how to optimize this iterative process using mathematica's ...
0
votes
3answers
390 views

saving outputs of loop

I am stuck on a problem. I have outputs generated at every iteration of a do loop. However, I want to save the outputs in some other file format, like text file etc, in such a way that i must be able ...
0
votes
1answer
295 views

Index of iteration inside NestList [duplicate]

I have a list of RandomReal: delta = RandomReal[{-0.01, 0.01}, 1000] I want to add each element of the list to the ...