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

Numerical  Methods   79

                   under  a complicated curve may be approximated by  the trapezoidal  rule. The area
                   is  subdivided  into n  panels  and





                   where Axn = (b - a)/n  and f, is the value of the function  at each xi. If  the number
                   of  panels  n  = 2',  an  alternate  form  of  the  trapezoidal  can  be  given, where

                             1         "-1
                     I=T, =-Tk_,+Axkxf(a+iAxk)
                             2         ,=I
                                       I add
                   where  Ax, =  (b  - a)/2',  To =  1/2(fa +  fJ(b  - a), and  the  equation  for  T,  is
                   repeatedly applied for k  = 1,2, . . . until  sufficient  accuracy has been  obtained.
                     If  the function  f(x) is approximated by  parabolas, Simpson's  Rule  is obtained,
                   by  which  (the number  of  panels  n  being  even)
                                 I     "-1    n-2     1
                                 r
                     I=S,  =-Ax  f,+4xf,+2xfL+f,
                             3        ;:id    I eYe"
                                              i=2

                   where E is the dominant error term involving the fourth  derivative off, so that
                   it  is  impractical  to  attempt  to  provide  error correction  by  approximating  this
                   term.  Instead  Simpson's  rule  with  end  correction  (sixth order  rather than  fourth
                   order) may  be  applied  where



                                                              +Ax[f'(a)-f'(b)]



                     The original Simpson's formula without end correction may be generalized in a
                   similar way  as the trapezoidal formula for n = 2'  panels, using A3 = (b - a)/2,  and
                   increasing k  until  sufficient accuracy  is achieved, where
                                                                  1

                                                   n-2
                                    i=l            i=2
                                    i odd         i even
                     For the next higher level of integration  algorithm, f(x) over segments of  [a,b]
                   can  be  approximated  by  a  cubic  and  if  this  kth order result  is  C,,  then  Cote's
                   rule  can be  given as

                       =  'k     k + (  -
                            '
   85   86   87   88   89   90   91   92   93   94   95