# Tag Info

### Archimedes' Scheme to find $\pi$

This is a "visual proof" of the Archimedean limiting regular polygons. You could implement the recursion and it would progressively approach $\pi$. The proof lies in the "squeezing" argument. $\pi$ ...
• 58.7k

### Finite difference method not converging to correct steady state or conserving area?

Since a fully NDSolve-based solution is acceptable for you, let me give you one. You simply need the magic of "Pseudospectral" or a dense enough 4th order spatial ...
• 63.5k

### Paying off an installment

Using Annuity: pmt /.Solve[TimeValue[Annuity[pmt, 52, 1], .02, 0] == 5000, pmt] 155.545 ...
• 10.9k

### RecurrenceTable iteration variable not localized? Bug or user error?

As Bob Hanlon's answer points out, RecurrenceTable does not hold its arguments, but most especially, it does not hold its iterator arguments. This must surely be ...
• 68.4k
Accepted

### How do I recursively calculate this equation and generate a list of iteration?

You were correct. NestList is exactly the function you want to use. ...
• 4,644
Accepted

### Finite difference method not converging to correct steady state or conserving area?

Introduction A lack of time to write up an answer ironically provided time to reflect on the problem, and some nagging uncertainties about some issues contributed to the delay. The slowness of the ...
• 233k
Accepted

### Archimedes' Scheme to find $\pi$

You should use RecurrenceTable: ...
• 6,557

### Solving Recurrence Equation $a_{n+1}=a_n(1-a_n)$

Your recurrence is an instance of the logistic map $$x_{n+1} = r x_n(1 - x_n).$$ The first sentence of the Solution in some cases section in the link above says: The special case of r = 4 can in ...
• 35.5k

### RecurrenceTable iteration variable not localized? Bug or user error?

Unlike many other functions that use an iterator, RecurrenceTable does not have the attribute HoldAll. Presumably, this ...
• 151k
Accepted

### Finding Hofstadter's Q-Sequence very slow

Proper memoization is the key: Q[1] = 1; Q[2] = 1; Q[n_] := Q[n] = Q[n - Q[n - 1]] + Q[n - Q[n - 2]] data = Table[Q[n]/n, {n, 10000}]; // AbsoluteTiming {0....
• 23.7k
Accepted

### Stability classification code for dynamic system

The code in the article you cited was poorly formatted, poorly indented, and generally not at all readable. However, what it did was relatively simple, so I rewrote it to be more readable and perhaps ...
• 65.8k
Accepted

### Limit n->Infinity of recursive sequence

Alternatively, and perhaps more directly, use ...
• 60.7k

### Archimedes' Scheme to find $\pi$

You can use Mathematica to prove the induction step in a proof that $a_n, b_n \rightarrow L$ for some limit $L$ by showing that $a_n$ is decreasing and $b_n$ increasing toward each other and that the ...
• 233k

### How do I recursively calculate this equation and generate a list of iteration?

Your can use MatrixPower for this example: f[n_] := MatrixPower[{{.5, -.6}, {.75, 1.1}}, n].{2, 0} f /@ Range[0, 5] yields: <...
• 58.7k

### Find a stable 3-cycle of the sine map

This is how you define the function $g$ in Mathematica: g[a_, x_] = a*Sin[π*x]; Making a color-plot of the function $g(g(g(x)))-x$ in the $a$-$x$ plane and ...
• 45.9k
Accepted

### How to plot a system of recurrence equations

Straightforward method: ...
Accepted

### Plotting an image of a discrete dynamical system

Use the sliders to modify matrix entries. Click and drag locators (small disks) to modify initial points; ALT+Click to add/remove locators. ...
• 384k

### How to Generate a Phase Portrait for a Jacobian Evaluated at Fixed Points

First, we can plot phase portrait for 3D system as follows (see comment @I.M.) ...
• 41.9k

### How to find roots of general polynomials as functions in Mathematica?

Outline: Code Discussion on polynomial roots that do not involve radicals What is the point of getting an explicit function ? Explanation of code Examples Discussion about factoring and ...
• 5,727
Accepted

### Recurrences related to Ramanujan's 1/pi formulas for level 10?

The question is asking to find linear recurrences with polynomial coefficients for number sequences. As far as I know, Mathematica still does not have this functionality builtin. That is the context ...
• 4,897

### How to replace the symbol n in DifferenceRoot

There is a hidden option to change the variables used by DifferenceRoot[]: ...

### How to find roots of general polynomials as functions in Mathematica?

Clear["Global`*"] poly6 = x^6 - x - z; The exact solutions as Root expressions ...
• 151k
Accepted

### Evolution of a trait in an asexual population (performance tuning)

Here is a modified version of your code. On my PC it completes your example run in about 5 seconds. I won't try to describe every change but will point out the major features. Some of the changes are ...
• 84.6k

### Paying off an installment

The general formula can be derived as follows. ...
• 60.7k
Accepted

### Calculating the Feigenbaum Constants

Several changes are required to obtain the desired results. First, the syntax error mu[n] == mu must be replaced by mu[n] = mu. ...
• 60.7k
Accepted

### Using Total inside the RecurrenceTable

First, as I noted in the comment, a much simpler approach is to use NestList: NestList[f, 12, 3] {12, 9, 729, 1080} Let's ...
• 23.7k
Accepted

### Using dynamic programming to compute an integer sequence

This is a good chance to use #0:) If[#1 == 1, 1, # + 1 - #0[EulerPhi @ #]] & /@ Range[20] ...
• 384k

### How to draw discrete dynamic systems in mathematica

Play with the following example: $$\begin{eqnarray} x(n+1)&=&rx(n)(1-y(n))\\ y(n)&=&x(n), \end{eqnarray}$$ with $r=\displaystyle\frac{2005}{1000}$ and three orbits. The phase ...
• 12.1k