Iterating the tent mapThis worksheet iterates the tent map.restart;
with(plots):Define the tent map.f := proc(x)
if x < 0.5 then 2*x
else 2*(1-x)
fi
end;Intial conditions and number of iteatesX := 2/7;
n1 := 6;Make a table of the iteates from 1 to n1.for n from 1 to n1 do
X := f(X) od;Intial conditions, number of iteates, and ends of the interval to use fora plot of the cobweb (stairstep) graphical method of iteration. x0 := 11/37:
n1 := 20:
a := 0:
b := 1:Plot the cobweb for the values above. pic := {plot(x ,x=a..b, color=black)}:
pic := pic union {plot(f, a..b, color=black)}:
for i from 1 to n1 do
x1:= f(x0):
pic := pic union {plot([[x0,x0],[x0,x1],[x1,x1]], color=blue)}:
x0:=x1:
od:
display(pic);