Sundials.jl
Sundials.jl copied to clipboard
Sundials and SecondOrderODEProblem (OrdinaryDiffEq) not compatible
To reproduce the problem:
using OrdinaryDiffEq
ω = 1
x₀ = [0.0]
dx₀ = [π/2]
tspan = (0.0, 2π)
function harmonic_oscillator(ddu,du,u,ω,t)
ddu .= -ω^2 * u
end
prob = SecondOrderODEProblem(harmonic_oscillator, dx₀, x₀, tspan, ω)
#Tsit 5 works
sol = solve(prob, Tsit5())
using Sundials
# error using CVODE_BDF
sol = solve(prob, CVODE_BDF())
Error:
ERROR: LoadError: MethodError: Cannot `convert` an object of type Array{Float64,1} to an object of type RecursiveArrayTools.ArrayPartition{Float64,Tuple{Array{Float64,1},Array{Float64,1}}}
Current workaround: Formulate the problem as an ODEProblem