I am using NonlinearSolve but have some stupid problem.
I can run the following example script:
using NonlinearSolve, StaticArrays
f(u, p) = u .* u .- p
u0 = @SVector[1.0, 1.0]
p = 2.0
probN = NonlinearProblem(f, u0, p)
sol = solve(probN, NewtonRaphson(), reltol = 1e-9)
However, when I want to use other methods, for example the trust-region method or the Broyden method, I simply change the last line to
sol = solve(probN, TrustRegion(), reltol = 1e-9)
or
sol = solve(probN, Broyden(), reltol = 1e-9)
But the REPL simply tells me that neither Trustregion nor Broyden is defined.
Why is that and How can I use these methods?
Also, the example code only works if u0
is static. What can I do if I want to use normal (non-static) array?