Documentation

Add patterns for the inverse Laplace transform

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

```ilaplace::addpattern(`pat`, `s`, `t`, `res`, <`vars, <conds>`>)
```

Description

`ilaplace::addpattern(pat, s, t, res)` teaches `ilaplace` to return ilaplace(pat, s, t) = res.

The `ilaplace` function uses a set of patterns for computing inverse Laplace transforms. You can extend the set by adding your own patterns. To add a new pattern to the pattern matcher, use `ilaplace::addpattern`. MuPAD® does not save custom patterns permanently. The new patterns are available in the current MuPAD session only.

Variable names that you use when calling `ilaplace::addpattern` can differ from the names that you use when calling `ilaplace`. See Example 2.

You can include a list of free parameters and a list of conditions on these parameters. These conditions and the result are protected from premature evaluation. This means that you can use ```not   iszero(a^2 - b)``` instead of ```hold( _not @ iszero )(a^2 - b)```.

The following conditions treat assumptions on identifiers differently:

• `a^2 - b <> 0` takes into account assumptions on identifiers.

• `not   iszero(a^2 - b)` disregards assumptions on identifiers.

See Example 4.

Environment Interactions

Calling `ilaplace::addpattern` changes the expressions returned by future calls to `ilaplace`.

Examples

Example 1

Compute the inverse Laplace transform of the function `bar`. By default, MuPAD does not have a pattern for this function:

`ilaplace(bar(s), s, t)`

Add a pattern for the inverse Laplace transform of `bar` using `ilaplace::addpattern`:

`ilaplace::addpattern(bar(s), s, t, foo(t)):`

Now `ilaplace` returns the inverse Laplace transform of `bar`:

`ilaplace(bar(s), s, t)`

After you add a new transform pattern, MuPAD can use that pattern indirectly:

`ilaplace(exp(-s)*bar(s), s, t)`

Example 2

Define the inverse Laplace transform of `bar(y)` using the variables `x` and `y` as parameters:

`ilaplace::addpattern(bar(y), y, x, foo(x)):`

The `ilaplace` function recognizes the added pattern even if you use other variables as parameters:

`ilaplace(bar(s), s, t)`

Example 3

Add this pattern for the inverse Laplace transform of `F`:

```ilaplace::addpattern(F(c, S)*G(c, S), S, T, T/(T^4 + 4*c^4)): ilaplace(F(c, s)*G(c, s), s, t)```

This pattern holds only when the first argument of `F` is the symbolic parameter `c`. If you use any other value of this parameter, `ilaplace` ignores the pattern:

`ilaplace(F(A, s)*G(A, s), s, t)`

To use the pattern for arbitrary values of the parameter, declare the parameter `c` as an additional pattern variable:

`ilaplace::addpattern(F(c, S)*G(c, S), S, T, T/(T^4 + 4*c^4), [c]):`

Now `ilaplace` applies the specified pattern for an arbitrary value of `c`:

`ilaplace(F(C, s)*G(C, s), s, t)`

You also can declare several parameters as pattern variables. For example, this pattern has two pattern variables, `a` and `b`:

```ilaplace::addpattern(f(a*y + b), y, x, g(x/a - b), [a, b]): ilaplace(f(2*s + B), s, t)```

Example 4

Use assumptions when adding this pattern for the inverse Laplace transform:

```ilaplace::addpattern(BAR(x*s), s, t, sin(1/(x - 1/2))*FOO(t), [x], [abs(x) < 1]): ilaplace(BAR(x*s), s, t) assuming -1 < x < 1```

If |x| ≥ 1, you cannot apply this pattern:

`ilaplace(BAR(x*s), s, t) assuming x >= 1`

If MuPAD cannot determine whether the conditions are satisfied, it returns a `piecewise` object:

`ilaplace(BAR(x*s), s, t)`

Note that the resulting expression defining the inverse Laplace transform of `BAR(x*s)` implicitly assumes that the value of `x` is not 1/2. A strict definition of the pattern is:

```ilaplace::addpattern(BAR(x*t), s, t, sin(1/(x - 1/2))*FOO(t), [x], [abs(x) < 1, x <> 1/2]):```

If either the conditions are not satisfied or substituting the values into the result gives an error, `ilaplace` ignores the pattern. For this particular pattern, you can omit specifying the assumption ```x <> 1/2```. If `x = 1/2`, MuPAD throws an internal "Division by zero." error and ignores the pattern:

`ilaplace(BAR(s/2), s, t)`

Parameters

 `pat` Arithmetical expression in the variable `s` representing the pattern to match. `s` `t` Identifier or indexed identifier used as a variable in the result `res` Arithmetical expression in the variable `t` representing a pattern for the result `vars` List of identifiers or indexed identifiers used as "pattern variables" (placeholders in `pat` and `res`). You can use pattern variables as placeholders for almost arbitrary MuPAD expressions not containing `s` or `t`. You can restrict them by conditions given in the optional parameter `conds`. `conds` List of conditions on the pattern variables

Return Values

Object of type `DOM_NULL`

Get trial now