I’m trying to solve a non-linear equation using a Newton-Raphson method using NonlinearSolve.jl . I have my own implementation of a basic Newton-Raphson algorithm, and the SimpleNewtonRaphson algorithm does reproduce the same results. Now, I’d like to use the NewtonRaphson alg (with advanced features) but first I would like to reproduce my reference results. In other words, I’d like to mimic the SimpleNewtonRaphson with NewtonRaphson. So far, I’ve tried
This situation might be related to the termination_cache mechanism of NewtonRaphson. From my understanding, when the SimpleNewtonRaphson reaches the maximum number of iterations, it returns the solution obtained from the last iteration performed. When the NewtonRaphson hits the maximum number of iterations, it does not return the solution obtained from the last iteration, but the minimizer of f from all the performed iterations. For stiff problems, the two solutions (minimizer of f accross all the newton iterations vs last solution obtained from the iterations) are not equal, hence the differences.
Yes if I “skip” this termination algorithm, NewtonRaphson and SimpleNewtonRaphson return the same result.
For now I solved my problem here and the one related to the “callback” (cf my other topic) by using the step! interface. Thanks for all these features