scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
jacobi(n, alpha, beta, monic=False)

Defined to be the solution of

$$(1 - x^2)\frac{d^2}{dx^2}P_n^{(\alpha, \beta)} + (\beta - \alpha - (\alpha + \beta + 2)x) \frac{d}{dx}P_n^{(\alpha, \beta)} + n(n + \alpha + \beta + 1)P_n^{(\alpha, \beta)} = 0$$

for $\alpha, \beta > -1$ ; $P_n^{(\alpha, \beta)}$ is a polynomial of degree $n$ .

Notes

For fixed $\alpha, \beta$ , the polynomials $P_n^{(\alpha, \beta)}$ are orthogonal over $[-1, 1]$ with weight function $(1 - x)^\alpha(1 + x)^\beta$ .

Parameters

n : int

Degree of the polynomial.

alpha : float

Parameter, must be greater than -1.

beta : float

Parameter, must be greater than -1.

monic : bool, optional

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

Returns

P : orthopoly1d

Jacobi polynomial.

Jacobi polynomial.

Examples

The Jacobi polynomials satisfy the recurrence relation:

$$P_n^{(\alpha, \beta-1)}(x) - P_n^{(\alpha-1, \beta)}(x) = P_{n-1}^{(\alpha, \beta)}(x)$$

This can be verified, for example, for $\alpha = \beta = 2$ and $n = 1$ over the interval $[-1, 1]$ :

>>> import numpy as np
... from scipy.special import jacobi
... x = np.arange(-1.0, 1.0, 0.01)
... np.allclose(jacobi(0, 2, 2)(x),
...  jacobi(1, 2, 1)(x) - jacobi(1, 1, 2)(x)) True

Plot of the Jacobi polynomial $P_5^{(\alpha, -0.5)}$ for different values of $\alpha$ :

>>> import matplotlib.pyplot as plt
... import numpy as np
... from scipy.special import jacobi
... x = np.arange(-1.0, 1.0, 0.01)
... fig, ax = plt.subplots()
... ax.set_ylim(-2.0, 2.0)
... ax.set_title(r'Jacobi polynomials $P_5^{(\alpha, -0.5)}$')
... for alpha in np.arange(0, 4, 1):
...  ax.plot(x, jacobi(5, alpha, -0.5)(x), label=rf'$\alpha={alpha}$')
... plt.legend(loc='best')
... plt.show()
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.special._orthogonal.jacobi scipy.special._orthogonal.chebyt

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/special/_orthogonal.py#284
type: <class 'function'>
Commit: