Application Center - Maplesoft

App Preview:

Logistic map

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

The logistic map revisited

Jerzy Ombach, Cracow, Poland
ombach@im.uj.edu.pl
October 8, 1999

This worksheet explores the period-doubling bifurcation sequence and ther phenomena associated with the discrete logistic map f(x) =a*x*(1-x). I refer to Bob Corless' worksheet logmap.mws in the share library, where you can see the power of algebraic utilities in Maple. Here I will show more geometric and numerical approach than Bob did, which is now possible due to new features of Maple, release 5.

> restart:

> libname := "C:/Program Files/Maple Release 5.1/Ombach",libname:

> with(onedd):

Introduction

Define the logistic function

> eval(f);

[Maple Math]

Plot the graph for a particular value of the parameter:

> a := 3.8:

> plot(f,0..1);

[Maple Plot]

Animate the above plot.

> plots[animate]('a'*x*(1 - x), x = 0..1,'a' = 0..4);

Use the context menu to see the animation. Note that for parameters a : 0 <= a <= 4 the unit interval [0,1] is maped onto itself by the map [Maple Math] .

[Maple Plot]

Next we will iterate points from the interval [0,1] by the map [Maple Math] . Thus, for a given [Maple Math] in [0,1] we will look for the points [Maple Math] defined inductively as [Maple Math] , for n = 0, 1, 2, .... Identifying points x from the interval with points (x,x) on the diagonal we may interpret successive [Maple Math] 's geometrically.

We find 10 iterations, i.e. the initial 11 elements of the orbit starting at [Maple Math] = 0.2324 under map [Maple Math] . We also request for the value of [Maple Math] .

> orbit(20,3.5,0.02324,xn);

> xn;

[Maple Plot]

[Maple Math]

The above animation may suggest that our orbit tends to some 4-periodic orbit. Make sure by continuing from [Maple Math] . In this case we do not require for the value of the last point, and thus the fourth argument is omitted.

> orbit(10,3.5,xn);

[Maple Plot]

Define the fourth iteration g(x) = f(f(f(f(x)))) and plot its graph along with the graph of f and the diagonal.

> g := f@@4;

[Maple Math]

> a := 3.5:
plot([f(x),g(x),x],x=0..1, axes = BOXED,
color =[BLACK,RED,BLUE]);

[Maple Plot]

The plot shows two fixed points of [Maple Math] (or equilibrium states), they are the points of intersection of the graph of [Maple Math] with the diagonal. They are also fixed points of [Maple Math] = [Maple Math] . Still, [Maple Math] has six additional fixed points. Previous examination of iterations indicates that four of them form an attracting 4-periodic orbit. A basic theorem of dynamical system says that attractivity of fixed points and periodic orbits depends on the absolute value of the derivative of the corresponding iteration. In particular, if p is an n-periodic point of [Maple Math] and the derivative of [Maple Math] at p has absolute value < 1, then the periodic orbit of p is attracting, and is not if this value is > 1. In our case we then have by inspection of the plot one 4-peridic attracting orbit. Alternatively, we can numerically find fixed points of [Maple Math] and [Maple Math] and compute the appropriate derivatives.

> [solve(f(x) = x)];

[Maple Math]

> map(unapply(diff(f(x),x),x),%);

[Maple Math]

> [solve(g(x) = x)];

[Maple Math]
[Maple Math]
[Maple Math]

> select(x ->(Im(x)= 0),%);

[Maple Math]

> map(unapply(diff(g(x),x),x),%);

[Maple Math]

Let us look for the limit set of a given point..

> x[0] := 0.6343:

> for n from 1 to 200 do
x[n] := evalf(f(x[n-1]))
od:

> plots[pointplot]([seq([n,x[n]],n = 101..200)], view = [100..200,0..1]);

[Maple Plot]

Another way to make sure that for a = 3.5 we have a 4-periodic attractor is to examine graphs of successive [Maple Math] noting the change of their shape. We will see the animation of 20 successive iterations of f when the parameter a = 3.5.

> iteration(20,3.5);

[Maple Plot]

I suggest you to repeat the above steps with different parameters. In particular:

use 0 < a <= 3 to identify an attracting fixed point.
use 3 < a <= 3.569 to identify
[Maple Math] -periodic attracting periodic orbits.
use a = 3.9 or a = 4 to identify chaotic behavior.

Try other a <= 4.

Bifurcation of periodic orbits and transition to chaos

Going further we will see how the limit set of an orbit changes while the parameter a increases. First we plot the limit set (or more formally the segment [Maple Math] , ... , [Maple Math] of the orbit starting at x0 = 0.23) versus the parameter a = 4..

> limset(4,0.23,200,100,DIAMOND);

[Maple Plot]

In the following procedure we make bifurcation diagram or animation (if whatever as the third argument is present) for the values of parameter a ranging over interval [0, 4].

> bif(0,4,232);

[Maple Plot]

> bif(0,4);

[Maple Plot]

Decrease the interval for parameter a.

> bif(2.5,4);

[Maple Plot]

