You are on page 1of 3

I.

The simulation of system


a. Transfer function:
num=[分子之係數]
den=[分母之係數]
sys=tf(num,den);

例 G( s)  6s 2  1
s 3  3s 2  3s  1
num=[6 0 1];
den=[1 3 3 1];
sys=tf(num,den);
b. The poles and zeros of a system

例 G( s)  6s 2  1
s 3  3s 2  3s  1
p=pole(sys)
z=zero(sys)
c. The characteristic root of the system

例 G( s)  6s 2  1
s 3  3s 2  3s  1
num=[6 0 1];
den=[1 3 3 1];
sys=tf(num,den);
r=roots(den);
pzmap(sys);

d. Block diagram model:


Series U Y
G1(s) G2(s)

sys1 sys2

sys=series(sys1,sys2)
Parallel
G1(s)

G2(s)

sys=parallel(sys1,sys2)
e. The feedback system
R(s) + Y(s)
G(s)
-

H(s)

sys=feedback(sys1,sys2)
f. State-space model:

u(t) x(t)y(t)

x  Ax  Bu
y  Cx  Du

sys=ss(A,B,C,D)
g. root locus

例 G( s)  s 1
s  2s  2
2

sys=tf([1 1],[1 2 2])


rlocus(sys);
rlocfind(sys);
II. Time response
1. impulse response
impulse(sys)
2. step response
step(sys)
3. ramp response and any linear function response
t=0:0.1:10;
u=t;
lsim(sys,u,t)
III. System Performance

R(s) + n
2
Y(s)

- s  2 n s
2

G(s)
sam5.m
clear
t=0:0.1:12;
num=[1];
zeta=0.1;den=[1 2*zeta 1]; sys1=tf(num,den);
zeta=0.2;den=[1 2*zeta 1]; sys2=tf(num,den);
zeta=0.4;den=[1 2*zeta 1]; sys3=tf(num,den);
zeta=0.7;den=[1 2*zeta 1]; sys4=tf(num,den);
zeta=1;den=[1 2*zeta 1]; sys5=tf(num,den);
zeta=2;den=[1 2*zeta 1]; sys6=tf(num,den);
zeta=0;den=[1 2*zeta 1]; sys7=tf(num,den);
zeta=-1;den=[1 2*zeta 1]; sys8=tf(num,den);
%
[y1,t1]=step(sys1,t);
[y2,t2]=step(sys2,t);
[y3,t3]=step(sys3,t);
[y4,t4]=step(sys4,t);
[y5,t5]=step(sys5,t);
[y6,t6]=step(sys6,t);
[y7,t7]=step(sys7,t);
[y8,t8]=step(sys8,t);
%
plot(t1,y1,'k-')
hold on
pause
plot(t2,y2,'b--')
pause
plot(t3,y3,'r--')
pause
plot(t4,y4,'y-')
pause
plot(t5,y5,'g--')
pause
plot(t6,y6,'c-')
pause
plot(t7,y7,'m--')
pause
plot(t8,y8)

You might also like