You are on page 1of 41

SOLUTION TO

LINEAR DIFFERENTIAL
EQUATIONS WITH
CONSTANT-COEFFICIENTS
(LCCDE)
BY LAPLACE TRANSFORM
jmmartinezjr
07092003
1
jmmartinezjr 07092003

TOPIC OBJECTIVES
To be able to:

• Take the Laplace Transform of time-


domain functions analytically or using
Matlab laplace command.
• Take the Inverse Laplace Transform of
s-domain functions analytically or using
Matlab ilaplace command.
• Take the Partial Fraction Expansions
of rational functions analytically or using
Matlab residue command.
2
jmmartinezjr 07092003

LAPLACE TRANSFORM
Steps in Solving LCCDE using
Laplace Transform

1. Convert the differential equation to


Laplace Transform
(time domain Æ s-domain).
1. Solve for Y(s) (isolate Y(s)).
2. Expand Y(s) into partial fractions.
3. Take the Inverse Laplace Transform of Y(s).
(s-domain Æ time domain).
3
jmmartinezjr 07092003

LAPLACE TRANSFORM PAIRS


f (t ) F (s )
δ (t ) 1
1
u (t ) s
at 1
e s−a
1
t s2
ω
sin ωt s2 + ω 2
cos ωt s
s2 + ω 2 4
jmmartinezjr 07092003

LAPLACE TRANSFORM PAIRS


(FIRST-SHIFTING THEOREM)
L[e f (t )] = L[ f (t )]s → s − a
at

f (t ) F (s )
at 1
e t (s − a) 2
ω
e sin ωt
at
( s − a) + ω
2 2

( s − a)
e cos ωt
at
( s − a) 2 + ω 2 5
jmmartinezjr 07092003

OTHER LAPLACE TRANSFORM PAIRS


f (t ) F (s )
n n!
t s n +1
− at a
1− e s( s + a)
− at − bt b−a
e −e ( s + a )( s + b)

− at a2
at −1 + e
s 2 ( s + a)
a −b  a − b  − at a ( s + b)
+ bt −  e
a  a  s 2 ( s + a)
b − at a −bt ab
1+ e − e 6
a −b a −b s ( s + a )( s + b)
jmmartinezjr 07092003

LAPLACE TRANSFORM PAIRS


(INTEGRAL & DERIVATIVES)
f (t ) F (s )
τ
G(s)
∫ g (τ )dτ
0 s
dg (t )
sG (s )
dt
d n g (t )
s nG (s )
dt n

Note: All Initial Conditions were assumed zero.


7
jmmartinezjr 07092003

Example 1:
Find the Total Solution of the Differential
Equation (Assume all initial conditions=0)
2
d y dy
2
+ 5 + 4 y = 2t
dt dt
Solution: First, we will convert the D.E.
into Laplace Transform
2
s Y ( s ) + 5sY ( s ) + 4Y ( s ) = 2
2

s
8
jmmartinezjr 07092003

Example 1:
Solving for Y(s)
2
2
Y (s) = 2 s
s + 5s + 4

simplifying

2
Y ( s) = 2
s ( s + 4)( s + 1)
9
jmmartinezjr 07092003

Example 1:
Taking the Partial Fraction Expansion
2 A B C D
Y (s) = 2 = 2+ + +
s ( s + 4)( s + 1) s s ( s + 4) ( s + 1)

Using cover-up method (see slide 22)


2 2 −1
C = ( s + 4) 2 = =
s ( s + 4)( s + 1) s = −4 (−4) (−4 + 1) 24
2

2 2 2
D = ( s + 1) 2 = =
s ( s + 4)( s + 1) s = −1 (−1) (−1 + 4) 3
2
10
jmmartinezjr 07092003

Example 1:
Using cover-up method
2 2 1
A=s 2 2
= =
s ( s + 4)( s + 1) s =0 (0 + 4)(0 + 1) 2

