Skip to main content

numerical integration - Animating the Lorenz Equations


I am trying to use the Animate command to vary a parameter of the Lorenz Equations in 3-D phase space and I'm not having much luck.


The equations are:



$\begin{align*} \dot{x} &= \sigma(y-x)\\ \dot{y} &= rx-y-xz\\ \dot{z} &= xy-bz \end{align*}$




Where $\sigma, r, b > 0$ are parameters to be varied.


Insofar, I am using the NDSolve command to numerically integrate these equations, then ParametricPlot3D and the Evaluate command to plot them.


Just for starters, I am trying to create an animate command to vary $\sigma$ for example from 0 to 10. Can anyone guide me in the right direction? My code looks like this so far:




σ = 10;

NDSolve[{x'[t] == σ (y[t] - x[t]),
y'[t] == 28 x[t] - y[t] - x[t] z[t], z'[t] == x[t] y[t] - 8/3 z[t],
x[0] == z[0] == 0, y[0] == 2}, {x, y, z}, {t, 0, 25}]


Animate[ParametricPlot3D[
Evaluate[{x[t], y[t], z[t]} /. solution], {t, 0, 25}], {σ, 0, 25},
AnimationRunning -> False]



This will generate an animated plot but obviously as σ varies, nothing is changing since I am not implementing new NDSolve commands. Can anyone guide me as to how I can implement successive NDSolve's inside the animate command? Thank you


EDIT: I am using $r=28$ and $b=\frac83$ in place of r and b in my code.




Comments