# Orbit diagram of a quadratic map [duplicate]

I am very new to Mathematica. I am trying to draw an orbit diagram of the quadratic map $f(x) = r - x^2$ for $r <= 2$. I have the following idea for a program:

For each value of $r <= 2$:

• Iterate $f(x)$ starting with $x_0 = 0$ and store values in list.
• Plot the last elements of the list against $r$.

I am having a lot of trouble with the implementation. Hope you can help me!

• Try using the Nest command and the Function command to perform the iterations. – LouisB Jun 14 '17 at 22:16
• For this to be meaningful, iterating the function would have to generate a sequence that converged to a fixed point. In which case, FixedPointList would provide the list. However, this does not generally occur. For example, with r = 1 the sequence oscillates between 0 and 1. Similarly, for r = 1.1 the list eventually oscillates between -0.0916079783099617 and 1.0916079783099617 – Bob Hanlon Jun 14 '17 at 22:28
• Similar questions have been answered before, see: 113777, 132405, 13723, 5123 – Chris K Jul 15 '17 at 12:13

Manipulate[ListLinePlot[Partition[NestList[r - #^2 &, 0, 500], 2, 1],
PlotRange -> {{-2, 2}, {-2, 2}}, AspectRatio -> 1], {{r, 1.8}, 0,  2}]


Update: Re How would you draw the r, x plane?

lpp = ListPointPlot3D[Table[Flatten /@
Thread[{r, Partition[NestList[r - #^2 &, 0, 500], 2, 1]}], {r, 1, 2, .1}],
AxesLabel -> {"r", Subscript[y, t], Subscript[y, t + 1]}, BoxRatios->1] /.
Point -> Line;

planes = Graphics3D[{Opacity[.25], EdgeForm[],
Table[InfinitePlane[{{k, -1, -1}, {k, -1, 1}, {k, 1, 1}}], {k, 1, 2, .1}]}];

Show[lpp, planes, BoxRatios->1]


• Thank you! This helped me very much in understanding the ways of Mathematica. How would you draw the r, x plane? – Luna Jun 16 '17 at 6:46