# ilaplace

Inverse Laplace transform

## Syntax

``f = ilaplace(F)``
``f = ilaplace(F,transVar)``
``f = ilaplace(F,var,transVar)``

## Description

example

````f = ilaplace(F)` returns the Inverse Laplace Transform of `F`. By default, the independent variable is `s` and the transformation variable is `t`. If `F` does not contain `s`, `ilaplace` uses the function `symvar`.```

example

````f = ilaplace(F,transVar)` uses the transformation variable `transVar` instead of `t`.```

example

````f = ilaplace(F,var,transVar)` uses the independent variable `var` and the transformation variable `transVar` instead of `s` and `t`, respectively.```

## Examples

collapse all

Compute the inverse Laplace transform of `1/s^2`. By default, the inverse transform is in terms of `t`.

```syms s F = 1/s^2; f = ilaplace(F)```
`f = $t$`

Compute the inverse Laplace transform of `1/(s-a)^2`. By default, the independent and transformation variables are `s` and `t`, respectively.

```syms a s F = 1/(s-a)^2; f = ilaplace(F)```
`f = $t {\mathrm{e}}^{a t}$`

Specify the transformation variable as `x`. If you specify only one variable, that variable is the transformation variable. The independent variable is still `s`.

```syms x f = ilaplace(F,x)```
`f = $x {\mathrm{e}}^{a x}$`

Specify both the independent and transformation variables as `a` and `x` in the second and third arguments, respectively.

`f = ilaplace(F,a,x)`
`f = $x {\mathrm{e}}^{s x}$`

Compute the following inverse Laplace transforms that involve the Dirac and Heaviside functions.

```syms s t f1 = ilaplace(1,s,t)```
`f1 = $\delta \text{dirac}\left(t\right)$`
```F = exp(-2*s)/(s^2+1); f2 = ilaplace(F,s,t)```
`f2 = $\mathrm{heaviside}\left(t-2\right) \mathrm{sin}\left(t-2\right)$`

Find the inverse Laplace transform of the matrix `M`. Specify the independent and transformation variables for each matrix entry by using matrices of the same size. When the arguments are nonscalars, `ilaplace` acts on them element-wise.

```syms a b c d w x y z M = [exp(x) 1; sin(y) 1i*z]; vars = [w x; y z]; transVars = [a b; c d]; f = ilaplace(M,vars,transVars)```
```f =  $\left(\begin{array}{cc}{\mathrm{e}}^{x} \delta \text{dirac}\left(a\right)& \delta \text{dirac}\left(b\right)\\ \mathrm{ilaplace}\left(\mathrm{sin}\left(y\right),y,c\right)& {\delta \text{dirac}}^{\prime }\left(d\right) \mathrm{i}\end{array}\right)$```

If `ilaplace` is called with both scalar and nonscalar arguments, then it expands the scalars to match the nonscalars by using scalar expansion. Nonscalar arguments must be the same size.

```syms w x y z a b c d f = ilaplace(x,vars,transVars)```
```f =  $\left(\begin{array}{cc}x \delta \text{dirac}\left(a\right)& {\delta \text{dirac}}^{\prime }\left(b\right)\\ x \delta \text{dirac}\left(c\right)& x \delta \text{dirac}\left(d\right)\end{array}\right)$```

Compute the Inverse Laplace transform of symbolic functions. When the first argument contains symbolic functions, then the second argument must be a scalar.

```syms F1(x) F2(x) a b F1(x) = exp(x); F2(x) = x; f = ilaplace([F1 F2],x,[a b])```
`f = $\left(\begin{array}{cc}\mathrm{ilaplace}\left({\mathrm{e}}^{x},x,a\right)& {\delta \text{dirac}}^{\prime }\left(b\right)\end{array}\right)$`

If `ilaplace` cannot compute the inverse transform, then it returns an unevaluated call to `ilaplace`.

```syms F(s) t F(s) = exp(s); f(t) = ilaplace(F,s,t)```
`f(t) = $\mathrm{ilaplace}\left({\mathrm{e}}^{s},s,t\right)$`

Return the original expression by using `laplace`.

`F(s) = laplace(f,t,s)`
`F(s) = ${\mathrm{e}}^{s}$`

## Input Arguments

collapse all

Input, specified as a symbolic expression, function, vector, or matrix.

Independent variable, specified as a symbolic variable, expression, vector, or matrix. This variable is often called the "complex frequency variable." If you do not specify the variable, then `ilaplace` uses `s`. If `F` does not contain `s`, then `ilaplace` uses the function `symvar` to determine the independent variable.

Transformation variable, specified as a symbolic variable, expression, vector, or matrix. It is often called the "time variable" or "space variable." By default, `ilaplace` uses `t`. If `t` is the independent variable of `F`, then `ilaplace` uses `x`.

collapse all

### Inverse Laplace Transform

The inverse Laplace transform f = f(t) of F = F(s) is:

`$f\left(t\right)=\frac{1}{2\pi i}\underset{c-i\infty }{\overset{c+i\infty }{\int }}F\left(s\right){e}^{st}ds.$`

Here, c is a suitable complex number.

## Tips

• If any argument is an array, then `ilaplace` acts element-wise on all elements of the array.

• If the first argument contains a symbolic function, then the second argument must be a scalar.

• To compute the direct Laplace transform, use `laplace`.

• For a signal f(t), computing the Laplace transform (`laplace`) and then the inverse Laplace transform (`ilaplace`) of the result may not return the original signal for t < 0. This is because the definition of `laplace` uses the unilateral transform. This definition assumes that the signal f(t) is only defined for all real numbers t ≥ 0. Therefore, the inverse result does not make sense for t < 0 and may not match the original signal for negative t. One way to correct the problem is to multiply the result of `ilaplace` by a Heaviside step function. For example, both of these code blocks:

```syms t; laplace(sin(t))```

and

```syms t; laplace(sin(t)*heaviside(t))```

return `1/(s^2 + 1)`. However, the inverse Laplace transform

```syms s; ilaplace(1/(s^2 + 1))```

returns `sin(t)`, not `sin(t)*heaviside(t)`.

## Version History

Introduced before R2006a