1 d  2 2  d  2 
B=  (s ) 2  =  2 
1! ds  s ( s + 4)( s + 1)  s =0 ds  ( s + 5s + 4)  s =0

[ −2
B = − 2( s + 5s + 4) (2 s + 5)
2
] s =0
−2
= −2(4) (5) =
−5
8

11
jmmartinezjr 07092003

Example 1:
substituting
1 −5 −1 2
Y ( s ) = 22 + 8 + 24 + 3
s s ( s + 4) ( s + 1)

taking the Inverse Laplace Transform


1 5 1 − 4t 2 −t
y (t ) = t − − e + e
2 8 24 3
12
jmmartinezjr 07092003

Example 2:
Find the Total Solution of the Differential
Equation (Assume all initial conditions=0)
2
d y dy
2
+ − 2 y = 2t − 40 cos 2t
dt dt
Solution: First, we will convert the D.E.
into Laplace Transform
2 s
s Y ( s ) + sY ( s ) − 2Y ( s ) = 2 − 40 2
2

s s +4
13
jmmartinezjr 07092003

Example 2:
Solving for Y(s)
2 s
− 40 2
Y (s) = s 2
s + 4
s +s−2
2

simplifying
− 40 s 3 + 2 s 2 + 8
Y (s) = 2 2
s ( s + 4)( s 2 + s − 2)
14
jmmartinezjr 07092003

Example 2:
Taking the Partial Fraction Expansion

− 40 s 3 + 2 s 2 + 8
Y (s) = 2 2
s ( s + 4)( s + s − 2)
2

A B C D E F
= 2+ + + + +
s s (s − j2) (s + j2) s − (−2) s −1
15
Example 2:
jmmartinezjr 07092003

solving for A,B,C,D,E, and F.


− 40 s 3 + 2 s 2 + 8
s 2 ( s − j 2)( s + j 2)( s + 2)( s − 1)
A B C D E F
= 2 + + + + +
s s (s − j2) (s + j2) s+ 2 s −1
by cover-up method:
− 40 s 3
+ 2 s 2
+8
A=s 2
2

s ( s − j 2)( s + j 2)( s + 2)( s − 1) s =0

− 40(0) 3 + 2(0) 2 + 8
= = −1
(0 − j 2)(0 + j 2)(0 + 2)(0 − 1) 16
jmmartinezjr 07092003

Example 2:
1 d  2 − 40 s 3 + 2 s 2 + 8 
B= s 2 
1! ds  s ( s − j 2)( s + j 2)( s + 2)( s − 1)  s =0

d  − 40 s 3 + 2 s 2 + 8 
=  4 3 
ds  ( s + s + 2 s 2 + 4 s − 8)  s =0

 ( s 4 + s 3 + 2 s 2 + 4 s − 8)(−120 s 2 + 4 s ) − (−40 s 3 + 2 s 2 + 8)(4s 3 + 3s 2 + 4 s + 4) 


B= 
 ( s 4
+ s 3
+ 2 s 2
+ 4 s − 8) 2
 s =0

(−8)(0) − (8)(4) − 1
B= =
(−8) 2
2 17
jmmartinezjr 07092003

Example 2:
− 40 s 3 + 2s 2 + 8 − 40 s 3 + 2s 2 + 8
C = ( s − j 2) 2 = 2
s ( s − j 2)( s + j 2)( s + 2)( s − 1) s = j 2 s ( s + j 2)( s + 2)( s − 1) s = j 2

− 40( j 2) 3 + 2( j 2) 2 + 8
= = 3+ j
( j 2) ( j 2 + j 2)( j 2 + 2)( j 2 − 1)
2

− 40 s 3 + 2 s 2 + 8 − 40 s 3 + 2 s 2 + 8
D = ( s + j 2) 2 = 2
s ( s − j 2)( s + j 2)( s + 2)( s − 1) s = − j 2 s ( s − j 2)( s + 2)( s − 1) s = − j 2

