scipy.special.expn

scipy.special.expn(n, x, out=None) = <ufunc 'expn'>

广义指数积分En。

对于整数 \(n \geq 0\) 而且是真实的 \(x \geq 0\) 广义指数积分定义为 [dlmf]

\[e_n(X)=x^{n-1}\int_x^\infty\frac{e^{-t}}{t^n}dt。\]
参数
n: array_like

非负整数

x: array_like

实实在在的论据

输出:ndarray,可选

函数结果的可选输出数组

退货
标量或ndarray

广义指数积分的取值问题

参见

exp1

的特殊情况 \(E_n\)\(n = 1\)

expi

与相关的 \(E_n\) 什么时候 \(n = 1\)

参考文献

dlmf

数学函数数字类库,8.19.2 https://dlmf.nist.gov/8.19#E2

示例

>>> import scipy.special as sc

它的定义域是非负的n和x。

>>> sc.expn(-1, 1.0), sc.expn(1, -1.0)
(nan, nan)

它有一根杆子在 x = 0n = 1, 2 ;对于较大的 n 它等于 1 / (n - 1)

>>> sc.expn([0, 1, 2, 3, 4], 0)
array([       inf,        inf, 1.        , 0.5       , 0.33333333])

对于n等于0,它减少到 exp(-x) / x

>>> x = np.array([1, 2, 3, 4])
>>> sc.expn(0, x)
array([0.36787944, 0.06766764, 0.01659569, 0.00457891])
>>> np.exp(-x) / x
array([0.36787944, 0.06766764, 0.01659569, 0.00457891])

对于n等于1,它减少到 exp1

>>> sc.expn(1, x)
array([0.21938393, 0.04890051, 0.01304838, 0.00377935])
>>> sc.exp1(x)
array([0.21938393, 0.04890051, 0.01304838, 0.00377935])