You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using NonlinearSolve
function mwe(out, u, p)
out[1] = u[1] - p[1]
end
p = [5.0]
prob = NonlinearProblem(mwe, [5.2], p=p)
u = solve(prob, NewtonRaphson())
prob2 = remake(prob, p=[6.0])
u2 = solve(prob2, NewtonRaphson())
Results in:
julia> u
u: 1-element Vector{Float64}:
5.0
julia> u2
u: 1-element Vector{Float64}:
5.0
But when looking at ?remake:
remake(prob::NonlinearProblem; f = missing, u0 = missing, p = missing,
problem_type = missing, kwargs = missing, _kwargs...)
Remake the given NonlinearProblem. If u0 or p are given as symbolic maps ModelingToolkit.jl has to be loaded.
I don't know if this is expected behavior (and maybe should result in an error or a warning) or should just be fixed, but I felt like it should be reported as it can result in a silent wrong answer.
The text was updated successfully, but these errors were encountered:
using NonlinearSolve
functionmwe(out, u, p)
out[1] = u[1] - p[1]
end
p = [5.0]
prob =NonlinearProblem(mwe, [5.2], p)
prob.p
prob.kwargs
u =solve(prob, NewtonRaphson())
prob2 =remake(prob, p=[6.0])
u2 =solve(prob2, NewtonRaphson())
julia> u
u:1-element Vector{Float64}:5.0
julia> u2
u:1-element Vector{Float64}:6.0
MWE:
Results in:
But when looking at
?remake
:I don't know if this is expected behavior (and maybe should result in an error or a warning) or should just be fixed, but I felt like it should be reported as it can result in a silent wrong answer.
The text was updated successfully, but these errors were encountered: