Chaps16.mw

Maple Text Commands used in Chapter 16 -  

CHAOS CONTROL AND SYNCHRONIZATION 

Figure 16.3: Chaos control in the logistic map. 

> # Define the logistic function and find f(f(x)).
# Control to a period two orbit.
restart:with(plots):
mu:=4:f:=x->mu*x*(1-x):
ff:=expand(f(f(x)));  # Find k when xs=0.2:
k:=0.2/f(f(0.2));
# Initialise.
x:=array(0..10000):
x[0]:=0.6:imax:=100:k:=0.217:
# Switch on the control after the 60'th iterate.
# Kick the system every second iterate.
for i from 0 by 2 to imax do
x[i+1]:=mu*x[i]*(1-x[i]):x[i+2]:=mu*x[i+1]*(1-x[i+1]):
if i>60 then
x[i+1]:=k*mu*x[i]*(1-x[i]):x[i+2]:=mu*x[i+1]*(1-x[i+1]):fi:od:
# Plot the time series data.
pts:=[[m,x[m]]$m=0..imax]:
p1:=plot(pts,style=point,symbol=circle,color=black):
p2:=plot(pts,x=0..imax,y=0..1,color=blue):
display({p1,p2},labels=[``,``]);
 

 

 

`+`(`*`(16, `*`(x)), `-`(`*`(80, `*`(`^`(x, 2)))), `*`(128, `*`(`^`(x, 3))), `-`(`*`(64, `*`(`^`(x, 4)))))
.2170138888
Plot_2d
 

Figure 16.6: Chaos control in a 2-dimensional system. 

> # PROGRAM TWO : Controlling Chaos in the Henon Map
restart:with(LinearAlgebra):with(plots):
alpha:=1.2:beta:=0.4:
# Find the fixed points of period one.
solve({alpha-x^2+beta*y-x,x-y},{x,y});
x:=array(0..10000):y:=array(0..10000):rsqr:=array(0..10000):
xstar:=0.8357816692:ystar:=xstar:
A:=matrix([[-2*xstar-k1,beta-k2],[1,0]]);
# Determine the characteristic polynomial.
expand((-1.671563338-k1-lambda)*(-lambda)-(beta-k2));
# Iterate the system and switch on the control after 200 iterations.
# In this case the regulator poles are chosen to be k1=-1.8 and k2=1.2.
x[0]:=0.5:y[0]:=0.6:imax:=499:
k1:=-1.8:k2:=1.2:
for i from 0 to imax do
x[i+1]:=alpha+beta*y[i]-(x[i])^2:
y[i+1]:=x[i]:
if i>200 then
x[i+1]:=(-k1*(x[i]-xstar)-k2*(y[i]-ystar)+alpha)+beta*y[i]-(x[i])^2:
y[i+1]:=x[i]:end if: end do:
# Determine the square of the distance of each point from the origin.
for j from 0 to imax do
rsqr[j]:=evalf((x[j])^2+(y[j])^2):end do:
points:=[[m,rsqr[m]]$m=0..imax]:
p1:=plot({points},x=0..imax,y=0..6):
display({p1},labels=[`n`,`r^2[n]`]);
 

 

 

 

{{Typesetting:-mi(
array( 1 .. 2, 1 .. 2, [( 2, 1 ) = 1, ( 2, 2 ) = 0, ( 1, 2 ) = `+`(.4, `-`(k2)), ( 1, 1 ) = `+`(`-`(1.671563338), `-`(k1)) ] )
`+`(`*`(1.671563338, `*`(lambda)), `*`(lambda, `*`(k1)), `*`(`^`(lambda, 2)), `-`(.4), k2)
Plot_2d
 

Figure 16.7: Complete synchronization. 

> with(DEtools):
sigma:=16:b:=4:r:=45.92:
LorenzLorenz:=diff(x1(t),t)=sigma*(x2(t)-x1(t)),diff(x2(t),t)=-x1(t)*x3(t)+r*x1(t)-x2(t),diff(x3(t),t)=x1(t)*x2(t)-b*x3(t),diff(y2(t),t)=-x1(t)*y3(t)+r*x1(t)-y2(t),diff(y3(t),t)=x1(t)*y2(t)-b*y3(t):
dsol:=dsolve({LorenzLorenz,x1(0)=15,x2(0)=20,x3(0)=30,y2(0)=10,y3(0)=20},numeric,range=0..100,maxfun=100000):
odeplot(dsol,[x3(t),y3(t)],50..100,labels=["x3","y3"]);
 

Plot_2d
 

Figure 16.8(b): Generalized synchronization. Set g=8 to get synchronization.  

Note that dsolve, numeric, parameter is different in Maple 12 from Maple 11. 

> restart:with(DEtools):with(plots):
RosslerLorenzLorenz:=diff(x1(t),t)=-(x2(t)+x3(t)),diff(x2(t),t)=x1(t)+0.2*x2(t),diff(x3(t),t)=0.2+x3(t)*(x1(t)-mu),diff(y1(t),t)=sigma*(y2(t)-y1(t))-g*(y1(t)-x1(t)),diff(y2(t),t)=-y1(t)*y3(t)+r*y1(t)-y2(t),diff(y3(t),t)=y1(t)*y2(t)-b*y3(t),diff(z1(t),t)=sigma*(z2(t)-z1(t))-g*(z1(t)-x1(t)),diff(z2(t),t)=-z1(t)*z3(t)+r*z1(t)-z2(t),diff(z3(t),t)=z1(t)*z2(t)-b*z3(t):
dsol2:=dsolve({RosslerLorenzLorenz,x1(0)=2,x2(0)=-10,x3(0)=44,y1(0)=30,y2(0)=10,y3(0)=20,z1(0)=31,z2(0)=11,z3(0)=22},numeric,range=0..200,maxfun=0,parameters=[b,g,mu,r,sigma]):
dsol2(initial_and_parameters):
dsol2(initial_and_parameters=[0, 2, -10, 44, 30, 10, 20, 31, 11, 22,b=4,g=4,mu=5.7,r=45.92,sigma=16]):
odeplot(dsol2,[y2(t),z2(t)],50..200,labels=["y2","z2"],numpoints=100000);

 

Plot_2d
 

END OF CHAPTER 16 COMMANDS