# Deterministic Chaos

*Deterministic Chaos* is a term used to describe the behavior
of some nonlinear systems.

Perhaps the simplest system which may display chaotic behavior
is the logistics map. The logistics map has a single configurable parameter
*r* (also known as l),
which must be chosen in the range 0 ≤ r &le 4.

Once started with some initial value x_{0},
the logistics map produces a sequence of values x_{n}
all of which obey 0 ≤ x_{n} ≤ 1 .

The logistics map is defined as follows:

x_{n+1} = r x_{n} ( 1 - x_{n})

For some values of r and x_{0} the logistics map produces
completely predictable sequences, for example, for all r,
starting with x_{0} = 0 produces x_{n}=0 for all n!
However, in general the behavior of x_{n} depends on r.

You can find out a lot more about the logistics map
by reading section 5.5 of DSPCSP.

I have written a few **Windows** programs that will help you explore the fascinating
world of deterministic chaos.

SPECTRUM is a program
that analyzes x_{n} as a digital signal.
The upper half of the display is devoted to the signal
in the time domain, while the lower half is the signal
in the frequency domain. The frequency domain representation
is found by computing a 512-point FFT (without windowing).

When first started, the program displays the signal
for default parameters. The dialog box allows the user
to change the r parameter; the initial value x_{0};
the *transient*, which is the number of iterations
performed before displaying the results in order to allow
the initial transient to die down; and the display length,
which determines the number of points that are displayed
(but does not influence the spectral display).
pressing **Go** runs the simulation with
the parameters as set in the dialog box.

After each iteration the x_{0} is set to the last
x_{n} value. So you can press **Go**
multiple times to see how the signal develops over time.
Set the transient parameter to zero to see consecutive windows.

When points belonging to an attractor are very close,
they are hard to distinguish based on the time display in SPECTRUM.
An alternative depiction is the *return map*,
which also graphically elucidates the logistics recursion
by exploiting a two dimensional graph.
This graph plots x_{n+1} (as x) as a function of x_{n}
(as y), so the logistics map itself is an inverted parabola.
The recursion starts with some initial x value x_{0}
and computes the y value x_{1};
so we could show this by starting on the x axis at x_{0}
and going up vertically until we intersect the logistics parabola,
but instead the return map starts on the 45 degree diagonal line
and goes vertically either up or down until it hits the logistics
parabola. For the next iteration we have to use this new (y)
value as our x, so we head left or right for the 45-degree diagonal
(which interchanges x and y) and then go once again up or down
until we hit the logistics parabola.

This method of displaying the operation of the logistics
map is demonstrated in RETURN.
When first started, the program displays the logistics inverted
parabola and the 45-degree diagonal line.
You can set the r and x_{0} using the dialog box,
and run the simlation by pressing **Go**.
There is no transient suppression in RETURN,
so you can observe how the logistics map recursion falls into
its attractor. Each new **Go** starts where the previous one
left off.
You can also try different number of iterations
and add delay (in milliseconds) to slow down the recursions
for easier viewing. If you want to see the logistics
parabola without iterations set the number of iterations to zero;
if you want to blank the diagonal line as well you may
set the delay to a negative number as well.

ATTRACTORS is a program
that displays the fixed points and more complex attractors
of the logistics map as a function of r.
When started up it displays the entire range
0 ≤ r &le 4, but you can zoom in by holding down the left
mouse button and marking a rectangular region.
You can proceed to zoom in as much as you want,
and don't worry if you go outside the square -
the program will automatically select appropriate values.
Double click in order to return to the initial state.
In order to undo your last zoom click the right mouse button.
Multiple undo operations are supported.
Of course you can resize the window in the usual fashion.
Try zooming in on bifurcations and note the fractal self-similarity
the picture!

The program uses certain internal parameters
(*transient*, *passes* and *density*)
in order to produce the displays,
and the default values for these parameters
were chosen as a compromise between accuracy and
run-time.
The *transient* parameter controls how many iterations
are run before the simulation is assumed to be in the attractor;
*passes* is the maximum attractor size that can be fully displayed,
and *density* determines the display step size in r value.

After zooming in a number of times, you will probably
have to increase the accuracy of the simulation,
at the expense of slower screen updates.
Increasing any parameter doubles its value,
delivering more accuract but slower displays.
The right and left arrow keys increase and decrease
the *transient* parameter.
The up and down arrows increase and decrease the *passes*
parameter. Be careful when decreasing
*passes* - when it is too low the display becomes
meaningless. The End and Home keys increase and decrease
the *density* parameter, respectively.

There are also old **DOS** versions of these programs: