给定某系统的系统函数为
H(S)=s/(s2+2s+101)
要求画出该系统的零极点图、波特图和阶跃相应图。
下面是对应的MATLAB程序,请在程序中写上相应的注释。
t = linspace(0,5,201);
w = logspace(-1,3,201);
num = [1 0];
den = [1 2 101];
[poles,zeros] = pzmap(num,den);
[mag,angle] = bode(num,den,w);
[y,x] = step(num,den,t);
figure(1)
subplot(2,2,1)
plot(real(poles),imag(poles),’x’,real(zeros),imag(zeros),’o’);
title(’Pole-Zero Diagram’);
xlabel(’Real’);
ylabel(’Imaginary’);
axis([-1.1 0.1 -12 12]);
grid;
subplot(2, 2, 2);
semilogx(w,20*log10(mag));
title(’Magnitude of Bode Diagram’);
ylabel(’Magnitude (dB)’);
xlabel(’Radian Frequency (rad/s)’);
axis([0.1 1000 -60 0]);
grid;
subplot(2, 2, 4);
semilogx(w,angle);
title(’Angle of Bode Diagram’);
ylabel(’Angle (deg)’);
xlabel(’Radian Frequency (rad/s)’);
axis([0.1 1000 -90 90]);
grid;
subplot(2, 2, 3);
plot(t,y);
title(’Step Response’);
xlabel(’Time (s)’);
ylabel(’Amplitude’);
grid;