Mathematical Modeling of Complex Systems

Dr. Courtney Brown

Assignment #9

With this assignment you will be working with the logistic map. This is the model that started all of the fuss about chaos theory (see May 1976 in the bibliography). You might look at this url to see why this model is of interest to scientists studying certain types of populations. The model is X(t+1) = aX(t)[1 - X(t)]. A derivation of this model using population terms can be found at this url. A good url for common definitions useful for the study of chaos can be found here.

Use Phaser to construct the following plots of this model: (1) a plot of X(t) over time, (2) a stair-step diagram, and (3) a bifurcation diagram. Begin by trying a value for parameter "a" of 3.8, with an initial condition of 0.02, and plot the iterations from the first to iteration 100. Explain your results. What do all of those plots represent?

Now try to construct all of the above plots using a value for the parameter "a" that does not produce chaos. Explain your results.

Hand all this in.

 

GRADUATE STUDENTS ONLY: Do this assignment using R. This will require some careful programming. To give you hints, below is a program in SAS that produces a stair-step diagram. Use it only to get ideas. Your R program can be much simpler. The || command in SAS/IML is similar to the cbind command in R. The // command in SAS is similar to the rbind command in R. The program below first does "step1" and then does "step2" to collect all the data needed to do the plot. The parabola part of the graph comes out of step1, and the iterating chaos part comes out of step2. You can probably find a package in R that does all this for you with a few clicks. Take a look.

options nocenter;

PROC IML;

a=2.80;miny=0;maxy=1;connect1=1;connect2=2;y0=0.1;

Start;
Goto buildit;

step1:
l1=999;
yvalues=miny||(miny||(connect1||l1));
nexty=maxy||(maxy||(connect1||l1));
yvalues=yvalues//nexty;
nexty=l1||(l1||(connect1||l1));
yvalues=yvalues//nexty;

Do yt1=miny to maxy by 0.01;
yt2=a#yt1#(1-yt1);
yvalue1=(yt2||(yt1||(connect1||l1)));
yvalues=yvalues//yvalue1;
End;
yvalue1=(l1||(l1||(connect1||l1)));
yvalues=yvalues//yvalue1;
Return;


step2:
time=0;
nexty=miny||(y0||(connect1||time));
yvalues=yvalues//nexty;
yt1=y0;
Do i=1 to 100;
time=time+1;
yt2=a#yt1#(1-yt1);
yvalue1=(yt2||(yt1||(connect1||time)));
yvalues=yvalues//yvalue1;
yvalue1=(yt2||(yt2||(connect1||time)));
yvalues=yvalues//yvalue1;
yt1=yt2;
End;
Return;


buildit:
Link step1;
Link step2;

Finish;Run;

party={'y2' 'y1' 'connect' 'time'};
Create traject From yvalues (|Colname=party|);
Append From yvalues;
Close traject;
Run;

* Now we have left SAS/IML and are in simple SAS.

Data traject;Set traject;
If y2=999 then Do;y1=.;y2=.;end;
Label y2='Y at t+1';
Label y1='Y at t';
sym=connect;

proc print data=traject;
var y2 y1 connect time;

Symbol1 color=black i=join;
Symbol2 color=black i=join;
Symbol3 color=black f=simplex v='.';
Symbol4 color=black f=simplex v='.';
Symbol5 color=black f=simplex v='.';

*Here is the stair-step diagram;
TITLE1 f=simplex h=1.6 color=black '1-D Stair Step Diagram';
Proc Gplot Data=traject;
axis1 color=black minor=none
order=(0 to 1 by 1)
value=(h=1.5 f=simplex c=black 'low' 'high')
label=(a=90 r=0 h=2 f=simplex c=black);
axis2 color=black minor=none
order=(0 to 1 by 1)
value=(h=1.5 f=simplex c=black 'low' 'high')
label=(h=2 f=simplex c=black);
Plot y2*y1=Sym/ Skipmiss Nolegend
Vaxis=axis1 Haxis=axis2 Vminor=0 Hminor=0;

Data traject;set traject;
if time=999 then delete;

*Here is an overtime plot;
Proc Gplot Data=traject;
axis1 color=black minor=none
order=(0 to 1 by 1)
value=(h=1.5 f=simplex c=black 'low' 'high')
label=(a=90 r=0 h=2 f=simplex c=black);
axis2 color=black minor=none
order=(0 to 100 by 10)
value=(h=1.5 f=simplex c=black)
label=(h=2 f=simplex c=black);
Plot y2*time=Sym/ Skipmiss Nolegend
Vaxis=axis1 Haxis=axis2 Vminor=0 Hminor=0;