Mathematica - Showing iterations graphically

  • Context: Mathematica 
  • Thread starter Thread starter nothingbetter
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
nothingbetter
Messages
5
Reaction score
0
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:

http://demonstrations.wolfram.com/IteratingLinearFunctions/

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.

Thanks!

[I also don't know how to get LaTeX to work in this forum. Sorry!]
 
Physics news on Phys.org
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
http://reference.wolfram.com/mathematica/ref/Line.html
will give you an idea what result you need to generate from your points.
 
Last edited: