bundles / scipy 1.18.0 / scipy / special / _orthogonal / laguerre
function
scipy.special._orthogonal:laguerre
Signature
def laguerre(n, monic = False)Summary
Laguerre polynomial.
Extended Summary
Defined to be the solution of
is a polynomial of degree .
Parameters
n: intDegree of the polynomial.
monic: bool, optionalIf True, scale the leading coefficient to be 1. Default is False.
Returns
L: orthopoly1dLaguerre Polynomial.
Notes
The polynomials are orthogonal over with weight function .
Examples
The Laguerre polynomials :math:`L_n` are the special case :math:`\alpha = 0` of the generalized Laguerre polynomials :math:`L_n^{(\alpha)}`. Let's verify it on the interval :math:`[-1, 1]`:import numpy as np from scipy.special import genlaguerre from scipy.special import laguerre x = np.arange(-1.0, 1.0, 0.01) np.allclose(genlaguerre(3, 0)(x), laguerre(3)(x))✓
TrueThe polynomials :math:`L_n` also satisfy the recurrence relation: .. math:: (n + 1)L_{n+1}(x) = (2n +1 -x)L_n(x) - nL_{n-1}(x) This can be easily checked on :math:`[0, 1]` for :math:`n = 3`:
x = np.arange(0.0, 1.0, 0.01) np.allclose(4 * laguerre(4)(x), (7 - x) * laguerre(3)(x) - 3 * laguerre(2)(x))✓
TrueThis is the plot of the first few Laguerre polynomials :math:`L_n`:
import matplotlib.pyplot as plt x = np.arange(-1.0, 5.0, 0.01) fig, ax = plt.subplots()✓
ax.set_ylim(-5.0, 5.0) ax.set_title(r'Laguerre polynomials $L_n$') for n in np.arange(0, 5): ax.plot(x, laguerre(n)(x), label=rf'$L_{n}$') plt.legend(loc='best')✗
<matplotlib.legend.Legend object at 0x7fa8f40a92b0>
plt.show()
✓
See also
- genlaguerre
Generalized (associated) Laguerre polynomial.
Aliases
scipy.special.laguerre