Page 83 - Numerical methods for chemical engineering
P. 83

The secant method                                                     69



                  so that the errors at successive iterations are related by

                                                            [k]
                                                         f x
                                             ε k+1 = ε k +                           (2.32)
                                                        f  (1)  x [k]
                                                                   [k]
                  If we divide the Taylor series approximation (2.30) by f  (1)  (x ),
                                                [k]           (2)    [k]
                                            f x              f  x
                                       0 ≈          + ε k + ε 2 k                    (2.33)
                                            f  (1)  x  [k]  2 f  (1)  x  [k]
                  and use (2.32), we obtain


                                                       f  (2)    x [k]
                                             ε k+1 =−ε 2                             (2.34)
                                                     k   (1)    [k]
                                                      2 f  x
                  This means that if we are very close to the solution, Newton’s method converges quadrat-
                  ically. For example, assume that we are sufficiently close to a solution for this quadratic
                                                  −1
                  convergence to hold and that |ε k |= 10 . Then, the sequence of errors in the next few
                  iterations is approximately

                        |ε k+1 | = 10 −2  |ε k+2 | = 10 −4  |ε k+3 | = 10 −8  |ε k+4 | = 10 −16  (2.35)

                  Once Newton’s method is close enough to the real solution for the second-order Taylor series
                  approximation to be accurate, the sequence of estimates converges very rapidly (quadrati-
                  cally) to the solution.



                  The secant method


                  Each iteration of Newton’s method requires not only an evaluation of the function, but
                  also an evaluation of the first derivative. In some cases, the algebraic function may be of
                  such complexity that it is inconvenient to derive the analytical form of the derivative. One
                  alternative would be to use a finite difference approximation,


                                              [k]         [k]
                                            f x  + ε − f x
                                   df                               √
                                         ≈                       ε ≈  eps            (2.36)
                                   dx              ε
                                      x [k]
                  where eps is the machine precision. This approach, however, requires two function evalua-
                  tions per iteration, so that in practice it is more common to use the secant method, in which
                  the value of the derivative is approximated by the two most recent function evaluations,

                                                     [k]      [k−1]
                                                  f x   − f x
                                          df
                                                ≈                                    (2.37)
                                          dx         x  [k]  − x  [k−1]
                                             x  [k]
   78   79   80   81   82   83   84   85   86   87   88