Skip to content

Sundials.jl does not work with ArrayPartition from RecursiveArrayTools.jl #331

@mauro3

Description

@mauro3

This errors:

using OrdinaryDiffEq, Sundials, RecursiveArrayTools

function problem!(du, u, p, t)
    h, ϕ = u.x
    dh, dϕ = du.x
    dh .= 0.5 * h
    dϕ .= 0.1 * ϕ
end

h0 = rand(3, 4)
ϕ0 = rand(3, 4)
u0 = ArrayPartition(h0, ϕ0)

tspan = (0.0, 1e3)
prob = ODEProblem(problem!, u0, tspan)
sol = solve(prob, Tsit5()) # works
sol = solve(prob, CVODE_BDF())

with

ERROR: MethodError: Cannot `convert` an object of type Vector{Float64} to an object of type ArrayPartition{Float64, Tuple{Matrix{Float64}, Matrix{Float64}}}
Closest candidates are:
...

Feel free to close if this is not going to be supported.

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