You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using OrdinaryDiffEq, RecursiveArrayTools
functionproblem!(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.
The text was updated successfully, but these errors were encountered:
Someone could do a kind of "reinterpret to a vector" kind of thing to get it to work in Sundials. Basically have a uvec created for internal to the binary and keep that separate from the one in the f and just u .= uvec if it's not a type that is compatible with the binary. It would have a bit of overhead like that but it's possible. I don't think it's a priority though, especially with the waning use cases where Sundials is actually faster, so I'll keep it open but don't plan to do it.
This errors:
with
Feel free to close if this is not going to be supported.
The text was updated successfully, but these errors were encountered: