Julia uses a lot of memory with package DifferentialEquations.jl; DynamicalSystems.jl

Please don’t use saveat or other output controlling keywords with trajectory. Instead, use solve directly. trajectory is nothing more than a convenience wrapper around solve that ensures equal time steps and also that the output is a Dataset. There is no reason to use it besides a convenience quick function; go to the source, solve, which gives you much more power if what you are interested in is simply evolving the system with a lot of control.

You shouldn’t save a trajetory anyways. If you want to compute extreme events you should use integrator and simply step the integrator and detect the events and store only these events. It is very ineficient to make trajectories of 100000000000 of time steps and then loop through that to find the events.

By the way, I am very interested to make a function extreme_events(ds::DynamicalSystem, ...) that computes extreme events given some quantifier of the event/state. This could be done with call backs or integrator looping. It is very common in nonlinear dynamics. Perhaps you want to contribute this? In any case, you should participate in this discussion here and mention your use case so I can see what can of use cases people are interested in.

https://github.com/JuliaDynamics/DynamicalSystems.jl/issues/189

2 Likes