资源预览内容
第1页 / 共34页
第2页 / 共34页
第3页 / 共34页
第4页 / 共34页
第5页 / 共34页
第6页 / 共34页
第7页 / 共34页
第8页 / 共34页
第9页 / 共34页
第10页 / 共34页
亲,该文档总共34页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
陈涵11东北大学自动化控制基础系统计算机辅助设计实验2022年东北大学自动化控制系统计算机辅助设计实验控制系记录算机辅助设计第一部分1 function dx=lorenzeq(t,x)dx=-x(2)-x(3);x(1)+0.2*x(2);0.2+(x(1)-5.7)*x(3); x0=0;0;0; t,y=ode45(lorenzeq,0,100,x0); plot(t,y) figure;plot3(y(:,1),y(:,2),y(:,3),grid,2function y,yeq=f2a(x)yeq=;y=4*x(1)2+x(2)2-4; Aeq=;Beq=;A=;B=; xm=0;0; xM=;x0=0;0; f1=inline(x(1)2-2*x(1)+x(2); x,f=fmincon(f1,x0,A,B,Aeq,Beq,xm,xM,f2a);x,fans = 1.0000 0f =-13(a) s=tf(s);G=(s3+4*s+2)/s3/(s2+2)/(s2+1)3+2*s+5Transfer function: s3 + 4 s + 2-s11 + 5 s9 + 9 s7 + 2 s6 + 12 s5 + 4 s4 + 12 s3(b) z=tf(z,0.1); H=(z2+0.568)/(z-1)/(z2-0.2*z+0.99)Transfer function: z2 + 0.568-z3 - 1.2 z2 + 1.19 z - 0.99Sampling time: 0.14 A=0 1 0;0 0 1;-5 -4 -13; B=0;0;2; C=1 0 0;0 0 0;0 0 0; D=0; G=ss(A,B,C,D); Ga = x1 x2 x3 x1 0 1 0 x2 0 0 1 x3 -5 -4 -13b = u1 x1 0 x2 0 x3 2c = x1 x2 x3 y1 1 0 0 y2 0 0 0 y3 0 0 0d = u1 y1 0 y2 0 y3 0Continuous-time model. G=tf(G)Transfer function from input to output. 2 #1: - s3 + 13 s2 + 4 s + 5 #2: 0 #3: 0 GG=zpk(G)Zero/pole/gain from input to output. 2 #1: - (s+12.72) (s2 + 0.2836s + 0.3932) #2: 0 #3: 0根据微分方程也可以直接写出传递函数模型: num=2; den=1,13,4,5; G=tf(num,den); GTransfer function: 2-s3 + 13 s2 + 4 s + 5 GG=zpk(G)Zero/pole/gain: 2-(s+12.72) (s2 + 0.2836s + 0.3932)5 num=1,2; den=1,1,0.16; H=tf(num,den,Ts,1); HTransfer function: z + 2-z2 + z + 0.16Sampling time: 16function H=feedback(G1,G2,key)if nargin=2;key=-1;end,H=G1/(sym(1)-key*G1*G2);H=simple(H); syms J Kp Ki s; gc=(Kp*s+Ki)/s; g=(s+1)/(J*s2+2*s+5); gg=feedback(g*gc,1) gg=feedback(g*gc,1)gg =(Ki + Kp*s)*(s + 1)/(J*s3 + (Kp + 2)*s2 + (Ki + Kp + 5)*s + Ki)7(a) s=tf(s); G=(211.87*s+317.64)/(s+20)/(s+94.34)/(s+0.1684); Gc=(169.6*s+400)/s/(s+4); Hs=1/(0.01*s+1); GG=feedback(G*Gc,Hs)Transfer function: 359.3 s3 + 3.732e004 s2 + 1.399e005 s + 127056-0.01 s6 + 2.185 s5 + 142.1 s4 + 2444 s3 + 4.389e004 s2 + 1.399e005 s + 127056 zpk(GG)Zero/pole/gain: 35933.152 (s+100) (s+2.358) (s+1.499)-(s2 + 3.667s + 3.501) (s2 + 11.73s + 339.1) (s2 + 203.1s + 1.07e004)(b) z=tf(z); G=(35786.7*z-1+108444)/(z-1+4)*(z-1+20)*(z-1+74.04); Gc=1/(z-1-1); H=1/(0.5*z-1-1); GG=feedback(G*Gc,H)Transfer function: -108444 z6 + 1.844e004 z5 + 1.789e004 z4-1.144e005 z6 + 2.876e004 z5 + 274.2 z4 + 782.4 z3 + 47.52 z2 + 0.5 z Sampling time: unspecified zpk(GG)Zero/pole/gain: -0.94821 z4 (z-0.5) (z+0.33)-z (z+0.3035) (z+0.04438) (z+0.01355) (z2 - 0.11z + 0.02396)Sampling time: unspecified8 s=tf(s);c1=feedback(1/(s+1)*s/(s2+2),(4*s+2)/(s+1)2);c2=feedback(1/s2,50);G=feedback(c1*c2,(s2+2)/(s3+14)Transfer function: s6 + 2 s5 + s4 + 14 s3 + 28 s2 + 14 s-s10 + 3 s9 + 55 s8 + 175 s7 + 300 s6 + 1323 s5 + 2656 s4 + 3715 s3 + 7732 s2 + 5602 s + 1400 9 s=tf(s); G=(s+1)2*(s2+2*s+400)/(s+5)2/(s2+3*s+100)/(s2+3*s+2500); G1=c2d(G,0.01)Transfer function:4.716e-005 z5 - 0.0001396 z4 + 9.596e-005 z3 + 8.18e -005 z2 - 0.0001289 z + 4.355e-005 -z6 - 5.592 z5 + 13.26 z4 - 17.06 z3 + 12.58 z2 - 5.032 z + 0.8521Sampling time: 0.01step(G1) G2=c2d(G,0.1)Transfer function:0.0003982 z5 - 0.0003919 z4 - 0.000336 z3
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号