scipy.special.

hermite#

scipy.special.hermite(n, monic=False)[原始碼]#

物理學家的 Hermite 多項式。

定義為

\[H_n(x) = (-1)^ne^{x^2}\frac{d^n}{dx^n}e^{-x^2};\]

\(H_n\) 是一個 \(n\) 次多項式。

參數:
nint

多項式的次數。

monicbool, optional

如果 True,將領先係數縮放為 1。預設為 False

回傳值:
Horthopoly1d

Hermite 多項式。

註解

多項式 \(H_n\)\((-\infty, \infty)\) 區間內,以權重函數 \(e^{-x^2}\) 正交。

範例

>>> from scipy import special
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> p_monic = special.hermite(3, monic=True)
>>> p_monic
poly1d([ 1. ,  0. , -1.5,  0. ])
>>> p_monic(1)
-0.49999999999999983
>>> x = np.linspace(-3, 3, 400)
>>> y = p_monic(x)
>>> plt.plot(x, y)
>>> plt.title("Monic Hermite polynomial of degree 3")
>>> plt.xlabel("x")
>>> plt.ylabel("H_3(x)")
>>> plt.show()
../../_images/scipy-special-hermite-1.png