Skip to content
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

specialize ODEProblem #84

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::Dyna
(callback = CallbackSet(callback, odesolve_kwargs[:callback]))

# Construct and solve the ODEProblem
odeprob = ODEProblem{isinplace(prob)}(f, prob.u0, tspan, prob.p)
odeprob = ODEProblem{isinplace(prob), true}(f, prob.u0, tspan, prob.p)
odesol = solve(odeprob, alg.alg, args...; abstol, reltol, kwargs...,
odesolve_kwargs..., callback, save_end = true)

Expand Down
7 changes: 6 additions & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ end
sol = solve(prob, DynamicSS(CVODE_BDF()), dt = 1.0)
@test SciMLBase.successful_retcode(sol.retcode)

# test autodiff
sol = solve(prob, DynamicSS(Rodas5P()))

@test SciMLBase.successful_retcode(sol.retcode)

# scalar save_idxs
scalar_sol = solve(prob, DynamicSS(CVODE_BDF()), dt = 1.0, save_idxs = 1)
@test scalar_sol[1] ≈ sol[1]
@test scalar_sol[1] ≈ sol[1] atol=1e-6

f(du, sol.u, p, 0)
@test du≈[0, 0] atol=1e-6
Expand Down
Loading