bundles / scipy 1.17.1 / scipy / special / _orthogonal / chebyt
function
scipy.special._orthogonal:chebyt
Signature
def chebyt ( n , monic = False ) Summary
Chebyshev polynomial of the first kind.
Extended Summary
Defined to be the solution of
is a polynomial of degree .
Parameters
n: intDegree of the polynomial.
monic: bool, optionalIf
True, scale the leading coefficient to be 1. Default isFalse.
Returns
T: orthopoly1dChebyshev polynomial of the first kind.
Notes
The polynomials are orthogonal over with weight function .
Examples
Chebyshev polynomials of the first kind of order :math:`n` can be obtained as the determinant of specific :math:`n \times n` matrices. As an example we can check how the points obtained from the determinant of the following :math:`3 \times 3` matrix lay exactly on :math:`T_3`:import numpy as np import matplotlib.pyplot as plt from scipy.linalg import det from scipy.special import chebyt x = np.arange(-1.0, 1.0, 0.01) fig, ax = plt.subplots()✓
ax.set_ylim(-2.0, 2.0) ax.set_title(r'Chebyshev polynomial $T_3$') ax.plot(x, chebyt(3)(x), label=rf'$T_3$') for p in np.arange(-1.0, 1.0, 0.1): ax.plot(p, det(np.array([[p, 1, 0], [1, 2*p, 1], [0, 1, 2*p]])), 'rx') plt.legend(loc='best')✗
plt.show()
✓
from scipy.special import binom from scipy.special import jacobi x = np.arange(-1.0, 1.0, 0.01) np.allclose(jacobi(3, -0.5, -0.5)(x), 1/64 * binom(6, 3) * chebyt(3)(x))✓
x = np.arange(-1.5, 1.5, 0.01) fig, ax = plt.subplots()✓
ax.set_ylim(-4.0, 4.0) ax.set_title(r'Chebyshev polynomials $T_n$') for n in np.arange(2,5): ax.plot(x, chebyt(n)(x), label=rf'$T_n={n}$') plt.legend(loc='best')✗
plt.show()
✓
See also
- chebyu
Chebyshev polynomial of the second kind.
Aliases
-
scipy.special.chebyt