Matlab大作业2Word文件下载.docx
《Matlab大作业2Word文件下载.docx》由会员分享,可在线阅读,更多相关《Matlab大作业2Word文件下载.docx(22页珍藏版)》请在冰点文库上搜索。
同理,忽略电枢绕组的电感L,简化系统传递函数方框图如下
三、系统分析
1.分析时间响应
其传递函数如下:
(1)系统时间响应
令τ=0、τ=0.0125、τ=0.025,应用impulse函数,可得到系统单位脉冲响应;
应用step函数,可得系统单位跃阶响应。
其程序与曲线图像如下:
t=0:
0.001:
1;
%
nG=[109.375];
tao=0;
dG=[3.1251+109.375*tao109.375];
G1=tf(nG,dG);
tao=0.0125;
G2=tf(nG,dG);
tao=0.025;
G3=tf(nG,dG);
[y1,T]=impulse(G1,t);
[y1a,T]=step(G1,t);
[y2,T]=impulse(G2,t);
[y2a,T]=step(G2,t);
[y3,T]=impulse(G3,t);
[y3a,T]=step(G3,t);
subplot(121),plot(T,y1,'
--'
T,y2,'
-'
T,y3,'
legend('
tao=0'
'
tao=0.0125'
tao=0.025'
xlabel('
t(sec)'
),ylabel('
x(t)'
);
gridon;
subplot(122),plot(T,y1a,'
T,y2a,'
T,y3a,'
(2)系统的瞬态性能指标
分别计算在τ=0、τ=0.0125、τ=0.025时系统的性能指标.其程序与结果如下:
yss=1;
dta=0.02;
y1=step(G1,t);
y2=step(G2,t);
y3=step(G3,t);
r=1;
whiley1(r)<
yss;
r=r+1;
end
tr1=(r-1)*0.001;
[ymax,tp]=max(y1);
tp1=(tp-1)*0.001;
mp1=(ymax-yss)/yss;
s=1001;
whiley1(s)>
1-dta&
y1(s)<
1+dta;
s=s-1;
ts1=(s-1)*0.001;
whiley2(r)<
tr2=(r-1)*0.001;
[ymax,tp]=max(y2);
tp2=(tp-1)*0.001;
mp2=(ymax-yss)/yss;
whiley2(s)>
y3(s)<
ts2=(s-1)*0.001;
whiley3(r)<
tr3=(r-1)*0.001;
[ymax,tp]=max(y3);
tp3=(tp-1)*0.001;
mp3=(ymax-yss)/yss;
whiley3(s)>
ts3=(s-1)*0.001
[tr1tp1mp1ts1;
tr2tp2mp2ts2;
tr3tp3mp3ts3]
subplot(121),plot(T,y1,)
结果:
Τ
上升时间/s
峰值时间/s
最大超调量/%
调整时间
0.2710
0.5310
0.9185
1.0000
0.125
0.2770
0.5320
0.8175
0.25
0.2850
0.5340
0.7269
2.分析系统的频率特性
(1)利用MATLAB绘制Nyquist图
其程序与曲线图像如下:
nunG1=35;
denG1=[10.3235];
[re,im]=nyquist(nunG1,denG1);
plot(re,im);
(2)利用MATLAB绘制Bode图
;
w=logspace(-2,3,100);
bode(nunG1,denG1,w);
(3)利用MATLAB求系统的频域特征量
应用带输出函数的nyquist函数和bode函数,可以得到系统的实频特性、虚频特性、幅频特性,从而得到系统的频域特征量。
其程序与结果如下
numG1=35;
w=logspace(-1,3,100);
[Gm,Pm,w]=bode(numG1,denG1,w);
[Mr,k]=max(Gm);
Mr=20*log10(Mr),Wr=w(k)
M0=20*log10(Gm
(1))
n=1;
while20*log10(Gm(n))>
=-3;
n=n+1;
Wb=w(n)
结果
谐振峰值/dBMr=24.2916
峰值频率/s-Wr=5.9948
零频值/dBM0=0.0025
截止频率/s-1Wb=9.5455
(由于模型数据太过繁琐,后续采用书中例题的数据)
3分析系统的稳定性
其程序与结果如下:
clear
K=10;
num1=4000*K;
den=conv([10],[0.22002000]);
[mag,phase,w]=bode(num1,den);
figure
(1);
margin(mag,phase,w);
holdon
figure
(2);
sys1=tf(num1,den);
sys=feedback(sys1,1);
step(sys);
[Gm1Pm1Wg1Wc1]=margin(num1,den);
K=40;
num2=4000*K;
[mag,phase,w]=bode(num2,den);
figure(3);
figure(4);
sys2=tf(num2,den);
sys=feedback(sys2,1);
[Gm2Pm2Wg2Wc2]=margin(mag,phase,w);
K=600;
num3=4000*K;
[mag,phase,w]=bode(num3,den);
figure(5);
figure(6);
sys3=tf(num3,den);
sys=feedback(sys3,1);
[Gm3Pm3Wg3Wc3]=margin(num3,den);
[20*log10(Gm1)Pm1Wg1Wc1];
[20*log10(Gm1)Pm2Wg2Wc2];
[20*log10(Gm1)Pm3Wg3Wc3];
[33.9794,38.1203,100.0,12.5437;
21.938,18.5503,100.000,27.5315]
四,矫正
绘制矫正后系统的Bode图,检验系统的相对裕度是否符合要求
程序:
>
K=40;
sys=tf(num2,den);
[mag,phase,w]=bode(sys,w);
gama=45;
[mu,pu]=bode(sys,w);
gam=gama*pi/180;
alfa=(1-sin(gam))/(1+sin(gam));
adb=20*log10(mu);
am=10*log10(alfa);
ca=adb+am;
wc=spline(adb,w,am);
T=1/(wc*sqrt(alfa));
alfa=alfa*T;
Gc=tf([T,1],[alfa,1])
Gc=
0.0554s+1
--------------
0.009506s+1
Continuous-timetransferfunction.
den1=conv([10],[0.22002000]);
sys1=tf(num3,den1);
num3=[0.0554,1];
den3=[0.009506,1];
sys2=tf(num3,den3);
sys=sys1*sys2;
[mag,phase,w]=bode(sys);
相对裕度=50.4695oC
幅值域度=27.1084dB相位裕度=55.1973oC
超前校正后系统的Bode图
系统矫正后,其相当裕度由18.5503o变为50.1973o,幅值裕度由矫正前的21.938dB变为27.1084dB.因此通过相位超前矫正环节后,可使系统性能满足设计要求。