SciML / OrdinaryDiffEq.jl

High performance ordinary differential equation (ODE) and differential-algebraic equation (DAE) solvers, including neural ordinary differential equations (neural ODEs) and scientific machine learning (SciML)
https://diffeq.sciml.ai/latest/
Other
556 stars 210 forks source link

Feature request: support for arrays of `SVector` with stabilized Runge-Kutta methods #1924

Open jlchan opened 1 year ago

jlchan commented 1 year ago

Arrays of arrays work for most explicit solvers, but are not yet supported by stabilized Runge-Kutta solvers such as RKC, ROCK2, and ROCK4. Here's a MWE:

using Pkg; Pkg.activate(temp=true); Pkg.add("OrdinaryDiffEq"); Pkg.add("StaticArrays")
using OrdinaryDiffEq
using StaticArrays

u = [SVector(1.0)]
function rhs!(du, u, p, t)
    du .= u
end
ode = ODEProblem(rhs!, u, (0.0, 1.0))
sol = solve(ode, ROCK4()) # works with Tsit5, RK4

@ranocha and I are interested in using these in Trixi. Would it be possible to support arrays of SVector for stabilized RK solvers? Happy to take a stab at adding this.

ranocha commented 1 year ago

ROCK2 and ROCK4 should work on master, RKC etc. still needs to be fixed (but I don't have the time right now)

jlchan commented 1 year ago

That's fantastic! Thanks - we mostly use ROCK2 and ROCK4 so this is great.

ranocha commented 1 year ago

@ChrisRackauckas Shall we make a new release of OrdinarDiffEq.jl?

jlchan commented 1 year ago

Bump on a new release?

Edit: done with v6.50. Thanks!