Enter the function to iterate, the seed, x0, and the number of iterates, n.
Input := g[x_] = f[x, 2.8]; x0 = 0.45; n = 100;
Create a list of Points on the Orbit Diagram
Input :=
pts = Table[0, {i, 1, 2n + 1}];
pts[[1]] = {x0, g[x0]};
Do[x0 = g[x0];
pts[[i]] = {x0, x0};
pts[[i + 1]] = {x0, g[x0]},
{i, 2, 2 n, 2}];
Plot the Points
Input := iterateplot = ListPlot[pts, PlotJoined -> True, DisplayFunction -> Identity];
Plot the Map along with the Replacement Line
Input :=
mapplot = Plot[{x, g[x]}, {x, 0, 1},
PlotStyle -> {AbsoluteThickness[1],
AbsoluteThickness[2]},
AspectRatio -> Automatic,
PlotRange -> {0, 1},
DisplayFunction -> Identity];
Plot the Orbit Diagram
Input :=
Show[iterateplot, mapplot,
AspectRatio -> Automatic,
PlotRange -> {{0, 1}, {0, 1}},
DisplayFunction -> $DisplayFunction];
