Adaptive quadrature
Adaptive quadrature is a numerical integration method in which the integral of a function 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 scheme1. procedure integrate
2.
3.
4. if ε > τ then
5. m = / 2
6. Q = integrate + integrate
7. endif
8. return Q
An approximation to the integral of over the interval is computed, as well as an error estimate . If the estimated error is larger than the required tolerance, the interval is subdivided and the quadrature is applied on both halves separately. Either the initial estimate or the sum of the recursively computed halves is returned.
The important components are the quadrature rule itself
the error estimator
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 formwhere the nodes and weights are generally precomputed.
In the simplest case, Newton–Cotes formulas of even degree are used, where the nodes are evenly spaced in the interval:
When such rules are used, the points at which has been evaluated can be re-used upon recursion:
A similar strategy is used with Clenshaw–Curtis quadrature, where the nodes are chosen as
Or, when Fejér quadrature is used,
Other quadrature rules, such as Gaussian quadrature 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.See:
- Richardson extrapolation
- Null rules
- Epsilon algorithm