Questions tagged [nest]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
0answers
108 views

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

Are there any configurations to fix it? Test code: ...
0
votes
0answers
39 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 ...
0
votes
0answers
29 views

Multiple nested (time ordered) integrals with NIntegrate

I want to construct and calculate multiple (time - ordered) nested integrals of two functions: the "fo" function is applied to the odd and even "fe" to the even times. I have ...
1
vote
1answer
39 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 ...
0
votes
1answer
49 views

How to write a function returning Chebyshev Polynominals of the first kind using Nest[]? [duplicate]

I want to create a function returning the Chebyshev polynomials of the first kind using the in build Nest[] function, preferably with a pure function. I know there exist an in-build function for the ...
0
votes
0answers
38 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 ...
1
vote
2answers
229 views

Chebyshev polynomials

How could I write the Chebyshev polynomial as a function that uses Nest? Also, how could I write it using recursion? Furthermore, how can I show that $T_n(x)=\...
5
votes
1answer
110 views

Nest or fold a series of geometric transforms

I have a requirement to perform a series of GeometricTransformation[]s using the AfineTransform[] function. I use these to set ...
3
votes
1answer
36 views

How can I find the maclaurin coefficients of different iterations of the same function?

I'm rather new to Mathematica so I would greatly appreciate any help. I want to find the series expansion coefficients of iterations of a function and export them as a .csv. Here is what I have ...
3
votes
1answer
130 views

two tier compound interest problem

I am trying to make sense of how mortgage repayment figures are calculated for two tier mortgages, where you fix your interest rate for a certain period and after that period, you fall back to the SVR ...
1
vote
1answer
38 views

Get Solution range of NSolve

I have a numerical solution and when I solve it with NSolve, and substitue the results in an expression, I get something like: 1 + x + x^2 if 0 < x< 10 I ...
0
votes
1answer
35 views

Building an array of T NxM matrices where one item in each matrix changes

