scipy.special.eval_sh_jacobi#
- scipy.special.eval_sh_jacobi(n, p, q, x, out=None) = <ufunc 'eval_sh_jacobi'>#
Evaluate shifted Jacobi polynomial at a point.
Defined by
\[G_n^{(p, q)}(x) = \frac{\Gamma(n+1)\Gamma(n+p)}{\Gamma(2n+p)} P_n^{(p - q, q - 1)}(2x - 1),\]where \(P_n^{(\cdot, \cdot)}\) is the n-th Jacobi polynomial. See 22.5.2 in [AS] (or equivalently [DLMF]) for details. Note that here, in contrast to
eval_sh_legendre,eval_sh_chebyt, andeval_sh_chebyu, more than just the argument is shifted.- Parameters:
- nfloat
Degree of the polynomial. If not an integer, the result is determined via the relation to
binomandeval_jacobi.- pfloat
Parameter, must satisfy \(p - q > -1\).
- qfloat
Parameter, must be greater than 0.
- xarray_like
Points at which to evaluate the polynomial.
- outndarray, optional
Optional output array for the function values
- Returns:
- Gscalar or ndarray
Values of the shifted Jacobi polynomial.
See also
roots_sh_jacobiroots and quadrature weights of shifted Jacobi polynomials
sh_jacobishifted Jacobi polynomial object
eval_jacobievaluate Jacobi polynomials
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.E2
Examples
>>> import numpy as np >>> from scipy.special import eval_sh_jacobi >>> import matplotlib.pyplot as plt
These are the parameter values that we’ll use in this example.
>>> p = 0.5 >>> q = 0.125
Evaluate the order 3 polynomial at a few values of x.
>>> eval_sh_jacobi(3, p, q, [0, 0.25, 0.5]) array([-0.00344968, 0.01217532, -0.02333604])
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_jacobi(n, p, q, x) ... ax.plot(x, y, label=f'{n = }') >>> ax.grid() >>> ax.set_title("Shifted Jacobi Polynomials") >>> ax.set_xlabel("$x$") >>> ax.set_ylabel("$G_n^{(p, q)}(x)$") >>> ax.legend(loc='upper left', bbox_to_anchor=(1, 1), shadow=True) >>> plt.show()