L03-Rev2-LCCDE-LaplaceTransform.pdf

Preview:

DESCRIPTION

laplace v2

Citation preview

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

Mapúa 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

)(sF

tωsin

1

)(tu

)(tδ)(tf

tωcos

2

1st

as −1ates1

22 ωω+s

22 ω+ss

jmmartinezjr 07092003

4

LAPLACE TRANSFORM PAIRS (FIRST-SHIFTING THEOREM)

)(sF

teat ωsin

assat tfLtfeL −→= )]([)]([

)(tf

teat ωcos

2)(1as −teat

22)( ωω+− as

22)()(ω+−

−as

as

jmmartinezjr 07092003

5

OTHER LAPLACE TRANSFORM PAIRS

))(( bsasab++

−btat ee −− −

)()(

2 assbsa

++

)(sF

ate−−1

)(tf

)(2

2

assa+

nt

)( assa+

ateat −+−1

1

!+ns

n

))(( bsassab

++btat e

baae

bab −−

−−

−+1

atea

babta

ba −

−+−

jmmartinezjr 07092003

6

LAPLACE TRANSFORM PAIRS (INTEGRAL & DERIVATIVES)

n

n

dttgd )(

)(sF

dttdg )(

)(tf

ssG )(∫

τ

ττ0

)( dg

)(ssG

)(sGsn

Note: All Initial Conditions are assumed zero.

jmmartinezjr 07092003

7

COVER-UP METHOD

[ ]as

sFasR=

−= )()(

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

[ ]as

nkn

kn

k sFasdsd

knR

=−

−−

= )()()!(

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:

22 2

45s

sYssYsYs =++ )()()(

Find the Total Solution to the Differential Equation (Assume all initial conditions=0)

Solution: Converting the DE into LaplaceTransform, we have

tydtdy

dtyd

2452

2

=++

jmmartinezjr 07092003

10

Example 1:Solving for Y(s)

45

2

2

2

++=

ssssY )(

simplifying

))(()(

14

22 ++

=sss

sY

jmmartinezjr 07092003

11

Example 1:

Taking the Partial Fraction Expansion

)()())(()(

1414

222 +

++

++=++

=sD

sC

sB

sA

ssssY

Using cover-up method

24

1

144

2

14

24

24

2

−=

+−−=

+++=

−= )()())(()(

sssssC

3

2

411

2

14

21

21

2=

+−−=

+++=

−= )()())(()(

sssssD

jmmartinezjr 07092003

12

Example 1:

2

1

1040

2

14

2

02

2 =++

=++

==

))(())(( sssssA

Using cover-up method for multiple roots

02

02

2

45

2

14

2

1

1

==

++=

++=

ssssds

dsss

sdsdB

)())(()(

!

[ ]8

554252452 2

0

22 −=−=+++−= −

=

− )()()()(s

sssB

jmmartinezjr 07092003

13

Example 1:

)()()(

13

2

424

1

8

5

2

1

2 ++

+

+

+=ssss

sY

substituting

tt eetty −− +−−=3

2

24

1

8

5

2

1 4)(

taking the Inverse Laplace Transform

jmmartinezjr 07092003

14

Example 2:

440

22

222

+−=−+

ss

ssYssYsYs )()()(

Find the Total Solution to the Differential Equation (Assume all initial conditions=0)

Solution: Converting the DE into LaplaceTransform, we have

ttydtdy

dtyd

240222

2

cos−=−+

jmmartinezjr 07092003

15

Example 2:Solving for Y(s)

24

402

2

22

−++

−=

sss

sssY )(

simplifying

))(()(

24

8240222

23

−++++−

=ssss

sssY

jmmartinezjr 07092003

16

Example 2:Taking the Partial Fraction Expansion, we have

4

2

412

24

8240

222

222

23

++

++++

−+

−−=

−++++−

=

sF

sEs

sD

sC

sB

sA

sssssssY

)()(

))(()(

jmmartinezjr 07092003

tFtEDCtBeAety tt 222 sincos)( +++++= −

By taking the Inverse Laplace Transform, y(t) is of the form

17

Example 2:

221411

812140

24

824022

23

122

23

−=++++−

=++++−

== ))(()(

)()())(( ssss

ssB

2

7

12422

822240

14

824022

23

222

23 −=

−−+−−+−+−−

=−+++−

=−= ))(()(

)()())(( ssss

ssA

jmmartinezjr 07092003

solving for the residues using cover-up method

1102040

802040

124

82402

23

02

23

−=−++++−

=−++++−

== ))()((

)()())()(( ssss

ssC

18

Example 2:jmmartinezjr 07092003

0234

23

02

23

842

8240

124

8240

1

1

=

=

−+++++−

=

−++++−

=

s

s

ssssss

dsdD

sssss

dsdD

)(

))()((!

02234

23232234

842

443482404120842

=

−++++++++−−+−−+++

=s

sssssssssssssssD

)())(())((

2

1

8

48082

−=

−−−

=)(

))(())((D

solving for the residues using cover-up method

19

Example 2:

12422

12222

822240

12

82402

2

23

22

23

jFjE

jjjjj

sssssFEs

js

−−=+−

−−+−−+−+−−

=−+++−

=+−=

)(

))(()()()(

))((

12422

12222

822240

12

82402

2

23

22

23

jFjE

jjjjj

sssssFEs

js

+−=+

−+++−

=−+++−

=+=

)(

))(()()()(

))((

jmmartinezjr 07092003

solving for the residues using cover-up method

20

Example 2:

substituting into the expression shown in slide 14

jmmartinezjr 07092003

244

84

jEjF

=−=

Taking the sum and difference of the two expressions will result into

6

2

=−=

EF

ttteety tt 22262

12

2

7 2 sincos)( −+−−−−= −

21

(Alternative Solution to Example 2)Determination of Residues by Equating Coefficients

jmmartinezjr 07092003

4

2

412

24

8240

222

222

23

++

++++

−+

−−=

−++++−

=

sF

sEs

sD

sC

sB

sA

sssssssY

)()(

))(()(

• 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

422 sFEDCBA )( +++++−+

322244 sFEDCBA )( +−++++

Expanding each term, and then grouping similar terms we have

244284 sFDCBA )( −+++−+

523 8240 sEDBAss )( +++=++−

)()( CsDC 884 −+−+

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

).( 10 eqEDBA =+++

).( 2022 eqFEDCBA =+++++−

).( 34022244 eqFEDCBA −=+−+++

).( 4244284 eqFDCBA =−+++−

).( 5084 eqDC =−

).( 688 eqC =−

jmmartinezjr 07092003

24

(Alternative Solution to Example 2)Determination of Residues by Equating Coefficients

−=

−−

−−−

8

0

2

40

0

0

000800

008400

404284

222144

211121

011011

FEDCBA

In matrix form

jmmartinezjr 07092003

25

(Alternative Solution to Example 2)Determination of Residues by Equating Coefficients

Using Cramer’s Rule or other methods for system of linear equations

2

62

11

22

7

−==

−=

−=−=

−=

FE

DCB

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

62

72

2

7=++=−−−= DBAE

22

62

1122

2

7

2

2−=

−+−−−−−=

−−−−=

)()(EDCBAF

27

Example 3:Determine the Inverse Laplace Transform of the

function

Solution: By completing the square of the expression

)()()(

2561

7236422

23

+−−+

=sss

ss-ssY

jmmartinezjr 07092003

2562 +− ss we have

22

2222

43

32536256

+−=

−++−=+−

)(

)()(

s

ssss

28

Example 3:Taking the Partial Fraction Expansion of

Y(s), we obtain

jmmartinezjr 07092003

22222 43

4

43

3

11 +−+

+−−

+−

+−

=)(

)()(

)()()(

)(s

Ds

sCs

Bs

AsY

Using cover-up method

225161

17213614

256

723642

23

12

23

=+−+

=+−+

== )()(

)()()()(

-ss

ss-sAs

29

Example 3:jmmartinezjr 07092003

Using cover-up method

1

25161

612172136147217211225161

256

6272364727212256

256

72364

1

1

22

2322

122

2322

12

23

=+−

−+−++−=

+−−+−++−

=

+−+

=

=

=

B

--

sssss-ss-sss

ssss-s

dsdB

s

s

])()[(])()][()()([])()(][)([

)())(())((

)(!

30

Example 3:Expanding each term of the numerator

jmmartinezjr 07092003

22

2223

1413

256125672364

)())((

))(()(

−+−−+

+−−++−=+

sDssC

sssBssAss-s

)()()()(DCBAsDCBAsDCBAsCBss-s

43252587316

45772364 2323

+−−+−++−++−−++=+

and then grouping similar terms we have

31

Example 3:equating coefficients of s3 to solve for C

jmmartinezjr 07092003

4=+CB

3

14

4

=−=−=

CC

BC

equating coefficients of s2 to solve for D

36457 −=+−− DCBA

44

35172364

5736

−=

++−−=

++−−=

D

D

CBAD

)()(

32

Example 3:jmmartinezjr 07092003

tDetCeBeAtety tttt 44 33 sincos)( +++=

By taking the Inverse Laplace Transform of

we have

22222 43

4

43

3

11 +−+

+−−

+−

+−

=)(

)()(

)()()(

)(s

Ds

sCs

Bs

AsY

teteetety tttt 44432 33 sincos)( −++=

Substituting the values of A,B,C, and D

33

MATLAB IMPLEMENTATIONPartial 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-p1)(s-p2)…

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.00004.0000

P =-2.0000-1.0000-1.0000

K =[]

MATLAB IMPLEMENTATION

2)1(4

)1(4

24)(

++

+−

++

=sss

sY

Example 1: Find the partial fraction expansion of

2544)( 23 +++

=sss

sY

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.0000i3.0000 - 1.0000i

-3.5000 -2.0000 -0.5000 -1.0000

P =0.0000 + 2.0000i0.0000 - 2.0000i

-2.0000 1.0000

0 0

MATLAB IMPLEMENTATIONExample 2: Find the partial fraction expansion of

))(()(

24

8240222

23

−++++−

=ssss

sssY

jmmartinezjr 07092003

K =[ ]

>> E=R(1)+R(2) %E in Ex.2E =

6.0000>> F=i*(R(1)-R(2)) %F in Ex.2F =

-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.0000i1.5000 - 2.0000i1.0000 2.0000

P =3.0000 + 4.0000i3.0000 - 4.0000i1.0000 1.0000

K =[]

MATLAB IMPLEMENTATIONExample 3: Find the partial fraction expansion of

)()()(

2561

7236422

23

+−−+

=sss

ss-ssY

jmmartinezjr 07092003

>> C=R(1)+R(2) % C in Example 3C =

3.0000>> D=i*(R(1)-R(2))% D in Example 3D =

-4.0000

37

MATLAB IMPLEMENTATIONUsing MatLab Symbolic Toolbox we can find the

solution to LCCDE by

syms s tFirst creating symbolic variables s and t using the command

Then, converting time functions into LaplaceTransform 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

ttydtdy

dtyd 2cos40222

2

−=−+

tttf 2cos402)( −=

>>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

dtyd

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)

ttydtdy

dtyd 2cos40222

2

−=−+

Solution:

jmmartinezjr 07092003

43

Example 5:

tt eettttty 22

272sincos4cos12

213)( −−−−+−−=

tt eetttty 2

2722sin22cos6

21)( −−−−+−−=

ttt 2cos662

)2cos(112cos12 2 +=+

=

The Total Solution

can also be written as

by considering that

tttt 2sin22

)2sin(4sincos4 −=−=−

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,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.

jmmartinezjr 07092003

2nd Revision: 08202007