scipy.special.besselpoly#
- scipy.special.besselpoly(a, lmb, nu, out=None) = <ufunc 'besselpoly'>#
第一類 Bessel 函數的加權積分。
計算
\[\int_0^1 x^\lambda J_\nu(2 a x) \, dx\]其中 \(J_\nu\) 是 Bessel 函數,且 \(\lambda=lmb\)、\(\nu=nu\)。
- 參數:
- aarray_like
Bessel 函數內部的比例因子。
- lmbarray_like
x 的次方
- nuarray_like
Bessel 函數的階數。
- outndarray,選用
函數結果的選用輸出陣列。
- 回傳值:
- 純量或 ndarray
積分值。
參考文獻
[1]Cephes 數學函數庫,http://www.netlib.org/cephes/
範例
評估單一參數集的函數。
>>> from scipy.special import besselpoly >>> besselpoly(1, 1, 1) 0.24449718372863877
評估不同比例因子的函數。
>>> import numpy as np >>> factors = np.array([0., 3., 6.]) >>> besselpoly(factors, 1, 1) array([ 0. , -0.00549029, 0.00140174])
繪製不同次方、階數和比例的函數圖。
>>> import matplotlib.pyplot as plt >>> fig, ax = plt.subplots() >>> powers = np.linspace(0, 10, 100) >>> orders = [1, 2, 3] >>> scales = [1, 2] >>> all_combinations = [(order, scale) for order in orders ... for scale in scales] >>> for order, scale in all_combinations: ... ax.plot(powers, besselpoly(scale, powers, order), ... label=rf"$\nu={order}, a={scale}$") >>> ax.legend() >>> ax.set_xlabel(r"$\lambda$") >>> ax.set_ylabel(r"$\int_0^1 x^{\lambda} J_{\nu}(2ax)\,dx$") >>> plt.show()