-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with SavingCallback defaulting to Array{Float64,1} with CVODE? #275
Comments
using Sundials, DiffEqCallbacks, LinearAlgebra
prob = ODEProblem((du,u,p,t) -> du .= u, rand(4,4), (0.0,1.0))
saved_values = SavedValues(Float64, Tuple{Float64,Float64})
cb = SavingCallback((u,t,integrator)->(tr(reshape(u,4,4)),norm(reshape(u,4,4))), saved_values)
sol = solve(prob, CVODE_BDF(), callback=cb) is a workaround. We have to internally flatten for Sundials' API, and we normally reshape before |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not very good at making a MWE so I took the example from and replaced Tsit5() with CVODE_BDF(). I assumed it would still work since it's just a different solver, albeit not very efficient since it is a stiff solver.
It errors with
My code creates this error, which is almost identical apart from
in #solve_up#459 at DiffEqBase\ytJuW\src\solve.jl:114
from example abovein #solve_up#459 at DiffEqBase\ytJuW\src\solve.jl:110
in error from belowThe text was updated successfully, but these errors were encountered: