Sie sind auf Seite 1von 13

FEEDBACK AND CONTROL SYSTEMS

PLATE NO. 2.1

To learn to use MATLAB to (1) generate polynomials, (2) manipulate polynomials, (3) generate
transfer functions, (4) manipulate transfer functions, and (5) perform partial-fraction expansions.

Name: JAN MARCELO B. LESCAIN III

PRELAB

1. Using a calculator, the roots of the polynomial x6+7x5+2x4+9x3+10x2+27 are:

s1=−1.39492
s2=−6.86696
s3=0.79611+0.94592∗i
s4=0.79611−0.94592∗i
s5=−0.16517+1.34787∗i
s6=−0.16517−1.34787∗i

2. Using a calculator, the roots of the polynomial 6 + 9s5 + 8s4 + 9s7 + 12s2 + 15s + 20:

s = -1.095
s = -0.551-i*0.737
s = -0.551+i*0.737
s = 0.112-i*1.305
s = 0.112+i*1.305
s = 0.931-i*0.727
s = 0.931+i*0.727
3. P1 = s6+7s5+2s4+9s3+10s2+12s+15; P2 = s6+9s5+8s4+9s3+12s2+15s+20
P1 + P2 = 2s6+16s5+10s4+18s3+22s2+27s+35
P1 - P2 = 16s5+10s4+18s3+22s2+27s+35
P1P2 = (s6+7s5+2s4+9s3+10s2+12s+15)(s6+9s5+8s4+9s3+12s2+15s+20)

4.
5.

6.

7.
LAB

syms s;

No. 1
p1 = [1 7 2 9 10 12 15];
p2 = [1 9 8 9 12 15 20];
p3 = p1 + p2
p4 = p1 - p2
p5 = conv(p1, p2)

p3 =
2 16 10 18 22 27 35

p4 =

0 -2 -6 0 -2 -3 -5

p5 =
1 16 73 92 182 291 433 599 523 609 560 465 300

No. 2
p6 = poly([-7 -8 -3 -5 -9 -10])

p6 =
Columns 1 through 6
1 42 718 6372 30817 76530
Column 7
75600

No. 3
numa = conv(20, poly([2 3 6 8]));
dena = poly([0 -7 -9 -10 -15]);
g1 = tf(numa, dena)

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.

No. 4
numb = poly([-1 -17 -99 -223 -140]);
denb= poly([-1 -32 -363 -2092 -5052 -4320]);
g2 = zpk(numb, denb, 1)
g2 =

(s-1) (s-480) (s-7.549e04) (s-4.307e06) (s-5.254e07) (s-5.678e07)


------------------------------------------------------------------------
(s-1) (s-1.186e04) (s-4.598e07) (s-6.22e10) (s-1.858e13) (s-5.304e14)

(s-5.489e14)

Continuous-time zero/pole/gain model.

No. 5
'G1 + G2'
g1 + g2
'Factored'
tf(g1 + g2)
'G1 - G2'
g1 - g2
'Factored'
tf(g1 - g2)
'G1 * G2'
g1 * g2
'Factored'
tf(g1 * g2)

ans =
G1 + G2

ans =

21 (s-1.858e13) (s-6.22e10) (s-4.598e07) (s-1.186e04) (s-53.05)

(s+48.53) (s-8.002) (s-6.484) (s-1) (s^2 - 1.027e15s + 2.773e29)


------------------------------------------------------------------------
s (s+15) (s+10) (s+9) (s+7) (s-1) (s-1.186e04) (s-4.598e07) (s-6.22e10)

(s-1.858e13) (s-5.304e14) (s-5.489e14)

Continuous-time zero/pole/gain model.

ans =
Factored

ans =

21 s^11 - 2.196e16 s^10 + 6.224e30 s^9 - 1.085e44 s^8 + 6.733e54 s^7


- 3.094e62 s^6 + 3.675e66 s^5 - 7.262e67 s^4 - 8.958e69 s^3

+ 1.45e71 s^2 - 6.261e71 s + 4.901e71


------------------------------------------------------------------------
s^12 - 1.098e15 s^11 + 3.112e29 s^10 - 5.427e42 s^9 + 3.366e53 s^8