We want to see the reasons for which fixed point zero is an attractor for 0 <= a < 1, then a non-zero fixed point appears which is an attractor when a passes by 1, then a 2- periodic attracting periodic orbit is born when a passes by 3, which in turn bifurcates into 4-perioddic attractor and so on.

How about bifurcation at [Maple Math] ? Remember the meaning of the derivative for the attractivity of the fixed point. We animate the graph of f for a in the interval [0.8, 2.4] with the step = 0.2.

> aiter(1,0.8,2.4,0.2);

[Maple Plot]

How about bifurcation at [Maple Math] ? Remember that fixed points of [Maple Math] that are not fixed point of f form a 2-periodic orbit.

> aiter(2,2.8,3.2,0.02);

[Maple Plot]

How long is this 2-periodic orbit an attractor?

> aiter(2,3,3.5,0.01);

[Maple Plot]

It seems that for some a below 3.5 the 2-periodic orbit is no longer an attractor. We find an appropriate value of a .

> a := 'a': x := 'x':

> r1 := expand(eval((f@@2)(x)));

[Maple Math]

> r2 := diff(r1,x);

[Maple Math]

> fsolve({r1 = x,r2 = -1},{a,x},{a = 3.4..3.6,x = 0.3..0.5});

[Maple Math]

This bifurcation diagram suggests that a 4-periodic attractor appears at [Maple Math] and losses its attractivity at some a above 3.5. Then, animate the fourth iteration of f .

> aiter(4,3.4,3.6,0.01);

[Maple Plot]

> a := 'a': x := 'x':

> r1 := (f@@4)(x):

> r2 := diff(r1,x):

> fsolve({r1 = x,r2 = -1},{a,x},{a = 3.5..3.6,x = 0.3..0.5});

[Maple Math]

Thus the 4-peridodic orbit loses its attractivity at the parameter [Maple Math] . Does 8-peridic orbit then appear? The concept of renormalization developed by Feigenbaum may help with understanding the whole process.

> afeig(3,3.6,0.05);

[Maple Plot]

We see that the family of essential part of [Maple Math] - deciding in fact of the dynamics of [Maple Math] - marked with the small rectangle - left, and expanded by the linear change of variables to the feig(f) defined on the interval [0,1] - right, behaves for a ranging over certain interval [3,b] like the family of f does while a ranges over the interval [1,4]. First, we find this b and then check by inspection of the animation that our method of finding b is correct.

> a := 'a': x :='x':

> fsolve({f(x) = x,(f@@3)(0.5) = x},{a,x},{a = 3.6..3.7,x = 0.5..1});

[Maple Math]

> afeig(3,3.678573510,0.02);

[Maple Plot]

In particular, one can prove that any k-periodic (resp. attracting) orbit of feig(f) produces a 2k-periodic orbit of f (resp. attracting). Moreover, bifuration of non-zero fixed point into 2-periodic orbit for feig(f) implies bifurcation of 2-periodic into 4-periodic orbit for f, and so on .

Now, for a > [Maple Math] we can define feig ( feig(f)), etc. Thus, attracting [Maple Math] -periodic orbits bifurcate into attracting [Maple Math] -periodic orbits more and more quickly. There exists [Maple Math] (approx. [Maple Math] =3.570) such that f has periodic orbits with all [Maple Math] -periods, k = 1,2,3, ..., none of them attracting. For a > [Maple Math] periodic orbits with another periods appear. In particular, for a > b = [Maple Math] periodic orbits with odd periods appear.

We look for a 3-peridic orbit.

> aiter(3,3.5,4,0.02);

[Maple Plot]

We can see that 3-periodic orbit appears for a .> 3.8, when the graph of [Maple Math] crosses the diagonal. In fact, they are two such orbits, one attracting for a while and the other repelling. We find the values of a for which 3-periodic orbits are born and one of them becomes an attractor.

> a := 'a':

> r1 := (f@@3)(x):

> r2 := diff(r1,x):

> fsolve({r1 = x,r2 = 1}, {a,x},{a = 3.8..3.9, x = 0.4..0.6});

[Maple Math]

When 3-periodic orbit is no longer an attractor (and bifurcates into 6-periodic attractor)?

> fsolve({r1 = x,r2 = -1},{a,x},{a = 3.8..3.9, x = 0.4..0.6});

[Maple Math]

By the Sharkovskii Theorem the existence of period three implies the existence of all other periods! So, for example, 5-periodic orbit should have appeared for some a < [Maple Math] . Check it now.

> aiter(5,3.6,4,0.02);

[Maple Plot]

In fact, 5-peridic orbits (an attractor including) appear for a close to 3.74. Incidentally, we can see two other values of a , when extra 5-periodic orbits appear. I reccommend examining the rising of periodic orbits with period 7, 9, 11, ... . It would be a good test of your computer power!

And what about a 6-periodic attractor? From this what we have already have learned, there are at least two values of a for which a 6-periodic attractor is born. One is a = [Maple Math] mentioned above, when 3-periodic orbit bifurcates. We should also anticipate another 6-periodic orbit, which corresponds to a 3-periodic orbit of the feig(f).

> bif(3.6,3.7);

[Maple Plot]