− 40(− j 2) 3 + 2(− j 2) 2 + 8
= = 3− j
(− j 2) (− j 2 − j 2)(− j 2 + 2)(− j 2 − 1)
2
18
jmmartinezjr 07092003

Example 2:
− 40 s 3 + 2 s 2 + 8 − 40 s 3 + 2 s 2 + 8
E = ( s + 2) 2 = 2
s ( s − j 2)( s + j 2)( s + 2)( s − 1) s = −2 s ( s − j 2)( s + j 2)( s − 1) s = −2

− 40(−2) 3 + 2(−2) 2 + 8 −7
== =
(−2) 2 (−2 − j 2)(−2 + j 2)(−2 − 1) s = −2 2

− 40 s 3 + 2 s 2 + 8 − 40 s 3 + 2 s 2 + 8
F = ( s − 1) 2 = 2
s ( s − j 2)( s + j 2)( s + 2)( s − 1) s =1 s ( s − j 2)( s + j 2)( s + 2) s =1

− 40(1) 3 + 2(1) 2 + 8
= 2 = −2
(1) (1 − j 2)(1 + j 2)(1 + 2) s =1
19
jmmartinezjr 07092003

Example 2:
from slide 15

A B C D E F
= 2+ + + + +
s s (s − j2) (s + j2) s − (−2) s −1

substituting the computed residues


1 7
− −
−1 2 3 + j 3 − j 2 −2
Y ( s) = 2 + + + + +
s s ( s − j 2) ( s + j 2) s + 2 s − 1
20
jmmartinezjr 07092003

Example 2:
taking the Inverse Laplace
1 − j 2t 7 − 2t
Y (t ) = −t − + (3 + j )e + (3 − j )e
j 2t
− e − 2e t

2 2

or

1 7 − 2t
y (t ) = −t − + 6 cos 2t − 2 sin 2t − e − 2e t
2 2
21
jmmartinezjr 07092003

COVER-UP METHOD

Use to find the constants (residues) of the partial


fraction expansion of rational functions

R = [(s − a) F (s)] s =a

See Examples 1 and 2


22
jmmartinezjr 07092003

COVER-UP METHOD FOR


MULTIPLE ROOTS

[ ]
n−k
1 d
Rk = n−k
( s − a ) n
F ( s )
(n − k )! ds s =a

where:
a = multiple root
n = multiplicity of the roots
k = order of root=n,n-1,…3,2,1
23
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
MatLab can find the solution to LCCDE using
Symbolic Toolbox
First create symbolic variables s and t
syms s t
Then, convert time functions into
Laplace Transform using
laplace(F)
Finally, take the Inverse Laplace Transform using
ilaplace(F) 24
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
Example:
Find the Total Solution of the Differential
Equation (Assume all initial conditions=0)
2
d y dy
2
+ − 2 y = 2t − 40 cos 2t
dt dt
Solution: First, we will convert f (t ) = 2t − 40 cos 2t
into Laplace Transform
>>f=laplace(2*t-40*cos(2*t))
f =

2/s^2-40*s/(s^2+4) 25
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
Example:
Then we will solve for Y(s) by dividing f(t)
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)

26
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
Example:
Finally, we will 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 27
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
(Other useful Matlab Functions )

Partial Fraction Expansion of polynomials given


the Coefficients of Numerator B and Denominator A

[R,P,K]=residue(B,A)

where:
R=residues (numerator)
P=poles i.e (s-p1)(s-p2)…
K=direct term (null if order of B < A) 28
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
Example: Find the partial fraction expansion of
4
Y (s) = 3
s + 4 s 2 + 5s + 2
>> B=[4];
>> A=[1 4 5 2]; Y(s) can be written as
>> [R,P,K]=residue(B,A)
R = 4 −4 4
Y ( s) = + +
4.0000 s + 2 ( s + 1) ( s + 1) 2
-4.0000
4.0000
P =
-2.0000 Multiple poles should be written
-1.0000 like this
-1.0000
K =
29
[]
jmmartinezjr 07092003

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! 30
jmmartinezjr 07092003

