1

Im writing a script to calculate the Lyapunov exponent of a particular system with varying parameter. The code is ungodly slow and it hangs every so often when running on Jupyter Notebook. Any suggestions?

using DynamicalSystems, Plots

function RF!(du,u,p,t)
    gamma = p[1]
    nu = p[2]
    du[1]= u[2]*(u[3]-1+u[1]^2)+gamma*u[1]
    du[2]= u[1]*(3*u[3]+1-u[1]^2)+gamma*u[2]
    du[3]= -2*u[3]*(nu+u[1]*u[2])
end
a = 0.287
iterate=100
lambdas = rand(iterate)
for d in 1:iterate
    rf = ContinuousDynamicalSystem(RF!,[0.1,0.1,0.1,0],[0.1,a])
    a = a + 0.024
    push!(lambdas,ChaosTools.lyapunov(rf,2000))
end
lambdas
'''
Stev L
  • 11
  • 1

0 Answers0