1
$\begingroup$

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!

$\endgroup$
3
  • $\begingroup$ Try using the Nest command and the Function command to perform the iterations. $\endgroup$ – LouisB Jun 14 '17 at 22:16
  • $\begingroup$ 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 $\endgroup$ – Bob Hanlon Jun 14 '17 at 22:28
  • $\begingroup$ Similar questions have been answered before, see: 113777, 132405, 13723, 5123 $\endgroup$ – Chris K Jul 15 '17 at 12:13
3
$\begingroup$
Manipulate[ListLinePlot[Partition[NestList[r - #^2 &, 0, 500], 2, 1], 
  PlotRange -> {{-2, 2}, {-2, 2}}, AspectRatio -> 1], {{r, 1.8}, 0,  2}]

Mathematica graphics

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]

enter image description here

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.