Cobweb Graphics

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu
9/9/2012. Last edit 10/22/2012

The command graphs the cobweb diagram of an iterated function.

Inputs are: the function, the variable name, the plot range, the initial point (Subscript[x, 0]), and the number of iterations (default 5).

Cobweb[fun_,var_,range_,x0_,iterations_:5]:=Module[{Fct,fct},Fct=Function[var,fun];Animate[Plot[{x,Fct[x]},{x,range[[1]],range[[2]]},PlotStyle->{Dotted,Automatic},AspectRatio->1,ImageSize->400,Epilog->Flatten[Map[Function[t,{Red,Dashed,{AbsolutePointSize[6],Point[{t,t}]},
{Arrowheads[.02],Arrow[{{t,t},{t,Fct[t]},{Fct[t],Fct[t]}}]}}],NestList[Fct,N[x0],k],2]]],
{k,0,iterations,1}]]

Cobweb[.1+t,t,{.25,2.75},.7,15]

Cobweb[-.95x+1,x,{0,1},.2,35]