# Essays/Lorenz Attractor

Jump to: navigation, search

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 $X_0=0$ $\sigma=10$ Prandtl number Y vertical/horizontal temperature difference $Y_0=1$ $\rho=28$ Rayleigh number Z vertical temperature deviation $Z_0=0$ $\beta=8/3$ geometric factor

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

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

## Quadratic Map

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.

## See Also

Contributed by Oleg Kobchenko.