Here we deal with numerical methods for approximation of real solutions of a system
of nonlinear equations
,
, i.e., finding the roots of a vector function
.
Compared with the one-dimensional case, root-finding in the multidimensional case is much more
complicated. For example, in one-dimensional case one can relatively easily bracket the roots of a given function
(i.e., determine the intervals, in which at least one root of the function lies) but there are no
methods for bracketing of roots of general functions in the multidimensional case! Usually we even do not know
whether a root (solution of the system) exists and whether it is unique.
The Newton-Raphson method is very popular also in the multidimensional case (here we have far less methods to choose from). As well as in the one-dimensional case, it is very efficient if one has a good initial approximation.
The formula for the multidimensional Newton-Raphson method can be derived similarly as in Section 7.2.2.
Start again with the Taylor series of centered in (vector!)
Computing the derivative : As well as
in one-dimensional case,
can be also
approximated by differences (see 7.6.3).
Termination: For usual termination criteria, see Section 7.2.1.
|
Its simplest usage is in form
z = nmnewton(fname,"",x0),as shown in
example
XEGnum02.xpl
, searching for a solution of the following system of two nonlinear equations:
![]() |
![]() |
0 | |
![]() |
![]() |
0 |
Contents of sol.x [1,] -1.7807e-15 [2,] -1 Contents of sol.fval [1,] 1.5987e-14 [2,] 2.2204e-14 Contents of sol.fderval [1,] 0 -2 [2,] 1 -3
If functions computing the derivatives of fname are not available and the precision of the
numerical approximation of the derivatives should be influenced, one can input a step h for
nmjacobian
(see Section 7.6.3):
z = nmnewton(fname,h,x0).
Having the functions for computation of the derivatives of fname available, one may input their name(s) as a parameter fder:
z = nmnewton(fname,fder,x0);fder should be either a string with a name of the function computing the Jacobian of fname or a vector of strings with names of functions that compute gradients of the first, second, ...,
This possibility is shown in example
XEGnum03.xpl
that solves the following system:
![]() |
![]() |
0 | |
![]() |
![]() |
0 |
Contents of _tmp.x [1,] 0.7854 [2,] -0.7854 Contents of _tmp.fval [1,] 0 [2,] 6.1257e-17 Contents of _tmp.fderval [1,] 1 1 [2,] -1 1
The parameters epsf, epsx and maxiter influence the termination of an iterative process of finding the solution (see Section 7.2.1): the procedure ends if sum of absolute values of fname or corrections to z are less or equal to epsf or epsx, respectively; the process is also terminated if the number of iterations exceeds maxiter.
In each iteration we multiply by
, the inverse matrix to the Jacobian of fname;
the high condition number of the Jacobian can cause a numerical instability of the iterative process.
Set the last parameter checkcond for checking the stability;
A warning message will be produced if the condition number exceeds checkcond.
Unfortunately, the Newton-Raphson method can fail if the initial approximation is not close enough to the root.
Failing of the method (i.e., convergence is not achieved after any reasonable number of iterations) means
either that has no roots or that the Newton-Raphson steps
were too long in some iterations
(as mentioned above, each step of the Newton-Raphson
method goes in the descent direction of the function
, having its minimum
, if a root exists).
The latter possible difficulty can be solved using a modification of the Newton-Raphson method
described in the Section 7.3.3
The Newton-Raphson method can be modified following way to achieve higher numerical stability:
In each iteration, compute the Newton-Raphson step
and check whether
.
If this condition is not valid, we have to reduce step size until having an acceptable
.
More or less ingenious ways of reducing step size were introduced (see, e.g., (Press, Teukolsky, Vetterling, and Flannery; 1992));
however, reducing it too much can substantially decrease the convergence rate.
The following quantlet solves a nonlinear system of equations using the modified Newton-Raphson method:
|
Its usage is the same as for the quantlet
nmnewton
, see Section 7.3.2.
An example
XEGnum04.xpl
shows a problem where using the modified Newton-Raphson method instead of the original one
is desirable. The following equation is to be solved:
![]() |
Setting an initial estimate to , the modified Newton-Raphson method gives a solution
in 5 iterations (shown as a filled circle at Fig. 7.2).
On the other hand, the original Newton-Raphson method needs 88 iterations to find
a much more distant root
.
Contents of _tmp [1,] "Newton-Raphson method:" Contents of x [1,] 0.010702 Contents of fval [1,] 4.7088e-05 Contents of _tmp [1,] "Modified Newton-Raphson method:" Contents of x [1,] 0.010002 Contents of fval [1,] -1.9808e-05