You are on page 1of 10

# Caringal, Paul Aris E. caringal_aris@yahoo.

com
ECE131L-B11-01 November 09, 2012
Module 2
1.
a.
>> b=[ 5 0 8];
>> a=[1 5 6];
>> sysa=tf(b,a)

Transfer function:
5 s^2 + 8
-------------
s^2 + 5 s + 6

## b. >> z=[-4 1];

>> p=[3 -7];
>> k=[15];
>> sysb=zpk(z,p,k)

Zero/pole/gain:
15 (s+4) (s-1)
--------------
(s-3) (s+7)

## c. >> a=[0 1; -5 -2];

>> c=[1 0];
>> d=[0];
>> b=[0;3];
>> sysc=ss(a,b,c,d)

a=
x1 x2
x1 0 1
x2 -5 -2

b=
u1
x1 0
x2 3
c=
x1 x2
y1 1 0

d=
u1
y1 0

Continuous-time model.

## d. >> freq=[1000; 2000; 3000];

>> resp=[-0.91+0.7*i;-0.54+0.43*i;-0.43+0.65*i];
>> sysd=frd(resp,freq)

## From input 1 to:

---------------- --------
1000 -0.91+0.70i
2000 -0.54+0.43i
3000 -0.43+0.65i

## 2. >> b=[ 5 -8 3];

>> a=[ 2 -4 -4];
>> sys1=tf(b,a)

Transfer function:
5 s^2 - 8 s + 3
---------------
2 s^2 - 4 s – 4

a. >> [b,a]=tfdata(sys1,'v')

b=

5 -8 3
a=

2 -4 -4

b. >> [z,p,k]=zpkdata(sys1,'v')

z=

1.0000
0.6000

p=

2.7321
-0.7321

k=

2.5000

c. >> [a,b,c,d]=ssdata(sys1)

a=

2 1
2 0

b=

2
0

c=

0.5000 1.6250
d=

2.5000

d. >> [f,r]=frdata(sys1)
??? Error using ==> lti.frdata
FRDATA is applicable to FRD models only.

3.
a. >> b1=[1 3 3];
>> a1=[1 0 5 0 1];
>> sys1=tf(b1,a1);
>> b2=[1 4 3];
>> a2=[1 2 5 10];
>> sys2=tf(b2,a2);
>> b3=[1 5 4];
>> a3=[1 4 0 8];
>> sys3=tf(b3,a3);
>> b4=[1 6 0];
>> a4=[3 3 4];
>> sys4=tf(b4,a4);
>> syss=series(sys2,sys3)

Transfer function:
s^4 + 9 s^3 + 27 s^2 + 31 s + 12
--------------------------------------------------
s^6 + 6 s^5 + 13 s^4 + 38 s^3 + 56 s^2 + 40 s + 80

>> sysp=parallel(syss,sys1)

Transfer function:

## + 455 s^2 + 391 s + 252

----------------------------------------------------------
s^10 + 6 s^9 + 18 s^8 + 68 s^7 + 122 s^6 + 236 s^5

## + 373 s^4 + 238 s^3 + 456 s^2 + 40 s + 80

>> sysf=feedback(sysp,sys4,-1)

Transfer function:

6 s^10 + 60 s^9 + 260 s^8 + 783 s^7 + 1848 s^6 + 3213 s^5

## + 4251 s^4 + 4482 s^3 + 3749 s^2 + 2320 s + 1008

----------------------------------------------------------
3 s^12 + 21 s^11 + 78 s^10 + 312 s^9 + 816 s^8 + 1913 s^7

## b. >> b1=[3 0 0];

>> a1=[2 0 4];
>> sys1=tf(b1,a1);
>> b2=[1];
>> a2=[1 0 4];
>> sys2=tf(b2,a2);
>> b3=[1 0 0];
>> a3=[2 -5 1];
>> sys3=tf(b3,a3);
>> b4=[1];
>> a4=[3 4];
>> sys4=tf(b4,a4);
>> sysf=feedback(sys1,sys2,-1);
>> syss=series(sysf,sys3);
>> sysff=feedback(syss,sys4,+1)

Transfer function:

## 9 s^7 + 12 s^6 + 36 s^5 + 48 s^4

------------------------------------------------------------
12 s^7 - 17 s^6 + 56 s^5 - 109 s^4 - 159 s^3 - 52 s^2

- 272 s + 64
c. >> a=[0 1; -5 -2];
>> b=[0 ; 3];
>> c=[1 0];
>> d=[0];
>> ss1=ss(a,b,c,d);
>> [b,a]=tfdata(ss1,'v')

b=

0 0 3

a=

## >> b=[0 0 12];

>> sys2=tf(b,a)

Transfer function:
12
-------------
s^2 + 2 s + 5

>> k=[10];
>> p=[0 -2 -3];
>> z=[-1 -1];
>> zpks=zpk(z,p,k);
>> [b,a]=tfdata(zpks, 'v')

b=

0 10 20 10

a=

1 5 6 0

>> sys1=tf(b,a)
Transfer function:
10 s^2 + 20 s + 10
------------------
s^3 + 5 s^2 + 6 s

## >> b3=[1 0 0];

>> a3=[1 4 4];
>> sys3=tf(b3,a3);
>> b4=[1];
>> a4=[1 0];
>> sys4=tf(b4,a4);
>> b5=[2 4];
>> a5=[1 4 0];
>> sys5=tf(b5,a5);
>> sysp=parallel(sys1,sys2);
>> sysf=feedback(sysp,sys3,-1);
>> syss=series(sys5,sysf);
>> sysff=feedback(syss,sys4,-1);
>> sysss=series(sysff,sys4)

Transfer function:

20 s^8 + 224 s^7 + 1184 s^6 + 3712 s^5 + 7076 s^4 + 7768 s^3

## + 4272 s^2 + 800 s

--------------------------------------------------------------------
s^11 + 25 s^10 + 189 s^9 + 749 s^8 + 1914 s^7 + 3318 s^6 +
5104 s^5

## + 7556 s^4 + 7768 s^3 + 4272 s^2 + 800 s

4. function
[sys1,sys2,sys3,num,den,zero,pole,gain,A,B,C,D]=seriesrlc(R,L,C)
num =[1/C]
den = [L R 1/C]
sys3 = tf(num,den)
[zero,pole,gain] = zpkdata(sys3,'v')
[A,B,C,D]=ssdata(sys3)
sys1 = ss( A,B,C,D)
sys2 = zpk(zero,pole,gain)
end

5. >> seriesrlc(25,0.001,0.000001)

num =

1000000

den =

1.0e+006 *

## 0.0000 0.0000 1.0000

Transfer function:
1e006
------------------------
0.001 s^2 + 25 s + 1e006

zero =

## Empty matrix: 0-by-1

pole =

1.0e+004 *

-1.2500 + 2.9047i
-1.2500 - 2.9047i
gain =

1.0000e+009

A=

1.0e+004 *

-2.5000 -3.0518
3.2768 0

B=

128
0

C=

0 238.4186

D=

a=
x1 x2
x1 -2.5e+004 -3.052e+004
x2 3.277e+004 0

b=
u1
x1 128
x2 0

c=
x1 x2
y1 0 238.4
d=
u1
y1 0

Continuous-time model.

Zero/pole/gain:
1000000000
-------------------------
(s^2 + 2.5e004s + 1e009)

a=
x1 x2
x1 -2.5e+004 -3.052e+004
x2 3.277e+004 0

b=
u1
x1 128
x2 0

c=
x1 x2
y1 0 238.4

d=
u1
y1 0

Continuous-time model.