DynamicalSystemsBase.jl icon indicating copy to clipboard operation
DynamicalSystemsBase.jl copied to clipboard

Improving the speed of Lyapunov spectra computation

Open rseydam opened this issue 1 year ago • 4 comments

When using the lyapunovspectrum function, it would be nice to use the Jacobian's structure (diagonal, banded, rank1, and so on) especially as long as one doesn't use a GPU for the matrix multiplication. In the problem I am working on the Jacobian has a diagonal, a rank 1, and a banded part. When the size gets big it would be nice to make use of that. Is this possible and how would this be done?

Maybe another related idea is to use a GPU for the evolution of the variational equation. Is this something that could be implemented?

rseydam avatar Oct 26 '23 08:10 rseydam

All of these are nice ideas, and they need to be implemented in DynamicalSystemsBase.jl for the TangentDynamicalSystem. DifferentialEquations.jl ecosystem has functionality to detect the sparsity structure of Jacobian that we could utilize. In general, DifferentialEquations.jl uses the Jacobian in many solvers already so we could be re-using things.

Unfortunately this issue falls outside my bandwidth.

Datseris avatar Feb 21 '24 09:02 Datseris

(note that you can pass in a sparse Jacobian already thats not a problem, but you would have to create the sparse and pass it in when you initialize a TangentDynamicalSystem)

Datseris avatar Feb 21 '24 09:02 Datseris

https://juliadynamics.github.io/DynamicalSystemsDocs.jl/dynamicalsystemsbase/stable/#Advanced-example

Datseris avatar Feb 21 '24 09:02 Datseris

See also https://github.com/SciML/ModelingToolkit.jl/issues/1160 that practically solves the problem. We just need to make sure that this information is utilized when creating a TangentDynamicalSystem.

Datseris avatar Feb 23 '24 14:02 Datseris