资源描述:
《由实验数据求传递函数范例》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、阶跃响应采样数据如下表所示,求出传递函数的估计值。ty(t)ty(t)ty(t)000.200.03380.900.44090.020.00010.220.03951.000.49240.040.00050.240.04801.500.69040.060.00140.260.05712.000.81210.080.00310.280.06682.500.88600.100.00570.300.07713.000.93090.120.00910.500.19793.500.95810.140.01350.600.26244.000.97460.160.01870.700.32535.000
2、.99070.180.02480.800.3851解:MATLAB程序如下:t=[0:0.02:0.300.50:0.10:1.001.50:0.50:4.005.00];yt=[00.00010.00050.00140.00310.00570.00910.01350.01870.02480.0338...0.03950.04800.05710.06680.07710.19790.26240.32530.38510.4409...0.49240.69040.81210.88600.93090.95810.97460.9907];yinf=1;%firstlyfittingeuqation
3、y1=log(yinf-yt);p=polyfit(t,y1,1);alpha=-p(1);A=-exp(p(2));yt1=yinf+A*exp(-alpha*t);figure(1)plot(t,yt,'*',t,yt1)gridon;figure(2)plot(t,p(1)*t+p(2),t,y1,'*');gridon;e1=yt1-yt;figure(3)plot(t,e1)gridon;shga1=find(abs(e1)<=0.05);a11=find(t(a1)>1.0);y11=log(yinf-yt(a1(a11(1)):29));p=polyfit(t(a1(a11
4、(1)):29),y11,1);alpha=-p(1);A=-exp(p(2));figure(4)plot(t,p(1)*t+p(2),t,y1,'*');gridon;yt11=yinf+A*exp(-alpha*t);figure(5)plot(t,yt,'*',t,yt11)gridon;%secondlyfittingeuqationys2=yt-yt11;a2=find(ys2>=0.0001);y2=log(ys2(a2));t2=t(a2);p2=polyfit(t2,y2,1);beta=-p2(1);B=exp(p2(2));yt2=yt11+B*exp(-beta*
5、t);figure(6)plot(t,yt,'*',t,yt2)gridon;e2=yt2-yt;figure(7)plot(t,e2)gridon;shgb=find(abs(e2)<=0.001);b2=find(t(b)>0.5);y22=log(ys2(b(b2(1)):29));p=polyfit(t(b(b2(1)):29),y22,1);beta=-p2(1);B=exp(p2(2));yt22=yt11+B*exp(-beta*t);figure(8)plot(t,e2)gridon;shgfigure(9)plot(t,yt,'*',t,yt22)gridon;hold
6、on;e2=yt22-yt;symsxff=(x+alpha)*(x+beta)+A*(x+beta)*x+B*(x+alpha)*x;f=collect(f);num=sym2poly(f);den=conv(conv([1,0],[1,alpha]),[1,beta]);tf(num,den(1:3))[y,t3]=step(tf(num,den(1:3)));figure(10)plot(t3,y,'k',t,yt,'*')结果如下:(只给出主要的结果)