# iv.opC: Inverse Laplace Transform In invLT: Inversion of Laplace-Transformed Functions

## Description

Functionals that numerically invert a Laplace Transform.

## Usage

 ```1 2 3 4 5``` ```iv.opC(L.FUN, t, nterms = 31L, m = 1, fail.val = NA) iv.opChalf(L.FUN, t, nterms = 16L, m = 1, fail.val = NA) iv.BrC(L.FUN, t, nterms = 1000L, gamma = 1) ```

## Arguments

 `L.FUN` the Laplace-Transformed function `t` standard (time) domain function at which to evaluate `nterms` number of terms to use in the numerical inversion (odd number safest for `iv.opC`, even for `iv.opChalf`) `m` see `opC.r` documentation `fail.val` value to return in event of failure to converge `gamma` the Bromwich contour is a straight line and intersects the real axis at γ

## Details

Optimum contour based on:

Evans & Chung, 2000: Laplace transform inversions using optimal contours in the complex plane International Journal of Computer Mathematics v73 pp531-543.

## Functions

• `iv.opC`: inversion using the full optimum contour

• `iv.opChalf`: for functions which are symmetric about the real axis, it is sufficient to use half the optimum contour and half the number of subdivisions (`nterms`)

• `iv.BrC`: inversion using the Bromwich contour (the definition, but very unstable for numerical evaluation - not recommended)

## Examples

 ```1 2 3``` ```tvals <- seq(-pi/2, pi/2, length.out = 7) sinvals <- vapply(tvals, iv.opC, complex(1), L.FUN = L.sin) plot(tvals, Re(sinvals), type = "l") ```

### 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.

Tools:
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 2, 2019, 3:43 p.m.