laplace¶
Module listing¶
Numerical inverse Laplace transform
-
class
geotecha.mathematics.laplace.
Talbot
(f, n=24, shift=0.0, vectorized=True)[source]¶ Bases:
object
Numerical inverse Laplace transform, Talbot method
Parameters: - f : function or method
Function to perform inverse Laplace transform on. Function should be vectorised (but doesn’t have to be).
- n : even int, optional
Number of integration points. Nf n is even it will be rounded up to nearest even number. Default n=24.
- shift : float, optional
Shift contour to the right in case there is a pole on the positive real axis. Default shift=0.0.
- vectorized : True/False, optional
If True then f accepts vector inputs and numpy broadcasting will be used. Otherwise function evaluation will occur in loops. Default vectorized=True.
See also
geotecha.mathematics.mp_laplace.Talbot
- higher precision numerical inverse Laplace transform.
Notes
Talbot suggested that the Bromwich line be deformed into a contour that begins and ends in the left half plane, i.e., z infinity at both ends. Due to the exponential factor the integrand decays rapidly on such a contour. In such situations the trapezoidal rule converge extraordinarily rapidly.
Shift contour to the right in case there is a pole on the positive real axis : Note the contour will not be optimal since it was originally devoloped for function with singularities on the negative real axis For example take F(s) = 1/(s-1), it has a pole at s = 1, the contour needs to be shifted with one unit, i.e shift = 1.
References
Code adapted (vectorised, args added) from [1] and [2] (including much of the text taken verbatim). Algorithm from [3]:
[1] (1, 2) Created by Fernando Damian Nieuwveldt, 25 October 2009, fdnieuwveldt@gmail.com, http://code.activestate.com/recipes/576934-numerical-inversion-of-the-laplace-transform-using/ [2] (1, 2) Adapted to mpmath and classes by Dieter Kadelka, 27 October 2009, Dieter.Kadelka@kit.edu, http://code.activestate.com/recipes/578799-numerical-inversion-of-the-laplace-transform-with-/ [3] (1, 2) L.N.Trefethen, J.A.C.Weideman, and T.Schmelzer. Talbot quadratures and rational approximations. BIT. Numerical Mathematics, 46(3):653 670, 2006. Methods
__call__
(t[, args])Numerical inverse laplace transform of F at various time t.