OpenGL Demo script 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 Prandtl number Y vertical/horizontal temperature difference Rayleigh number Z vertical temperature deviation geometric factor

In J this can be expressed as follows 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.