NAG Library Routine Document
C06LBF
1 Purpose
C06LBF computes the inverse Laplace transform
of a user-supplied function
, defined for complex
. The routine uses a modification of Weeks' method which is suitable when
has continuous derivatives of all orders. The routine returns the coefficients of an expansion which approximates
and can be evaluated for given values of
by subsequent calls of
C06LCF.
2 Specification
INTEGER |
MMAX, M, IFAIL |
REAL (KIND=nag_wp) |
SIGMA0, SIGMA, B, EPSTOL, ACOEF(MMAX), ERRVEC(8) |
COMPLEX (KIND=nag_wp) |
F |
EXTERNAL |
F |
|
3 Description
Given a function
of a real variable
, its Laplace transform
is a function of a complex variable
, defined by
Then
is the inverse Laplace transform of
. The value
is referred to as the abscissa of convergence of the Laplace transform; it is the rightmost real part of the singularities of
.
C06LBF, along with its companion
C06LCF, attempts to solve the following problem:
- given a function , compute values of its inverse Laplace transform for specified values of .
The method is a modification of Weeks' method (see
Garbow et al. (1988a)), which approximates
by a truncated Laguerre expansion:
where
is the Laguerre polynomial of degree
. This routine computes the coefficients
of the above Laguerre expansion; the expansion can then be evaluated for specified
by calling
C06LCF. You must supply the value of
, and also suitable values for
and
: see
Section 8 for guidance.
The method is only suitable when has continuous derivatives of all orders. For such functions the approximation is usually good and inexpensive. The routine will fail with an error exit if the method is not suitable for the supplied function .
The routine is designed to satisfy an accuracy criterion of the form:
where
is a user-supplied bound. The error measure on the left-hand side is referred to as the
pseudo-relative
error, or
pseudo-error for short. Note that if
and
is large, the absolute error in
may be very large.
C06LBF is derived from the subroutine MODUL1 in
Garbow et al. (1988a).
4 References
Garbow B S, Giunta G, Lyness J N and Murli A (1988a) Software for an implementation of Weeks' method for the inverse laplace transform problem ACM Trans. Math. Software 14 163–170
Garbow B S, Giunta G, Lyness J N and Murli A (1988b) Algorithm 662: A Fortran software package for the numerical inversion of the Laplace transform based on Weeks' method ACM Trans. Math. Software 14 171–176
5 Parameters
- 1: F – COMPLEX (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
F must return the value of the Laplace transform function
for a given complex value of
.
The specification of
F is:
- 1: S – COMPLEX (KIND=nag_wp)Input
On entry: the value of
for which
must be evaluated. The real part of
S is greater than
.
F must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which C06LBF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 2: SIGMA0 – REAL (KIND=nag_wp)Input
On entry: the abscissa of convergence of the Laplace transform, .
- 3: SIGMA – REAL (KIND=nag_wp)Input/Output
On entry: the parameter
of the Laguerre expansion. If on entry
,
SIGMA is reset to
.
On exit: the value actually used for , as just described.
- 4: B – REAL (KIND=nag_wp)Input/Output
On entry: the parameter
of the Laguerre expansion. If on entry
,
B is reset to
.
On exit: the value actually used for , as just described.
- 5: EPSTOL – REAL (KIND=nag_wp)Input
On entry: the required relative pseudo-accuracy, that is, an upper bound on .
- 6: MMAX – INTEGERInput
On entry: an upper bound on the number of Laguerre expansion coefficients to be computed. The number of coefficients actually computed is always a power of
, so
MMAX should be a power of
; if
MMAX is not a power of
then the maximum number of coefficients calculated will be the largest power of
less than
MMAX.
Suggested value:
is sufficient for all but a few exceptional cases.
Constraint:
.
- 7: M – INTEGEROutput
On exit: the number of Laguerre expansion coefficients actually computed. The number of calls to
F is
.
- 8: ACOEF(MMAX) – REAL (KIND=nag_wp) arrayOutput
On exit: the first
M elements contain the computed Laguerre expansion coefficients,
.
- 9: ERRVEC() – REAL (KIND=nag_wp) arrayOutput
On exit: an
-component vector of diagnostic information.
- Overall estimate of the pseudo-error .
- Estimate of the discretization pseudo-error.
- Estimate of the truncation pseudo-error.
- Estimate of the condition pseudo-error on the basis of minimal noise levels in function values.
- , coefficient of a heuristic decay function for the expansion coefficients.
- , base of the decay function for the expansion coefficients.
- Logarithm of the largest expansion coefficient.
- Logarithm of the smallest nonzero expansion coefficient.
The values
and
returned in
and
define a decay function
constructed by the routine for the purposes of error estimation. It satisfies
- 10: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if
on exit, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Note: C06LBF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
The estimated pseudo-error bounds are slightly larger than
EPSTOL. Note, however, that the actual errors in the final results may be smaller than
EPSTOL as bounds independent of the value of
are pessimistic.
Computation was terminated early because the estimate of rounding error was greater than
EPSTOL. Increasing
EPSTOL may help.
The decay rate of the coefficients is too small. Increasing
MMAX may help.
The decay rate of the coefficients is too small. In addition the rounding error is such that the required accuracy cannot be obtained. Increasing
MMAX or
EPSTOL may help.
The behaviour of the coefficients does not enable reasonable prediction of error bounds. Check the value of
SIGMA0. In this case,
is set to
, for
.
When
, changing
SIGMA or
B may help. If not, the method should be abandoned.
7 Accuracy
The error estimate returned in has been found in practice to be a highly reliable bound on the pseudo-error .
Nearly all techniques for inversion of the Laplace transform require you to supply the value of , the convergence abscissa, or else an upper bound on . For this routine, one of the reasons for having to supply is that the parameter must be greater than ; otherwise the series for will not converge.
If you do not know the value of , you must be prepared for significant preliminary effort, either in experimenting with the method and obtaining chaotic results, or in attempting to locate the rightmost singularity of .
The value of
is also relevant in defining a natural accuracy criterion. For large
,
is of uniform numerical order
, so a
natural measure of relative accuracy of the approximation
is:
C06LBF uses the supplied value of
only in determining the values of
and
(see
Sections 8.2 and
8.3); thereafter it bases its computation entirely on
and
.
Even when the value of
is known, choosing a value for
is not easy. Briefly, the series for
converges slowly when
is small, and faster when
is larger. However the natural accuracy measure satisfies
and this degrades exponentially with
, the exponential constant being
.
Hence, if you require meaningful results over a large range of values of , you should choose small, in which case the series for converges slowly; while for a smaller range of values of , you can allow to be larger and obtain faster convergence.
The default value for used by C06LBF is . There is no theoretical justification for this.
The simplest advice for choosing
is to set
. The default value used by the routine is
. A more refined choice is to set
where
are the singularities of
.
9 Example
This example computes values of the inverse Laplace transform of the function
The exact answer is
The program first calls C06LBF to compute the coefficients of the Laguerre expansion, and then calls
C06LCF to evaluate the expansion at
,
,
,
,
,
.
9.1 Program Text
Program Text (c06lbfe.f90)
9.2 Program Data
Program Data (c06lbfe.d)
9.3 Program Results
Program Results (c06lbfe.r)