Newton's method applied to multivariate nonlinear functions.

newtonsys(Ffun, x0, Jfun = NULL, ...,
        maxiter = 100, tol = .Machine$double.eps^(1/2))

Arguments

Ffun

m functions of n variables.

Jfun

Function returning a square n-by-n matrix (of partial derivatives) or NULL, the default.

x0

Numeric vector of length n.

maxiter

Maximum number of iterations.

tol

Tolerance, relative accuracy.

...

Additional parameters to be passed to f.

Details

Solves the system of equations applying Newton's method with the univariate derivative replaced by the Jacobian.

Value

List with components: zero the root found so far, fnorm the square root of sum of squares of the values of f, and iter the number of iterations needed.

References

Quarteroni, A., R. Sacco, and F. Saleri (2007). Numerical Mathematics. Second Edition, Springer-Verlag, Berlin Heidelberg.

Note

TODO: better error checking, e.g. when the Jacobian is not invertible.

Examples