archimedes.quadrature.clenshaw_curtis¶
- archimedes.quadrature.clenshaw_curtis(n: int) QuadratureRule¶
Clenshaw-Curtis quadrature rule with
nnodes.Nodes are the extrema of the degree-\((n-1)\) Chebyshev polynomial \(T_{n-1}(x)\) (the Chebyshev-Lobatto points), including both endpoints \(\pm 1\):
\[x_k = \cos(k \pi / (n - 1)), \quad k = 0, \ldots, n - 1.\]Unlike Gauss quadrature, these nodes are not chosen to maximize polynomial exactness – the rule is only guaranteed exact for polynomials up to degree \(n - 1\), half that of Gauss-Legendre for the same node count. The weight function is still uniform, so this rule shares the Legendre measure with
gauss_legendre,gauss_radau, andgauss_lobatto, and can be tiled withcomposite. The tradeoff for the lower degree of exactness is that Chebyshev-Lobatto nodes are nested across doublings ofnand cheap, numerically stable to compute for very largen.Weights are computed via a \(O(n \log n)\) algorithm from Waldvogel [1], which expresses them as the inverse DFT of an explicit, rational moment vector.
- Parameters:
n (int) – Number of quadrature nodes.
- Returns:
rule – Clenshaw-Curtis rule with
nnodes on \([-1, 1]\), exact to degree \(n - 1\).- Return type:
- Raises:
ValueError – If
n < 2.
References