Recently I want to make some code to make inverse Laplace transformation.
I use mpmath.invertlaplace function.
It works quite well, but I want to remove for loop to get this result.
Here is an example.
import mpmath as mp
def func = lambda s: 1 / (s + k)
Time = mp.linspace(1,10,100)
result = []
for i in Time:
value = mp.invertlaplace(func, i, method = 'stehfest', degree = 32)
result.append(value)
return Time, result
Unfortunately, I cannot use array for mpmath.invertlaplace function.
Is there another library or function that I use?