As I do not use Mathematica often enough, I am a bit rusty. I need to work on an array of T matrices and each of those NxM matrices has the following pattern: $$ \begin{equation} A(t):= \left( ...
6
votes
2answers
128 views

How to create a nested list of variable depth with indexed elements

i want to obtain this definition of a nested list t = Table[C[i, j], {i, 3}, {j, 3}] with arbitrary depth, ...
2
votes
1answer
35 views

Problem with recursive relations

Continuing the topic of my previous questions (link1 and link2), let me ask one more question. I have problems with the following code: ...
0
votes
1answer
44 views

Nest expressions of several arguments

I have the following function: Q[r_, f_, s0_] := Q[r, f, s0] = F[r, s0] D[f[s0], s0] By calling Q[r, Q[r, f, s0], s0] I ...
2
votes
2answers
66 views

Symbolic nest expressions

I'm trying to understand how to use symbolic expressions as arguments. The following example represents my problem: ...
0
votes
0answers
37 views

Running Nestlist with multiple functions

I want to create a iteration with a loop for my Nestlist with multiple functions. The following code is a very simplified one. ...
3
votes
2answers
83 views

How to iterate all the points on curves

I plot curves by ContourPlot[x^2 y + x y^2 == 1, {x, -10, 10}, {y, -10, 10}] It shows three curves on the (x,y) plane, but ...
0
votes
0answers
66 views

FindRoot not recognising replaced symbol in nested function

I have the following example FindRoot function as part of a Nest function. ...
5
votes
1answer
70 views

What is the most efficient way to implement NestPairWhileList[f,expr,test,g]

Question NestWhileList[f,x,test] lets you iterate a function until a condition is satisfied, outputting the list of iterated values ...
2
votes
1answer
76 views

Nesting differential operators

Suppose I define differential operators $d=x\frac{\partial}{\partial x}$ and $L=g(x)d^4$ (so that $L(f)=g(x)(x\frac{\partial}{\partial x})^4f$ ) and I want to expand the differential operator $L=a_0+...
1
vote
2answers
122 views

Apply NestList to Iteratively Calculate Gradient (Gradient Descent)

I'm attempting to calculate the gradient of a function defined by two variables. After following a tutorial I found, I have the following code: ...
5
votes
1answer
111 views

Recursive nesting with parameter

I would like to apply a function f recursively to an expression expr an arbitrary number of times. However the catch is that <...
4
votes
1answer
252 views

How to nest multiple functions with multiple variables

I'm trying to solve coupled equations by using iteration. There are two functions $G$ and $H$ that I need to find. In the code, G and H are actually lists of numbers. I start by using a simpler ...
5
votes
2answers
134 views

Building Truncatable Primes using Nest(List), While, Fold

Here is a video on Truncatable Primes. I tried to build it myself. Here is what I have tried using the method in the video for left Truncatable Primes. ...
1
vote
2answers
75 views

How to iteratively (or most efficiently) create such list?

Update A very crude attemp ...
3
votes
2answers
150 views

Using NestList?

Here is the code that I have so far: ...
4
votes
1answer
142 views

NestList: How to have a parameter that is changing as a function of nest index, n?

I have a NestList construction NestList[STEP[#] &, m0, NT] where a function is being called repeatedly that acts on a list and returns a list, for details, ...
2
votes
3answers
317 views

Sum with variable terms to sum over

Suppose I have a polynomial like this: $$a=x_{j_1} + x_{j_1}x_{j_2} + x_{j_1}x_{j_2}x_{j_3} + ...+x_{j_1}x_{j_2}x_{j_3}...x_{j_n}$$ I want to create a function that takes this polynomial and does the ...
0
votes
1answer
91 views

Variable nesting depth inside table

I hope my title makes sense. The idea is the make a function in which a set of variables, $l_1$, $l_2$, etc. are accessible inside the innermost body of a nested (/folded) function. Each of these ...
2
votes
1answer
99 views

Can I use Nest iteration variable as the variable of Limit?

Can anybody tell me what is wrong with this: Limit[Nest[1/(1 + #) &, x0, n], n -> ∞]
2
votes
2answers
271 views

nested commutators

I have defined the commutator between two matrices as comm[A_,B_]:=A.B-B.A I have defined the nested commutator as ...
3
votes
2answers
332 views

Efficient implementation of Non-Maximum Suppression

I would like to know is there is a way to do this: ...
2
votes
1answer
63 views

NestWhile and infinite loop

Obviously, the following code leads to an infinite loop: ...
1
vote
2answers
118 views

Reproducing Nest-function with recursive nesting does not work

In general, when I am learning a new programming language, it helps me to understand how builtin functions works. I am trying to reproduce the builtin Nest[f,exp,n] ...
0
votes
0answers
122 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: ...
5
votes
3answers
260 views

How to use FoldList / NestList and Pure function for this?

...
7
votes
2answers
320 views

Using Nest to build continued fraction

To build basic continued fraction one can simply use: Nest[1/(1 + #) &, x, 3] However, it's unclear how using Nest ...
5
votes
2answers
57 views

Removing from a sublist, inserting into another one

From a list like test = {{1, 3}, {2,7, 8}, {5,6}}; I would like to randomly select k elements, lift them out of their current ...
9
votes
6answers
601 views

Delete repeating elements across sublists

I have a list like this test = {{1, 3, 5}, {7, 2, 8, 5}, {7, 1, 3}}; The list is guaranteed to have duplicates only across sublists and not within. I would like ...
0
votes
2answers
190 views

Reducing the computation time used by parallel table when finding a fixed point

I am using Intel Core(™) processor, 32 bit operating system, 4GB RAM, Windows 7. I am running the following code and it is taking hours to obtain the result. Can any one help me in improving the codes ...
3
votes
2answers
124 views

Join nested lists if first element is within another list

I have a list like: list1={{1, 16}, {1, 14}, {1, 3}, {1, 18}, {1, 2}, {1, 17}, {2, 17}, {2, 18}, {3, 14},{4,10}} I would like to see if the first element of one ...
0
votes
0answers
92 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: ...
0
votes
1answer
126 views

nest non pure function

I have a problem to nest a non pure function.The function f has two arguments, i and j, it ...
9
votes
5answers
1k views

Simple Birth Death Process

I am trying to implement simple birth death process. Why my code does not work? Any suggestion. Thanks. Cross posted http://community.wolfram.com/groups/-/m/t/1205656 ...
2
votes
2answers
254 views

Use Nest in a recurrence function

I have following recurrence function: ...
1
vote
3answers
905 views

Pass function or expression as argument to be evaluated

I'm trying to create a function using Nest, which will use Newton's method to find the root of the passed function (or even the passed expression). I've got this, which won't work obviously. ...