Integrating large systems of ODEs

Hello! I am pretty new to Julia and I am looking for some answers and suggestions for a project of mine.
I am translating a code from C to Julia because I would like to divide the code in modules and possibly take advantage of libraries and packages. In my original code, I use Runge-Kutta to integrate a large system of ODEs:

\tau \frac{dr_i}{dt} = - r_i + \Phi(W^T \vec{r})

where i \in [N] and N = 10000 but W is sparse. I have been trying to understand what is the best package for integrating such a large number of equations, either DifferentialEquations.jl or NetworkDynamics.jl. Or maybe it is enough to copy and paste the RK4 method in Julia, like I did in the C version, which already took into account the sparsity (the loops are of order of the number of elements of W).

RK4 isn’t tolerance controlled, and it has slow convergence, so I’d generally recommend folks just use DiffEq’s Tsit5 (can just directly using OrdinaryDiffEqTsit5 for just that one solver). NetworkDyamics.jl is a modeling library that builds ODEs for DifferentialEquations so whether it should be used is more of a modeling choice.

3 Likes