Skip to content

Sundials and SecondOrderODEProblem (OrdinaryDiffEq) not compatible #353

@magix2

Description

@magix2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions