PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_sum_invlaplace_weeks_eval (c06lc)
Purpose
nag_sum_invlaplace_weeks_eval (c06lc) evaluates an inverse Laplace transform at a given point, using the expansion coefficients computed by
nag_sum_invlaplace_weeks (c06lb).
Syntax
Description
nag_sum_invlaplace_weeks_eval (c06lc) is designed to be used following a call to
nag_sum_invlaplace_weeks (c06lb), which computes an inverse Laplace transform by representing it as a Laguerre expansion of the form:
where
is the Laguerre polynomial of degree
.
This function simply evaluates the above expansion for a specified value of .
nag_sum_invlaplace_weeks_eval (c06lc) is derived from the function MODUL2 in
Garbow et al. (1988)
References
Garbow B S, Giunta G, Lyness J N and Murli A (1988) 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
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
The value for which the inverse Laplace transform must be evaluated.
- 2:
– double scalar
- 3:
– double scalar
- 4:
– double array
- 5:
– double array
-
sigma,
b,
m,
acoef and
errvec must be unchanged from the previous call of
nag_sum_invlaplace_weeks (c06lb).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
acoef.
sigma,
b,
m,
acoef and
errvec must be unchanged from the previous call of
nag_sum_invlaplace_weeks (c06lb).
Output Parameters
- 1:
– double scalar
-
The approximation to the inverse Laplace transform at .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
- W
-
The approximation to
is too large to be representable:
finv is set to
.
- W
-
The approximation to
is too small to be representable:
finv is set to
.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The error estimate returned by
nag_sum_invlaplace_weeks (c06lb) in
has been found in practice to be a highly reliable bound on the pseudo-error
.
Further Comments
nag_sum_invlaplace_weeks_eval (c06lc) is primarily designed to evaluate when . When , the result approximates the analytic continuation of ; the approximation becomes progressively poorer as becomes more negative.
Example
Open in the MATLAB editor:
c06lc_example
function c06lc_example
fprintf('c06lc example results\n\n');
sigma0 = 3;
sigma = 0;
b = 0;
epstol = 1e-05;
[sigmaOut, bOut, m, acoef, errvec, ifail] = ...
c06lb(@f, sigma0, sigma, b, epstol, 'mmax', int64(512));
fprintf('\nNo. of coefficients returned by c06lb = %d\n\n', m);
fprintf(' Computed Exact Pseudo\n');
fprintf(' t f(t) f(t) error\n');
for j = 0:5
[finv, ifail] = c06lc(j, sigmaOut, bOut, acoef, errvec);
exact = sinh(3*j);
pserr = abs(finv-exact)/exp(sigmaOut*j);
fprintf(' %10.2f %15.4f %15.4f %12.1g\n',j, finv, exact, pserr);
end
function [f] = f(s)
f=3.0/(s^2-9.0);
if isreal(f)
f=complex(f);
end
c06lc example results
No. of coefficients returned by c06lb = 64
Computed Exact Pseudo
t f(t) f(t) error
0.00 0.0000 0.0000 2e-09
1.00 10.0179 10.0179 2e-09
2.00 201.7132 201.7132 1e-10
3.00 4051.5420 4051.5419 1e-09
4.00 81377.3949 81377.3957 3e-10
5.00 1634508.5023 1634508.6862 2e-09
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015