100% found this document useful (1 vote)
144 views3 pages

Lyapunov Exponents: C. C. Esporlas National Institute of Physics University of The Philippines

Lyapunov Exponents - Solving non-linear equations and analysis of chaotic systmes like the Logistic Map used for population dynamics using Python
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
144 views3 pages

Lyapunov Exponents: C. C. Esporlas National Institute of Physics University of The Philippines

Lyapunov Exponents - Solving non-linear equations and analysis of chaotic systmes like the Logistic Map used for population dynamics using Python
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lyapunov Exponents

C. C. Esporlas
National Institute of Physics
University of the Philippines
[email protected]

1. Introduction
Not all physical systems follow linear dynamics.
These nonlinear physical systems exhibit chaotic
behaviors that were once difficult to understand or
approximate. Such systems include impulsively
driven mechanical systems, some parts of economics,
digital electronics, weather patterns, turbulent fluid
systems and population dynamics. These systems
occur in times that are discrete rather than continuous
and are modeled using difference equations,
recursion relations or iterated maps.
In population dynamics, chaotic behavior was
discovered by biologist Robert May by studying a
simplified model of population growth. This model is
called the Logistic Map which is simple but contains
key attributes of complex chaotic behavior. The
Logistic Map used in this paper is of the form:
xn +1 = 4rxn (1 xn ) = f ( xn )
n = 0,1, 2,...
(1)
which is a one-dimensional map since the points xn
belong to the one-dimensional space of real numbers.
The sequence x0, x1, x2, ... is called the orbit starting
from x0 which tells the initial population size while r
is the control parameter which accounts for both the
death and birth rates of a certain population.

value of r where the single fixed point bifurcates into


two fixed values is r=3/4.

Figure 1. x_n vs n (x_0=0.65)


Another way of determining the behavior of the
Logistic Map in Equation(1) is to get the Bifurcation
Diagram by plotting xn vs r where for each value of r,
the iterated values of xn are plotted after the first 100
iterations are discarded.

2. Physics
The chaotic behavior of simple systems such as a
growing population can be observed by analyzing the
behavior of the Logistic Map.
From Equation (1) with 1 xn 0 since if xn
1, xn+1 would be negative which would be unphysical
while 1 r 0.
If some initial population x0 is used, and r 1/4,
xn0 as n, the population always goes extinct. If
1/4 r < 3, the population grows and reaches a
nonzero steady state. But before it goes to a steady
state, as r increases it undergoes an initial transient
behavior which is shown in Figure1. At r=0.2, the
stable fixed point is x=0 starting at r=0.25 the x0 but
as it increases more like at r=0.87, an initial transient
behavior is observed and then it oscillates between
four values which means xn repeats every four
iterations that it has a stable cycle of period 4 unlike
the stable cycle of period 1 at smaller values. This

Figure 2. Bifurcation Diagram


We can see that the bifurcation goes faster and
faster as r increases till it reaches up to a limit of n
where rn converges to r and the distance between
successive transitions shrinks by a constant factor: the
Feigenbaum constant.
r r
= lim n n 1 = 4.669...
(2)
n r
n +1 rn
From Figure2 the transition from periodic to
chaotic behaviour and the narrow windows of periodic

behaviour within the region of chaos can be observed


as it is zoomed.
Now, for systems exhibiting a chaotic behaviour,
its sensitivity from the initial condition is the most
important characteristic such that an infinitesimal
change of initial conditions results in an
unpredictable state for long times. These deviations
are measured by the Lyapunov exponent which is an
estimation of the degree of divergence of initially
closely-related trajectories.
Consider an initial condition x0 and a nearby
point x0+d0 where d0, the initial separation is very
small and after n iterates the separation is dn. Now, if
|dn|=|d0|en, where is the Lyapunov exponent then a
0 indicates that the point xn is unstable or in chaos
while if =0 then xn is a fixed point and that the
system is in a some kind of steady state mode and
lastly if 0 then that point attracts to a stable point
or a stable periodic orbit.
To get we solve for it by noting that
(3)
d n = f '' ( x0 + d 0 ) f '' ( x0 )
then we get,
1
n

= ln
=

dn
d0

f
1
ln
n

''

calculation. Now for each value of r within the given


