Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica - Showing iterations graphically

  1. Jan 20, 2012 #1
    I'm trying to do this:

    Suppose I have some iterative function $x_{n+1}=\sin(x_n)$. I want to demonstrate an iteration on a plot by graphing $y=\sin(x)$ and $y=x$, then drawing lines from the graph of x to the graph of sin x, like in this page:


    I would try to google or check the documentation to do this, but I have no idea on what keywords to use, nor do I have any clue on where to begin.


    [I also don't know how to get LaTeX to work in this forum. Sorry!]
  2. jcsd
  3. Jan 20, 2012 #2
    y = NestList[Sin, 1, 6]; x = Range[7]; points = Transpose[{x, y}]; ListPlot[points]

    might get you started.

    From that you need to use the contents of points to generate the horizontal and vertical line segments shown in that demonstration. This
    will give you an idea what result you need to generate from your points.
    Last edited: Jan 21, 2012
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook