| Contents | Index |
plot::Iteration(f, x0, n, x =
) is a graphical object visualizing the iteration
(
) of the given starting point
.
Call:
plot::Iteration(f, x0, <n>, x =
..
, <a = amin .. amax>, Options)
Parameters:
|
f: |
the iteration function: an arithmetical expression in the independent variable x and the animation parameter a. Alternatively, a MuPAD procedure that accepts 1 input parameter x or 2 input parameters x, a and returns a real numerical value when the input parameters are numerical. |
|
x0: |
the starting point for the iteration: x0 must be a numerical real value or an expression in the animation parameter a. |
|
n: |
the number of iterations: n must be a positive integer or an expression in the animation parameter a. |
|
x: |
the independent variable: an identifier or an indexed identifier. |
|
|
the plot range: |
See Also:
Details:
plot::Iteration(f, x0, n, x =
) visualizes the iteration
for
starting with the point
.
The iteration is visualized by connecting the points
and
by a vertical line. For any step of the iteration, a horizontal line is drawn from the point
(on the graph of
) to the point
on the main diagonal. From there, a vertical line is drawn to the next pair
of the iteration.
The iteration object neither includes the graph of the function
nor the main diagonal
. You need to plot them separately if you wish the function and/or the diagonal to be in your picture! See the examples.
The iteration is stopped prematurely when the iterated point leaves the plot range
. Cf. example 3.
Despite the fact that the number of iterations n represents an integer, it can be animated! Cf. example 4
The default color used for the iteration plot is RGB::Grey50. It can be modified by setting the attribute Color or LineColor. Cf. example 1.
The default line style is solid. It can be modified by setting the attribute LineStyle.
Example 1
We consider the logistic map for the parameter value
, i.e., the parabola
for
. We iterate the starting point
:
f := plot::Function2d(3*x*(1 - x), x = 0..1,
Color = RGB::Blue):
x0 := 0.5:
We plot the iteration (without specifying the number of iterations), the parabola
and the diagonal line
:
g := plot::Function2d(x, x = 0..1, Color = RGB::Red):
it := plot::Iteration(3*x*(1 - x), x0, x = 0..1):
plot(f, g, it)

We increase the number of iterations to
and change the color of the lines to RGB::Black:
it::Iterations := 50:
it::Color := RGB::Black:
plot(f, g, it)

Finally, we animate the number of steps, allowing to follow the course of the iteration:
it := plot::Iteration(3*x*(1 - x), x0, n, x = 0..1,
n = 1..50, Color = RGB::Black):
plot(f, g, it)


delete f, g, it:
Example 2
We consider the logistic map
for
and the animation parameter
running from
to
:
f := plot::Function2d(a*x*(1 - x), x = 0..1, a = 2..4,
Color = RGB::Black):
We define the iteration of the starting point
by
and plot it together with the function graph of
and the diagonal line
:
g := plot::Function2d(x, x = 0..1, Color = RGB::Black):
it1 := plot::Iteration(a*x*(1 - x), 0.2, 30, x = 0..1,
a = 2..4, Color = RGB::Red):
plot(f, g, it1)


We define an additional iteration starting at
and add it to the plot:
it2 := plot::Iteration(a*x*(1 - x), 0.21, 30, x = 0..1,
a = 2..4, Color = RGB::Blue):
plot(f, g, it1, it2)


For small values of
, the two iterations converge to the same fixed point. When
approaches the value
, the iterations drift into chaos.
delete f, g, it1, it2:
Example 3
Consider the iteration of the starting point
by the logistic map
with the plot range
:
f := plot::Function2d(x*(x - 1), x = 0..1):
it := plot::Iteration(x*(x - 1), 0.2, x = 0..1):
plot(f, it)

We see that only one step of the iteration is plotted. The reason is that the point
is negative and, hence, not contained in the requested plot range x = 0..1. We modifiy the plot range:
f::XRange:= -0.5..1:
it::XRange:= -0.5..1:
plot(f, it)

delete f, it:
Example 4
We animate the parameter
that sets the number of iterations. We set the time range for the animation to 40 (seconds). Using Frames, the total number of frames is chosen such that approximately 10 frames are used to visualize the step from
to
:
f := plot::Function2d(4*x*(1 - x), x = 0..1):
g := plot::Function2d(x, x = 0..1):
it := plot::Iteration(4*x*(1 - x), 0.4, n, x = 0..1,
LineStyle = Dashed,
n = 0..40, Frames = 411,
TimeRange = 0..40):
plot(f, g, it)


delete f, g, it:

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |