Skip to content

Commit

Permalink
fix type stability??
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 28, 2023
1 parent 55888b8 commit 8d69044
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/solve/single_shooting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function SciMLBase.__solve(prob::BVProblem, alg::Shooting; odesolve_kwargs = (;)
end
opt = solve(NonlinearProblem(NonlinearFunction{iip}(loss_fn; prob.f.jac_prototype,
resid_prototype = prob.f.bcresid_prototype), vec(u0), prob.p), alg.nlsolve;
kwargs...)
sol_prob = ODEProblem{iip}(prob.f, reshape(opt.u, u0_size), prob.tspan, prob.p)
sol = solve(sol_prob, alg.ode_alg; nlsolve_kwargs..., kwargs...)
nlsolve_kwargs..., kwargs...)
newprob = ODEProblem{iip}(prob.f, reshape(opt.u, u0_size), prob.tspan, prob.p)
sol = solve(newprob, alg.ode_alg; odesolve_kwargs..., kwargs...)
return DiffEqBase.solution_new_retcode(sol,
sol.retcode == opt.retcode ? ReturnCode.Success : ReturnCode.Failure)
end

0 comments on commit 8d69044

Please sign in to comment.