資源描述:
《控制系統(tǒng)數(shù)字仿真與cad實驗答案》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、程序及仿真結(jié)果1.1G(s)=den=[1,20,70,100,48];num=[1,14,48,48];[A,B,C,D]=tf2ss(num,den)[z,p,k]=ss2zp(A,B,C,D)[R,P,H]=residue(num,den)A=-20-70-100-48100001000010B=1000C=1144848D=0z=-9.4641-2.5359-2.0000p=-16.0051-1.5269+0.9247i-1.5269-0.9247i-0.9412k=1.0000R=0.3892-0.0932-0.3754i-0.0932+0.3754i0.7
2、973P=-16.0051-1.5269+0.9247i-1.5269-0.9247i-0.9412H=[]>>1.2=y=[0202]XA=[2.25,-5,-1.25,-0.5;2.25,-4.25,-1.25,-0.25;0.25,-0.5,-1.25,-1;1.25,-1.75,-0.25,-0.75];B=[4;2;2;0];C=[0,2,0,2];[num,den]=ss2tf(A,B,C,D)[z,p,k]=ss2zp(A,B,C,D)[R,P,H]=residue(num,den)G=tf(num,den)num=04.000014.000022.00
3、0015.0000den=1.00004.00006.25005.25002.2500z=-1.0000+1.2247i-1.0000-1.2247i-1.5000p=-0.5000+0.8660i-0.5000-0.8660i-1.5000-1.5000k=4.0000R=4.0000-0.00000.0000-2.3094i0.0000+2.3094iP=-1.5000-1.5000-0.5000+0.8660i-0.5000-0.8660iH=[]Transferfunction:4s^3+14s^2+22s+15------------------------
4、--------------s^4+4s^3+6.25s^2+5.25s+2.25>>2.已知元件的實驗數(shù)據(jù)如下,擬合這一數(shù)據(jù),并嘗試給出其特性方程。X0.01001.01002.01003.01004.0100Y2.54377.88849.624211.607111.9727X5.01006.01007.01008.01009.0100y13.218914.267914.613415.404515.0805x=0.01:1:9.01;y=[2.54377.88849.624211.607111.972713.218914.267914.613415.404515.0
5、805];p=polyfit(x,y,3);xi=0:0.01:9.01;yi=polyval(p,xi);plot(x,y,xi,yi)Grid實驗2的1.分別用歐拉法、二階龍格-庫塔法、四階龍格-庫塔法求下面系統(tǒng)的輸出響應(yīng)y(t)在0≤t≤1上,h=0.1時的數(shù)值解。要求保留4位小數(shù),并將三種方法的結(jié)果與真解進行比較。2.若為如何編程計算?第一題:程序h=0.1;disp('歐拉法求函數(shù)的數(shù)值解為');disp('y=');y=1;fort=0:h:1m=y;disp(y);y=m-2*m*h;end運行結(jié)果為>>歐拉法求函數(shù)的數(shù)值解為y=10.80000.640
6、00.51200.40960.32770.26210.20970.16780.13420.1074>>程序:h=0.1;disp('二階龍格—庫塔法函數(shù)的數(shù)值解為');disp('y=');y=1;fort=0:h:1disp(y);k1=-2*y;k2=-2*(y+k1*h);y=y+(k1+k2)*h/2;end運行結(jié)果:>>二階龍格—庫塔法函數(shù)的數(shù)值解為y=10.82000.67240.55140.45210.37070.30400.24930.20440.16760.1374>>程序:h=0.1;disp('四階龍格—庫塔法求解函數(shù)數(shù)值解為');disp('y
7、=');y=1;fort=0:h:1disp(y);k1=-2*y;k2=-2*(y+k1*h/2);k3=-2*(y+k2*h/2);k4=-2*(y+k3*h);y=y+(k1+2*k2+2*k3+k4)*h/6;end運行結(jié)果:>>四階龍格—庫塔法求解函數(shù)數(shù)值解為y=10.81870.67030.54880.44930.36790.30120.24660.20190.16530.1353>>真解程序:h=0.1;disp('函數(shù)的離散時刻解為');disp('y=');y=1;fort=0:h:1y=exp(-2*t);disp(y);end運