# Phase Portrait for the Lorenz System > restart: > with(plots): > with(DEtools): Warning, the name changecoords has been redefined # Define the differential equation using 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)]; [ d [--- x(t) = sigma (y(t) - x(t)), [ dt d --- y(t) = r x(t) - y(t) - x(t) z(t), dt d ] --- z(t) = x(t) y(t) - b z(t)] dt ] # 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]] > sigma := 10; b := 8/3; r := 28; 10 8 - 3 28 # Plot x versus z > DEplot(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)`); # Plot t versus x > DEplot(LorenzDE, [x(t),y(t),z(t)], t=0..20, > IC,linecolour=BLUE,thickness=1, x=-30..30, y=-30..30,z=0..50, stepsize=0.01, > arrows=NONE, method=classical[rk4],scene=[t,y], > title=`Lorenz System: (t,y)`); # 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)`); > # #