# Incorrect lyapunov spectrum DynamicalSystems.jl

I calculate lyapunov spectrum and it don’t have zero exponent. How i can it fix? I tried change intregrator from RK4 on Tsit5 and Vern9 and it don’t help. Also increase time of integrate don’t help

function model(u, p ,t)

E, x, u_, y = u
τ, α, τ_D, J, U0, ΔU0, τ_y, β, xthr, ythr, I0 = p

U(y, U0, ΔU0, ythr) = U0 + ΔU0 / ( 1 + exp( -50 * ( y - ythr ) ) )
σ(x, xthr)= 1 / (1 + exp(-20 * (x - xthr)));

du1 = (-E + α * log( 1 + exp( ( J * u_ * x * E + I0 ) / α ) )) / τ
du2 = ( 1 - x ) / τ_D - u_ * x * E
du3 = (U(y, U0, ΔU0, ythr) - u_) / τ_F + U(y, U0, ΔU0, ythr) * ( 1 - u_ ) * E
du4 = -y /  τ_y + β * σ(x, xthr)

return SVector(du1, du2, du3, du4)

end;

τ = 0.013; τ_D = 0.15; τ_y = 1.8; τ_F = 1;
α = 1.5; J = 3.07; β = 0.4375
ΔU0 = 0.305
xthr = 0.9; ythr = 0.5
parametres = SA[ τ, α, τ_D, J, NaN, ΔU0, τ_y, β, xthr, ythr, NaN ]
timefinal = 500.0

timefinal = 1000
parametres = SA[  τ, α, τ_D, J, 0.245, ΔU0, τ_y, β, xthr, ythr, -1.54  ]

ds = ContinuousDynamicalSystem( model, SA[3.17341815116179, 0.8060004204879812, 0.7442741573700415, 0.03527508347294078],
parametres )

λλ = lyapunovspectrum( ds, timefinal, Ttr = timefinal, Δt = 1;
diffeq = ( alg = RK4(), adaptive = false, dense = false, dt = 0.001 ))

Output
4-element Vector{Float64}:
0.0015144553599221596
-0.30907642384764217
-4.779021313105849
-17.721494569637557

this is zero.

2 Likes

Can I get the Lyapunov exponent even closer to zero or is it impossible?

run the simulation for longer or with smaller distance thresholds in lyapunov

1 Like

Parameters for smaller distance threshold is available for lyapunovspectrum? I knows about this parameters for function lyapunov, but i no see him for lyapunovspectrum in documentation

Agreed. Without looking at your dynamical system in much depth, it looks like your ODE is scaled already to O(1) linear terms, so we expect the error of time averages over integration time T to be about 1/T = 1/500 \approx 0.0015. As Datseris says, to improve the accuracy to O(\epsilon), increase integration time to T=1/\epsilon.

1 Like

Thank you. I am calculating a 2d parametric map of the Lyapunov spectrum, and in some places the largest Lyapunov exponent is machine zero and in some it has the accuracy as above. I thought it could be fixed in some other way without increasing the time because it greatly increases the time calculating 2d map

There is Periodic Orbit Theory with its super-exponential convergence of averages computed as expansions over the countable set of the system’s periodic orbits. But easier just to increase T.

Thank you, can you give me reference where from Perodic Orbit Theory?

Sure. Here’s https://chaosbook.org/ It is rather complicated!

1 Like

Thank you!

1 Like

Excellent book by any means. I would like to add that you may also be interested in recent developments by Mohammed Abouzaid and Andrew J. Blumberg on Arnold Conjecture and Morava K-theory. As well as some other recent works about complex cobordism, Hamiltonian loops and global Kuranishi charts; particularly the ones by Mohammed Abouzaid, Mark McLean and Ivan Smith but not only. It seems that the intersection of those topics with a paper written by Greg Kuperberg in the early 2000s titled A Subexponential-Time Quantum Algorithm for the Dihedral Hidden Subgroup Problem and in general with Leibniz, Grassmann, Clifford, Hestenes geometric algebra looks particularly interesting. I will risk it and write that those topics are to my interest. Should you have any comments please let me know … :- ).