控制系统的MALAB仿真与设计第七章.docVIP

  • 2
  • 0
  • 约7.66千字
  • 约 6页
  • 2016-10-16 发布于贵州
  • 举报
控制系统的MALAB仿真与设计第七章

7.1 7.2 7.3 7.4 7.5 7.6 7.7 function [sys,x0,str,ts]=ww(t,x,u,flag) %定义连续系统的S函数 A=[0,1;-0.4,-0.2]; B=[0;0.2]; C=[1,0]; D=0; switch flag, case 0, [sys,x0,str,ts]=mdlInitializeSizes(A,B,C,D); case 1, sys=mdlDerivatives(t,x,u,A,B,C,D); case 2, sys=mdlUpdate(t,x,u); case 3, sys=mdlOutputs(t,x,u,A,B,C,D); case 4, sys=mdlGetTimeOfNextVarHit(t,x,u); case 9, sys=mdlTerminate(t,x,u); otherwise error([Unhandled flag = ,num2str(flag)]); end %============================================================================= function [sys,x0,str,ts]=mdlInitializeSizes(A,B,C,D) sizes = simsizes; sizes.NumContStates = 2; sizes.NumDiscStates = 0; sizes.NumOutputs = 1; sizes.NumInputs = 1; sizes.DirFeedthrough = 1; sizes.NumSampleTimes = 1; sys = simsizes(sizes); x0 = [0;0]; str = []; ts = [0 0]; %============================================================================= function sys=mdlDerivatives(t,x,u,A,B,C,D) sys = A*x+B*u; %============================================================================= function sys=mdlUpdate(t,x,u) sys = []; %============================================================================= function sys=mdlOutputs(t,x,u,A,B,C,D) sys = C*x+D*u; %============================================================================= function sys=mdlGetTimeOfNextVarHit(t,x,u) sampleTime = 1; sys = t + sampleTime; %============================================================================= function sys=mdlTerminate(t,x,u) sys = []; spacing of 100mm. C, line line line nearby. D, spare wire unified terminal strip Terminal (terminal strip at the top of the vertical, horizontal terminal strip from the harness to Terminal Pai end at the beginning), length to ensure as far as Terminal and set aside. After e, form a wire harness, cable, line. When the line should be in the core wire for better identification and marking on the cards will be prepared in advance, alternate core core content for

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档