Date: 12 September 2013

x

x

n

n+1

xmin = -1
xmax = 5
ymin = -1
ymax = 5
f(x) = 0.3 * (x - 1) * (x - 2) * (x - 3) + x
fxmin = -1.0E100
fxmax = 1.0E100
g = Function(f, fxmin, fxmax)
xsubscriptdisplayed = If(Length[xsubscript] > 0, "_{" + xsubscript + "}", "")
ysubscriptdisplayed = If(Length[ysubscript] > 0, "_{" + ysubscript + "}", "")
ylabeldisplayed: "" + (LaTeX[ylabel]) + "" + (LaTeX[ysubscriptdisplayed]) + ""
xlabeldisplayed: "" + (LaTeX[xlabel]) + "" + (LaTeX[xsubscriptdisplayed]) + ""
xlabelwithsub: "" + (LaTeX[xlabel]) + "" + (LaTeX[xsubscriptdisplayed]) + ""
x01 = 3.9
n = 3
iterates1 = IterationList(f, x01, n)
oncurves1 = Sequence((Element[iterates1, i], Element[iterates1, i + 1]), i, 1, n)
diagonals1 = Sequence((Element[iterates1, i], Element[iterates1, i]), i, 2, n)
initialvert1 = Segment((x01, 0), (x01, f(x01)))
horizsegs1 = Sequence(Segment[Element[oncurves1, i], Element[diagonals1, i]], i, 1, n - 1)
X_01: (x01, 0)
theroots: {Roots[f(x) - x, xmin, xmax]}
equilibrium_points = Zip((x(A), x(A)), A, theroots)
show_equilibria = false
x02 = NaN
x03 = NaN
x04 = NaN
iterates2 = IterationList(f, x02, n)
iterates3 = IterationList(f, x03, n)
iterates4 = IterationList(f, x04, n)
oncurves2 = Sequence((Element[iterates2, i], Element[iterates2, i + 1]), i, 1, n)
oncurves3 = Sequence((Element[iterates3, i], Element[iterates3, i + 1]), i, 1, n)
oncurves4 = Sequence((Element[iterates4, i], Element[iterates4, i + 1]), i, 1, n)
diagonals2 = Sequence((Element[iterates2, i], Element[iterates2, i]), i, 2, n)
diagonals3 = Sequence((Element[iterates3, i], Element[iterates3, i]), i, 2, n)
diagonals4 = Sequence((Element[iterates4, i], Element[iterates4, i]), i, 2, n)
horizsegs2 = Sequence(Segment[Element[oncurves2, i], Element[diagonals2, i]], i, 1, n - 1)
horizsegs3 = Sequence(Segment[Element[oncurves3, i], Element[diagonals3, i]], i, 1, n - 1)
horizsegs4 = Sequence(Segment[Element[oncurves4, i], Element[diagonals4, i]], i, 1, n - 1)
vertsegs3 = Sequence(Segment[Element[diagonals3, i - 1], Element[oncurves3, i]], i, 2, n)
vertsegs2 = Sequence(Segment[Element[diagonals2, i - 1], Element[oncurves2, i]], i, 2, n)
vertsegs1 = Sequence(Segment[Element[diagonals1, i - 1], Element[oncurves1, i]], i, 2, n)
vertsegs4 = Sequence(Segment[Element[diagonals4, i - 1], Element[oncurves4, i]], i, 2, n)
initialvert2 = Segment((x02, 0), (x02, f(x02)))
initialvert3 = Segment((x03, 0), (x03, f(x03)))
initialvert4 = Segment((x04, 0), (x04, f(x04)))
X_02: (x02, 0)
X_03: (x03, 0)
X_04: (x04, 0)