NonlinearSolve.jl - sol.stats returns nothing

I’m struggling to locate the solver stats in NonlinearSolve.jl. After running the basic example from the docs,

using NonlinearSolve

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

I’m finding that sol.stats is empty. Is there a keyword I need to set?

What version of NonlinearSolve and SciMLBase?

SciMLBase v1.97.0
NonlinearSolve v1.6.0

It was added in NonlinearSolve.jl v3.

1 Like

I see, thank you.

it’s also probably worth noting that prior to version 3, Nonlinear solve had a number of bugs that made it fail to converge or converge much slower than it should. As such, I strongly recommend upgrading.

1 Like