1、系统建模与仿真实验图3.(1)分别取0.3,0.5,0.8,2时,系统的bode图绘制:num=1;den=1 8 27 38 26 0;rlocus(num,den)r,k=rlocfind(num,den)Gridxlabel(Real Axis),ylabel(Imaginary Axis)title(Root Locus)选定图中根轨迹与虚轴的交点,单击鼠标左键得:selected_point = 0.0021 + 0.9627ik = 28.7425r = -2.8199 + 2.1667i -2.8199 - 2.1667i -2.3313 -0.0145 + 0.9873i -0
2、.0145 - 0.9873i3.(2)num=1 12;den=1 23 242 1220 1000;rlocus(num,den)k,r=rlocfind(num,den)gridxlabel(Real Axis),ylabel(Imaginary Axis)title(Root Locus)选定图中根轨迹与虚轴的交点,单击鼠标左键得:selected_point = 0.0059 + 9.8758ik = 1.0652e+003r= -11.4165 + 2.9641i -11.4165 - 2.9641i -0.0835 + 9.9528i -0.0835 - 9.9528i3.(3)
3、num=0.05 1;den=0.0008568 0.01914 0.1714 1 0;rlocus(num,den)k,r=rlocfind(num,den)Gridxlabel(Real Axis),ylabel(Imaginary Axis)title(Root Locus)选定图中根轨迹与虚轴的交点,单击鼠标左键得:selected_point = 0.0237 + 8.3230ik = 7.6385r =-0.0916 + 8.4713i-0.0916 - 8.4713i-11.0779 + 1.2238i-11.0779 - 1.2238i4.2先令G(s)=1/s,则可得其单位阶
4、跃响应波形图为然后逐步添加如下:第一步、添加共轭极点-1+j1和-1-j1得到G(s)=1/s(s2+2s+2),运行可得其单位阶跃响应波形为第二步、添加共轭极点-3+j2和-3-j2得到G(s)=1/s(s2+2s+2)( s2+6s+13),运行后可得其单位阶跃响应波形为(2)通过添加零、极点凑系统:先令G(s)=1/(s+1),则可得其单位阶跃响应波形然后逐步添加如下:第一步、添加共轭极点-6+j8和-6-j8得到G(s)=1/(s+1)(s2+12s+100),运行后可得其单位阶跃响应波形为第二步、添加极点-10得到G(s)=1/(s+1)(s2+12s+100)(s+10),运行后可
5、得其单位阶跃响应波形为第三步、添加零点-12得到G(s)=(s+12)/(s+1)(s2+12s+100)(s+10), 运行后可得其单位阶跃响应波形为(3)通过添加零、极点凑系统:先令G(s)=1/s,则可得其单位阶跃响应波形图为然后逐步添加如下:第一步、添加极点-1/0.0714得到G(s)=1/s(0.0714s+1), 运行后可得其单位阶跃响应波形为第二步、添加一对共轭极点,即分子添加项(0.012s2+0.1s+1)后可得到G(s)=1/s(0.0714s+1)( 0.012s2+0.1s+1)运行后可得其单位阶跃响应波形为第三步、添加极点-20得到G(s)=1/s(0.0714s+
6、1)( 0.012s2+0.1s+1)(0.05s+1),运行后可得其单位阶跃响应波形为4.11 分别取 ,0.3,0.5,0.8,2时,系统的bode图绘制:2.(1)Bode图的绘制:num=0 0 0 0 10 ;den=5 24 -5 0 0;bode(num,den)gridNyquist图的绘制:num= 0 0 0 0 10;den= 5 24 -5 0 0;z,p,k=tf2zp(num,den); pp = 0 0 -5.0000 0.2000Nichols图的绘制num= 0 0 0 0 10;den= 5 24 -5 0 0;mag,phase=nichols(num,d
7、en);plot(phase,20*log10(mag)ngridStep曲线的绘制num= 0 0 0 0 10;den= 5 24 -5 0 0;step(num,den)gridnum=0 0 0 0 8 8 ;1 bode曲线的绘制:num=0 0 0 0 8 8 ;den=1 21 100 150 0 0 ;bode(num,den)gridNyquist曲线的绘制:num= 0 0 0 0 8 8;den= 1 21 100 150 0 0;z,p,k=tf2zp(num,den);nyquist(num,den)p = 0 0 -15.0000 -3.0000 + 1.0000i
8、 -3.0000 - 1.0000iNichols图的绘制:num= 0 0 0 0 8 8;den= 1 21 100 150 0 0; mag,phase=nichols(num,den);plot(phase,20*log10(mag)ngridStep曲线的绘制num= 0 0 0 0 8 8;den= 1 21 100 150 0 0;step(num,den)gridbode曲线的绘制:num= 0 0 0 1.333 4;den=0.0001 0.008 0.17 1 0;bode(num,den)gridNyquist曲线的绘制:num= 0 0 0 1.333 4;den=0
9、.0001 0.008 0.17 1 0;z,p,k=tf2zp(num,den); pnyquist(num,den)p = 0-50.0000 -20.0000 -10.0000Nichols图的绘制:num= 0 0 0 1.333 4 ;den=0.0001 0.008 0.17 1 0;mag,phase=nichols(num,den);plot(phase,20*log10(mag);ngridStep曲线的绘制num= 0 0 0 1.333 4;den=0.0001 0.008 0.17 1 0;step(num,den)gridnum= 0 0 1 1;den=0.1 1
10、0 0;gm,pm,wcg,wcp=margin(num,den);gm,pm,wcg,wcpgm = Infpm = 44.4594wcg = Inf wcp = 1.26475.3num0=10; den0=conv(1,0,conv(1,1,1,2); w=logspace(-1,1.2); gm1,pm1,wcg1,wcp1=margin(num0,den0);Warning: The closed-loop system is unstable. In lti.margin at 89 In margin at 92 mag1,phase1=bode(num0,den0,w); gm
11、1,pm1,wcg1,wcp1ans = 0.6000 -12.9919 1.4142 1.8020 margin(num0,den0) grid; wc=1.41; beit=10; T2=10/wc; lw=20*log10(w/1.41)-4.44; il,ii=min(abs(lw+20); w1=w(ii); numc1=1/w1,1;denc1=1/ (beit*w1),1; numc2= T2,1;denc2= beit*T2,1; numc,denc=series(numc1,denc1,numc2,denc2); num,den=series(num0,den0,numc,d
12、enc);printsys(numc,denc) num/den = 31.0168 s2 + 11.4656 s + 1 - 31.0168 s2 + 71.3593 s + 1 disp(校正之后的系统开环传递函数为:);printsys(num,den)校正之后的系统开环传递函数为: num/den = 310.1682 s2 + 114.6557 s + 10 - 31.0168 s5 + 164.4098 s4 + 277.1116 s3 + 145.7186 s2 + 2 s mag2,phase2=bode(numc,denc,w); mag,phase=bode(num,den
13、,w); gm,pm,wcg,wcp=margin(num,den); subplot(2,1,1);semilogx(w,20*log10(mag),w,20*log10(mag1),-,w,20*log10(mag2),-.); grid; ylabel(幅值(db); title(-Go,-Gc,GoGc); subplot(2,1,2); semilogx(w,phase,w,phase1,-,w,phase2,-,w,(w-180-w),:); grid; ylabel(相位(0); xlabel(频率(rad/sec); title(校正后:幅值裕量=,num2str(20*log10(gm),db,相位裕量=,num2str(pm),0);
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1