Dynamical Systems

Lyapunov Exponent

The Lyapunov exponent, measures how quickly an infinitesimally small distance between two initially close states grows over time.

| F(x_0 + \epsilon, t) - F(x_0, t) | \sim \epsilon e^{\lambda t} \\

The left hand side is the distance between two initially close states after steps, and the right hand side is the assumption that the distance grows exponentially over time. The Lyapunov exponent which is measured for long period of time corresponds to the exponent . The stability of the system is given by the sign of . If : means that s small distance grow with time, this corresponds to the stretching mechanism. And if : small distance do not grow indefinitely.The expression of is obtained by doing some mathematical derivation, as follows:

e^{\lambda t} \sim \frac{| F(x_0 + \epsilon, t) - F(x_0, t) | }{\epsilon }\\ \quad\\ \lambda \sim \lim \limits_{r \rightarrow \infty}\frac{1}{t} \log \Big\vert \frac{dF}{dx} \Big\vert_{x = x_0} \Big\vert \\ \quad\\ \lambda \sim \lim \limits_{r \rightarrow \infty}\frac{1}{t} \log \sum_{i=0}^{t-1} \Big\vert \frac{dF}{dx} \Big\vert_{x = x_i} \Big\vert

Taking the example of non-linear equation described above, we can calculate the Lyapunov exponent for different values of :

\frac{dx}{dt} = r-x^2

We can observe that the system becomes chaotic from a certain value of . The reader can play with different values of by using the following code source.

Visual output of the following code, showing the Lyapunov exponent of the above equation
1
2
@author: yacine.mezemate
3
"""
4
import numpy as np
5
import matplotlib.pyplot as plt
6
7
global x0, r
8
9
x0 = 0 # Initial condition
10
r = np.linspace(0,2,200) # Parameter r
11
12
# Differential equation
13
def F(x0,r):    
14
    x = np.zeros((100,200))
15
    
16
    for j in range(0,200):
17
        
18
        x[0,j] = x0 
19
20
        for i in range(0,99):
21
            x[i+1,j] = x[i,j] + r[j] - x[i,j]**2 
22
    return x            
23
24
# Derivative
25
def dF(x):
26
    dy = np.log(abs(1-x*2))
27
    return dy
28
29
# Lyapunov exponent    
30
def Lyapunov(dy):
31
    Lambda = np.mean(dy, axis =0)
32
    return Lambda
33
    
34
# main    
35
y = F(x0,r)
36
dy = dF(y)
37
lam = Lyapunov(dy)
38
39
# PLot
40
plt.plot(r,lam)
41
plt.plot([0,2], [0,0], "--")
42
plt.xlabel("r", fontsize =18)
43
plt.ylabel("Lyapunov exponent $\lambda$", fontsize =18)
PreviousPreviousNextNext
HomepageHomepagePrintPrintCreated with Scenari (new window)