Add patterns for the inverse Laplace transform
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
ilaplace::addpattern(pat
, s
, t
, res
, <vars, <conds>
>)
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.
Calling ilaplace::addpattern
changes the
expressions returned by future calls to ilaplace
.
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)
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)
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)
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)

Arithmetical
expression in the variable 

Identifier or indexed identifier used as a variable in the pattern 

Identifier or indexed identifier used as a variable in the result 

Arithmetical expression in the variable 

List of identifiers or indexed identifiers used as "pattern
variables" (placeholders in 

List of conditions on the pattern variables 
Object of type DOM_NULL