range we calculate for the Lyapunov exponent.
First the initial condition is stated: x0=0.65.
Starting from this initial condition, we remove the
points that exhibit transient behavior by iterating the
logistic map for 100 times. Another parameter is
introduced (l) to store the lyapunov exponents for
N=500 iterations.
In each iteration we get the value of xn+1 from the
logistic map as a function of xn then compute for
ln|f(xn)|=ln|4r-8rxn|,
x_n = f(r,x_n)
l = l + scipy.log(abs(df(r,x_n))).
Next is, we gather all the values of l and take the
average since we need the summation of the logarithms
over the number of iterations (see Equation 6) and store
it in the empty array set for the Lyapunov exponents.
As we get each current Lyapunov exponent and plot it
versus the control parameter r. We repeat the process
for all r in the range given. The end result is shown in
Figure3.

4. Results

( x0 + d 0 ) f ( x0 )
''

(4)

d0

'
1
ln ( f '' ) ( x0 )
n
where we took the lim d00 in the last step. By
applying chain rule to the term in the logarithm in the
last step we get,

n =1

f '' ( x0 ) = f ' ( xi )

(5)

i =0

and substituting it to Equation (4) and take the limit


as n we get Equation (6) which is the Lyapunov
exponent for the orbit starting at x0.

1 n 1
= lim ln f ' ( xi )
n n
i =0

(6)
n 1
1
'
= lim ln ( f ( xi ) )
n n
i =0

3. Algorithm
To calculate the Lyapunov exponents of the
Logistic Map in Equation (1) we first define the
needed functions which are the logistic map and its
derivative, then we set the range for the control
parameter r which is set at 1 r 0 and lastly the
number of iterations N which can be a very large
number. Now, all we need to get is the current value
of xn with respect to its r. To do this, two empty
arrays are created before implementing the

Figure 3. Lyapunov Exponents for Logistic Map


f(x)=4rx(1-x)
From Figure3 we can see that starts at a negative
value meaning the system is still stable but start of
chaos can be seen when r 0.89 when becomes
positive. The negative spikes correspond to the
periodic instances (2n - cycles) a super stable trajectory.
Also as r increases further, becomes more
positive except when a periodic window occurs (see
Figure$). By getting a superimposed plot of the
bifurcation diagram and the Lyapunov exponents, more
observations can be deduced.

Appendix
Source Code:
import scipy, pylab
def f(r,x):
return 4*r*x*(1.0-x)

Figure 4. Bifurcation Diagram and Lyapunov


Exponents for Logistic Map
Comparing the behaviour of the to the
bifurcation diagram, it can be noted that < 0 for r <
3/4 and approaches zero whenever bifurcation occurs.
A larger view at the area where chaos is largely
observed is shown in Figure5.

def df(r,x):
return 4*r-8*r*x
N=500
rrange = scipy.linspace(0.1,1,500)
#Create arrays to store lyapunov
#exponents at each parameter value
lexp=[ ]
rlexp=[ ]
for r in rrange:
#Set initial condition
x_n = 0.65
#Remove initial transient iterations
for i in range(100):
x_n=f(r,x_n)
#Bifurcation
rlist=[ ]
x=[]

Figure 5. Bifurcation and Lyapunov Exponents


(Zoom)
Figure5 shows a better view where large dips are
present whenever a periodic window occurs. The
largest window of period 3 can be seen near r=0.96.
In general, the transitions between the regular and
chaotic states is widely observed and this is a major
characteristic of a nonlinear chaotic system.

References
[1] S. Strogatz, Non-Linear Dynamics and Chaos,
Chapter 10, Perseus Books Publishing, 1994.
[2] W. Kinzel and G. Reents. Physics by Computer.
Springer. 1998

for i in range(N):
x_n = f(r,x_n)
rlist.append(r)
x.append(x_n)
pylab.plot(rlist, x, 'r,')
#Estimate lyapunov exponents over N iterations
l=0.0
for i in range(N):
x_n = f(r,x_n)
l = l + scipy.log(abs(df(r,x_n)))
#Get average of lyapunov exponent per iteration
l = l/float(N)
lexp.append(l)
rlexp.append(r)
pylab.plot(rlexp,lexp,'g-')
pylab.show()

You might also like