The Logistic Map

Math 242 Modern Computational Mathematics

Define the logistic map

The logistic map is the recurrence (Subscript[x, n+1])=r (Subscript[x, n])(1-(Subscript[x, n])), where 0<=r<=4 is a parameter. For any starting value 0<=(Subscript[x, 0])<=1, this recurrence defines a sequence of real numbers (Subscript[x, 0]),(Subscript[x, 1]),(Subscript[x, 2]),….

To compute logistic map trajectories, first define a function (Subscript[f, r])(x)=r x(1-x). Then (Subscript[x, n+1])=(Subscript[f, r])((Subscript[x, n])).

Explore: iterate (Subscript[f, r])(x) for various parameters 0<=r<=4 and various starting values 0<=(Subscript[x, 0])<=1. What do you observe? What do you wonder?

Cobweb plots

The following module makes a cobweb plot. The basic usage is cobwebPlot[ function, starting value, number of iterates ]. Optional parameters xmin and xmax specify the domain to be plotted.

cobwebPlot[f_,start_,numIter_,xmin_:0,xmax_:1]:=Module[{cob={{start,0}},prev=start,next,g1,g2},
(* build the list of points to plot *)
Do[
next=f[prev];
AppendTo[cob,{prev,next}];
AppendTo[cob,{next,next}];
prev=next,
numIter];

(* display the plot *)
g1=Graphics[{Purple,Opacity[0.3],Line[cob]}];
g2=Plot[{x,f[x]},{x,xmin,xmax},PlotStyle->{Blue,Black}];
Show[{g1,g2},Frame->True]
]