scipy.special.mathieu_sem#
- scipy.special.mathieu_sem(m, q, x, out=None) = <ufunc 'mathieu_sem'>#
奇次馬 Mathieu 函數及其導數
返回 m 階和參數 q 的奇次 Mathieu 函數 se_m(x, q),在 x 處求值(以度為單位)。同時返回 se_m(x, q) 對 x 的導數。
- 參數:
- marray_like
函數的階數
- qarray_like
函數的參數
- xarray_like
函數的自變數,以度為單位,而非弧度。
- outtuple of ndarray, optional
函數結果的可選輸出陣列
- 返回:
- yscalar or ndarray
函數值
- ypscalar or ndarray
對 x 的導數值
註解
奇次 Mathieu 函數是 Mathieu 微分方程式的解
\[\frac{d^2y}{dx^2} + (b_m - 2q \cos(2x))y = 0\]其中特徵數 \(b_m\)(使用
mathieu_b
計算)產生一個週期為 180 度(對於偶數 \(m\))或 360 度(對於奇數 \(m\))的奇次週期解 \(y(x)\)。參考文獻
[1]‘Mathieu function’。維基百科。 https://en.wikipedia.org/wiki/Mathieu_function
範例
繪製 2 階和 4 階的奇次 Mathieu 函數。
>>> import numpy as np >>> from scipy import special >>> import matplotlib.pyplot as plt >>> m = np.asarray([2, 4]) >>> q = 50 >>> x = np.linspace(-180, 180, 300)[:, np.newaxis] >>> y, _ = special.mathieu_sem(m, q, x) >>> plt.plot(x, y) >>> plt.xlabel('x (degrees)') >>> plt.ylabel('y') >>> plt.legend(('m = 2', 'm = 4'))
因為 2 階和 4 階是偶數,所以每個函數的週期為 180 度。