Adaptive quadrature
   HOME

TheInfoList



OR:

Adaptive quadrature is a
numerical integration In analysis, numerical integration comprises a broad family of algorithms for calculating the numerical value of a definite integral, and by extension, the term is also sometimes used to describe the numerical solution of differential equatio ...
method in which the
integral In mathematics, an integral assigns numbers to functions in a way that describes displacement, area, volume, and other concepts that arise by combining infinitesimal data. The process of finding integrals is called integration. Along with ...
of a function f(x) is approximated using static quadrature rules on adaptively refined subintervals of the region of integration. Generally, adaptive algorithms are just as efficient and effective as traditional algorithms for "well behaved" integrands, but are also effective for "badly behaved" integrands for which traditional algorithms may fail.


General scheme

Adaptive quadrature follows the general scheme 1. procedure integrate ( f, a, b, τ ) 2. Q \approx \int_a^b f(x)\,\mathrmx 3. \varepsilon \approx \left, Q - \int_a^b f(x)\,\mathrmx\ 4. if ''ε'' > ''τ'' then 5. m = (a + b) / 2 6. Q = integrate(f, a, m, τ/2) + integrate(f, m, b, τ/2) 7. endif 8. return Q An approximation Q to the integral of f(x) over the interval ,b/math> is computed (line 2), as well as an error estimate \varepsilon (line 3). If the estimated error is larger than the required tolerance \tau(line 4), the interval is subdivided (line 5) and the quadrature is applied on both halves separately (line 6). Either the initial estimate or the sum of the recursively computed halves is returned (line 7). The important components are the quadrature rule itself :Q \approx \int_a^bf(x)\,\mathrmx , the error estimator :\varepsilon \approx \left, Q - \int_a^bf(x)\,\mathrmx\ , and the logic for deciding which interval to subdivide, and when to terminate. There are several variants of this scheme. The most common will be discussed later.


Basic rules

The quadrature rules generally have the form :Q_n \quad = \quad \sum_^n w_if(x_i) \quad \approx \quad \int_a^b f(x)\,\mathrmx where the nodes x_i and weights w_i are generally precomputed. In the simplest case,
Newton–Cotes formulas In numerical analysis, the Newton–Cotes formulas, also called the Newton–Cotes quadrature rules or simply Newton–Cotes rules, are a group of formulas for numerical integration (also called ''quadrature'') based on evaluating the integrand at ...
of even degree are used, where the nodes x_i are evenly spaced in the interval: :x_i = a + \frac i. When such rules are used, the points at which f(x) has been evaluated can be re-used upon recursion: : A similar strategy is used with Clenshaw–Curtis quadrature, where the nodes are chosen as :x_i = \cos\left( \frac\pi \right). Or, when Fejér quadrature is used, :x_i = \cos\left( \frac\pi \right). Other quadrature rules, such as
Gaussian quadrature In numerical analysis, a quadrature rule is an approximation of the definite integral of a function, usually stated as a weighted sum of function values at specified points within the domain of integration. (See numerical integration for mor ...
or Gauss-Kronrod quadrature, may also be used. An algorithm may elect to use different quadrature methods on different subintervals, for example using a high-order method only where the integrand is smooth.


Error estimation

Some quadrature algorithms generate a sequence of results which should approach the correct value. Otherwise one can use a "null rule" which has the form of the above quadrature rule, but whose value would be zero for a simple integrand (for example, if the integrand were a polynomial of the appropriate degree). See: *
Richardson extrapolation In numerical analysis, Richardson extrapolation is a sequence acceleration method used to improve the rate of convergence of a sequence of estimates of some value A^\ast = \lim_ A(h). In essence, given the value of A(h) for several values of h, ...
(see also Romberg's method) * Null rules * Epsilon algorithm


Subdivision logic

"Local" adaptive quadrature makes the acceptable error for a given interval proportional to the length of that interval. This criterion can be difficult to satisfy if the integrands are badly behaved at only a few points, for example with a few step discontinuities. Alternatively, one could require only that the sum of the errors on each of the subintervals be less than the user's requirement. This would be "global" adaptive quadrature. Global adaptive quadrature can be more efficient (using fewer evaluations of the integrand) but is generally more complex to program and may require more working space to record information on the current set of intervals.


See also

*
Adaptive numerical differentiation In numerical analysis, numerical differentiation algorithms estimate the derivative of a mathematical function or function subroutine using values of the function and perhaps other knowledge about the function. Finite differences The simples ...
*
Adaptive step size In mathematics and numerical analysis, an adaptive step size is used in some methods for the numerical solution of ordinary differential equations (including the special case of numerical integration) in order to control the errors of the metho ...
in ODE * Adaptive Simpson's method for an example of adaptive quadrature *
QUADPACK QUADPACK is a FORTRAN 77 library for numerical integration of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain. The individual subprograms are also available on netlib ...
, a FORTRAN library that uses global adaptive quadrature


Notes


References

*
John R. Rice. A Metalgorithm for Adaptive Quadrature. Journal of the ACM 22(1) pp 61-82 (January 1975).
* {{Citation , last1=Press , first1=WH , last2=Teukolsky , first2=SA , last3=Vetterling , first3=WT , last4=Flannery , first4=BP , year=2007 , title=Numerical Recipes: The Art of Scientific Computing , edition=3rd , publisher=Cambridge University Press , publication-place=New York , isbn=978-0-521-88068-8 , chapter=Section 4.7. Adaptive Quadrature, chapter-url=http://apps.nrbook.com/empanel/index.html?pg=194 Numerical integration (quadrature)