Page 72 - Standard Handbook Of Petroleum & Natural Gas Engineering
P. 72

Numerical  Methods   61

                    The second  forward  difference  of  f(x) at  xi  is
                      A*fi  = fi+' - 2fi+, + f,

                    and  the  second  derivative  of  f(x) is  then  given by
                      f"(x) = (A2fi)/h2 + O(h)

                    The  second backward  difference  of  f  at  xI is

                      V'f,  =  f, - 2f 3-1  +  f,-2
                    and  f"(x) may  also be  defined  as
                      f"(x) = (V2f,)/h2 +  O(h)

                    Approximate  expressions  for  derivatives  of  any  order  are  given  in  terms  of
                    forward  and backward  difference  expressions  as

                      fb) = (A"f,)/h" + O(h) = (V"f,)/h"  + O(h)

                      Coefficients  of  forward  difference  expressions  for  derivatives  of  up  to  the
                    fourth  order are  given  in  Figure  1-52 and  of  backward  difference  expressions
                    in  Figure  1-53.
                      More accurate difference  expressions may  be found by  expanding the Taylor
                    series.  For  example,  f'(x) to  V(h) is  given by  forward  difference by

                      f'(x) = (-fi+,  + 4fi+, - 3fi)/(2h)  + O(h2)
                    and  a  similar  backward  difference  representation  can  also  be  easily  obtained.
                    These  expressions  are  exact  for  a  parabola.  Forward  and  backward  difference
                    expressions  of  O(h2) are contained  in  Figures  1-54 and  1-55.
                      A central difference  expression  may  be derived by  combining the equations for
                    forward  and  backward  differences.
















                           __    ~~~

                                Figure 1-52.  Forward difference coefficients of  o(h).
   67   68   69   70   71   72   73   74   75   76   77