JuliaNLSolvers / NLsolve.jl

Julia solvers for systems of nonlinear equations and mixed complementarity problems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xtol evaluates to false while it clearly isn't

shakisparki opened this issue · comments

Xtol evaluates to false while trace data shows other wise

z5

3e-19 is clearly less than 1e-15.

z6

The residual norm agrees with whats on the trace table, and evaluates correctly to true

Or am I interpreting this wrong?

I realize the same thing for ftol as well. And I wonder why the 'Inf norm of residuals' appears as all zeros.

nlsolve

After taking a look at the code, I realized that the discrepancy arises from the fact that what is reported in the trace data is different from what is used to check convergence.

In the trace data, the Inf-norm is recorded using maximum(abs, value(df)) which gives the same value as vecnorm(value(df), Inf) . This is also how the residual_norm field is calculated. However in checking for convergence norm(value(df), Inf) < ftol is used. Apparently vecnorm and norm give two different values depending on the dimensions of array e.g.

z1

Similar applies for the Step 2-norm. It is recorded in the trace data using the sqeuclidean distance metric, while convergence uses chebyshev.

Is this how it's meant to be or is this an error? I can't understand why what's displayed in the log/trace should be different from what is actually happening