Phase Portrait for a Lorenz Systemrestart:
with(plots):with(DEtools):Define the differential equation and parameters:LorenzDE := [diff(x(t),t) = sigma*(y(t)-x(t)),
diff(y(t),t) = r*x(t)-y(t) -x(t)*z(t),
diff(z(t),t) = x(t)*y(t) -b*z(t)];
sigma := 10; b := 8/3; r := 28;The initial conditions are given in the first line and can be changed.IC:=[[x(0)= 0.1,y(0)=0.1, z(0)=0],[x(0)= -0.1,y(0)=-0.1, z(0)=0]];Plot x versus zDEplot(LorenzDE, [x(t),y(t),z(t)], t=0..20,
IC,linecolour=BLUE, x=-30..30, y=-30..30,z=0..50, stepsize=0.01,
arrows=NONE,thickness=1, method=classical[rk4],scene=[x,z],
title=`Lorenz System: (x,z)`);3 Dimensional plot which can be rotated:DEplot3d(LorenzDE, [x(t),y(t),z(t)], t=0..20,
IC,linecolour=BLUE, x=-30..30, y=-30..30,z=0..50, stepsize=0.01,
arrows=NONE, method=classical[rk4],scene=[x,y,z],
title=`Lorenz System: (x,y,z)`);Plot t versus xICt:=[[x(0)= 0.1,y(0)=0.1, z(0)=0]];
DEplot(LorenzDE, [x(t),y(t),z(t)], t=0..20,
ICt,linecolour=BLUE,thickness=1, x=-30..30, y=-30..30,z=0..50, stepsize=0.01,
arrows=NONE, method=classical[rk4],scene=[t,x],
title=`Lorenz System: (t,x)`);