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.\]
參數:
narray_like

非負整數

xarray_like

實數引數

outndarray, optional

用於函數結果的可選輸出陣列

回傳值:
純量或 ndarray

廣義指數積分的值

另請參閱

exp1

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

expi

\(n = 1\) 時與 \(E_n\) 相關

參考文獻

[dlmf]

Digital Library of Mathematical Functions, 8.19.2 https://dlmf.nist.gov/8.19#E2

範例

>>> import numpy as np
>>> import scipy.special as sc

其定義域為非負 n 和 x。

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

n = 1, 2 時,它在 x = 0 處有一個極點;對於較大的 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])