You are on page 1of 19

Signals and Systems Lab DEE, FURC

Laplace Transforms

The Laplace Transformation (after the French mathematician Pierre Simon Marquis de
Laplace) is a method for solving differential equations, and the corresponding initial and
boundary value problems. The Laplace transform is a generalization of the Continuous-Time
Fourier Transform. However, instead of using complex sinusoids of the form e jwt , as the
CTFT does, the Laplace transform uses the more general, e st ; where s    jw s.

Finding a solution of a differential equation using the Laplace Transformation consists of


three steps:

1. Transformation of the equation into a subsidiary equation (moving the equation from
the so called t-space to s-space)

2. Solving the subsidiary equation by simple algebraic manipulations

3. Transforming the subsidiary equation back into t-space to obtain the solution of the
given problem

I will only describe the basic definition of the Laplace Transform, some basic properties, and
a basic example on the use of this method.

Consider a function f(t), defined for all t≥0. Multiply this function by e -st, and integrate with
respect to t from zero to infinity. The resulting integral F(s) is given by:

L(f) = F(s) = 
0
e  st f (t ) dt

The function F(s) of the variable s is called the Laplace Transform, denoted by L(f).
Furthermore, the original function f(t) is called the inverse transform, denoted by L-1(F):

f(t) = L-1(F)

An important property of the Laplace Transform is its linearity:

L{af(t) + bg(t)} = aL{f(t)} + bL{g(t)}

1
Signals and Systems Lab DEE, FURC

In order to solve differential equations using Laplace Transforms, the transform of the
derivative of a function f(t) is needed. This is given by:

