You are on page 1of 8

Experimrnt-02

Objective 1: To learn to use MATLAB to


1.
2.
3.
4.
5.

Generate polynomials
Manipulate polynomials
Generate transfer function
Manipulate transfer function
Perform partial fraction expansions

Minimum Required Software Package: MATLAB and the Control System Toolbox.
Background Theory and Concept:
The Laplace transform is a frequency-domain approach for continuous time signals
irrespective of whether the system is stable or unstable. The Laplace transform of a function
f(t), defined for all real numbers t 0, is the function F(s), which is a unilateral transform
defined by

F ( s )= est f (t) dt
0

Where s is a complex number parameter.


The applications of Laplace Transform are
1. Can be used to find the roots of the complex polynomials
2. Generate transfer functions
3. Perform partial fraction expansions
Questions and Answers:
1. Calculate the following by hand or calculator.

Roots of P1, where

P1=s 6 +7 s 5 +2 s 4 +9 s3 +10 s 2 +12 s+15

Roots of P2, where

P2=s +9 s +8 s + 9 s + 12 s +15 s +20

Roots of P3, where P3= P1+P2


Roots of P4, where P4=P1-P2
Roots of P5, where P5=P1*P2

Answer 1:
a.
clc
clear all
close all
P1=[1 7 2 9 10 12 15]
roots(P1)
Result:
P1 = 1
7
2
ans =
-6.8731
0.7632
0.7632
-1.0000

+
+
+

0.0000i
1.0822i
1.0822i
0.0000i

10

12

15

-0.3266 + 1.0667i
-0.3266 - 1.0667i
b.
clc
clear all
close all
P2=[1 9 8 9 12 15 20]
roots(P2)
Result:
P2 = 1
9
8
ans =
-8.1330
0.6996
0.6996
-1.2183
-0.5240
-0.5240

+
+
+
+
-

+
+
+
+
-

10

+
+
+
-

15

20

18

22

27

35

0.0000i
1.0281i
1.0281i
0.0000i
1.0751i
1.0751i

d.
clc
clear all
close all
P4=P1-P2
roots(P4)
Result:
P4 =0
-2
ans =
-3.0818
0.6463
0.6463
-0.6054
-0.6054

12

0.0000i
0.9880i
0.9880i
0.0000i
1.0501i
1.0501i

c.
clc
clear all
close all
P3=P2+P1
roots(P3)
Result:
P3 = 2
16
ans =
-7.4691
0.7215
0.7215
-1.1042
-0.4348
-0.4348

-6

-2

-3

-5

0.0000i
0.7809i
0.7809i
0.6504i
0.6504i

e.
clc
clear all
close all
P5=conv(P1,P2)
roots(P5)

Result:

P5 =1
300

16

73

92

182

291

433

599

523

609

560

465

ans =
-6.8731
-8.1330
0.7632
0.7632
0.6996
0.6996
-1.2183
-1.0000
-0.5240
-0.5240
-0.3266
-0.3266

+
+
+
+
+
+
+
+
-

0.0000i
0.0000i
1.0822i
1.0822i
0.9880i
0.9880i
0.0000i
0.0000i
1.0501i
1.0501i
1.0667i
1.0667i

2. Calculate by hand or calculator.


P6=(S+7)(S+8)(S+3)(S+5)(S+9)(S+10)
Answer 2:
clc
clear all
close all
P6=[-7 -8 -3 -5 -9 -10]
poly(P6)

Result:

P6 = -7

-8

-3

-5

-9 -10

ans =
1

42

718

6372

30817

76530

75600

3.
a. Represent the following as numerator divided by denominator
polynomial.

G ( S )=

b.

20(s+2)( s+3)(s+6)(s+ 8)
s (s +7)(s +9)( s+10)(s+15)

Express as factors in numerator divided by factors in


denominator.

S 4 +17 s3 +99 s2 +223 s +140


G2= 5
s +32 s4 + 363 s3 +2092 s 2 +5052 s+ 4320
Answer 3:
a.
clc
clear all
close all
p1=20*poly([-2 -3 -6 -8])
p2=poly([0 -7 -9 -10 -15])
G1=tf(p1,p2)

