Mathematica Mathematica - Showing iterations graphically

  • Thread starter Thread starter nothingbetter
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
To demonstrate the iterative function x_{n+1} = sin(x_n) through a plot, the goal is to graph y = sin(x) and y = x, and visually represent the iterations by drawing lines connecting points on these graphs. The initial suggestion involves using the Mathematica function NestList to generate points for the iterations, starting from an initial value. The generated points can then be used to create horizontal and vertical line segments that illustrate the iterative process, similar to examples found in Wolfram demonstrations. For further guidance, the documentation on the Line function in Mathematica is recommended to understand how to create the necessary visual elements from the points.
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:

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
620
  • · Replies 2 ·
Replies
2
Views
2K