Skip to content

Commit

Permalink
Merge pull request #727 from AayushSabharwal/as/interval-nonlinear-pr…
Browse files Browse the repository at this point in the history
…oblem

fix: fix remake for `IntervalNonlinearProblem`
  • Loading branch information
ChrisRackauckas authored Jul 1, 2024
2 parents e313903 + bfbb09e commit 27dcb4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/remake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ function remake(prob::AbstractSciMLProblem; u0 = missing,
_remake_internal(prob; kwargs..., u0, p)
end

function remake(prob::AbstractIntervalNonlinearProblem; p = missing, interpret_symbolicmap = true, use_defaults = false, kwargs...)
_, p = updated_u0_p(prob, [], p; interpret_symbolicmap, use_defaults)
_remake_internal(prob; kwargs..., p)
end

function remake(prob::AbstractNoiseProblem; kwargs...)
_remake_internal(prob; kwargs...)
end
Expand Down
8 changes: 8 additions & 0 deletions test/remake_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,11 @@ u0 = [1.0; 2.0; 3.0]
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz!, u0, tspan, nothing)
@test_nowarn remake(prob, p = (), interpret_symbolicmap = true)

# IntervalNonlinearProblem doesn't have a u0
# Issue#726
interval_f(u, p) = u * u - 2.0 + p[1]
uspan = (1.0, 2.0)
interval_prob = IntervalNonlinearProblem(interval_f, uspan)
new_prob = @inferred IntervalNonlinearProblem remake(interval_prob; p = [0])
@test new_prob.p == [0]

0 comments on commit 27dcb4c

Please sign in to comment.