JuliaDynamics / DynamicalSystemsBase.jl

Definition of dynamical systems and integrators for DynamicalSystems.jl
Other
56 stars 29 forks source link

Improving the speed of Lyapunov spectra computation #197

Open rseydam opened 11 months ago

rseydam commented 11 months ago

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?

Datseris commented 7 months ago

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 commented 7 months ago

(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 commented 7 months ago

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

Datseris commented 7 months ago

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.