资源描述:
《控制系统数字仿真与cad实验答案》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、程序及仿真结果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.已知元件的实验数据如下,拟合这一数据,并尝试给出其特性方程。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.分别用欧拉法、二阶龙格-库塔法、四阶龙格-库塔法求下面系统的输出响应y(t)在0≤t≤1上,h=0.1时的数值解。要求保留4位小数,并将三种方法的结果与真解进行比较。2.若为如何编程计算?第一题:程序h=0.1;disp('欧拉法求函数的数值解为');disp('y=');y=1;fort=0:h:1m=y;disp(y);y=m-2*m*h;end运行结果为>>欧拉法求函数的数值解为y=10.80000.640
6、00.51200.40960.32770.26210.20970.16780.13420.1074>>程序:h=0.1;disp('二阶龙格—库塔法函数的数值解为');disp('y=');y=1;fort=0:h:1disp(y);k1=-2*y;k2=-2*(y+k1*h);y=y+(k1+k2)*h/2;end运行结果:>>二阶龙格—库塔法函数的数值解为y=10.82000.67240.55140.45210.37070.30400.24930.20440.16760.1374>>程序:h=0.1;disp('四阶龙格—库塔法求解函数数值解为');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运行结果:>>四阶龙格—库塔法求解函数数值解为y=10.81870.67030.54880.44930.36790.30120.24660.20190.16530.1353>>真解程序:h=0.1;disp('函数的离散时刻解为');disp('y=');y=1;fort=0:h:1y=exp(-2*t);disp(y);end运