Mathematica - Showing iterations graphically

  • Mathematica
  • Thread starter nothingbetter
  • Start date
  • Tags
    Mathematica
In summary, the conversation discusses using an iterative function to demonstrate an iteration on a plot by graphing two functions and drawing lines between them. The individual is unsure how to do this and is seeking guidance on keywords and starting points. Additionally, they mention difficulties with using LaTeX in the forum. Some suggested resources are provided to help with the task.
  • #1
nothingbetter
5
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
  • #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
http://reference.wolfram.com/mathematica/ref/Line.html
will give you an idea what result you need to generate from your points.
 
Last edited:

Related to Mathematica - Showing iterations graphically

1. How can I use Mathematica to show iterations graphically?

To show iterations graphically in Mathematica, you can use the ListPlot or Plot functions to plot the values of your iterations as a line or scatter plot. You can also use the Manipulate function to create interactive graphs that display the changes in your iterations as you adjust certain parameters.

2. Can I customize the appearance of my graph in Mathematica?

Yes, you can customize the appearance of your graph in Mathematica by using different options and settings for the ListPlot and Plot functions. You can change the color, style, and size of your plot, as well as add labels, legends, and other annotations to make your graph more visually appealing and informative.

3. How do I plot multiple iterations on the same graph?

To plot multiple iterations on the same graph in Mathematica, you can use the Show function to combine multiple plots into one. You can also use the PlotRange option to adjust the range of values displayed on the graph and make sure all iterations are visible.

4. Is it possible to export my graph to an image or document?

Yes, you can export your graph from Mathematica as an image, PDF, or other document format. You can use the Export function and specify the desired file format to save your graph as an external file that can be shared or used in other documents or presentations.

5. Can I use Mathematica to analyze and compare different iterations?

Yes, you can use Mathematica to analyze and compare different iterations by using functions such as MaxValue, MinValue, and Mean to find the maximum, minimum, and average values of your iterations. You can also use FindRoot or FindMaximum to find the roots or maximum points of your iterations and compare them with each other.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
982
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
708
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top