1、MATLAB课后答案电子工业出版社53 阶跃响应曲线:K=10K=30K=50斜坡响应曲线:K=10K=30K=50冲激响应曲线:K=10K=30K=505.661figure(1)num=1 1;den=conv(1 0 0,conv(1 2,1 4);sys=tf(num,den);rlocus(sys);title(根轨迹图)figure(2)num=1 1;den=conv(1 0,conv(1 -1,1 4 16);sys=tf(num,den);rlocus(sys);title(根轨迹图)figure(3)num=1 8;den=conv(1 1 0,conv(1 3,conv(
2、1 5,conv(1 7,1 15);sys=tf(num,den);rlocus(sys);title(根轨迹图)6.5(1)clcnum=-1 2;den=1 3 0;G=tf(num,den);H=1;GG=feedback(G,H)Transfer function: -s + 2-s2 + 2 s + 2(2)clcnum=-1 2;den=1 3 0;G=tf(num,den);rlocus(G);title(根轨迹图)(3)由图可以看出,改点不在根轨迹曲线上。(4) clcnum=-1 2;den=1 3 0;G=tf(num,den);rlocus(G);grid on;tit
3、le(根轨迹图)k,poles=rlocfind(G)Select a point in the graphics windowselected_point =-0.0024 + 2.3975ik =2.9461poles =-0.0269 + 2.4272i -0.0269 - 2.4272i当增益K4时,闭环系统的极点都位于虚轴的左部,处于稳定状态。71(1)clcnum=100*1 1;den=conv(1 0,conv(2 1,10 1);figure(1)bode(num,den)gridfigure(2)nyquist(num,den)(2)clcnum=10;den=conv(1
4、 0,conv(0.1 1,0.5 1);figure(1)bode(num,den)gridfigure(2)nyquist(num,den)(3)clcnum=5*0.5 -1;den=conv(1 0,conv(0.1 1,0.2 -1);figure(1)bode(num,den)gridfigure(2)nyquist(num,den)(4)clcnum=10*5 1;den=conv(1 1 0,conv(1 1,0.2 1);figure(1)bode(num,den)gridfigure(2)nyquist(num,den)(5)clcnum=2*10 1;den=conv(1
5、 0,conv(1 1 0,conv(1 4 25,1 0.2);figure(1)bode(num,den)gridfigure(2)nyquist(num,den)7.4(1)num=300;den=conv(1 1 0,conv(0.2,1,0.02,1);G=tf(num,den)Transfer function: 300-0.004 s4 + 0.224 s3 + 1.22 s2 + s(2)clcnum=300;den=conv(1 1 0,conv(0.2,1,0.02,1);G=tf(num,den);w=logspace(0,4,50);margin(num,den)gri
6、dGm,Pm,Wcg,Wcp=margin(G)Gm = 0.0179Pm = -72.7403Wcg = 2.1129Wcp = 10.9919幅值穿越频率:Wcg = 2.11298.2(1)clcnum=10;den=conv(1 0,conv(0.2 1,0.5 2);G=tf(num,den);H=1;GG=feedback(G,H)bode(GG)grid ontitle(幅频特性曲线)Transfer function: 10-0.1 s3 + 0.9 s2 + 2 s + 10(2)clcnum=10;den=conv(1 0,conv(0.2 1,0.5 2);G=tf(nu
7、m,den);kc=5;yPm=50+12;Gc=cqjz_frequency(G,kc,yPm);G=G*kc;GGc=G*Gc;Gy_close=feedback(G,1)Gx_open=feedback(GGc,1)子函数:%function Gc=cqjz_frequency(G,kc,yPm);G=tf(G);mag,pha,w=bode(G*kc);Mag=20*log(mag);Gm,Pm.Wcg,Wcp=margin(G*kc);phi=(yPm-getfield(Pm,Wcg)*pi/180;alpha=(1+sin(phi)/(1-sin(phi);Mn=-10*log10
8、(alpha);Wcgn=spline(Mag,w,Mn);T=1/Wcgn/sqrt(alpha);Tz=alpha*T;Gc=tf(Tz,1,T,1)Transfer function: 3.273 s + 1-0.001756 s + 1 Transfer function: 50-0.1 s3 + 0.9 s2 + 2 s + 50 Transfer function: 163.6 s + 50-0.0001756 s4 + 0.1016 s3 + 0.9035 s2 + 165.6 s + 509.3clcclearA=-2 2 -1;0 -2 0;1 -4 0;B=0;0;1;C=
9、1 0 0;D=0;sys=ss(A,B,C,D)control_matrix=ctrb(A,B);rank_control=rank(control_matrix);if rank_control3 disp(系统不可控!)else disp(系统可控!)endobserve_matrix=obsv(A,C);rank_observe=rank(observe_matrix);if rank_observe3 disp(系统不可观!)else disp(系统可观!)endnum,den=ss2tf(A,B,C,D);G=tf(num,den)z,p,k=tf2zp(num,den)a = x
10、1 x2 x3 x1 -2 2 -1 x2 0 -2 0 x3 1 -4 0 b = u1 x1 0 x2 0 x3 1 c = x1 x2 x3 y1 1 0 0 d = u1 y1 0 Continuous-time model.系统不可控!系统不可观! Transfer function: -s - 2-s3 + 4 s2 + 5 s + 2 z = -2p = -2.0000 -1.0000 + 0.0000i -1.0000 - 0.0000ik =-1由结果可以看出,闭环传递函数的所有极点都在S平面的左半平面,因此该系统是稳定的。10.2 num=20;den=1 4 3 0;G=tf(num,den)A,B,C,D=tf2ss(num,den);G1=ss(A,B,C,D)P=-5,-2+2i,-2-2i;K=acker(A,B,P)无反馈:加反馈:10.4clcA=0 1;-2 -3;B=0;1;C=2,0;D=0;G=ss(A,B,C,D)P=-10 -10;G=acker(A,C,P);Kg=G11.111.2(1)(2)12.5当K=1,T=0.1时当K=1,T=1时当K=1,T=2时当K=2,T=1时当K=3,T=1时
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1