# ======================================
# Elliot Pace
# elliotlp@gmail.com
# ======================================
:
restart;
with(plots):
with(linalg):
Rossler:=(
diff(x(t),t) = -y(t)-z(t),
diff(y(t),t) = x(t)+a*y(t),
diff(z(t),t) = b+z(t)*(x(t)-c)
);
fixedpoints := solve({-y-z=0, x+a*y=0, b+z*(x-c)=0}, {x,y,z}):
fixedpoint1 := fixedpoints[1];
fixedpoint2 := fixedpoints[2];
a := 0.2:
b := 0.2:
c := 14:
fixedpoints := solve({-y-z=0, x+a*y=0, b+z*(x-c)=0}, {x,y,z}):
fixedpoint1 := fixedpoints[1];
fixedpoint2 := fixedpoints[2];
vfixedpoint1 := [rhs(fixedpoint1[1]), rhs(fixedpoint1[2]), rhs(fixedpoint1[3])];
vfixedpoint2 := [rhs(fixedpoint2[1]), rhs(fixedpoint2[2]), rhs(fixedpoint2[3])];
#Wikipedia's solutions for the two fixed points:
fp1 := [(c+sqrt(c^2-4*a*b))/2, (-c-sqrt(c^2-4*a*b))/(2*a), (c+sqrt(c^2-4*a*b))/(2*a)];
fp2 := [(c-sqrt(c^2-4*a*b))/2, (-c+sqrt(c^2-4*a*b))/(2*a), (c-sqrt(c^2-4*a*b))/(2*a)];
params := a=a, b=b, c=c:
init1 := x(0)=0.002, y(0)=-0.014, z(0)=0.014:
dvars := [x(t),y(t),z(t)]:
Rossler1 := [Rossler,init1]:
LS1 := dsolve(Rossler1, numeric):
t0 := 0:
t1 := 200:
plot1 := odeplot(
LS1,
dvars,
t=t0..t1,
axes=frame,
numpoints=20000,
color=blue,
thickness=1,
orientation=[20,75],
title=`Rossler Attractor`
):
fixedpoint1plot := pointplot3d(vfixedpoint1, axes=normal, symbol=sphere, thickness=10, color=red):
fixedpoint2plot := pointplot3d(vfixedpoint2, axes=normal, symbol=sphere, thickness=10, color=green):
plots[display]({plot1, fixedpoint1plot, fixedpoint2plot});