scipy.special.eval_chebyc#
- scipy.special.eval_chebyc(n, x, out=None) = <ufunc 'eval_chebyc'>#
Evaluate Chebyshev polynomial of the first kind on [-2, 2] at a point.
These polynomials are defined as
\[C_n(x) = 2 T_n(x/2)\]where \(T_n\) is a Chebyshev polynomial of the first kind. See 22.5.11 in [AS] (or equivalently [DLMF]) for details.
- Parameters:
- narray_like
Degree of the polynomial. If not an integer, the result is determined via the relation to
eval_chebyt.- xarray_like
Points at which to evaluate the Chebyshev polynomial
- outndarray, optional
Optional output array for the function values
- Returns:
- Cscalar or ndarray
Values of the Chebyshev polynomial
See also
roots_chebycroots and quadrature weights of Chebyshev polynomials of the first kind on [-2, 2]
chebycChebyshev polynomial object
numpy.polynomial.chebyshev.ChebyshevChebyshev series
eval_chebytevaluate Chebycshev polynomials of the first kind
References
[AS]Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972.
[DLMF]NIST Digital Library of Mathematical Functions, https://dlmf.nist.gov/18.1.E3
Examples
>>> import numpy as np >>> from scipy.special import eval_chebyc, eval_chebyt >>> import matplotlib.pyplot as plt
Evaluate the order 3 polynomial at a few values of x.
>>> eval_chebyc(3, [0, 0.25, 0.5]) array([-0. , -0.734375, -1.375 ])
Plot the polynomials of order 0 through 4.
>>> x = np.linspace(-2, 2, 800) >>> fig, ax = plt.subplots(1, 1, constrained_layout=True) >>> for n in range(5): ... y = eval_chebyc(n, x) ... ax.plot(x, y, label=f'{n = }') >>> ax.grid() >>> ax.set_title("Chebyshev Polynomials of the First Kind on [-2, 2]") >>> ax.set_xlabel("$x$") >>> ax.set_ylabel("$C_n(x)$") >>> ax.legend(loc='upper left', bbox_to_anchor=(1, 1), shadow=True) >>> plt.show()
They are a scaled version of the Chebyshev polynomials of the first kind.
>>> x = np.linspace(-2, 2, 6) >>> eval_chebyc(3, x) array([-2. , 1.872, 1.136, -1.136, -1.872, 2. ]) >>> 2 * eval_chebyt(3, x / 2) array([-2. , 1.872, 1.136, -1.136, -1.872, 2. ])