L(f') = sL(f) - f(0)

This definition can be extended to transforms of derivatives of arbitrary higher orders:

L(fn) = snL(f) - sn-1 f(0) - sn-2 f'(0) - ... - f(n-1)(0)

Example: solve the initial value problem:

y" + 4y' +3y = 0 y(0) = 3, y'(0) = 1

First set up the subsidiary equations, with Y(s) = L(y):

L(y') = sY - y(0) = sY - 3
L(y") = s2Y -sy(0) - y'(0) = s2Y - 3s - 1

s2Y + 4sY +3Y = 3s + 1 + 4*3

Solve the subsidiary equation for Y:

(s + 3)(s + 1)Y = 3s + 13

3s  13 2 5
Y   
( s  3)( s  1) s  3 s  1

Solve the given problem by using the inverse transform:

L-1{1/(s + 3)} = e-3t


L-1{1/(s + 1)} = e-t

y(t) = -2e-3t + 5e-t

Matlab has two functions, laplace and ilaplace, that are both part of the symbolic toolbox,
and will find the Laplace and inverse Laplace transforms respectively. This method is
2
Signals and Systems Lab DEE, FURC

generally preferred for more complicated functions. Simpler and more contrived functions
are usually found easily enough by using tables as shown in above example.

MATLAB EXERCISE

Laplace transform of a function f(t) is defined as

where

Laplace transform of a function f(t) can be obtained with Matlab's function laplace.
Syntax: L =laplace(f)

a. Calculate the Laplace Transform using Matlab

Calculating the Laplace F(s) transform of a function f(t) is quite simple in Matlab. First
you need to specify that the variable t and s are symbolic ones. This is done with the
command

>> syms t s

Next you define the function f(t). The actual command to calculate the transform is

>> F=laplace(f,t,s)

To make the expression more readable one can use the commands, simplify and pretty.

Here are some examples;

Example 1;
−2t −2t
f (t) = −1.25 + 3.5te + 1.25e

3
Signals and Systems Lab DEE, FURC

>> syms t s %syms t


>> f=-1.25+3.5*t*exp(-2*t)+1.25*exp(-2*t);
>> F=laplace(f,t,s) %F=laplace(f)

F =

-5/4/s+7/2/(s+2)^2+5/4/(s+2)

>> simplify(F)

ans =

(s-5)/s/(s+2)^2

s - 5
----------
2
s (s + 2)

>> pretty(ans)

which corresponds to F(s),


(s − 5)
F (s) = 2
s(s + 2)

Alternatively, one can write the function f(t) directly as part of the laplace command:

>>F2=laplace(-1.25+3.5*t*exp(-2*t)+1.25*exp(-2*t))

Example 2.
Find the Laplace transform of

Matlab performs Laplace transform symbolically. Thus, you need to first define the variable
t as a "symbol".

>> syms t

Next, enter the function f(t):

>> f=5*exp(-2*t);

Finally, enter the following command:


4
Signals and Systems Lab DEE, FURC

>> L=laplace(f)

Matlab yields the following answer:

L = 5/(s+2)

You may want to carry out the transformation by hand (or using Laplace transform table) to
verify this result.

5
b. Inverse Laplace Transform

The command one uses now is ilaplace. One also needs to define the symbols t and s.
Lets calculate the inverse of the previous function F(s),
(s − 5)
F (s) = 2
s(s + 2)
>> syms t s
>> F=(s-5)/(s*(s+2)^2);
>> ilaplace(F)
ans = -5/4+(7/2*t+5/4)*exp(-2*t)
>> simplify(ans)
ans = -5/4+7/2*t*exp(-2*t)+5/4*exp(-2*t)
>> pretty(ans)
- 5/4 + 7/2 t exp(-2 t) + 5/4 exp(-2 t)

Which corresponds to f(t)


−2t −2t
f (t ) = −1.25 + 3.5te + 1.25e
Alternatively one can write

>> ilaplace((s-5)/(s*(s+2)^2))

Here is another example.

10(s + 2)
F (s) = 2
s(s + 4s + 5)

>> F=10*(s+2)/(s*(s^2+4*s+5));
>> ilaplace(F)
ans = -4*exp(-2*t)*cos(t)+2*exp(-2*t)*sin(t)+4

Which gives f(t),

−2t −2t
f (t) = [4 − 4e cos(t) + 2e sin(t)]u(t)

Making use of the trigonometric relationship,

x sin(α ) + y cos(α ) = R sin(α + β ) & x cos(α ) − y sin(α ) = R cos(α + β )


2 2
R= x +y & β = tan −1 ( y / x)

−2t o −2t o
 f(t) = [4 + 4.47e cos(t −153.4 )] u(t) = [4 - 4.47e cos(t +26.56 )]u(t)
Matlab often gives the inverse Laplace Transform in terms of sinhx and coshx. Using the
following definition one can rewrite the hyperbolic expression as a function of
exponentials:
e x  ex
sinh( x ) 
2

e x  ex
cosh( x ) 
2

Also, you may find the “Heaviside(t) function which corresponds to the unit step function
u(t): thus the function H(t) = heaviside(t) =0 for t<0 and H(t) = heaviside(t)=1 for t>0.

As an example, suppose that Matlab gives you the following result for the inverse
Laplace transforms:
2 heaviside(t-10) exp(-5/2t+25) sinh(1/2t-5)

This can be re-written, using the definition of the sinh(x) function:


e 0.5t 5  e 2.5t  5
f (t )  2u (t  10)e  2.5( t 10) ( )  (e  2 ( t 10)  e 3( t 10) )u (t  10)
2

This last expression is closer to what your hand calculations will give you for the inverse
Laplace Transform.

HOW TO FIND THE TRANSFER FUNCTION


The Laplace Transform allows a linear equation to be converted into a polynomial.  The
most useful property of the Laplace Transform for finding the transfer function is the
differentiation theorem.  Several properties are shown below:

  Time Domain Frequency Domain

Linearity f(t) + g(t)

Function x(t)

1st Derivative x'(t)

2nd Derivative x"(t)

nth Derivative xn(t)

Note:  While linearity allows Laplace transforms to be added, the same does not hold true
for multiplication.  f(t)g(t) does not equal F(s)G(s).  The solution to multiplication requires
convolution.

In order to convert the time dependent governing equation to the frequency domain,
perform the Laplace Transform to the input and output functions and their derivatives. 
These transformed functions must then be substituted back into the governing equation
assuming zero initial conditions.  Because the transfer function is defined as the output
Laplace function over the input Laplace function, rearrange the equation to fit this form.

EXAMPLE
Find the transfer function of the second order system below:

f(t) - kx - bx' - mx" = 0

The notation of the Laplace Transform operation is L{ }.

 When finding the transfer function, ‘zero’ initial conditions must be assumed, so x(0) =
x'(0) = 0.

 Taking the Laplace Transform of the governing equation results in:

F(s) - k[X(s)] - b[sX(s)] - m[s2X(s)] = 0

Collecting all the terms involving X(s) and factoring leads to:

[ms2 + bs + k] X(s) = F(s)

The transfer function is defined as the output Laplace Transform over the input Laplace
Transform, and so the transfer function of this second order system is:

X(s)/F(s) = 1/[ms2 + bs + k]

HOW TO INPUT THE TRANSFER FUNCTION INTO MATLAB

In order to enter a transfer function into MATLAB, the variables must be given numerical
value, because MATLAB cannot manipulate symbolic variables without the symbolic
toolbox.  Enter the numerator and denominator polynomial coefficients separately as
vectors of coefficients of the individual polynomials in descending order.   The syntax for
defining a transfer function in MATLAB is:

transferfunction = tf(num, den)

Where num is defined as the vector of numerator coefficients, and den is defined as the
vector of denominator coefficients.
EXAMPLE

Input the transfer function X(s)/F(s) = 1/[ms2 + bs + k] into MATLAB:

For illustration purposes, this example uses m = 2, b = 5, and k = 3.

>> m = 2; b = 5; k = 3;
>> num = [ 1 ]; den = [ m b k ];
>> f = tf(num, den)

MATLAB will assign the transfer function under the name ‘f’, and output the following:
        1
Transfer function: ---------------
2 s^2 + 5 s + 3

STEP RESPONSE USING THE TRANSFER FUNCTION

Once the transfer function is entered into MATLAB it is easy to calculate the response to a
step input. To calculate the response to a unit step input, use:

step(u * f); where u is the magnitude of the step and  ‘f’ is the name of the transfer function
of the system.

EXAMPLE

Find the unit step response and the step response when u = 4 of ‘f’ using MATLAB:

>> u = 4; step(u * f)

The MATLAB output will be the following plot of the step response:
IMPULSE RESPONSE USING THE TRANSFER FUNCTION 

MATLAB can also plot the impulse response of a transfer function.  Because the transfer
function is in the form of output over input, the transfer function must be multiplied by the
magnitude of the impulse.  The syntax for plotting the impulse response is: 

impulse(u * f); where u is the magnitude of the impulse and  ‘f’ is the name of the transfer
function of the system.

EXAMPLE

Find the impulse response of  ‘f’ with an input of u = 2 using MATLAB:

>> u = 2; impulse(u * f)

The MATLAB output will be the following plot of the impulse response:
BODE PLOT USING THE TRANSFER FUNCTION

MATLAB’s bode command plots the frequency response of a system as a bode plot.  The
syntax for the bode plot function in MATLAB is:

bode(f); where ‘f’ is the name of the transfer function system.

EXAMPLE

Find bode plot of the frequency response of the system ‘f’ using MATLAB:

>> bode(f)

The MATLAB output will be the following bode plot of the frequency response:

 
Some more examples for Furrier Transform & Laplace Transform

F = fourier(f), F = fourier(f,v), F = fourier(f,u,v)

f = ifourier(F), f = ifourier(F,u), f = ifourier(F,v,u)

F= laplace(f), laplace(f, t), laplace(f, w, z)

f = ilaplace(F), f = ilaplace(F,y), F = ilaplace(F,y,x)

Note: f = fourier(F,u) makes f a function of u instead of the default x.

Examples:

Fourier Transform MATLAB Commands

syms x;
f = exp(-x^2);
fourier(f)

ans =
pi^(1/2)/exp(w^2/4)
syms w;
g = exp(-abs(w));
fourier(g)
Fourier Transform MATLAB Commands

ans =
2/(v^2 + 1)

syms x u;
f = x*exp(-abs(x));
fourier(f,u)

ans =
-(4*i*u)/(u^2 + 1)^2
syms v u; syms x real; %syms x v u
f = exp(-x^2*abs(v))*sin(v)/v;
fourier(f,v,u)
ans =
-atan((u-1)/x^2)+atan((u+1)/x^2)

>> pretty(ans)
u-1 u+1
-atan(-----) + atan(-----)
2 2
x~ x~
Note: ‘x~‘means for condition (x<>0), since at x=0 the arctangent is infinity.

Inverse Fourier Transform MATLAB Commands

syms a w real;
f = exp(-w^2/(4*a^2));
F = ifourier(f);
F = simple(F)

F=
abs(a)/(pi^(1/2)*exp(a^2*x^2))
syms x real;
g = exp(-abs(x));
ifourier(g)

ans =
1/(pi*(t^2 + 1))
syms w t real;
f = 2*exp(-abs(w)) - 1;
simplify(ifourier(f,t))
Inverse Fourier Transform MATLAB Commands

ans =
2/(pi*(t^2 + 1)) - dirac(t)

Note: dirac(t) is  (t )

Laplace Transform MATLAB Command

f(t) = t4 syms t;
f = t^4;
laplace(f)

ans =
24/s^5
syms s;
g = 1/sqrt(s);
laplace(g)

ans =
pi^(1/2)/t^(1/2)

f(t) = e–at syms t a x;


f = exp(-a*t);
laplace(f,x)

ans =
1/(a + x)

Inverse Laplace Transform MATLAB Command

syms s;
f = 1/s^2;
ilaplace(f)

ans =
=t t

syms a t;
g = 1/(t-a)^2;
ilaplace(g)
Laplace Transform MATLAB Command

ans =
= xe ax x*exp(a*x)

syms x u;
syms a real;
f = 1/(u^2-a^2);
simplify(ilaplace(f,x))

ans =
sinh(a*x)/a

Here's a table of some basic Laplace transforms.


function Laplace

1 1/s
eat 1/ (s-a)

tn n! / s (n + 1)

tp, p >-1 Γ(p + 1) / s (p + 1)

sin at a / (s 2
+ a 2
)

cos at s / (s 2
+ a 2
)

sinh at a / (s 2
- a 2
)

cosh at s / (s 2
- a 2
)

e at
sin bt b / [ (s-a) 2
+ b 2
]

e at
cos bt (s - a) / [ (s-a) 2
+ b 2
]

tneat n! / (s - a) (n + 1)

uc(t) e -cs
/ s

uc(t)f(t-c) e-csF(s)

ect f(t) F(s - c)

f(ct) 1/c F(s/c)

∫0tf(t-τ)g(τ)dτ F(s)*G(s)

δ(t - c) e-cs

f(n)(t) snF(s)-sn-1f(0)-...-f(n - 1)
(0)

(-t)nf(t) F(n)(s)

You might also like