Wn=0.4;
t=0:0.1:80;
num=[Wn^2];
zeta1=0;dem1=[1 2*zeta1*Wn Wn^2];
zeta2=0.5;dem2=[1 2*zeta2*Wn Wn^2];
zeta3=1.0;dem3=[1 2*zeta3*Wn Wn^2];
zeta4=1.5;dem4=[1 2*zeta4*Wn Wn^2];
zeta5=2.0;dem5=[1 2*zeta5*Wn Wn^2];
[y1,x,t]=impulse(num,[dem1,0],t);
[y2,x,t]=impulse(num,[dem2,0],t);
[y3,x,t]=impulse(num,[dem3,0],t); [y4,x,t]=impulse(num,[dem4,0],t);
[y5,x,t]=impulse(num,[dem5,0],t);
plot(t,y1,t,y2,t,y3,t,y4,t,y5)
grid on;
t=0:0.1:80;
num=[Wn^2];
zeta1=0;dem1=[1 2*zeta1*Wn Wn^2];
zeta2=0.5;dem2=[1 2*zeta2*Wn Wn^2];
zeta3=1.0;dem3=[1 2*zeta3*Wn Wn^2];
zeta4=1.5;dem4=[1 2*zeta4*Wn Wn^2];
zeta5=2.0;dem5=[1 2*zeta5*Wn Wn^2];
[y1,x,t]=step(num,dem1,t);
[y2,x,t]=step(num,dem2,t);
[y3,x,t]=step(num,dem3,t); [y4,x,t]=step(num,dem4,t);
[y5,x,t]=step(num,dem5,t);
plot(t,y1,t,y2,t,y3,t,y4,t,y5)
grid on;
Wn=0.4;
t=0:0.1:80;
num=[Wn^2];
zeta1=0;dem1=[1 2*zeta1*Wn Wn^2];
zeta2=0.5;dem2=[1 2*zeta2*Wn Wn^2];
zeta3=1.0;dem3=[1 2*zeta3*Wn Wn^2];
zeta4=1.5;dem4=[1 2*zeta4*Wn Wn^2];
zeta5=2.0;dem5=[1 2*zeta5*Wn Wn^2];
[y1,x,t]=step(num,[dem1,0],t);
[y2,x,t]=step(num,[dem2,0],t);
[y3,x,t]=step(num,[dem3,0],t); [y4,x,t]=step(num,[dem4,0],t);
[y5,x,t]=step(num,[dem5,0],t);
plot(t,y1,t,y2,t,y3,t,y4,t,y5)
grid on;
num=[1];
den=[1 10];
pzmap(num,den)
sgrid
num=[1];
den=[1 8 12 ]; pzmap(num,den) sgrid
num=[1 2];
den=[1 7 15 9]; rlocus(num,den) sgrid
num=[1 3];
den=[1 12 70 100 0]; rlocus(num,den)
sgrid
num=[1 5.5 11 7.5]; den=[1 3.5 5 6.25 0]; rlocus(num,den)
sgrid
num=[1 5.5 11 7.5];
den=[1 3.5 5 6.25 0]; [k,p]=rlocfind(num,den) rlocus(num,den)
sgrid
num=1;
den=1;
bode(num,den); grid
num=1;
den=[1,0]; bode(num,den); grid
num=[1,0];
den=1;
bode(num,den); grid
num=1;
den=[1,1]; bode(num,den); grid
num=[1,1];
den=1;
bode(num,den); grid
num=1;
wn=10;
zeta=[0.1:0.1:1.2];
hold on
for z=zeta
den=[(1/wn)^2 2*z/wn 1];
sys=tf(num,den);
bode(sys)
end
title
hold off
num=[1];
zeta1=[0.1];den1=[0.01 0.2*zeta1 1]; zeta2=[0.3];den2=[0.01 0.2*zeta2 1]; zeta3=[0.5];den3=[0.01 0.2*zeta3 1]; zeta4=[0.7];den4=[0.01 0.2*zeta4 1]; zeta5=[0.8];den5=[0.01 0.2*zeta5 1]; zeta6=[0.9];den6=[0.01 0.2*zeta6 1]; zeta7=[1.0];den7=[0.01 0.2*zeta7 1]; zeta8=[1.1];den8=[0.01 0.2*zeta8 1]; zeta9=[1.2];den9=[0.01 0.2*zeta9 1]; [re1,im1]=nyquist(num,den1);
[re2,im2]=nyquist(num,den2);
[re3,im3]=nyquist(num,den3);
[re4,im4]=nyquist(num,den4);
[re5,im5]=nyquist(num,den5);
[re6,im6]=nyquist(num,den6);
[re7,im7]=nyquist(num,den7);
[re8,im8]=nyquist(num,den8);
[re9,im9]=nyquist(num,den9);
plot(re1,im1,re2,im2,re3,im3,re4,im4,re5,im5,re6,im6,re7,im7,re8,im8,re 9,im9);
grid
title('振荡环节奈氏图')
num=[1,1];
den=[1,0];
bode(num,den);
grid
num=[1,1,1]; den=[1,0]; bode(num,den); grid
sys=tf([250 200],[1 4.2 100.8 20 0]); subplot(2,1,1)
nyquist(sys)
subplot(2,1,2)
bode(sys)
h1=tf([250 200],[1 0.2 0]);
h2=tf([1],[1 4 100]);
h=h1*h2;
[num,den]=tfdata(h);
[mag,phase,w]=bode(num,den);
subplot(211);
semilogx(w,20*log10(mag));grid; subplot(212);
semilogx(w,phase);grid;
[gm,pm,wcg,wcp]=margin(mag,phase,w)
G1=tf(35,conv([0.002 0.21 1 0],[0.005,1]));
[mag phase w]=bode(G1);
magdb=20*log10(mag);
subplot(211);
bode(G1);
margin(mag,phase,w);
G2=tf(35*[0.2 3 10],conv([0.002 0.21 1 0],[0.005,1,0])); [mag phase w]=bode(G2);
magdb=20*log10(mag);
subplot(212);
bode(G2,'--');
margin(mag,phase,w);
G1=tf(35,conv([0.002 0.21 1 0],[0.005,1])); G2=tf([0.2,3,10],[1 0]);
figure;
G1_c=feedback(G1,1);
G2_c=feedback(G2,1);
step(G1_c);
hold;
step(G2_c,'--');
G1=tf(35,[0.000001,0.00305,0.11,1,0]);
G2=tf(35*[0.2,3,10],conv([0.000001,0.00305,0.11,1,0],[1,0])) bode(G1)
hold
bode(G2,'--')
figure
G1_c=feedback(G1,1)
G2_c=feedback(G2,1)
step(G1_c)
hold
step(G2_c,'--')
G1=tf(100,[0.04,1,0]);
G2=tf(100*[0.025,1],conv([0.04,1,0],[0.01,1])) bode(G1)
hold
bode(G2,'--')
figure
G1_c=feedback(G1,1)
G2_c=feedback(G2,1)
step(G1_c)
hold
step(G2_c,'--')。