This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / special / _orthogonal / sh_jacobi

function

scipy.special._orthogonal:sh_jacobi

source: build-install/usr/lib/python3.14/site-packages/scipy/special/_orthogonal.py:582

Signature

def sh_jacobi(n, p, q, monic = False)

Summary

Shifted Jacobi polynomial.

Extended Summary

Defined by

where is the n-th Jacobi polynomial. Note that here, in contrast to sh_legendre, sh_chebyt, and sh_chebyu, more than just the argument is shifted. See 22.2.2 in [AS] for details.

Parameters

n : int

Degree of the polynomial.

p : float

Parameter, must satisfy .

q : float

Parameter, must be greater than 0.

monic : bool, optional

If True, scale the leading coefficient to be 1. Default is False.

Returns

G : orthopoly1d

Shifted Jacobi polynomial.

Notes

For fixed , the polynomials are orthogonal over with weight function .

Examples

Evaluate the shifted Jacobi polynomial :math:`G_3^{(2, 1)}` at :math:`x = 0.5`:
import numpy as np
from scipy.special import binom, jacobi, sh_jacobi
✓
np.isclose(sh_jacobi(3, 2, 1)(0.5), -3/280)
✗
np.True_
The polynomial is related to the Jacobi polynomial :math:`P_n^{(p - q, q - 1)}`:
x = np.linspace(0, 1, 5)
n, p, q = 3, 2, 1
scale = 1 / binom(2*n + p - 1, n)
np.allclose(sh_jacobi(n, p, q)(x),
            scale * jacobi(n, p - q, q - 1)(2*x - 1))
✓
True
Plot :math:`G_3^{(p, 1)}` for several values of :math:`p`:
import matplotlib.pyplot as plt
x = np.linspace(0, 1, 400)
fig, ax = plt.subplots()
✓
for p in [1, 2, 3]:
    ax.plot(x, sh_jacobi(3, p, 1)(x), label=rf"$p={p}$")
ax.set_title(r"Shifted Jacobi polynomials $G_3^{(p, 1)}$")
ax.set_xlabel("x")
ax.legend(loc="best")
✗
<matplotlib.legend.Legend object at 0x7f3f58bb9550>
plt.show()
✓
fig-0bb13d43fc29fb21.png

Aliases

  • scipy.special.sh_jacobi