1、flagabc);t,x=ode45(f,0,100,0;0;0,0.2,0.2,5.7);plot3(x(:,1),x(:,2),x(:,3),grid,figure,plot(x(:,2),grid2.y=(x)x(1)2-2*x(1)+x(2);ff=optimset;ff.LargeScale=off;ff.TolFun=1e-30;ff.TolX=1e-15;ff.TolCon=1e-20;x0=1;1;1;xm=0;0;xM=;A=;B=;Aeq=;Beq=;x,f,c,d=fmincon(y,x0,A,B,Aeq,Beq,xm,xM,wzhfc1,ff)Warning: Opti
2、ons LargeScale = and Algorithm =trust-region-reflective conflict.Ignoring Algorithm and running active-set algorithm. To runtrust-region-reflective, setLargeScale = on. To run active-set without this warning, useAlgorithm = active-set. In fmincon at 456 Local minimum possible. Constraints satisfied.
3、fmincon stopped because the size of the current search direction is less thantwice the selected value of the step size tolerance and constraints are satisfied to within the selected value of the constraint tolerance.Active inequalities (to within options.TolCon = 1e-20): lower upper ineqlin ineqnonl
4、in 2 x = 1.0000 0f = -1.0000c = 4d = iterations: 5funcCount: 20lssteplength: 1stepsize: 3.9638e-26algorithm: medium-scale: SQP, Quasi-Newton, line-searchfirstorderopt: 7.4506e-09constrviolation:message: 1x766 char3.(a) s=tf(sG=(s3+4*s+2)/(s3*(s2+2)*(s2+1)3+2*s+5)G = s3 + 4 s + 2 - s11 + 5 s9 + 9 s7
5、+ 2 s6 + 12 s5 + 4 s4 + 12 s3 Continuous-time transfer function.(b) z=tf(z,0.1);H=(z2+0.568)/(z-1)*(z2-0.2*z+0.99)H = z2 + 0.568 - z3 - 1.2 z2 + 1.19 z - 0.99Sample time: 0.1 secondsDiscrete-time transfer function.4. A=0 1 0;0 0 1;-15 -4 -13;B=0 0 2C=1 0 0;D=0;G=ss(A,B,C,D),Gs=tf(G),Gz=zpk(G) a = x1
6、 x2 x3 x1 0 1 0 x2 0 0 1 x3 -15 -4 -13 b = u1 x1 0 x2 0 x3 2 c = y1 1 0 0 d = y1 0Continuous-time state-space model.Gs = 2 - s3 + 13 s2 + 4 s + 15Gz = - (s+12.78) (s2 + 0.2212s + 1.174) Continuous-time zero/pole/gain model.5.设采样周期为0.01s,0.01);H=(z+2)/(z2+z+0.16) z + 2 - z2 + z + 0.16 Sample time: 0.
7、01 seconds6. syms J Kp Ki s;G=(s+1)/(J*s2+2*s+5);Gc=(Kp*s+Ki)/s;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(G=(211.87*s+317.64)/(s+20)*(s+94.34)*(s+0.1684);Gc=(169.6*s+400)/(s*(s+4);H=1/(0.01*s+1);GG=feedback(G*Gc,H),Gd=ss(GG),Gz=zpk(GG) 359.3 s3 +
8、 3.732e04 s2 + 1.399e05 s + 127056 - 0.01 s6 + 2.185 s5 + 142.1 s4 + 2444 s3 + 4.389e04 s2 + 1.399e05 s + 127056Continuous-time transfer function.Gd = a = x1 x2 x3 x4 x5 x6 x1 -218.5 -111.1 -29.83 -16.74 -6.671 -3.029 x2 128 0 0 0 0 0 x3 0 64 0 0 0 0 x4 0 0 32 0 0 0 x5 0 0 0 8 0 0 x6 0 0 0 0 2 0 b =
9、 x1 4 x3 0 x4 0 x5 0 x6 0 c = y1 0 0 1.097 3.559 1.668 0.7573 d = 35933.152 (s+100) (s+2.358) (s+1.499) - (s2 + 3.667s + 3.501) (s2 + 11.73s + 339.1) (s2 + 203.1s + 1.07e04)Continuous-time zero/pole/gain model.(b)设采样周期为0.1sz=tf(G=(35786.7*z2+108444*z3)/(1+4*z)*(1+20*z)*(1+74.04*z);Gc=z/(1-z);H=z/(0.
10、5-z); -108444 z5 + 1.844e04 z4 + 1.789e04 z3 1.144e05 z5 + 2.876e04 z4 + 274.2 z3 + 782.4 z2 + 47.52 z + 0.5 x1 x2 x3 x4 x5 x1 -0.2515 -0.00959 -0.1095 -0.05318 -0.01791 x2 0.25 0 0 0 0 x3 0 0.25 0 0 0 x4 0 0 0.125 0 0 x5 0 0 0 0.03125 0 x1 1 y1 0.3996 0.6349 0.1038 0.05043 0.01698 y1 -0.9482Discrete-time state-space model. -0.94821 z3 (z-0.5) (z+0.33) - (z+0.3035) (z+0.04438) (z+0.01355) (z2 - 0.11z + 0.02396)Discret
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1