Determination of (constants)
residues by equating
coefficients
Instead of expanding Y(s) as shown in slide 15,
we will use the following expansion

− 40 s + 2 s + 8
3 2
Y (s) = 2 2
s ( s + 4 )( s + s − 2 )
2

A B Cs + D E F
= 2+ + 2 + +
s s s + 4 s + 2 s −1 31
jmmartinezjr 07092003

Determination of (constants)
residues by equating coefficients
To solve for the other constants, we will
equate coefficients
Expanding each term, then grouping similar terms
− 40s + 2s + 8 = ( B + C + E + F ) s
3 2 5

+ ( A + B + C + D − E + 2F )s 4

+ ( A + 2 B − 2C + D + 4 E + 4 F ) s 3
+ (2 A + 4 B − 2 D − 4 E + 8F ) s 2

+ (4 A − 8 B) s + (−8 A) 32
jmmartinezjr 07092003

Determination of residues by
equating coefficients
We will came up with the following equalities
B+C + E + F = 0 (eq.1)
A + B + C + D − E + 2F = 0 (eq.2)
A + 2 B − 2C + D + 4 E + 4 F = −40 (eq.3)
2 A + 4 B − 2 D − 4 E + 8F = 2 (eq.4)
4 A − 8B = 0 (eq.5)
− 8A = 8 (eq.6) 33
jmmartinezjr 07092003

Determination of residues by
equating coefficients
In matrix form
0 1 1 0 1 1  A   0 
1 1 1 1 − 1    
2  B   0  

1 2 −2 1 4 4  C  − 40
   =  
2 4 0 −2 −4 8  D   2 
 4 −8 0 0 0 0  E   0 
    
− 8 0 0 0 0 0  F   8 
34
jmmartinezjr 07092003

Determination of residues by
equating coefficients
Using Cramer’s Rule or other methods for
system of linear equations
A = −1
1
B=−
2
C =6
D = −4
7
E=−
2
F = −2 35
jmmartinezjr 07092003

Determination of residues by
equating coefficients
from slide 31

A B Cs + D E F
= 2+ + 2 + +
s s s + 4 s + 2 s −1

substituting
1 7
− −
−1 2 6s − 4 2 −2
Y ( s ) == 2 + + 2 + +
s s s + 4 s + 2 s −1
36
jmmartinezjr 07092003

Determination of residues by
equating coefficients

Taking the Inverse Laplace Transform

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

2 2

37
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
(Other useful Matlab Functions )
dsolve(‘D.E.’,’initial cond.’,’ind.var.’)
•The 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 d 2
y.
238
dt
jmmartinezjr 07092003

MATLAB IMPLEMENTATION
(Other useful Matlab Functions )
Example:
Find the Total Solution of the Differential
Equation (All initial conditions=0)
2
d y dy
2
+ − 2 y = 2t − 40 cos 2t
dt dt
Solution:
>> 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)
39
jmmartinezjr 07092003

Example:
The Total Solution
13 7 − 2t
y (t ) = −t − + 12 cos t − 4 cos t sin t − 2e − e
2 t

2 2
can also be written as
1 7 − 2t
y (t ) = −t − + 6 cos 2t − 2 sin 2t − 2e − e
t

2 2

by considering that
1 + cos(2t ) sin(2t )
12 cos t = 12
2
= 6 + 6 cos 2t − 4 cos t sin t = −4 = −2 sin 2t
2 2
40
jmmartinezjr 07092003

REFERENCES:
• Elementary Differential Equations,
7thedition,by Rainville E.D.,and Bedient P.E.
• Schaum’s Outline Series “Feedback
and Control Systems”, 2nd edition, by
DiStefano III, J.J., Stubberud A.R., and
Williams I.J.
• Control Systems Engineering, 3rd
edition, by Nise N.S.
41

You might also like