- 1.547e61 s^7 + 1.828e65 s^6 + 7.329e66 s^5 + 1.049e68 s^4


+ 6.167e68 s^3 + 1.005e69 s^2 - 1.734e69 s

Continuous-time transfer function.


ans =

G1 - G2

ans =

19 (s-6.981e14) (s-4.389e14) (s-1.858e13) (s-6.22e10) (s-4.598e07)


(s-1.186e04) (s-84.6) (s+79.74) (s-8) (s-6.142) (s-1)
------------------------------------------------------------------------

s (s+15) (s+10) (s+9) (s+7) (s-1) (s-1.186e04) (s-4.598e07) (s-6.22e10)


(s-1.858e13) (s-5.304e14) (s-5.489e14)

Continuous-time zero/pole/gain model.

ans =
Factored

ans =

19 s^11 - 2.196e16 s^10 + 6.224e30 s^9 - 1.085e44 s^8 + 6.733e54 s^7


- 3.094e62 s^6 + 3.675e66 s^5 - 7.134e67 s^4 - 2.428e70 s^3
+ 3.736e71 s^2 - 1.566e72 s + 1.216e72
------------------------------------------------------------------------
s^12 - 1.098e15 s^11 + 3.112e29 s^10 - 5.427e42 s^9 + 3.366e53 s^8
- 1.547e61 s^7 + 1.828e65 s^6 + 7.329e66 s^5 + 1.049e68 s^4
+ 6.167e68 s^3 + 1.005e69 s^2 - 1.734e69 s

Continuous-time transfer function.

ans =
G1 * G2

ans =

20 (s-8) (s-6) (s-3) (s-2) (s-1) (s-480) (s-7.549e04) (s-4.307e06)


(s-5.254e07) (s-5.678e07)
------------------------------------------------------------------------

s (s+15) (s+10) (s+9) (s+7) (s-1) (s-1.186e04) (s-4.598e07) (s-6.22e10)


(s-1.858e13) (s-5.304e14) (s-5.489e14)

Continuous-time zero/pole/gain model.

ans =
Factored

ans =

20 s^10 - 2.274e09 s^9 + 6.925e16 s^8 - 2.622e23 s^7 + 1.953e28 s^6


- 9.703e30 s^5 + 1.89e32 s^4 - 1.34e33 s^3 + 4.184e33 s^2
- 5.705e33 s + 2.682e33
------------------------------------------------------------------------

s^12 - 1.098e15 s^11 + 3.112e29 s^10 - 5.427e42 s^9 + 3.366e53 s^8


- 1.547e61 s^7 + 1.828e65 s^6 + 7.329e66 s^5 + 1.049e68 s^4
+ 6.167e68 s^3 + 1.005e69 s^2 - 1.734e69 s

Continuous-time transfer function.

No. 6
numc = conv(5, poly(-2));
denc = conv(poly(0), [1 8 15]);
'G6'
[K, p, k] = residue(numc, denc)
numd = conv(5, poly(-2));
dend = conv(poly(0), [1 6 9]);
'G7'
[K, p, k] = residue(numd, dend)
numd = conv(5, poly(-2));
dend = conv(poly(0), [1 6 34]);
'G8'
[K, p, k] = residue(numd, dend)

ans =
G6

K =

-1.5000
0.8333
0.6667

p =
-5
-3
0

k =
[]

ans =
G7

K =

-1.1111
1.6667
1.1111

p =
-3
-3
0
k =
[]

ans =

G8

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 =
[]

Postlab
1. Operating with transfer functions can involve a lot of polynomials. This can become
complicated to solve and write. MATLAB can make it easier. It can conveniently display
the results in both factored and polynomial form.
2. MATLAB makes solving for transfer functions and polynomials faster but inputting
equations can be complicated. Using MATLAB to evaluate partial fraction expansions is
faster than solving by hand. The shortcoming of solving partial fraction expansions with
MATLAB is that the results are not easily readable.
FEEDBACK AND CONTROL SYSTEMS
PLATE NO. 2.2

To learn to use MATLAB and the Symbolic Math Toolbox to (1) find
Laplace transforms for time functions, (2) find time functions from Laplace transforms,
(3) create LTI transfer functions from symbolic transfer functions, and (4)
perform solutions of symbolic simultaneous equations.

