This is an update to my earlier post on the Rossler system, one of the simplest examples of a dynamical system in 3 dimensions that can exhibit deterministic chaos.
restart;
interface(displayprecision=10):
PDEtools:-declare(prime=t,quiet):
ross_x:=diff(x(t),t)=-y(t)-z(t):
ross_y:=diff(y(t),t)=x(t)+a*y(t):
ross_z:=diff(z(t),t)=b+x(t)*z(t)-c*z(t):
rossler_sys:=ross_x,ross_y,ross_z;
#Find fixed points:
sol:=solve({rhs(ross_x)=0,rhs(ross_y)=0,rhs(ross_z)=0},{x(t),y(t),z(t)}):
fp_sol:=solve({rhs(ross_x)=0,rhs(ross_y)=0,rhs(ross_z)=0},{x(t),y(t),z(t)}):
params:={a=0.32,b=0.3,c=4.5}:
fp_sol:=allvalues(eval(fp_sol,params)):
fp1:=fp_sol[1];
fp2:=fp_sol[2];
#Jacobian:
J := frontend(Student:-VectorCalculus:-Jacobian, [map(rhs,[rossler_sys]), [x,y,z](t)], [{`*`,`+`,list},{}]);
ev1:=Student[LinearAlgebra][Eigenvectors](eval(J,fp1 union params));
ev2:=Student[LinearAlgebra][Eigenvectors](eval(J,fp2 union params));
# now take a look at the orbits
assign(params);
# Initial conditions:
ics:=[x(0)=1,y(0)=1,z(0)=1]:
DEtools[DEplot3d]({rossler_sys},{x(t),y(t),z(t)},t=0..50,[ics],scene=[x(t),y(t),z(t)],stepsize=0.05,thickness=1,linecolor=blue,orientation=[40,120]);
#with animation
plots:-display([seq(DEtools[DEplot3d]({rossler_sys},{x(t),y(t),z(t)},t=0..i,[ics],scene=[x(t),y(t),z(t)],stepsize=0.05,thickness=1,linecolor=blue,orientation=[40,120]),i=1..50)],insequence=true);
# look at the phase flow in just the xy plane
DEtools[DEplot]({rossler_sys},{x(t),y(t),z(t)},t=0..50,[ics],scene=[x(t),y(t)],stepsize=0.05,method=rkf45,linecolor=[blue],thickness=1);
# look at the evolution of x over time
DEtools[DEplot]({rossler_sys},{x(t),y(t),z(t)},t=0..50,[ics],scene=[t,x(t)],stepsize=0.05,method=rkf45,linecolor=[black],thickness=1);
#now make an almost imperceptible change in the x-coordinate of the initial conditions
ics1:=[x(0)=rhs(ics[1])+0.01,ics[2],ics[3]]:
DEtools[DEplot]({rossler_sys},{x(t),y(t),z(t)},t=0..50,[ics,ics1],scene=[t,x(t)],stepsize=0.05,method=rkf45,linecolor=[black,red],thickness=1);
# Note how, up to around t=25 the orbits of the two solutions cannot be told apart, but by t=50 they are
# of similar magnitude but opposite sign ! This is one of the defining properties of chaotic dynamical
# systems: that very small changes in initial values can lead to very large changes in the long run outcome. Comment and critiques most welcome !