scipy.special.eval_sh_chebyt#
- scipy.special.eval_sh_chebyt(n, x, out=None) = <ufunc 'eval_sh_chebyt'>#
Evaluate shifted Chebyshev polynomial of the first kind at a point.
These polynomials are defined as
\[T_n^*(x) = T_n(2x - 1)\]where \(T_n\) is a Chebyshev polynomial of the first kind. See 22.5.14 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 shifted Chebyshev polynomial
- outndarray, optional
Optional output array for the function values
- Returns:
- Tscalar or ndarray
Values of the shifted Chebyshev polynomial
See also
roots_sh_chebytroots and quadrature weights of shifted Chebyshev polynomials of the first kind
sh_chebytshifted Chebyshev polynomial object
eval_chebytevaluate Chebyshev polynomials of the first kind
numpy.polynomial.chebyshev.ChebyshevChebyshev series
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.7.E7
Examples
>>> import numpy as np >>> from scipy.special import eval_sh_chebyt >>> import matplotlib.pyplot as plt
Evaluate the order 3 polynomial at a few values of x.
>>> eval_sh_chebyt(3, [0, 0.125, 0.25, 0.375, 0.5]) array([-1. , 0.5625, 1. , 0.6875, -0. ])
Plot the polynomials of order 0 through 4.
>>> x = np.linspace(0, 1, 800) >>> fig, ax = plt.subplots(1, 1, constrained_layout=True) >>> for n in range(5): ... y = eval_sh_chebyt(n, x) ... ax.plot(x, y, label=f'{n = }') >>> ax.grid() >>> ax.set_title("Shifted Chebyshev Polynomials of the First Kind") >>> ax.set_xlabel("$x$") >>> ax.set_ylabel("$T_n^*(x)$") >>> ax.legend(loc='upper left', bbox_to_anchor=(1, 1), shadow=True) >>> plt.show()