Simulink模块库简介在进行系统动态仿真之前,应绘制仿真系统框图,并确定仿真所需要的参数。
Simulink 模块库包含有大部分常用的建立系统框图的模块,下面简要介绍常用模块。
1、连续模块(continuous) (2)2、非连续模块(Discontinuous) (2)3、离散模块(Discrete) (3)4、逻辑和位操作模块(Logic and Bit Operation) (4)5、查找表模块(Lookup Table) (5)6.数学模块(Math Operations) (5)7、模型检测模块(Model Verification) (7)8、模型扩充模块(Model-Wide Utilities) (8)9、端口和子系统模块(Prot & Subsystems) (8)10、信号属性模块(Signal Attributes) (9)11、信号路线模块(Signal Routing) (10)12、接收器模块(Sinks) (11)13、输入源模块(Sources) (12)14、用户自定义函数模块(User-DefinedFunctions) (13)15、AdditionalMath&Discrete (14)综合 (15)1、连续模块(continuous)图 1(1)Derivative输入信号微分;(2)Integrator输入信号积分;(3)State-Space状态空间系统模型(4)Transfer-Fcn传递函数模型(5)Transport Delay输入信号延时一个固定时间再输出(6)Variable Transport Delay输入信号延时一个可变时间再输出(7)Zero-Ploe零极点模型2、非连续模块(Discontinuous)图 2(1)Backlash间隙非线性(2)Coulomb&Viscous Friction 库仑和粘度摩擦非线性(3)Dead Zone死区非线性(4)Dead Zone Dynamic 动态死区非线性(5)Hit Crossing冲击非线性(6)Quantizer量化非线性(7)Rate Limiter静态限制信号的变化速率(8)Rate Limiter Dynamic动态限制信号的变化速率(9)Relay滞环比较器,限制输出值在某一范围内变化(10)Saturation饱和输出,让输出超过某一值是能够饱和(11)Saturation Dynamic动态饱和输出(12)Wrap To Zero3、离散模块(Discrete)图 3(1)Difference差分环节(2)Discrete Derivative离散微分环节(3)Discrete Filter离散滤波器(4)Discrete State-Space离散状态空间系统模型(5)Discrete Transfer Fcn离散传递函数模型(6)Discrete Zero-Pole以零极点表示的离散传递函数模型(7)Discrete-Time Integrator离散时间积分器(8)First-Order Hold一阶保持器(9)Integer Delay整数被延迟(10)Memory输出本模块上一步的输入值(11)Tapped Delay延迟(12)Transfer Fcn First Order离散一阶传递函数(13)Transfer Fcn Lead or Lag传递函数(14)Transfer Fcn Real Zero离散零点传递函数(15)Unit Delay一个采样周期的延时(16)Weighted Moving Average权值移动平均模型(17)Zero-Order Hold零阶保持器4、逻辑和位操作模块(Logic and Bit Operation)图 4(1)Bit Clear位清零(2)Bit Set位置位(3)Bitwise Operator逐位操作(4)Combinatorial Logic组合逻辑(5)Compare To Constant和常量比较(6)Compare To Zero和零比较(7)Detect Change检测跳变(8)Detect Decrease检测递减(9)Detect Fall Negative检测负上升沿(10)Detect Fall Nonpositive检测非负下降沿(11)Detect Increase检测递增(12)Detect Rise Nonnegative检测非负上升沿(13)Detect Rise Positive检测正上升沿(14)Extract Bits提取位(15)Interval Test检测开区间(16)Interval Test Dynamic动态检测开区间(17)Logical Operator逻辑操作符(18)Relational Operator关系操作符(19)Shift Arithmetic移位运算5、查找表模块(Lookup Table)图 5(1)Cosine余弦函数查询表(2)Direct Lookup Table (n-D) n个输入信号的查询表(直接匹配)(3)Interpolation (n-D) using PreLookup n个输入信号的预插值(4)Lookup Table输入信号的查询表(线性峰值匹配)(5)Lookup Table (2-D)两维输入信号的查询表(线性峰值匹配)(6)Lookup Table (n-D) n维输入信号的查询表(线性峰值匹配)(7)Lookup Table Dynamic动态查询表(8)PreLookup Index Search预查询索引搜索(9)Sine正弦函数查询表6.数学模块(Math Operations)图 6(1)Abs取绝对值(2)Add加法(3)Algebraic Constraint代数约束(4)Assignment赋值(5)Bias偏移(6)Complex to Magnitude-Angle由复数输入转为幅值和相角输出(7)Complex to Real-Imag由复数输入转为实部和虚部输出(8)Divide除法(9)Dot Product点乘运算(10)Gain比例运算(11)Magnitude-Angle to Complex由幅值和相角输入合成复数输出(12)Math Function包括指数函数、对数函数、求平方、开根号等常用数学函数(13)Matrix Concatenation矩阵级联(14)MinMax最值运算(15)MinMax Running Resettable最大最小值运算(16)Polynomial多项式(17)Product乘运算(18)Product of Elements元素乘运算(19)Real-Imag to Complex由实部和虚部输入合成复数输出(20)Reshape取整(21)Rounding Function舍入函数(22)Sign符号函数(23)Sine Wave Function正弦波函数(24)Slider Gain滑动增益(25)Subtract减法(26)Sum求和运算(27)Sum of Elements元素和运算(28)Trigonometric Function三角函数,包括正弦、余弦、正切等(29)Unary Minus一元减法(30)Weighted Sample Time Math权值采样时间运算7、模型检测模块(Model Verification)图7(1)Assertion确定操作(2)Check Discrete Gradient检查离散梯度(3)Check Dynamic Gap检查动态偏差(4)Check Dynamic Lower Bound检查动态下限(5)Check Dynamic Range检查动态范围(6)Check Dynamic Upper Bound检查动态上限(7)Check Input Resolution检查输入精度(8)Check Static Gap检查静态偏差(9)Check Static Lower Bound检查静态下限(10)Check Static Range检查静态范围(11)Check Static Upper Bound检查静态上限8、模型扩充模块(Model-Wide Utilities)图8(1)Block Support Table功能快支持的表(2)DocBlock文档模块(3)Model Info模型信息(4)Timed-Based Linearization时间线性分析(5)Trigger-Based Linearization触发线性分析9、端口和子系统模块(Prot & Subsystems)(1)Configurable Subsystem结构子系统(2)Atomic Subsystem单元子系统(3)CodeReuseSubsystem代码重用子系统(4)Enable使能(5)Enabled and Triggered Subsystem使能和触发子系统(6)Enabled Subsystem使能子系统(7)For Iterator Subsystem重复操作子系统(8)Function-Call Generator函数响应生成器(9)Function-Call Subsystem函数响应子系统(10)If假设操作(11)If Action Subsystem假设动作子系统(12)In1输入端口(13)Model模型(14)Out1输出端口(15)Subsystem子系统(16)Subsystem Examples子系统例子(17)Switch Case转换事件图9(18)Switch Case Action Subsystem转换事件子系统(19)Trigger触发操作(20)Triggered Subsystem触发子系统(21)While Iterator Subsystem重复子系统10、信号属性模块(Signal Attributes)(1)Data Type Conversion数据类型转换(2)Data Type Conversion Inherited继承的数据类型转换(3)Data Type Duplicate数据类型复制(4)Data Type Propagation数据类型继承(5)Data Type Propagation Examples数据类型继承例子(6)Data Type Scaling Strip数据类型缩放图10(7)IC信号输入属性(8)Probe探针点(9)Rate Transition比率变换(10)Signal Conversion信号转换(11)Signal Specification信号特征说明(12)Weighted Sample Time权值采样时间(13)Width信号带宽11、信号路线模块(Signal Routing)(1)Bus Assignment总线分配(2)Bus Creator总线生成(3)Bus Selector总线选择(4)Data Store Memory数据存储(5)Data Store Read数据存储读取(6)Data Store Write数据存储写入(7)Demux将一个复合输入转化位多个单一输出(8)Environment Controller环境控制器(9)From信号来源(10)Goto信号去向(11)Goto Tag Visibility标签可视化(12)Index Vector索引向量图11(13)Manual Switch手动选择开关(14)Merge信号合并(15)Multiport Switch多端口开关(16)Mux将多个单一输入转化为一个复合输出(17)Selector信号选择器(18)Switch开关选择,当第二输入端大于临界值时,输出由第一个输入端而来,否则输出由第三输入端而来12、接收器模块(Sinks)(1)Display数字显示器(2)Floating Scope浮动观察器(3)Out1输出端口(4)Scope示波器(5)Stop Simulation仿真停止(6)Terminator连接到没有连接到的输出端(7)To File将输出数据写入数据文件保存(8)To Workspace将输出数据写入Matlab的工作空间(9)XY Graph显示二维图形图1213、输入源模块(Sources)(1) Band-Limited White Noise 带限白噪声(2) Chirp Signal 产生一个频率不断增大的正弦波(3) Clock 显示和提供仿真时间(4) Constant 常数信号(5) Counter Free-Running 无限计数器(6) Counter Limited 有限计数器(7) Digital Clock 在规定的采样间隔产生仿真时间按(8) From File 来自数据文件(9) From Workspace 来自 Matlab 的工作空间(10) Ground 连接到没有连接到的输入端(11) In1 输入信号(12) Pulse Generator 脉冲发生器(13) Ramp 斜坡信号输入(14) Random Number 产生正态分布的随机数(15) Repeating Sequence 产生规律重复的任意信号(16) Repeating Sequence Interpolated 重复序列内插值(17) Repeating Sequence Stair 重复阶梯序列(18) Signal Builder 信号创建器(19) Signal Generator 信号发生器,可以产生正弦波、方波、锯齿波及任意波形(20) Sine Wave 正弦波信号(21) Step 阶跃信号(22) Uniform Random Number 一致随机数图1314、用户自定义函数模块(User-Defined Functions)图14(1)Embedded MATLAB Function嵌入的Matlab函数(2)Fcn用自定义的函数(表达式)进行运算(3)Level-2 M-file S-Function M文件编写的S函数(4)MATLAB Fcn利用Matlab的现有函数进行运算(5)S-Function调用自编的S函数程序进行运算(6)S-Function Builder S函数建立器(7)S-Function Examples S函数例子15、Additional Math & Discrete图15(1)Additional Discrete(2)Additional Math: Increment - Decrement综合。