numpy.polynomial.chebyshev.chebgauss#

polynomial.chebyshev.chebgauss(deg)[source]#

Gauss-Chebyshev quadrature.

Computes the sample points and weights for Gauss-Chebyshev quadrature. These sample points and weights will correctly integrate polynomials of degree \(2*deg - 1\) or less over the interval \([-1, 1]\) with the weight function \(f(x) = 1/\sqrt{1 - x^2}\).

Parameters:
degint

Number of sample points and weights. It must be >= 1.

Returns:
xndarray

1-D ndarray containing the sample points.

yndarray

1-D ndarray containing the weights.

Notes

The results have only been tested up to degree 100, higher degrees may be problematic. For Gauss-Chebyshev there are closed form solutions for the sample points and weights. If n = deg, then

\[x_i = \cos(\pi (2 i - 1) / (2 n))\]
\[w_i = \pi / n\]