-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrustRegion correctness #142
Comments
Here's another example: NewtonRaphson residual norm: 0.0
TrustRegion residual norm: 14.356339608897732
NLsolve residual norm: 4.948952112999869 function freudenstein_roth!(out, x, p = nothing)
out[1] = x[1] - x[2]^3 + 5.0 * x[2]^2 - 2.0 * x[2] - 13.0
out[2] = x[1] + x[2]^3 + x[2]^2 - 14.0 * x[2] - 29.0
end
x = [1.0; 0.0]
nlprob = NonlinearProblem(freudenstein_roth!, x)
out = similar(x)
freudenstein_roth!(out, solve(nlprob, NewtonRaphson(), abstol=1e-15, reltol=1e-15).u, nothing)
println("NewtonRaphson residual norm: $(norm(out))")
freudenstein_roth!(out, solve(nlprob, TrustRegion(), abstol=1e-15, reltol=1e-15).u, nothing)
println("TrustRegion residual norm: $(norm(out))")
sol = nlsolve(freudenstein_roth!, x, xtol=1e-15, ftol=1e-15)
println("NLsolve residual norm: $(sol.residual_norm)") |
Hmm, I'll look into this! |
TrustRegion() does poorly on this example:
Residuals: sys(sto, sol.u, p) = [27.517280871675148, 85.87133647397435] with NewtonRaphson(), Residuals: sys(sto, sol.u, p) = [0.0, 0.0] |
I've implemented the 23 tests in https://people.sc.fsu.edu/~jburkardt/m_src/test_nonlin/test_nonlin.html
|
Handled in #210 |
We should really implement all the tests in https://people.sc.fsu.edu/~jburkardt/m_src/test_nonlin/test_nonlin.html to validate our solvers.
Here's the result of the second test problem:
The full code is:
The text was updated successfully, but these errors were encountered: