您好,欢迎访问三七文档
5.2设222(x,y,z)4yzfxxyz,求函数f在(0.5,0.5,0.5)附近的最小值。解:fun=inline('x(1)+x(2)^2/(4*x(1))+x(3)^2/x(2)+2/x(3)','x');x0=[0.5,0.5,0.5];[xfval]=fminsearch(fun,x0)x=0.50001.00001.0000fval=4.0000函数f在(0.5,0.5,0.5)附近的最小值为:4.00006.8求方程组1221xyzxyzxyz的解。解:A=[111;1-11;2-1-1];b=[1;2;1];B=[A,b];rank(A),rank(B)ans=3ans=3X=A\bX=0.6667-0.50000.8333方程组的解为:0.6667x,=-0.5000y,=0.8333z6.11求函数3()sintftet的拉普拉斯变换。解:symst;ft=exp(-3*t)*sin(t);Fs=laplace(ft)Fs=1/((s+3)^2+1)函数3()sintftet的拉普拉斯变换为:21(s3)17.11单位负反馈系统的开环传递函数为1000(s)(0.1s1)(0.001s1)Gs应用Simulink仿真系统构建其阶跃响应曲线。解:模型仿真图1单位阶跃响应曲线图17.7用S函数创建二阶系统0.20.40.2(t)yyyu,0yy,()ut为单位阶跃信号,使用Simulink创建和仿真系统的模型。解:function[sys,x0,str,ts]=sfun1(t,x,u,flag)switchflag,case0[sys,x0,str,ts]=mdlInitializeSizes;case3sys=mdlOutputs(t,x,u);case{1,2,4,9}sys=[];endfunction[sys,x0,str,ts]=mdlInitializeSizes()sizes=simsizes;sizes.NumContStates=0;sizes.NumDiscStates=0;sizes.NumOutputs=1;sizes.NumInputs=-1;sizes.DirFeedthrough=1;sizes.NumSampleTimes=1;sys=simsizes(sizes);x0=[];str=[];ts=[00];functionsys=mdlOutputs(t,x,u)sys=u+(exp(-u/10)*cos((39^(1/2)*u)/10))/2-(19*39^(1/2)*exp(-u/10)*sin((39^(1/2)*u)/10))/78-1/2;8.1创建连续二阶系统和离散系统的传递函数模型。(1)25()22Gsss解:num=5;den=[122];sysc=tf(num,den)sysc=5-------------s^2+2s+2Continuous-timetransferfunction.(2)225()22sGsess解:s=tf('s');H=[5/(s^2+2*s+2)];clears=tf('s');sysc=[5/(s^2+2*s+2)];sysc.inputdelay=2sysc=5exp(-2*s)*-------------s^2+2s+2Continuous-timetransferfunction.(3)20.5()1.50.5zGzzz解:G=tf([0.50],[1-1.50.5],-1)G=0.5z-----------------z^2-1.5z+0.5Sampletime:unspecifiedDiscrete-timetransferfunction.8.2已知系统的传递函数为22(0.5)()(0.1)1sGss建立系统的传递函数模型,并转换为零极点模型和状态空间模型。解:num=[21]den=[10.21.01];G=tf(num,den)G=2s+1------------------s^2+0.2s+1.01Continuous-timetransferfunction.G1=zpk(G)G1=2(s+0.5)-------------------(s^2+0.2s+1.01)Continuous-timezero/pole/gainmodel.G2=ss(G)G2=a=x1x2x1-0.2-1.01x210b=u1x12x20c=x1x2y110.5d=u1y10Continuous-timestate-spacemodel.8.4已知系统的方框图如题图所示。其中11R,22R,13C,24C,计算系统的()()()CssRs。题图8.1系统的方框图解:R1=1;R2=2;C1=3;C2=4;G1=tf(1,R1);G2=tf(1,[C10]);G3=tf(1,R2);G4=tf(1,[C20]);sys1=series(G3,G4);sys2=feedback(sys1,1);sys3=series(G1,G2);sys4=feedback(sys3,1);SYS5=series(sys4,sys2);sys=feedback(sys5,tf(conv([R1],[C10]),1))sys=1-----------------24s^2+14s+1Continuous-timetransferfunction.9.1系统的传递函数为22251()23ssGsss绘制出其根轨迹。伯德图和奈奎斯图。解:num=[251];den=[123];sys=tf(num,den);subplot(3,1,1)rlocus(sys)gridonsubplot(3,1,2)bode(sys)gridonsubplot(3,1,3)nyquist(sys)gridon9.5系统的开环传递函数为27(5)()()(10)(1)sGsHssss计算系统的幅值裕度和相角裕度。解:num=[735];den=conv(conv([100],[110]),[11]);sys=tf(num,den)sys=7s+35---------------------s^4+11s^3+10s^2Continuous-timetransferfunction.[Gm,Pm,Wcg,Wcp]=margin(sys)Gm=0Pm=-47.2870Wcg=0Wcp=1.4354
本文标题:控制系统仿真
链接地址:https://www.777doc.com/doc-5007977 .html