# Essays/Lorenz Attractor

OpenGL Demo script File:Lorenz 3d.ijs

The Lorenz attractor was obtained by Edward Lorenz in 1963 when simplifying a system of fluid convection flow equations, and since then captured attention of both serious and popular science. The recognizable image is the trajectory of a solution of a dynamical system with the following variables and parameters.

 X convective intensity ${\displaystyle X_{0}=0}$ ${\displaystyle \sigma =10}$ Prandtl number Y vertical/horizontal temperature difference ${\displaystyle Y_{0}=1}$ ${\displaystyle \rho =28}$ Rayleigh number Z vertical temperature deviation ${\displaystyle Z_{0}=0}$ ${\displaystyle \beta =8/3}$ geometric factor

{\displaystyle {\begin{aligned}{dX \over dt}&=&\sigma (Y-X)\\{dY \over dt}&=&X(\rho -Z)-Y\\{dZ \over dt}&=&XY-\beta Z\end{aligned}}}

In J this can be expressed as follows File:Lorenz j504.ijs

'X Y Z'=: (0&{)(1&{)(2&{)
' s r b'=:  10  , 28  , 8%3

dx=: s*(Y - X)
dy=: (X * r - Z) - Y
dz=: (X*Y) - b*Z

dt=: 0.005
I=: + dt * dx,dy,dz

 plot <"1|: I^:(<1e4) 0 1 0

The system can also be expressed as a three-dimensional quadratic map.

   N=: ([: ; i. <@}."0 1 i.@,~) 4 NB. upper triangle indices

NB.   xx  xy  xz  x1  yy  yz  y1  zz  z1  11  NB. ;,&'  '&.> N { ,<@,"0/~'xyz1'

A=: ,:0   0   0 ,(-s),0   0  ,s,  0   0   0
A=: A,0   0  _1  ,r,  0   0  _1   0   0   0
A=: A,0   1   0   0   0   0   0   0 ,(-b),0

dL=: A +/ . * N { [: , [: */~ ,&1
J=: + dt * dL
`
 stereo <"1|: J^:(<1e4) 0 1 0

The image was obtained with the Stereo Plot utility.