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

Gregory−Newton Backward Interpolation Method


                Solution:

                We arbitrarily choose f =  2.128000  as our starting point since f1.18(  )   lies between f1.15(  )   and
                                      0
                 (
                f1.20 )  . Then,
                                                   h =  1.20 –  1.15 =  0.05
                and
                                                                      )
                                          r =  (  x x )  –  1  h ⁄  =  (  1.18 1.20 ⁄ 0.05 =  – 0.4
                                                                –
                Now, by (7.58) we have:
                                                                        )
                                                                         (
                                                                    – (  0.4 –  0.4 +  1 )
                                (
                                     )
                                                      (
                                                                )
                                                     )
                               f1.18 =   2.128 +  – (  0.4 0.307125 +  ------------------------------------------ 0.01725(  )
                                                                          2!
                                                   )
                                               – (  0.4 – 0.4 +  1 –  0.4 +  2 )
                                                    (
                                                              (
                                                             )
                                            +  -------------------------------------------------------------------- 0.00075(  )  =  2.003032
                                                          3!
                The computations were made with the spreadsheet of Figure 7.4.
                If the increments in   values are small, we can use the Excel VLOOKUP function to perform
                                     x
                interpolation. The syntax of this function is as follows.
                VLOOKUP(lookup_value, table_array, col_index_num, range lookup)
                where:
                lookup_value is the value being searched in the first column of the lookup table
                table_array are the columns forming a rectangular range or array
                col_index_num is the column where the answer will be found
                range lookup is a logical value (TRUE or FALSE) that specifies whether we require VLOOKUP to
                find an exact or an approximate match. If TRUE is omitted, an approximate match is returned.
                In other words, if an exact match is not found, the next largest value that is less than the
                lookup_value is returned. If FALSE is specified, VLOOKUP will attempt to find an exact match,
                and if one is not found, the error value #N/A will be returned.

                A sample spreadsheet is shown in Figure 7.5 where the values of x extend from −5 to +5 volts.
                Only a partial table is shown.



















               Numerical Analysis Using MATLAB® and Excel®, Third Edition                             7−23
               Copyright © Orchard Publications
   296   297   298   299   300   301   302   303   304   305   306