u_0

u_n

a = 0.5 (slider from -3 to 3, step 0.1)
b = 2 (slider from -3 to 3, step 0.1)
u_0 = 0.6 (slider from -8 to 5, step 0.1)
n = 3 (slider from 0 to 20, step 1)
f(x) = (a * x) + b
Termes = IterationList(f, u_0, n + 1)
U_0: (u_0, 0)
Pointsd = Sequence((Element[Termes, i], Element[Termes, i]), i, 1, n + 1)
Pointsf = Sequence((Element[Termes, i], Element[Termes, i + 1]), i, 1, n)
SegmentsH = Sequence(Segment[Element[Pointsf, i], Element[Pointsd, i + 1]], i, 1, n + 1)
U_n: (Element[Termes, n + 1], 0)
SegmentsV = Sequence(Segment[Element[Pointsd, i], Element[Pointsf, i]], i, 2, n)
d = Segment(U_0, Element[Pointsf, 1])