!LORENTZ EQUATIONS

!dx/dt = S(y-x)

!dy/dt = R*x - y - xz

!dz/dt = xy -Bz

!USE S = 10, R = 28, B = 8/3, x0 = z0 = 0, y0 =1

!deltat = 0.001

SET MODE "graphics"

SET WINDOW -40,160,-20,80

LET S=10

LET R=28

LET B=8/3

LET x=0

LET z=0

LET y=1

LET DT = 0.0005

!

DO WHILE t<=100

LET xdot = S*(y-x)

LET ydot = R*x - y - x*z

LET zdot = x*y - B*z

LET x = x + xdot*DT

LET y = y + ydot*DT

LET z = z + zdot*DT

LET t = t + DT

!

IF t>1 THEN PLOT x*5 + z*1.7,z + 1.7*y

!

LOOP

!

END

!