SciML / NonlinearSolve.jl

High-performance and differentiation-enabled nonlinear solvers (Newton methods), bracketed rootfinding (bisection, Falsi), with sparsity and Newton-Krylov support.
https://docs.sciml.ai/NonlinearSolve/stable/
MIT License
216 stars 39 forks source link

Unnecessary warning #448

Closed MichelJuillard closed 3 weeks ago

MichelJuillard commented 3 weeks ago

When solving a nonlinear system of equations with NewtonRaphson, LinesearchJL and AutoFiniteDiff, one gets a warning. See

using NonlinearSolve

f(u, p) = u .* u .- p
u0 = [1.0, 1.0]
p = 2.0
prob = NonlinearProblem(f, u0, p)
sol = solve(prob,NewtonRaphson(autodiff=AutoFiniteDiff(), linesearch = LineSearchesJL()))

triggers the following message:

AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}(Val{:forward}(), Val{:forward}(), Val{:hcentral}())
::AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}} is not a `ReverseMode`. Use with caution.

retcode: Success
u: 2-element Vector{Float64}:
 1.4142135623730951
 1.4142135623730951