NewtonSolver:
--------------------------------------------------------------------------
Solves for the zeros of a set of n equations.
The solver is based on the Taylor series
f(x) = f(x0) + f'(x0)*(x - x0)
Both f(x0) and f'(x0) are required. If f' is not supplied, it will
compute it numerically using a first order Jacobian.
For a demo type
NewtonSolver
for the equations
0 = x(1) + x(2)^2 - 2
0 = x(1)^2 - 1
Since version 7.
--------------------------------------------------------------------------
Form:
[x, k, err] = NewtonSolver( fun, x, opt, d )
--------------------------------------------------------------------------
------
Inputs
------
fun (1,:) Function containing the equations to be solved
x (:,1) Initial guess
opt (1,1) Data structure with optional parameters
.nMax (1,1) Maximum number of iterations (Default 100)
.tol (1,1) Tolerance on weighted error (Default 1e-10)
.w (:,1) Weight on each equation (Default ones(:,1))
.funJac (1,:) Jacobian function (Default internal numerical)
-------
Outputs
-------
x (:,1) Final values
k (1,1) Number of iterations
err (:,1) Errors
--------------------------------------------------------------------------