IMSL C# Numerical Library

Quadrature Class

Quadrature is a general-purpose integrator that uses a globally adaptive scheme in order to reduce the absolute error.

For a list of all members of this type, see Quadrature Members.

System.Object
   Imsl.Math.Quadrature

public class Quadrature

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Quadrature subdivides the interval [A, B] and uses a (2k+1)-point Gauss-Kronrod rule to estimate the integral over each subinterval. The error for each subinterval is estimated by comparison with the k-point Gauss quadrature rule. The subinterval with the largest estimated error is then bisected and the same procedure is applied to both halves. The bisection process is continued until either the error criterion is satisfied, roundoff error is detected, the subintervals become too small, or the maximum number of subintervals allowed is reached. The Class Quadrature is based on the subroutine QAG by Piessens et al. (1983).

If the function to be integrated has endpoint singularities then extrapolation should be enabled. As described above, the integral's value is approximated by applying a quadrature rule to a series of subdivisions of the interval. The sequence of approximate values converges to the integral's value. The \epsilon-algorithm can be used to extrapolate from the initial terms of the sequence to its limit. Without extrapolation, the quadrature approximation sequence converges slowly if the function being integrated has endpoint singularities. The \epsilon-algorithm accelerates convergence of the sequence in this case. The class EpsilonAlgorithm implements the \epsilon-algorithm. With extrapolation, this class is similar to the subroutine QAGS by Piessens et al. (1983).

The desired absolute error, \epsilon, can be set using AbsoluteError property. The desired relative error, \rho, can be set using RelativeError property. The method Eval computes the approximate integral value R \approx \int_a^b f(x) dx. It also computes an error estimate E, which can be retrieved using ErrorEstimate property. These are related by the following equation:

\left| \int_a^b f(x) dx -R \right| \le E \le \max\left\{\epsilon,\rho \left| \int_a^b f(x) dx \right|  \right\}

Requirements

Namespace: Imsl.Math

Assembly: ImslCS (in ImslCS.dll)

See Also

Quadrature Members | Imsl.Math Namespace | Example 1: Integral of exp(2x) | Example 2: Integral of exp(-x) from 0 to infinity | Example 3: Integral from -infinity to +infinity | Example 4: Integral of an oscillatory function