我正在使用 Python 计算上不完全伽马函数mpmath.gammainc
:
import numpy as np
from mpmath import gammainc
z = 0 # define power of t as t^(-1)
a = 0.5+0.4j # integral lower limit
b = np.inf # integral upper limit
myfun = np.array([gammainc(z,a,b,regularized=False)], dtype=complex)
它是 mpmath 文档中定义的一维积分。我想myfun
使用 scipy 的quad
函数来比较这个结果:
myfun2 = scipy.integrate.quad(exp(-t)/t, a, inf)[0]
但是,我不认为quad
接受关于积分上限/下限的复杂论点。我不知道是否可以将问题分成实部/虚部。有任何想法吗?