PRELAB

1.

2.
LAB

syms t;

No. 1(a)
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)

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

No. 1(b)
'Polynomial'
s = tf('s');
G = (2*(s+3)*(s+5)*(s+7))/(s*(s+8)*(s^2+10*s+100))
'Factored'
s = zpk('s');
H = (2*(s+3)*(s+5)*(s+7))/(s*(s+8)*(s^2+10*s+100))

ans =

Polynomial

G =

2 s^3 + 30 s^2 + 142 s + 210


------------------------------
s^4 + 18 s^3 + 180 s^2 + 800 s

Continuous-time transfer function.

ans =

Factored

H =

2 (s+3) (s+5) (s+7)


-------------------------
s (s+8) (s^2 + 10s + 100)
Continuous-time zero/pole/gain model.

No. 1(c)
'Laplace'
laplace(f)

ans =

Laplace

ans =

3/(400*s) - 9/(1250*(s + 8)) - (17*(s + 5/2))/(50000*((s + 5/2)^2 + 484)) + 957/(500*((s + 5/2)^2


+ 484))

No. 1(d)
clear
syms s;
F = (2*(s+3)*(s+5)*(s+7))/(s*(s+8)*(s^2+10*s+100))
'Inverse Laplace'
ilaplace(F)

F =

((2*s + 6)*(s + 5)*(s + 7))/(s*(s + 8)*(s^2 + 10*s + 100))

ans =

Inverse Laplace

ans =

(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

No. 1(e)
clear
syms s;
numa = conv(2, poly([-3 -5 -7]));
deno = conv([1 8 0],[1 10 100]);
s = tf('s');
F = tf(numa, deno)
s = zpk('s');
F = zpk(numa, deno, 1)

F =

2 s^3 + 30 s^2 + 142 s + 210


------------------------------
s^4 + 18 s^3 + 180 s^2 + 800 s

Continuous-time transfer function.

F =

(s-2) (s-30) (s-142) (s-210)


------------------------------
s (s-1) (s-18) (s-180) (s-800)

Continuous-time zero/pole/gain model.

No. 1(f)
clear
syms s V;
'For Current Loop 1:'
A1 = [V -(s+2) -5
0 (1/3*s)+2*s+4 -(s+2)
0 -(s+2) (1/4*s)+s+8];
A = [(1/5*s)+s+7 -(s+2) -5
-(s+2) (1/3*s)+2*s+4 -(s+2)
-5 -(s+2) (1/4*s)+s+8];
I1 = det(A1)/det(A);
G = I1/V;
pretty(simplify(G))

'For Current Loop 2:'


A2 = [(1/5*s)+s+7 V -5
-(s+2) 0 -(s+2)
-5 0 (1/4*s)+s+8];
I2 = det(A2)/det(A);
G = I2/V;
pretty(simplify(G))

'For Current Loop 3:'


A3 = [(1/5*s)+s+7 -(s+2) V
-(s+2) (1/3*s)+2*s+4 0
-5 -(s+2) 0];
I3 = det(A3)/det(A);
G = I3/V;
pretty(simplify(G))
ans =

For Current Loop 1:

2
115 s + 1180 s + 1680
------------------------------
3 2
63 s + 841 s + 2156 s + 1440

ans =

For Current Loop 2:

2
75 s + 930 s + 1560
------------------------------
3 2
63 s + 841 s + 2156 s + 1440

ans =

For Current Loop 3:

2
60 s + 940 s + 1440
------------------------------
3 2
63 s + 841 s + 2156 s + 1440
POSTLAB
1. The Symbolic Math Toolbox makes it easier and more readable to generate the transfer
function in both factored and polynomial form.
2. The advantage is that it is easier. The disadvantage is that the command and syntax can
be hard to remember.
3. The advantage of the Symbolic Math Toolbox is that you can operate on equations even
if they are still expressed in variables. You can also insert variables in matrices. It might
be possible to solve the equations in MATLAB alone but it can be more complicated than
using the Symbolic Math Toolbox.
4. There are no other observations while using the Symbolic Math Toolbox.

Das könnte Ihnen auch gefallen