Page 160 - Excel for Scientists and Engineers: Numerical Methods
P. 160

CHAPTER 7                    INTEGRATION                             137





















                      Figure 7-11.  Some results returned by the Integrates custom function.
                     (folder 'Chapter 07 Examples', workbook 'Integration', sheet Simpson Integration Fn')

                   Because some functions may require a large number of iterations, there may
               be a noticeable delay in calculation.

                Gaussian Quadrature
                   The  preceding  methods  for  numerical  integration  employ  evenly  spaced
               values  of  x at  which  the  function  is  evaluated.  Other  formulas  have  been
                developed  whereby  the  function  is  evaluated  at  specially  selected  values  of x.
                These Gaussian quadrature formulas are significantly more efficient, in terms of
                the accuracy of the evaluation.
                   Gaussian quadrature formulas involve the evaluation of the function at a set
                of x, values  (nodes), with the use  of a corresponding set  of weights w,, in  the
                following formula
                                            1         N
                                                      1.
                                       A = IF(x)dx = c WiF(Xi)                     (7-9)
                                           -1         i=l
                   The nodes  and  weights  can  be  derived  from  certain  kinds  of  polynomials.
                The Legendre polynomials will be used here to determine the values of xi and wi.
                The Legendre polynomials are a set of polynomials  of degree N.  Increasing N
                provides  an  increase  in  accuracy  of  evaluation  but  requires  a  concomitant
                increase in  computation time.  Values of Legendre polynomials  for N up to  100
                have been published.
                   The  integration  need  not  be  limited  solely  to  the  interval  -1  to  1.  By
                employing a change of variable
                                                2~ - (a + b)
                                            Z=                                    (7-10)
                                                  (b - a)
                the integral expression is
   155   156   157   158   159   160   161   162   163   164   165