This example shows how to solve the chaotic Lorenz’ dynamical system—you know the one of the butterfly. The differential equations are
\begin{cases} \dot{x} &= \sigma \cdot (y - x)\\ \dot{y} &= x \cdot (r - z) - y\\ \dot{z} &= xy - bz\\ \end{cases}
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.
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
= 10
sigma = 28
r = 8/3
b
# initial conditions
x_0 = -11
y_0 = -16
z_0 = 22.5
# the dynamical system
= sigma*(y - x)
x_dot .= x*(r - z) - y
y_dot .= x*y - b*z
z_dot .
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
$
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.