You are on page 1of 45

1

Control Systems Engineering


ECE 563
07092003
SOLUTION TO
LINEAR DIFFERENTIAL EQUATIONS WITH
CONSTANT-COEFFICIENTS (LCCDE)
BY LAPLACE TRANSFORM
J.M.Martinez, Jr.
School of EE-ECE-CoE
Mapa Institute of Technology
Laplace Transform of Common
Functions
First-Shifting Theorem
Other Laplace Transform Pairs
Laplace Transform of Derivatives
and Integral of Functions
Cover-up Method
(Residue Theorem)
Inverse Laplace Transform by
Partial Fraction Expansion
Determination of Residues by
Cover-up Method
Determination of Residues by
Equating Coefficients of the
Numerator
Using Matlab to solve LCCDE
2
LAPLACE TRANSFORM
Steps in Solving LCCDE using
Laplace Transform
1. Convert the differential equation to
Laplace Transform
(time domain s-domain).
2. Solve for Y(s) (isolate Y(s)).
3. Expand Y(s) into partial fractions.
4. Take the Inverse Laplace Transform of Y(s).
(s-domain time domain).
jmmartinezjr 07092003
3
LAPLACE TRANSFORM PAIRS
) (s F
t sin
1
) (t u
) (t
) (t f
t cos
2
1
s
t
a s
1
at
e
s
1
2 2

+ s
2 2
+ s
s
jmmartinezjr 07092003
4
LAPLACE TRANSFORM PAIRS
(FIRST-SHIFTING THEOREM)
) (s F
t e
at
sin
a s s
at
t f L t f e L

= )] ( [ )] ( [
) (t f
t e
at
cos
2
) (
1
a s
t e
at
2 2
) (

+ a s
2 2
) (
) (
+

a s
a s
jmmartinezjr 07092003
5
OTHER LAPLACE TRANSFORM PAIRS
) )( ( b s a s
a b
+ +

bt at
e e

) (
) (
2
a s s
b s a
+
+
) (s F
at
e

1
) (t f
) (
2
2
a s s
a
+
n
t
) ( a s s
a
+
at
e at

+ 1
1
!
+ n
s
n
) )( ( b s a s s
ab
+ +
bt at
e
b a
a
e
b a
b

+ 1
at
e
a
b a
bt
a
b a

|
.
|

\
|

+

jmmartinezjr 07092003
6
LAPLACE TRANSFORM PAIRS
(INTEGRAL & DERIVATIVES)
n
n
dt
t g d ) (
) (s F
dt
t dg ) (
) (t f
s
s G ) (


0
) ( d g
) (s sG
) (s G s
n
Note: All Initial Conditions are assumed zero.
jmmartinezjr 07092003
7
COVER-UP METHOD
| |
a s
s F a s R
=
= ) ( ) (
To find the constants (residues) of the partial
fraction expansion of rational functions we can
use Residue Theorem
jmmartinezjr 07092003
8
COVER-UP METHOD FOR
MULTIPLE ROOTS
| |
a s
n
k n
k n
k
s F a s
ds
d
k n
R
=

= ) ( ) (
)! (
1
where:
a = multiple roots
n = multiplicity of the roots
k = order of root = n, n-1, 3, 2, 1
jmmartinezjr 07092003
For multiple roots, Residue Theorem can be
expressed in the form
9
Example 1:
2
2
2
4 5
s
s Y s sY s Y s = + + ) ( ) ( ) (
Find the Total Solution to the Differential Equation
(Assume all initial conditions=0)
Solution: Converting the DE into Laplace
Transform, we have
t y
dt
dy
dt
y d
2 4 5
2
2
= + +
jmmartinezjr 07092003
10
Example 1:
Solving for Y(s)
4 5
2
2
2
+ +
=
s s
s
s Y ) (
simplifying
) )( (
) (
1 4
2
2
+ +
=
s s s
s Y
jmmartinezjr 07092003
11
Example 1:
Taking the Partial Fraction Expansion
) ( ) (
) )( (
) (
1 4
1 4
2
2 2
+
+
+
+ + =
+ +
=
s
D
s
C
s
B
s
A
s s s
s Y
Using cover-up method
24
1
1 4 4
2
1 4
2
4
2
4
2

=
+
=
+ +
+ =
=
) ( ) ( ) )( (
) (
s
s s s
s C
3
2
4 1 1
2
1 4
2
1
2
1
2
=
+
=
+ +
+ =
=
) ( ) ( ) )( (
) (
s
s s s
s D
jmmartinezjr 07092003
12
Example 1:
2
1
1 0 4 0
2
1 4
2
0
2
2
=
+ +
=
+ +
=
=
) )( (
) )( (
s
s s s
s A
Using cover-up method for multiple roots
0
2
0
2
2
4 5
2
1 4
2
1
1
= =
(
(

+ +
=
(
(

+ +
=
s s
s s
ds
d
s s s
s
ds
d
B
) ( ) )( (
) (
!
| |
8
5
5 4 2 5 2 4 5 2
2
0
2 2

= = + + + =

=

) ( ) ( ) ( ) (
s
s s s B
jmmartinezjr 07092003
13
Example 1:
) ( ) (
) (
1
3
2
4
24
1
8
5
2
1
2
+
+
+

+ =
s s s
s
s Y
substituting
t t
e e t t y

+ =
3
2
24
1
8
5
2
1
4
) (
taking the Inverse Laplace Transform
jmmartinezjr 07092003
14
Example 2:
4
40
2
2
2 2
2
+
= +
s
s
s
s Y s sY s Y s ) ( ) ( ) (
Find the Total Solution to the Differential Equation
(Assume all initial conditions=0)
Solution: Converting the DE into Laplace
Transform, we have
t t y
dt
dy
dt
y d
2 40 2 2
2
2
cos = +
jmmartinezjr 07092003
15
Example 2:
Solving for Y(s)
2
4
40
2
2
2 2
+
+

=
s s
s
s
s
s Y ) (
simplifying
) )( (
) (
2 4
8 2 40
2 2 2
2 3
+ +
+ +
=
s s s s
s s
s Y
jmmartinezjr 07092003
16
Example 2:
Taking the Partial Fraction Expansion, we have
4
2
4
1 2
2 4
8 2 40
2 2 2
2 2 2
2 3
+
+
+
+ + +

+

=
+ +
+ +
=
s
F
s
Es
s
D
s
C
s
B
s
A
s s s s
s s
s Y
) (
) (
) )( (
) (
jmmartinezjr 07092003
t F t E D Ct Be Ae t y
t t
2 2
2
sin cos ) ( + + + + + =

By taking the Inverse Laplace Transform,
y(t) is of the form
17
Example 2:
2
2 1 4 1 1
8 1 2 1 40
2 4
8 2 40
2 2
2 3
1
2 2
2 3
=
+ +
+ +
=
+ +
+ +
=
=
) )( ( ) (
) ( ) (
) )( (
s
s s s
s s
B
2
7
1 2 4 2 2
8 2 2 2 40
1 4
8 2 40
2 2
2 3
2
2 2
2 3

=
+
+ +
=
+
+ +
=
=
) )( ( ) (
) ( ) (
) )( (
s
s s s
s s
A
jmmartinezjr 07092003
solving for the residues using cover-up method
1
1 0 2 0 4 0
8 0 2 0 40
1 2 4
8 2 40
2
2 3
0
2
2 3
=
+ +
+ +
=
+ +
+ +
=
=
) )( )( (
) ( ) (
) )( )( (
s
s s s
s s
C
18
Example 2:
jmmartinezjr 07092003
0
2 3 4
2 3
0
2
2 3
8 4 2
8 2 40
1 2 4
8 2 40
1
1
=
=
(
(

+ + +
+ +
=
(
(

+ +
+ +
=
s
s
s s s s
s s
ds
d
D
s s s
s s
ds
d
D
) (
) )( )( (
!
0
2 2 3 4
2 3 2 3 2 2 3 4
8 4 2
4 4 3 4 8 2 40 4 120 8 4 2
=
(
(

+ + +
+ + + + + + + + +
=
s
s s s s
s s s s s s s s s s s
D
) (
) )( ( ) )( (
2
1
8
4 8 0 8
2


=
) (
) )( ( ) )( (
D
solving for the residues using cover-up method
19
Example 2:
12 4 2 2
1 2 2 2 2
8 2 2 2 40
1 2
8 2 40
2
2
2 3
2
2
2 3
j F j E
j j j
j j
s s s
s s
F Es
j s
= +
+
+ +
=
+
+ +
= +
=
) (
) )( ( ) (
) ( ) (
) )( (
12 4 2 2
1 2 2 2 2
8 2 2 2 40
1 2
8 2 40
2
2
2 3
2
2
2 3
j F j E
j j j
j j
s s s
s s
F Es
j s
+ = +
+
+ +
=
+
+ +
= +
=
) (
) )( ( ) (
) ( ) (
) )( (
jmmartinezjr 07092003
solving for the residues using cover-up method
20
Example 2:
substituting into the expression shown in slide 14
jmmartinezjr 07092003
24 4
8 4
j E j
F
=
=
Taking the sum and difference of the two expressions
will result into
6
2
=
=
E
F
t t t e e t y
t t
2 2 2 6
2
1
2
2
7
2
sin cos ) ( + =

21
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
jmmartinezjr 07092003
4
2
4
1 2
2 4
8 2 40
2 2 2
2 2 2
2 3
+
+
+
+ + +

+

=
+ +
+ +
=
s
F
s
Es
s
D
s
C
s
B
s
A
s s s s
s s
s Y
) (
) (
) )( (
) (
When the denominator contains complex roots, determining
the residues is more difficult because we have to evaluate
complex expressions.
We can eliminate the need for complex number operations
by equating coefficients of each term in the numerator and
then solving the resulting system of linear equations.
22
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
4
2 2 s F E D C B A ) ( + + + + + +
3
2 2 2 4 4 s F E D C B A ) ( + + + + +
Expanding each term, and then grouping similar
terms we have
2
4 4 2 8 4 s F D C B A ) ( + + + +
5 2 3
8 2 40 s E D B A s s ) ( + + + = + +
) ( ) ( C s D C 8 8 4 + +
jmmartinezjr 07092003
23
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
By equating coefficients of similar terms we have
the following set of linear equations
) . ( 1 0 eq E D B A = + + +
) . ( 2 0 2 2 eq F E D C B A = + + + + +
) . ( 3 40 2 2 2 4 4 eq F E D C B A = + + + +
) . ( 4 2 4 4 2 8 4 eq F D C B A = + + +
) . ( 5 0 8 4 eq D C =
) . ( 6 8 8 eq C =
jmmartinezjr 07092003
24
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(

8
0
2
40
0
0
0 0 0 8 0 0
0 0 8 4 0 0
4 0 4 2 8 4
2 2 2 1 4 4
2 1 1 1 2 1
0 1 1 0 1 1
F
E
D
C
B
A
In matrix form
jmmartinezjr 07092003
25
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
Using Cramers Rule or other methods for system
of linear equations
2
6
2
1
1
2
2
7
=
=
=
=
=
=
F
E
D
C
B
A
jmmartinezjr 07092003
26
(Alternative Solution to Example 2)
Determination of Residues by Equating Coefficients
Solving a large number simultaneous linear equations
is difficult!
If we already knew A, B, C, D using cover-up method,
we only need two of the six equations to solve for E and
F. Using eq.(1) and eq.(2) we have
jmmartinezjr 07092003
6
2
7
2
2
7
= + + = = D B A E
2
2
6
2
1
1 2 2
2
7
2
2
=
+
=

=
) ( ) (
E D C B A
F
27
Example 3:
Determine the Inverse Laplace Transform of the
function
Solution: By completing the square of the expression
) ( ) (
) (
25 6 1
72 36 4
2 2
2 3
+
+
=
s s s
s s - s
s Y
jmmartinezjr 07092003
25 6
2
+ s s
we have
2 2
2 2 2 2
4 3
3 25 3 6 25 6
+ =
+ + = +
) (
) ( ) (
s
s s s s
28
Example 3:
Taking the Partial Fraction Expansion of
Y(s), we obtain
jmmartinezjr 07092003
2 2 2 2 2
4 3
4
4 3
3
1
1 +
+
+

+

=
) (
) (
) (
) (
) (
) (
) (
s
D
s
s C
s
B
s
A
s Y
Using cover-up method
2
25 1 6 1
1 72 1 36 1 4
25 6
72 36 4
2
2 3
1
2
2 3
=
+
+
=
+
+
=
=
) ( ) (
) ( ) ( ) (
) (
-
s s
s s - s
A
s
29
Example 3:
jmmartinezjr 07092003
Using cover-up method
1
25 1 6 1
6 1 2 1 72 1 36 1 4 72 1 72 1 12 25 1 6 1
25 6
6 2 72 36 4 72 72 12 25 6
25 6
72 36 4
1
1
2 2
2 3 2 2
1
2 2
2 3 2 2
1
2
2 3
=
+
+ + +
=
+
+ + +
=
(
(

+
+
=
=
=
B
- -
s s
s s s - s s - s s s
s s
s s - s
ds
d
B
s
s
] ) ( ) [(
] ) ( )][ ( ) ( ) ( [ ] ) ( ) ( ][ ) ( [
) (
) )( ( ) )( (
) (
!
30
Example 3:
Expanding each term of the numerator
jmmartinezjr 07092003
2 2
2 2 2 3
1 4 1 3
25 6 1 25 6 72 36 4
) ( ) )( (
) )( ( ) (
+ +
+ + + = +
s D s s C
s s s B s s A s s - s
) ( ) (
) ( ) (
D C B A s D C B A
s D C B A s C B s s - s
4 3 25 25 8 7 31 6
4 5 7 72 36 4
2 3 2 3
+ + + + +
+ + + = +
and then grouping similar terms we have
31
Example 3:
equating coefficients of s
3
to solve for C
jmmartinezjr 07092003
4 = +C B
3
1 4
4
=
=
=
C
C
B C
equating coefficients of s
2
to solve for D
36 4 5 7 = + D C B A
4
4
3 5 1 7 2 36
4
5 7 36
=
+ +
=
+ +
=
D
D
C B A
D
) ( ) (
32
Example 3:
jmmartinezjr 07092003
t De t Ce Be Ate t y
t t t t
4 4
3 3
sin cos ) ( + + + =
By taking the Inverse Laplace Transform of
we have
2 2 2 2 2
4 3
4
4 3
3
1
1 +
+
+

+

=
) (
) (
) (
) (
) (
) (
) (
s
D
s
s C
s
B
s
A
s Y
t e t e e te t y
t t t t
4 4 4 3 2
3 3
sin cos ) ( + + =
Substituting the values of A,B,C, and D
33
MATLAB IMPLEMENTATION
Partial Fraction Expansion of polynomial
given the Coefficients of Numerator num and
Denominator den
[R,P,K]=residue(num,den)
where:
R=residues (numerator)
P=poles i.e (s-p
1
)(s-p
2
)
K=direct term (null if order of num<den)
jmmartinezjr 07092003
34
>> num=[4];
>> den=[1 4 5 2];
>> [R,P,K]=residue(num,den)
R =
4.0000
-4.0000
4.0000
P =
-2.0000
-1.0000
-1.0000
K =
[]
MATLAB IMPLEMENTATION
2
) 1 (
4
) 1 (
4
2
4
) (
+
+
+

+
+
=
s s s
s Y
Example 1: Find the partial fraction expansion of
2 5 4
4
) (
2 3
+ + +
=
s s s
s Y
Y(s) can be written as
Multiple poles should be written
in increasing order
jmmartinezjr 07092003
35
>> num=[-40 2 0 8];
>> den= poly([0 0 2i -2i -2 1]);
>> [R,P,K]=residue(num,den)
R =
3.0000 + 1.0000i
3.0000 - 1.0000i
-3.5000
-2.0000
-0.5000
-1.0000
P =
0.0000 + 2.0000i
0.0000 - 2.0000i
-2.0000
1.0000
0
0
MATLAB IMPLEMENTATION
Example 2: Find the partial fraction expansion of
) )( (
) (
2 4
8 2 40
2 2 2
2 3
+ +
+ +
=
s s s s
s s
s Y
jmmartinezjr 07092003
K =
[ ]
>> E=R(1)+R(2) %E in Ex.2
E =
6.0000
>> F=i*(R(1)-R(2)) %F in Ex.2
F =
-2.0000
36
>> num=[4 -36 72 0];
>> den=conv([1 -6 25],poly([1 1]));
>> [R,P,K]=residue(num,den)
R =
1.5000 + 2.0000i
1.5000 - 2.0000i
1.0000
2.0000
P =
3.0000 + 4.0000i
3.0000 - 4.0000i
1.0000
1.0000
K =
[]
MATLAB IMPLEMENTATION
Example 3: Find the partial fraction expansion of
) ( ) (
) (
25 6 1
72 36 4
2 2
2 3
+
+
=
s s s
s s - s
s Y
jmmartinezjr 07092003
>> C=R(1)+R(2)
% C in Example 3
C =
3.0000
>> D=i*(R(1)-R(2))
% D in Example 3
D =
-4.0000
37
MATLAB IMPLEMENTATION
Using MatLab Symbolic Toolbox we can find the
solution to LCCDE by
syms s t
First creating symbolic variables s and t using the command
Then, converting time functions into Laplace
Transform using the command
laplace(F)
And finally, taking the Inverse Laplace Transform
using the command
ilaplace(F)
jmmartinezjr 07092003
38
MATLAB IMPLEMENTATION
Example 4:
Find the Total Solution of the Differential Equation
(Assume all initial conditions=0)
Solution: First, take the Laplace Transform of
t t y
dt
dy
dt
y d
2 cos 40 2 2
2
2
= +
t t t f 2 cos 40 2 ) ( =
>>F=laplace(2*t-40*cos(2*t))
F =
2/s^2-40*s/(s^2+4)
jmmartinezjr 07092003
39
MATLAB IMPLEMENTATION
Example 4:
Then solve for Y(s) by dividing F(s) with the
auxiliary polynomial derived from the left side of
the D.E.
>>Y=F/(s^2+s-2)
Y =
(2/s^2-40*s/(s^2+4))/(s^2+s-2)
jmmartinezjr 07092003
40
MATLAB IMPLEMENTATION
Example 4:
Finally, convert Y(s) to y(t)
>> y=ilaplace(Y)
y =
-t-1/2-7/2*exp(-2*t)- 2*exp(t)
+ 6*cos(2*t)-2*sin(2*t)
Note: Matlab variables are case sensitive, so y is
different from Y
jmmartinezjr 07092003
41
MATLAB IMPLEMENTATION
(Other useful Matlab Functions )
dsolve(D.E.,initial cond.,ind.var.)
Function dsolve computes symbolic solutions to
ordinary differential equations.
The equations are specified by symbolic expressions
containing the letter D to denote differentiation.
The symbols D2, D3, ... DN, correspond to the
second, third, ..., Nth derivative, respectively. Thus,
D2y is the Symbolic Math Toolbox equivalent of .
2
2
dt
y d
jmmartinezjr 07092003
42
MATLAB IMPLEMENTATION
(Other useful Matlab Functions )
Example 5:
>> dsolve('D2y=-Dy+2*y+2*t-40*cos(2*t)','y(0)=0','Dy(0)=0', 't')
ans =
-t-13/2+12*cos(t)^2-4*cos(t)*sin(t)-2*exp(t)-7/2*exp(-2*t)
Find the Total Solution of the Differential
Equation (All initial conditions=0)
t t y
dt
dy
dt
y d
2 cos 40 2 2
2
2
= +
Solution:
jmmartinezjr 07092003
43
Example 5:
t t
e e t t t t t y
2 2
2
7
2 sin cos 4 cos 12
2
13
) (

+ =
t t
e e t t t t y
2
2
7
2 2 sin 2 2 cos 6
2
1
) (

+ =
t
t
t 2 cos 6 6
2
) 2 cos( 1
12 cos 12
2
+ =
+
=
The Total Solution
can also be written as
by considering that
t
t
t t 2 sin 2
2
) 2 sin(
4 sin cos 4 = =
jmmartinezjr 07092003
44
MATLAB IMPLEMENTATION
(Other useful Matlab Functions )
pretty(F)
The pretty function prints symbolic output in
a format that resembles typeset mathematics.
>> syms s t
>> y=ilaplace(4/(s^3+4*s^2+5*s+2))
y =
4*exp(-2*t)+4*t*exp(-t)-4*exp(-t)
>> pretty(y)
4 exp(-2 t) + 4 t exp(-t) - 4 exp(-t)
Difficult to read?
Better!
jmmartinezjr 07092003
45
REFERENCES:
Elementary Differential Equations,
7
th
edition,by Rainville E.D.,and Bedient P.E.
Schaums Outline Series Feedback
and Control Systems, 2
nd
edition, by
DiStefano III, J.J., Stubberud A.R., and
Williams I.J.
Control Systems Engineering, 3
rd
edition, by Nise N.S.
jmmartinezjr 07092003
2
nd
Revision: 08202007

You might also like