Skip to main content

Module quadrature

Module quadrature 

Source
Expand description

Adaptive numerical integration of vector-valued functions over a finite interval.

integrate applies the 15-point Gauss–Kronrod rule (G7K15) on each subinterval and bisects the subinterval with the largest error estimate until every component meets its tolerance. It is QUADPACK’s globally adaptive QAG strategy (R. Piessens, E. de Doncker-Kapenga, C. Überhuber and D. Kahaner, QUADPACK: A Subroutine Package for Automatic Integration, Springer, 1983, §2.2 and §3.3) without its extrapolation step, with the rule’s nodes and weights from QUADPACK’s qk15 (public domain).

On [a, b] with center c and half-width h, the Kronrod estimate and its embedded Gauss estimate are

K = h Σ_{i=0}^{14} w_i f(c + h x_i),        G = h Σ_{j=0}^{6} v_j f(c + h x_{2j+1})

K is exact for polynomials up to degree 22 and G up to degree 13. The error estimate of a subinterval is |K − G|, which overestimates the error of K for smooth integrands. The integral converges when, for every component k,

Σ_intervals |K_k − G_k| ≤ max(absolute, relative · |Σ_intervals K_k|)

Bisection copes with integrable endpoint singularities such as √x or x^(−1/2) and with kinks inside the interval, at the cost of more subintervals; callers should split the interval at kinks they know about. docs/physics/quadrature.md has the tests that pin the rule.

Structs§

Integral
A converged integral.
Tolerance
When an adaptive integral stops.

Functions§

integrate
Integrates the vector-valued f over [a, b] to tolerance.
integrate_scalar
Integrates the scalar f over [a, b] to tolerance; see integrate.