naginterfaces.library.sum.invlaplace_​weeks

naginterfaces.library.sum.invlaplace_weeks(f, sigma0, sigma, b, epstol, mmax=1024, data=None)[source]

invlaplace_weeks computes the inverse Laplace transform of a user-supplied function , defined for complex . The function uses a modification of Weeks’ method which is suitable when has continuous derivatives of all orders. The function returns the coefficients of an expansion which approximates and can be evaluated for given values of by subsequent calls of invlaplace_weeks_eval().

For full information please refer to the NAG Library document for c06lb

https://www.nag.com/numeric/nl/nagdoc_27.3/flhtml/c06/c06lbf.html

Parameters
fcallable retval = f(s, data=None)

must return the value of the Laplace transform function for a given complex value of .

Parameters
scomplex

The value of for which must be evaluated. The real part of is greater than .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalcomplex

The value of the Laplace transform function for the given complex value, .

sigma0float

The abscissa of convergence of the Laplace transform, .

sigmafloat

The parameter of the Laguerre expansion. If on entry , is reset to .

bfloat

The parameter of the Laguerre expansion. If on entry , is reset to .

epstolfloat

The required relative pseudo-accuracy, that is, an upper bound on .

mmaxint, optional

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 should be a power of ; if is not a power of then the maximum number of coefficients calculated will be the largest power of less than .

dataarbitrary, optional

User-communication data for callback functions.

Returns
sigmafloat

The value actually used for , as just described.

bfloat

The value actually used for , as just described.

mint

The number of Laguerre expansion coefficients actually computed. The number of calls to is .

acoeffloat, ndarray, shape

The first elements contain the computed Laguerre expansion coefficients, .

errvecfloat, ndarray, shape

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 function for the purposes of error estimation.

It satisfies

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

The decay rate of the coefficients is too small. Increasing may help. . Pseudo-error estimate and .

(errno )

The decay rate of the coefficients is too small and round-off error is such that the required accuracy cannot be obtained. Increasing or may help. . Pseudo-error estimate and .

Warns
NagAlgorithmicWarning
(errno )

The estimate of the pseudo-error is slightly larger than . Pseudo-error estimate and .

(errno )

The round-off error level is larger than . Increasing may help. Pseudo-error estimate and .

(errno )

Error bounds cannot be predicted. Check . .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

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 .

invlaplace_weeks, along with its companion invlaplace_weeks_eval(), 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 function computes the coefficients of the above Laguerre expansion; the expansion can then be evaluated for specified by calling invlaplace_weeks_eval(). You must supply the value of , and also suitable values for and : see Further Comments 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 function will fail with an error exit if the method is not suitable for the supplied function .

The function 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.

invlaplace_weeks is derived from the function MODUL1 in Garbow et al. (1988a).

References

Garbow, B S, Giunta, G, Lyness, J N and Murli, A, 1988, 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, 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