6-subsystem mask.pptVIP

  • 28
  • 0
  • 约1.36千字
  • 约 15页
  • 2016-02-24 发布于江苏
  • 举报
6-subsystemamp;mask.ppt

Simulink动态系统仿真2 子模块及模块封装技术 对于较复杂的Simulink模型,通过自定义功能模块可以简化图形,减少功能模块的个数,有利于模型的分层构建。 子系统的创建 通过子系统模块Subsystem建立 通过压缩已有模块建立* 在模型窗口中建立所定义功能模块的子模块。 用鼠标将这些需要组合的功能模块框住,然后选择Edit菜单下的Create Subsystem即可。 Example1: 试编写一个实现y=kx+b功能的子模块。 In:x Out:y 参数:k, b 模块的封装   选中Subsystem功能模块,再打开Edit菜单中的Mask Subsystem进入mask的编辑窗口 模块的封装 Icon:设定功能模块的外观。 Drawing commands的用法. Parameters:设定模块参数 Initialization:子模块的初始化 Documentation:设计模块的文字说明 Mask type: 模块最上面的说明 Mask description:模块的详细描述 Mask help:点help后显示的内容. 封装模块的查看 Look Under Mask Simulink与其他函数的联接 Fcn Matlab Fcn S-Function Fcn 模块 Apply a specified expression to the input Input: Vector or Scalar Output: Scalar (double双精度) MATLAB Fun Apply a MATLAB function or expression to the input. Ex6_1 试编写一个实现y=k1x1+k2x2功能的子模块。 In1:x1 In2:x2 Out:y 参数:k1, k2 Ex6_2 试编写一个实现状态空间表达式功能的子模块。 In1:u Out:y,x 参数:A,B,C,D Ex6_3 有下列模型方程组,试分析此模型的行为: 其中: Ex6_4 对该对象施加PID控制作用(要求利用Gain,Integer,Derivative模块自己搭建PID控制器),用Simulink构建该系统的单位负反馈模型,调整PID参数,并观察结果. 模块练习 To Workspace To File From File From Workspace * subsystem For Example: sltank This block is slower than the Fcn block because it calls the MATLAB parser(分析程序) during each integration step. Consider using built-in blocks (such as the Fcn block or the Math Function block) instead, or writing the function as an M-file or MEX-file S-function, then accessing it using the S-Function block. *

文档评论(0)

1亿VIP精品文档

相关文档