Page 199 - Applied Numerical Methods Using MATLAB
P. 199

188    NONLINEAR EQUATIONS
                                                           o
                            o
           We substitute x = x (the solution) into this and use f(x ) = 0 to write

                                                       f (x k )
                           o                  o                o     2
                    0 = f(x ) ≈ f(x k ) + f (x k )(x − x k ) +  (x − x k )
                                                         2
           and
                                                  f (x k )

                                         o                o     2
                         −f(x k ) ≈ f (x k )(x − x k ) +  (x − x k )
                                                    2
           Substituting this into Eq. (4.4.2) and defining the error of the estimate x k as
                     o
           e k = x k − x ,we can get

                                                f (x k )
                                       o                 o     2
                           x k+1 ≈ x k + (x − x k ) +  (x − x k ) ,

                                                2f (x k )


                                   f (x k )      2
                                          e = A k e =|A k e k ||e k |
                          |e k+1 |≈        2     k                       (4.4.3)

                                   2f (x k )    k
           This implies that once the magnitude of initial estimation error |e 0 | is small
           enough to make |Ae 0 | < 1, the magnitudes of successive estimation errors get
           smaller very quickly so long as A k does not become large. The Newton method
           is said to be ‘quadratically convergent’ on account of the fact that the magnitude
           of the estimation error is proportional to the square of the previous estimation
           error.
              Now, it is time to practice using the MATLAB routine “newton()” for solving
           a nonlinear equation like that dealt with in Example 4.2. We have to type the
           following statements into the MATLAB command window.

            >>x0 = 1.8; TolX = 1e-5; MaxIter = 50; %with initial guess 1.8,...
            >>[x,err,xx] = newton(f42,x0,1e-5,50)  %1 st  order derivative
            >>df42 = inline(’-(sec(pi-x)).^2-1’,’x’); %1 st  order derivative
            >>[x,err,xx1] = newton(f42,df42,1.8,1e-5,50)

           Remark 4.3. Newton(–Raphson) Method

              1. While bracketing methods such as the bisection method and the false posi-
                tion method converge in all cases, the Newton method is guaranteed to
                converge only in case where the initial value x 0 is sufficiently close to the
                                                                             o
                         o

                solution x and A(x) =|f (x)/2f (x)| is sufficiently small for x ≈ x .

                Apparently, it is good for fast convergence if we have small A(x)—that is,
                the relative magnitude of the second-order derivative |f (x)| over |f (x)| is


                small. In other words, the convergence of the Newton method is endangered
                if the slope of f(x) is too flat or fluctuates too sharply.
              2. Note two drawbacks of the Newton(–Raphson) method. One is the effort
                and time required to compute the derivative f (x k ) at each iteration; the
   194   195   196   197   198   199   200   201   202   203   204