资源描述:
《一节系统单位阶跃响应.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、多项式拟合时间常数T=1.15sclearallnum=1;den=[1,1];y=tf(num,den);step(0.92*y);gridon;holdon;y=0.001*[0,100,200,300,400,500,600,700,800,820,840,860,880,900,900];x=0.001*[0,140,300,460,660,880,1200,1560,2340,2660,2820,3100,4000,4400,5000];plot(x,y,'k');holdon;p=polyfit(x,y,3);yt=polyval(p,x);plot(x,yt,'
2、r');t=0:0.01:5;yt=polyval(p,t);Index=find(yt>0.632*max(yt))T=t(min(Index))xlabel('t/s'),ylabel('U/V')title('T=1s,U=-1v时单位阶跃响应')holdongridon时间常数T=1.098sx=0:0.001:5;a=-0.9204;b=0.9022;c=0.9119;yt=a*exp(-b*x)+c;Index=find(yt>0.632*max(yt))T=x(min(Index))时间常数T=1.19sclearallnum=1;den=[1,1];y=tf(
3、num,den);step(-0.92*y);gridon;holdon;x=0.001.*[0,160,260,480,680,860,1180,1540,2180,2800,3280,4000,5600,6000];y=0.001.*[0,-100,-200,-320,-400,-500,-600,-700,-800,-840,-880,-900,-920,-920];plot(x,y,'k');holdon;p=polyfit(x,y,3);yt=polyval(p,x);plot(x,yt,'r');t=0:0.01:6;yt=polyval(p,t);Index=f
4、ind(yt<0.632*min(yt))T1=t(min(Index))xlabel('t/s'),ylabel('U/v')title('T=1s,U=-1v时单位阶跃响应')holdongridon时间常数T=1.111sx=0:0.001:5;a=0.9388;b=0.8952;c=-0.9261;yt=a*exp(-b*x)+c;Index=find(yt<0.632*min(yt))T1=x(min(Index))