diff --git a/src/solve.jl b/src/solve.jl index 9da11cd..9fd5470 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -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) diff --git a/test/core.jl b/test/core.jl index 92470d1..18b5034 100644 --- a/test/core.jl +++ b/test/core.jl @@ -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