Sei sulla pagina 1di 4

Bai tap I.B.

2
%Khao sat he thong trong mien thoi gian
% PHAN A. XAC DINH VA XUAT RA MAN HINH HTD KIN CUA HE THONG
num1 = [1]; %Tu so cua ham truyen con 1
den1 = [1 2]; %Mau so cua ham truyen con 1
w1
= tf(num1, den1) %Ham truyen khau truyen thang thu 1
h1
= tf(1,[1 10]) %Ham truyen khau hoi tiep 1
w2
= tf(0.5,[1 5]) %Ham truyen khau truyen thang 2
h2
= tf(1,[1 3]) %Khau phan hoi 2
w3
= tf(1,[1 0]) %Ham truyen khau truyen thang thu 3
W
= (w1*w2*w3)/(1+w1*w2*h1+w2*w3*h2) %Ham truyen he kin
%Cach tinh W nhu sau:(x1=x-h1*x4;x2=x1*w1;x3=x2-y*h2;x4=x3*w2;y=x4*w3;W=y/x)
%Ket qua hien thi ra W nh sau:
% (0.5 s^6 + 12.5 s^5 + 115.5 s^4 + 497.5 s^3 + 1000 s^2 + 750 s)/
% (s^9 + 32 s^8 + 416 s^7 + 2863 s^6 + 1.129e004 s^5 + 25595 s^4 +
% 3.101e004 s^3 + 15825 s^2 + 500 s)
%PHAB B. KHAO SAT TINH ON DINH HE THONG
y = pole(W) %Vector cac diem cuc
n = length(y); %Lay do dai cua vector
state = 0; %Mac dinh cho he thong on dinh
%Lan luot kiem tra phan thuc cua cac diem cuc
%Chi can co mot diem cuc co phan thuc lon hon hoac bang khong ta thoat khoi
%vong lap
for i = 1:n
r = real(y(i));
if r > 0
state = 2
break
elseif r == 0
state = 1
break
end
end
switch(state)
case 0
disp('He thong on dinh')
case 1
disp('He thong o bien gioi on dinh')
case 2
disp('He thong khong on dinh')
end

subplot(211)
sgrid
pzmap(W) %Ve do thi cac diem cuc va khong cua he thong
axis([-2 0.1 -2 2]);
grid on
%Khao sat dac tinh thoi gian cua he thong
subplot(212)
step(W) ;%Ve dac tinh qua do cua he thong
grid on;%Hien thi luoi
s = stepinfo(W,'RiseTimeLimits',[0.05,0.95]) % Lay du lieu tham so, thoi gian khoi dau la 0

Ket qua khi chay nhu sau:


Transfer function:
1
----s+2
Transfer function:
1
-----s + 10
Transfer function:
0.5
----s+5
Transfer function:
1
----s+3
Transfer function:
1
s
Transfer function:
0.5 s^6 + 12.5 s^5 + 115.5 s^4 + 497.5 s^3 + 1000 s^2 + 750 s
------------------------------------------------------------------------------------------------s^9 + 32 s^8 + 416 s^7 + 2863 s^6 + 1.129e004 s^5 + 25595 s^4 + 3.101e004 s^3 + 15825 s^2 + 500 s

y=
0
-10.0125
-5.0162
-5.0000
-5.0000
-2.9146
-2.0230
-2.0000
-0.0338
state =
1
He thong o bien gioi on dinh
s=
RiseTime: 87.2070
SettlingTime: 116.5578
SettlingMin: 1.4260
SettlingMax: 1.4969
Overshoot: 0
Undershoot: 0
Peak: 1.4969
PeakTime: 183.6312

Potrebbero piacerti anche