# Weeks' Method for Numerical Laplace transform inversion with GPU acceleration

Version 1.3.0.0 (5.15 MB) by
Implementation of the Weeks method for numerical Laplace transform inversion with GPU acceleration.
Updated 18 Dec 2011

The numerical inversion of the Laplace transform is a long standing problem due its implicit ill-posedness. These functions implement one of the more well known numerical inversion algorithms, the Weeks method. Particularly new here is the use of graphics processing unit [GPU] computing to accelerate the method.

To assist the user, a wrapper (WeeksMethod.m) to the core inversion functions is provided. It allows a user to input the Laplace space function F(s) to invert as a string and a sequence of inversion times to obtain approximate f(t) values. Optional inputs are the relative error tolerance (0.05 for 5%) for each time and a selection of the search algorithm for the method's parameters. The wrapped code will refine the f(t) approximations until an internal estimate of the relative error is below the user requested tolerance. For some classes of F(s) functions, it is not possible to reach the input tolerance. Therefore the code can also return a flag for each time to indicate if the tolerance was met and the internally computed estimates of the absolute and relative errors.

The optional input search algorithm switch defines how the code will determine optimal values for the method's parameters. There are three choices: 0-local CPU fminbnd search, 1-global CPU search, 2-global GPU search. The tool has been written so that it will run in standard MATLAB on a central processing unit [CPU]. However, to rapidly perform a global search for optimal values of the method's parameters, GPU computing has also been used. To be more precise, in the Weeks method a function f(t) is represented as a sum of Laguerre polynomials

f(t) \approx \sum_{n=0}^{N-1}a_{n}e^{(\sigma - b)t}L_{n}(2bt)
a_{n} = a_{n}(F(s),\sigma,b)

Critical to the accuracy of the expansion is the choice of values for the (sigma,b) parameters. This can be accomplished from a minimization of an absolute error estimate for f_{N}(t). The calculation of the error estimate for each (sigma,b) pair requires that one compute the expansion coefficients a_{n} through a fast Fourier transform [FFT]. This tool uses the parallelization of a GPU to perform a global minimization by simultaneously computing an absolute error estimate E(\sigma,b) for the approximate f(t) for each (sigma,b) pair. The code also has a CPU implementation of the E(sigma,b) global search. The GPU implementation is considerably faster. A local minimization of the error estimate based on MATLAB's fminbnd function is also implemented for CPU computations. From the estimates, the (sigma,b) pair which corresponds to the smallest absolute error is selected for the expansion.

The default mode for the tool is to run on a CPU. The GPU code makes use of JACKET from AccelerEyes. For the GPU computations, one must have a NVIDIA brand graphics card installed and JACKET. These functions were developed using an NVIDIA Tesla c2070 GPU, MATLAB 2010b, and JACKET 1.6 in Debian Linux.

Documentation is provided in the help for each file, in the references, and in an examples script (ScrExample.m).

If you use the programs or adapt them to your own needs, we would appreciate a note letting us know who you are and about your work. The files are provided as is with no guarantees.

References:
William T. Weeks
Numerical Inversion of Laplace Transforms Using Laguerre Functions
Journal of the ACM (JACM)
Volume 13 Issue 3, July 1966

Patrick Kano, Moysey Brio
Weeks' method for the matrix exponential
www.math.arizona.edu/~brio/WEEKS_METHOD_PAGE/pkanoWeeksMethod.html

J. A. C. Weideman
Algorithms for Parameter Selection in the Weeks Method for Inverting the Laplace Transform
SIAM Journal on Scientific Computing archive
Volume 21 Issue 1, Aug.-Sept. 1999
http://dip.sun.ac.za/~weideman/research/weeks.html

JACKET for MATLAB GPU Computing
www.accelereyes.com

### Cite As

Patrick Kano (2024). Weeks' Method for Numerical Laplace transform inversion with GPU acceleration (https://www.mathworks.com/matlabcentral/fileexchange/30965-weeks-method-for-numerical-laplace-transform-inversion-with-gpu-acceleration), MATLAB Central File Exchange. Retrieved .

##### MATLAB Release Compatibility
Created with R2010b
Compatible with any release
##### Platform Compatibility
Windows macOS Linux
##### Categories
Find more on GPU Computing in Help Center and MATLAB Answers

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

#### WEEKS_METHOD_Exchange_Dec15/WEEKS_METHOD/

Version Published Release Notes
1.3.0.0

The GUI has been changed to allow the user to resize it. The figures have been slightly modified.

1.2.0.0

A simple GUI has been added to allow for easier use of this tool. The core Weeks method source files have not changed.

1.1.0.0