The Lorenz chaotic system

  • Difficulty: 005/100
  • Author: jeremy theler
  • Keywords: PHASE_SPACE, CONST, PRINT, HEADER, .=, =,

This example shows how to solve the chaotic Lorenz’ dynamical system—you know the one of the butterfly. The differential equations are

\[ \begin{align*} \dot{x} &= \sigma \cdot (y - x)\\ \dot{y} &= x \cdot (r - z) - y\\ \dot{z} &= xy - bz\\ \end{align*} \]

where \(\sigma=10\), \(b=8/3\) and \(r=28\) are the classical parameters that generate the butterfly as presented by Edward Lorenz back in his seminal 1963 paper Deterministic non-periodic flow.

lorenz.was

Please note the beauty of both the Lorenz system and the associated wasora input.

# lorenz' seminal dynamical system
PHASE_SPACE x y z
end_time = 40

# parameters
CONST sigma r b
sigma = 10
r = 28
b = 8/3

# initial conditions
x_0 = -11
y_0 = -16
z_0 = 22.5

# the dynamical system
x_dot .= sigma*(y - x)
y_dot .= x*(r - z) - y
z_dot .= x*y - b*z

PRINT t x y z HEADER

# exercise: play with the system! change
# the parameters and plot, plot plot!
$ wasora lorenz.was > lorenz.dat
$ qdp lorenz.dat -o lorenz2d --pt "16 17 18" --ps "0.5 0.5 0.5" --color "orange navyblue gray" --pi "60 71 87"
$ gnuplot lorenz3d.gp
$ 
lorenz2d.png
lorenz2d.png
lorenz3d.svg
lorenz3d.svg

The ability to solve the Lorenz system—that has both intrigued and inspired me since I was old enough to understand differential equations—with such simple and concise instructions shows me that indeed wasora has something to provide to the scientific/engineering community.

See also the besssugo plugin quickstart examples for videos of applications of wasora to solve and study the Lorenz equations—and other chaotic dynamical systems.