> a := 'a': x := 'x':

> r1 := (f@@6)(x):

> r2 := diff(r1,x):

Below we use Newton procedure from the share library instead of fsolve routine to find a value of the parameter a and a corresponding 6-periodic point.

> with(share): with(linalg): with(Newton):

See ?share and ?share,contents for information about the share library

Warning, new definition for diag

Warning, new definition for norm

Warning, new definition for trace

Share Library:  Newton

Author: Taylor, Ross.

Description:  An implementation of a Newton iteration for solvingnon-linear systems of equations

> Newton([r1 = x,r2 = 1],[a =3.62,x =0.3],output={functions,variables},iterations = 10,tolerance = 1e-6);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

We check the result graphically.

> assign(%);

> orbit(6,a,x,xn);

[Maple Plot]

> xn, x - xn;

[Maple Math]

> x := 'x':

Chaos and statistical behavior

They are parameter values, such that there is no periodic attractor. One can prove, that [Maple Math] is just the case. Let us look for iterations of some point.

> x0 := stats[random, uniform](1);

> orbit(100,4,x0);

[Maple Math]

[Maple Plot]

However, there are many orbits whith very simple behavior. In particular, there are infinite many periodic orbits and they are dense in the interval [0,1]. Look for 5-periodic orbits for example.

> a := 4:

> plots[display]([onedd[diag],plot(f@@5,0..1)]);

[Maple Plot]

Another simple orbits are the eventually periodic orbits. For example the orbit starting at [Maple Math] .

> orbit(10,4,0.5,xn);

[Maple Plot]

> xn ;

[Maple Math]

Going farther, we can consider orbits starting at preimages/onedd od [Maple Math] under the iterations of [Maple Math] .

> pre := array(0..4);

[Maple Math]

> pre[0] := [1/2]:
for k from 1 to 4 do
pre[k] := [seq(solve(f(x) = pre[k-1][i]), i = 1..nops(pre[k-1]))];
od;

[Maple Math]

[Maple Math]

[Maple Math]
[Maple Math]

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

Any orbit starting from one of the above points collapse at zero. For example:

> orbit(10,4,1/2+1/4*sqrt(2-sqrt(2+sqrt(2+sqrt(2)))));

[Maple Plot]

Have a look on the all computed preaimages/onedd:

> preimages/onedd := 0,1,seq(op(pre[k]), k = 0..4):

> nops({preimages/onedd});

[Maple Math]

> plots[pointplot]([seq([x,x],x = preimages/onedd)]);

[Maple Plot]

Points which orbits are eventually zero are dense in [0,1].

Similarly, points which orbits are eventually the nonzero fixed point are dense in [0,1]. The same is true for eventually periodic points with any given period.

> solve(f(x) = x,x);

> pre[0] := [3/4]:
for k from 1 to 4 do
pre[k] := [seq(solve(f(x) = pre[k-1][i]), i = 1..nops(pre[k-1]))];
od;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]
[Maple Math]
[Maple Math]

> preimages/onedd := 3/4,seq(op(pre[k]), k = 0..4):

> plots[pointplot]([seq([x,x],x = preimages/onedd)]);

[Maple Plot]

On the other hand, there are also points not eventually periodic. For example, points [Maple Math] , k, n = 1, 2, 3, ..., with [Maple Math] < [Maple Math] form a dense set in in [0,1] but are not eventually periodic.

We can thus agree that for a = 4 the system is chaotic. However, we will see that even in this case the system behaves nicely from a statistical point of view.

We will count how many times the orbit starting at x0 and having 5 000 points visits one of each of the 100 disjoint intervals of lengths [Maple Math] .

> emp_distr(4,x0,100,5000);

[Maple Plot]

One can change the starting point x0, still the distribution will be more less the same. It appears that there is a density distribution function corresponding to the empirical distribution with the following density function.

> phi := x -> 1/(Pi*sqrt(x*(1-x)));

[Maple Math]

> plot(phi, 0..1);

[Maple Plot]

> int(phi, 0..1), 5000/100;

[Maple Math]

> plots[display]({emp_distr(4,x0,100,5000),
plot(50*phi(x),x = 0..1,numpoints = 400)});

[Maple Plot]

A word of caution

For some values of parameter a , especially for these responsible for chaos, the system is sensitive to initial conditions and the roundoff error. Perform 25 iterations for two very close points.

> orbit(25,4,0.2324,xn):

> xn;

[Maple Math]

> orbit(25,4,0.2324001,xn):

> xn;

[Maple Math]

Increase the accuracy and repeat:

> Digits := 50:

> orbit(25,4,0.2324,xn):

> xn;

[Maple Math]

> orbit(25,4,0.2324001,xn):

> xn;

> Digits := 10:

[Maple Math]

We see that the roundoff error is perhaps of less importance, and the differences are caused by the dynamical system itself. We thus may ask, if the 'orbits' produced by the computer give information of any value about the 'true orbits'. This problem has not been completely solved so far. Still for the case a = 4, it is known that the system has the shadowing property, i.e. any 'orbit' produced by computer is very close shadowed (traced) by some 'true one' .