fftl.transforms.laplace#
- fftl.transforms.laplace(r, ar, *args, **kwargs)#
Laplace transform
The Laplace transform is defined as
\[\tilde{a}(k) = \int_{0}^{\infty} \! a(r) \, e^{-kr} \, dr \;.\]Examples
Compute the Laplace transform.
>>> # some test function >>> p, q = 2.0, 0.5 >>> r = np.logspace(-2, 2, 1000) >>> ar = r**p*np.exp(-q*r) >>> >>> # compute a biased transform >>> from fftl.transforms import laplace >>> k, ak = laplace(r, ar, q=0.7)
Compare with the analytical result.
>>> from scipy.special import gamma >>> res = gamma(p+1)/(q + k)**(p+1) >>> >>> import matplotlib.pyplot as plt >>> plt.loglog(k, ak, '-k', label='numerical') >>> plt.loglog(k, res, ':r', label='analytical') >>> plt.legend() >>> plt.show()