Page 72 - Numerical Analysis Using MATLAB and Excel
P. 72

The Bisection Method for Root Approximation



                                  A       B       C       D       E       F        G        H
                            1  Spreadsheet for finding approximations of the real roots of polynomials
                            2  up the 7th power by Newton's Method.
                            3
                            4  Powers of x and corresponding coefficients of given polynomial p(x)
                            5  Enter coefficients of p(x) in Row 7
                            6     x 7     x 6     x 5     x 4     x 3     x 2      x     Constant
                            7         1      -6      5       -4       3      -2       1       -15
                            8
                            9  Coefficients of the derivative p'(x)
                            10 Enter coefficients of p'(x) in Row 12
                            11            x 6     x 5     x 4     x 3     x 2      x     Constant
                            12               7     -36      25      -16       9       -4        1
                            13
                            14 Approximations: x n+1  = x n  − p(x n )/p'(x n )
                            15 Initial (x 0 ) 1st (x 1 ) 2nd (x 2 )  3rd  (x 3 )  4th (x 4 )  5th  (x 5 )  6th (x 6 )  7th  (x 7 )
                            16      5.0 5.20409 5.16507 5.163194 5.163190 5.163190
                                            Figure 2.10. Spreadsheet for Example 2.6.


               4. All cells in the formula of B16, except A16, have dollar signs ($) in front of the column letter,
                  and in front of the row number. These cells are said to be absolute. The value of an absolute
                  cell does not change when it is copied from one position to another. A cell that is not absolute
                  is said to be relative cell. Thus, B16 is a relative cell, and $B$16 is an absolute cell. The con-
                  tents of a relative cell changes when it is copied from one location to another. We can easily
                  convert a relative cell to absolute or vice versa, by first placing the cursor in front, at the end,
                  or between the letters and numbers of the cell, then, we press the function key F4. In this
                  example, we made all cells, except A16, absolute so that the formula of B16 can be copied to
                  C16, D16 and so on, without changing its value. The relative cell A16, when copied to the
                  next column, changes to B16, when copied to the next column to the right, changes to C16,
                  and so on.

               We can now use this template with any other polynomial by just entering the coefficients of the
               new polynomial in row 7 and the coefficients of its derivative in Row 12; then, we observe the
               successive approximations in Row 16.



               2.3 The Bisection Method for Root Approximation

                                                                     *
               The Bisection (or interval halving) method is an algorithm  for locating the real roots of a function.


               * This is a step−by−step problem−solving procedure, especially an established, recursive computational procedure for solving
                  a problem in a finite number of steps.


               Numerical Analysis Using MATLAB® and Excel®, Third Edition                              2−19
               Copyright © Orchard Publications
   67   68   69   70   71   72   73   74   75   76   77