ivLT.plot: Plot Laplace Transform inversion

Description Usage Arguments Details Examples

View source: R/ivLT.R


Plots the results of a Laplace Transform inversion at multiple time values.


ivLT.plot(L.FUN, METHOD = iv.opC, tPts = seq(-2, 5, 0.1), nterms = 100,



the Laplace-Transformed function


inversion algorithm to use (iv.opC, iv.opChalf or iv.BrC)


time points at which to plot


number of terms to use in the numerical inversion (odd number safest for iv.opC, even for iv.opChalf)


graphical parameters for plot


This function is useful for investigating the performance of a Laplace Transform inversion over a range of time values. Use for example with the LT functions provided in with this package (invLT).


ivLT.plot(L.tsq, iv.opC, nterms = 31L)
ivLT.plot(L.tsq, iv.opC, nterms = 1000L)
ivLT.plot(L.tsq, iv.opChalf, nterms = 16L)
ivLT.plot(L.tsq, iv.opChalf, nterms = 1000L)
ivLT.plot(L.tsq, iv.BrC, nterms = 31L)
ivLT.plot(L.tsq, iv.BrC, nterms = 1000L)

Example output

Numerical Laplace Transform inversion functions successfully sourced.
Optimum contour integration ref. Evans & Chung, 2000: Laplace transform inversions using optimal contours in the complex plane; International Journal of Computer Mathematics v73 pp531-543.:
iv.opC(L.FUN, t, nterms = 30L, m=1, fail.val = NA){
iv.opC2(L.FUN, t, nterms = 30L, m=1, fail.val = NA){
L.FUN: Laplace Transformed function to be inverted
t: untransformed domain co-ordinate value (typically time) at which to evaluate
nterms: number of terms with which to evaluate the inversion
m: "width" of the contour of integration - smaller values avoid the large oscillations at the right hand side of the Argand diagram, but are more likely to interact with singlurities on the real axis
for further details on m, see E&C 2000, or simply experiment
fail.val: after 10 attempts, increasing m and nterms, if the inversion still produces non-finite results, the function gives up and returns this value

iv.opC2 only uses half of the contour and therefore nterms can be half the size for the same accuracy: valid if Re(L.FUN) is symmetric about the real axis

Bromwich contour integration:
iv.BrC(L.FUN, t, nterms=1000, gamma=1)
gamma: distance of contour to right of imaginary axis

The Bromwich Contour is very unstable; it is included mainly for comparison.  The definition of the inverse Laplace Transform is usually expressed with the Bromwich Contour, even though its numerical implementation is impractical.

ivLT.plot(L.FUN, METHOD = iv.opC, tPts = seq(-2,5,.1), nterms = 100, ...)
METHOD: iv.opC, iv.opC2 or iv.BrC
tPts: points at which to plot time
...: parameters to pass to plot
some transformed functions for which there are analytical inverses:
L.t <- function(p){1/p^2}: LT of t^1
L.tsq <- function(p){2/p^3}: LT of t^2
L.exp <- function(p){1/(p+1)}: LT of exp(-t)
L.cos <- function(p){p/(p^2 + 1)}: LT of cos(t)
L.sin <- function(p){1/(p^2 + 1)}: LT of sin(t)
L.H <- function(p){exp(-p)/p}: LT of H(t - 1), the Heaviside unit function stepping at t = 1

invLT documentation built on May 30, 2017, 7:40 a.m.

Related to ivLT.plot in invLT...