Result:
p1 =
20

380

2480

6480

5760

41

613

3975

9450

p2 =

G1 =
20 s^4 + 380 s^3 + 2480 s^2 + 6480 s + 5760
------------------------------------------s^5 + 41 s^4 + 613 s^3 + 3975 s^2 + 9450 s
Continuous-time transfer function.

b.
clc
clear all
close all
num=roots([1 17 99 223 140])
den=roots([1 32 363 2092 5052 4320])
G2=zpk(num,den,1)

Result:
num =

-7.0000
-5.0000
-4.0000
-1.0000
den =
-16.7851
-5.5591
-5.5591
-2.0483
-2.0483

+
+
+
-

0.0000i
5.1669i
5.1669i
0.5221i
0.5221i

G2 =
(s+7) (s+5) (s+4) (s+1)
-----------------------------------------------------(s+16.79) (s^2 + 4.097s + 4.468) (s^2 + 11.12s + 57.6)
Continuous-time zero/pole/gain model.

4. Calculate the following partial fraction expressions of the following transfer


functions.

a.

s
s ( 2+8 s+15)
5( s+ 2)
G 6=

b.

s
s ( 2+6 s+9)
5( s+ 2)
G 7=

c.

s
s ( 2+6 s+34)
5( s +2)
G 8=

Answer4:
a.
clc
clear all
close all
num=[5 10]
den=[1 8 15 0]
[K,p,k]=residue(num,den)
Result:

num =
5

10

den =
1

K=
-1.5000
0.8333
0.6667
p=
-5
-3
0

15

k = []

b.
clc
clear all
close all
num=[5 10]
den=[1 6 9 0]
[K,p,k]=residue(num,den)

Result:
num =
5

10

den =
1

K =
-1.1111
1.6667
1.1111
p =
-3
-3
0
k = []
c.
clc
clear all
close all
num=[5 10]
den=[1 6 34 0]
[K,p,k]=residue(num,den)
Result:
num =
5

10

den =
1

34

K =
-0.1471 - 0.4118i

-0.1471 + 0.4118i
0.2941 + 0.0000i
p =
-3.0000 + 5.0000i
-3.0000 - 5.0000i
0.0000 + 0.0000i
k =[]

Objective 2: To use the symbolic math tool box in MATLAB to find Laplace
Transform and the inverse Laplace Transform Of the given function.
Software Required : MATLAB.
Questions and Answers:
1) Find the Laplace transform of

f ( t )=0.00750.00034 e2.5 t cos ( 22 t ) +0.087 e2.5 t sin ( 22 t ) 0.0072 e8 t


2) Find the inverse Laplace of

s
s( s+ 8)( 2+10 s+100)
2(s +3)(s +5)(s +7)
F 1 ( S )=

Answers:
1.
clc
clear all
close all
syms f t
f=0.0075-0.00034*exp(-2.5*t)*cos(22*t)+0.087*exp(-2.5*t)*sin(22*t)0.0072*exp(-8*t)
k=laplace(f)
pretty(k)
Result:
f =
(87*sin(22*t)*exp(-(5*t)/2))/1000 - (17*cos(22*t)*exp(-(5*t)/2))/50000 (9*exp(-8*t))/1250 + 3/400
k =
3/(400*s) - 9/(1250*(s + 8)) - (17*(s + 5/2))/(50000*((s + 5/2)^2 + 484)) +
957/(500*((s + 5/2)^2 + 484))

2.
clc
clear all
close all

syms s
p1=(2*((s+3)*(s+5)*(s+7)))
p2=(s*(s+8)*(s^2 +10*s+ 100))
g=p1/p2
f=ilaplace(g)
pretty(f)
Result:

p1 =
2*(s + 3)*(s + 5)*(s + 7)
p2 =
s*(s + 8)*(s^2 + 10*s + 100)
g =
(2*(s + 3)*(s + 5)*(s + 7))/(s*(s + 8)*(s^2 + 10*s + 100))
f =
(5*exp(-8*t))/112 + (237*exp(-5*t)*(cos(5*3^(1/2)*t) +
(3^(1/2)*sin(5*3^(1/2)*t))/9))/140 + 21/80

You might also like