hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_sum_invlaplace_weeks_eval (c06lc)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

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

[finv, ifail] = c06lc(t, sigma, b, acoef, errvec, 'm', m)
[finv, ifail] = nag_sum_invlaplace_weeks_eval(t, sigma, b, acoef, errvec, 'm', m)

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:
f~ t = eσt i=0 m-1 ai e -bt/2 Li bt ,   σ > σO ,   b > 0  
where Lix  is the Laguerre polynomial of degree i.
This function simply evaluates the above expansion for a specified value of t.
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:     t – double scalar
The value t for which the inverse Laplace transform ft must be evaluated.
2:     sigma – double scalar
3:     b – double scalar
4:     acoefm – double array
5:     errvec8 – 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:     m 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:     finv – double scalar
The approximation to the inverse Laplace transform at t.
2:     ifail int64int32nag_int scalar
ifail=0 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  ifail=1
The approximation to ft  is too large to be representable: finv is set to 0.0.
W  ifail=2
The approximation to ft  is too small to be representable: finv is set to 0.0.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

The error estimate returned by nag_sum_invlaplace_weeks (c06lb) in errvec1  has been found in practice to be a highly reliable bound on the pseudo-error f t - f~ t e-σt .

Further Comments

nag_sum_invlaplace_weeks_eval (c06lc) is primarily designed to evaluate f~t  when t>0 . When t0 , the result approximates the analytic continuation of ft ; the approximation becomes progressively poorer as t becomes more negative.

Example

See example for nag_sum_invlaplace_weeks (c06lb).
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)
% Evaluate the Laplace transform function.
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)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015