scipy.special.
assoc_laguerre#
- scipy.special.assoc_laguerre(x, n, k=0.0)[source]#
Compute the generalized (associated) Laguerre polynomial of degree \(n\) and order \(k\).
This function evaluates the generalized Laguerre polynomial
\[L^{(k)}_n(x).\]The polynomial is orthogonal over \([0, \infty)\) with weight function
\[e^{-x}x^k\]for \(k > -1\).
- Parameters:
- xfloat or ndarray
Points where to evaluate the Laguerre polynomial
- nint
Degree of the Laguerre polynomial
- kint
Order of the Laguerre polynomial
- Returns:
- assoc_laguerre: float or ndarray
Associated laguerre polynomial values
Notes
assoc_laguerreis a simple wrapper aroundeval_genlaguerre, with reversed argument order(x, n, k=0.0) --> (n, k, x).Examples
Evaluate the associated Laguerre polynomial \(L_3^{(2)}\) at \(x = 1\):
>>> import numpy as np >>> from scipy.special import assoc_laguerre, eval_genlaguerre >>> np.isclose(assoc_laguerre(1, 3, 2), 7/3) True
assoc_laguerreis equivalent toeval_genlaguerrewith reversed argument order:>>> x = np.linspace(0, 5, 6) >>> np.allclose(assoc_laguerre(x, 3, 2), eval_genlaguerre(3, 2, x)) True
Plot \(L_3^{(k)}\) for several values of \(k\):
>>> import matplotlib.pyplot as plt >>> x = np.linspace(0, 8, 400) >>> fig, ax = plt.subplots() >>> for k in range(3): ... ax.plot(x, assoc_laguerre(x, 3, k), label=rf"$k={k}$") >>> ax.set_title(r"Associated Laguerre polynomials $L_3^{(k)}$") >>> ax.set_xlabel("x") >>> ax.legend(loc="best") >>> plt.show()