'Inverse Laplace using mpmath and scipy
I want to invert the function Laplace_Max from the lapplace domain to the time domain using mp.invertlaplace. My problem is that I have sc.gammainc in my function which is from the scipylibrary and I think it is not compatible with mpmath. Does anyone have any idea how I can solve this problem?
import mpmath as mp
import scipy.special as sc
def Laplace_Max(s):
A=1/s**(5/4)*(0.00480931 + 0.0244077*s**(1/4) + 0.0129056*mp.exp**(-35*s)*s**(1/4) + 0.00329167*mp.exp**(0.707997*s)*mp.exp**(1/4)*sc.gammainc(0., 35.708*s) - 0.00530593*sc.gammainc(1.25, 35*s))
return 1/A
t_R_inv = np.linspace(1,1200,1200)
Max=[]
for t_i in range(len(t_R_inv)):
Max.append(float(mp.invertlaplace(Laplace_Max, t_R_inv[t_i], method = 'dehoog', dps = 10, degree = 50)))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
