simulink模块库介绍
simulink常用模块

SIMILINK模块库按功能进行分为以下8类子库:(l)Continuous (连续模块)(2)Discrete (离散模块)(3)Function&Tables (函数和平台模块)(4)Math (数学模块)(5)Nonlinear (非线性模块)(6)Signals&Systems (信号和系统模块)(7)Sinks (接收器模块)(8)Sources (输入源模块)连续模块(Continuous)continuous.mdlIntegrator :输入信号积分Derivative :输入信号微分State-Space :线性状态空间系统模型Transfer-Fcn:线性传递函数模型Zero-Pole:以零极点表示的传递函数模型Memory :存储上一时刻的状态值TransportDelay:输入信号延时一个固定时间再输出VariableTransportDelay :输入信号延时一个可变时间再输出离散模块(Discrete)discrete.mdlDiscrete-timeIntegrator :离散时间积分器DiscreteFilter:IIR 与FIR 滤波器DiscreteState-Space :离散状态空间系统模型DiscreteTransfer-Fcn :离散传递函数模型DiscreteZero-Pole:以零极点表示的离散传递函数模型First-OrderHold: 一阶采样和保持器Zero-OrderHold:零阶采样和保持器UnitDelay: 一个采样周期的延时函数和平台模块(Function&Tables)fUnction.mdl尸5:用自定义的函数(表达式)进行运算MATLAB Fcn :利用matlab的现有函数进行运算S-Function:调用自编的S函数的程序进行运算Look-UpTable:建立输入信号的查询表(线性峰值匹配)Look-UpTable(2-D):建立两个输入信号的查询表(线性峰值匹配)数学模块(Math)math.mdlSum:加减运算Product:乘运算DotProduct :点乘运算Gain:比例运算MathFunction:包括指数函数、对数函数、求平方、开根号等常用数学函数TrigonometricFunction:m角函数,包括正弦、余弦、正切等MinMax :最值运算Abs:取绝对值Sign:符号函数LogicalOperator:逻辑运算RelationalOperator :关系运算ComplextoMagnitude-Angle :由复数输入转为幅值和相角输出Magnitude-AngletoComplex :由幅值和相角输入合成复数输出ComplextoReal-Imag :由复数输入转为实部和虚部输出Real-ImagtoComplex :由实部和虚部输入合成复数输出非线性模块(Nonlinear)nonlinear.mdlSaturation:饱和输出,让输出超过某一值时能够饱和。
simulink各模块详解

Shop Floor Information System, SFIS现场信息整合系统
2. 模块库中没有单独的电阻模块,可对 “Series RLC Branch”模块进行适当设置:
翔威国际股份有限公司 第二事业部 厂区信息流自动化项目
SFIS.PPT 11
Shop Floor Information System, SFIS现场信息整合系统
6.2 Simulink电路分析应用 Shop Floor Information System, SFIS现场信息整合系统
一、Power System Blockset模块集 (电路仿真模块集)
翔威国际股份有限公司 第二事业部 厂区信息流自动化项目
SFIS.PPT 1
Shop Floor Information System, SFIS现场信息整合系统
Shop Floor Information System, SFIS现场信息整合系统
2. “Electrical Sources”模块库
其中包括7个用于产生电源信号的模块
功能说明 可编辑三相电源
三相电源 交流电流源 交流电压源 受控电流源 受控电压源 直流电压源
翔威国际股份有限公司 第二事业部 厂区信息流自动化项目
4. 模块间的连接
每个模块都设定了输入端和输出端,不能更改; 如果需要可利用“L connector”及“T connector” 模块增设接线端
翔威国际股份有限公司 第二事业部 厂区信息流自动化项目
SFIS.PPT 13
Shop Floor Information System, SFIS现场信息整合系统
1. “Connectors”模块库
其中包括接地点和中间节点两大类共10个模块
Simulink常用库模块介绍

Simulink常用库模块介绍1. Sources Library(源库):该库提供了一些用于输入信号的模块,如步进信号、正弦信号、随机信号等。
用户可以根据自己的需求选择适合的信号类型。
2. Sinks Library(输出库):该库提供了一些用于输出和记录信号的模块,如作用在信号上的示波器、记录信号的Scope等。
3. Continuous Library(连续库):该库提供了一些用于连续时间系统的模块,如积分器、微分器、比例积分微分控制器(PID)等。
这些模块可以用于建立和仿真连续时间动态系统。
4. Discrete Library(离散库):该库提供了一些用于离散时间系统的模块,如采样器、保持器、差分器等。
这些模块可以用于建立和仿真离散时间动态系统。
5. Logic and Bit Operations Library(逻辑和位运算库):该库提供了一些用于逻辑运算和位运算的模块,如AND门、OR门、XOR门、移位器等。
这些模块可以用于建立和仿真逻辑和位运算系统。
6. Math Operations Library(数学运算库):该库提供了一些用于数学运算的模块,如加法器、减法器、乘法器、除法器等。
这些模块可以用于建立和仿真数学运算系统。
7. Lookup Tables Library(查找表库):该库提供了一些用于查找表操作的模块,如一维和多维插值查找表、查找表与插值、查找表与线性插值等。
这些模块可以用于建立和仿真查找表系统。
8. Control Systems Library(控制系统库):该库提供了一些用于控制系统的模块,如PID控制器、状态空间模型、传递函数等。
这些模块可以用于建立和仿真控制系统。
9. Signal Routing Library(信号路由库):该库提供了一些用于信号路由的模块,如切换器、多路复用器、分支器等。
这些模块可以用于控制信号的路由和选择。
10. Simulink Extras Library(额外功能库):该库提供了一些Simulink中的辅助模块,如信号生成器、信号调整器、时间尺度转换器等。
SIMULINK模块库详细介绍

Simulink 模块库——Source
From File(从文件读数据)
模块功能 从文件读数据 模块说明 From File模块从指定的文件读取数据作为其 输出。模块的图标中显示了提供数据的文件 名。文件名必须包含一个两行或两行以上的 矩阵,第一行应是单调递增的时间点,其它 行是与之对应的数据点。 模块数据类型 双精度类型实数信号 模块参数对话框 File name:输入数据的文件名。 Sample time:从文件中读去数据的采样率
Simulink 模块库——Source
Repeating Sequence (重复序列)
模块功能 产生重复的任意信号 模块说明 Repeating Sequence模块可生 成随时间变化的重复信号。波 形任意指定,当仿真达到Time values 向量中的最大时间值时, 信号开始重复。 模块数据类型 双精度类型实数信号 模块参数对话框 Time values:单调增加的时 间向量(s) Output values:与Time values对应的输出向量
操作 单击 SIMULINK 图标 操作 或 键入 SIMULINK
1结果 打开 Library 模块库窗口
操作 双击“新建”图标 1结果 打开 simulink 工作窗,
默认名 untitled
SIMULINK 图库中 含连续部分的图元
模块库有关项目
点击模块库前面的“+”号 图标展开列出库中图元
Simulink 模块库——Source
Sine Wave(正弦波)
模块功能 产生一个正弦波 模块说明 Sine Wave 提供连续或离散形式的正弦波。 模块数据类型 双精度类型实数信号 模块参数对话框 Amplitude:信号的幅度 Frequency:信号的频率( rad/sec ) Phase:信号的相位(rad) Sample time:采样周期(0:连续;>0: 离散采样时间;-1:工作模式与接受信号 模式相同) y= Amplitude×sin(Frequency ×time+Phase)
SIMULINK的模块库介绍

SIMULINK的模块库介绍(1)Commonly UsedBus Creator Create signal busBus Selector Select signals from incoming busConstant Generate constant valueData Type Conversion Convert input signal to specified data typeDemux Extract and output elements of vector signalDiscrete-TimeIntegratorPerform discrete-time integration or accumulation of signal Gain Multiply input by constantGround Ground unconnected input portInport Create input port for subsystem or external input Integrator,IntegratorLimitedIntegrate signalLogical Operator Perform specified logical operation on inputMux Combine several input signals into vectorOutport Create output port for subsystem or external outputProduct Multiply and divide scalars and nonscalars or multiply and invert matricesRelational Operator Perform specified relational operation on inputs Saturation Limit range of signalScope and Floating Display signals generated during simulationScopeSubsystem,AtomicSubsystem,NonvirtualSubsystem,CodeReuseSubsystemRepresent system within another systemSum,Add,Subtract,Sum of ElementsAdd or subtract inputsSwitch Switch output between first input and third input based on value of second inputTerminator Terminate unconnected output portUnit Delay Delay signal one sample period(2)ContinuousDerivative Output time derivative of inputIntegrator,IntegratorLimitedIntegrate signalPID Controller Simulate continuous-or discrete-time PID controllersPID Controller(2 DOF) Simulate continuous-or discrete-time two-degree-of-freedom PID controllersSecond-OrderIntegrator,Second-Order Integrator LimitedIntegrate input signal twiceState-Space Implement linear state-space system Transfer Fcn Model linear system by transfer function Transport Delay Delay input by given amount of time Variable TimeDelay,VariableTransport DelayDelay input by variable amount of timeZero-Pole Model system by zero-pole-gain transfer function (3)DiscontinuitiesBacklash Model behavior of system with playCoulomb and ViscousModel discontinuity at zero,with linear gain elsewhere FrictionDead Zone Provide region of zero outputDead Zone Dynamic Set inputs within bounds to zeroHit Crossing Detect crossing pointQuantizer Discretize input at specified intervalRate Limiter Limit rate of change of signalRate Limiter Dynamic Limit rising and falling rates of signalRelay Switch output between two constantsSaturation Limit range of signalSaturation Dynamic Bound range of inputWrap To Zero Set output to zero if input is above threshold(4)DiscreteDifference Calculate change in signal over one time stepDiscrete Derivative Compute discrete time derivativeDiscrete Filter Model Infinite Impulse Response(IIR)direct form II filtersDiscrete FIR Filter Model FIR filtersDiscrete State-Space Implement discrete state-space systemDiscrete Transfer Fcn Implement discrete transfer functionDiscrete Zero-Pole Model system defined by zeros and poles of discrete transfer function Discrete-TimeIntegratorPerform discrete-time integration or accumulation of signalFirst-Order Hold Implement first-order sample-and-holdInteger Delay Delay signal N sample periodsMemory Output input from previous time stepPID Controller Simulate continuous-or discrete-time PID controllersPID Controller(2 DOF) Simulate continuous-or discrete-time two-degree-of-freedom PID controllersTapped Delay Delay scalar signal multiple sample periods and output all delayed versionsTransfer Fcn FirstOrderImplement discrete-time first order transfer functionTransfer Fcn Lead orLagImplement discrete-time lead or lag compensatorTransfer Fcn RealZeroImplement discrete-time transfer function that has real zero and no pole Unit Delay Delay signal one sample periodZero-Order Hold Implement zero-order hold of one sample period(5)Logic and BitOperationsBit Clear Set specified bit of stored integer to zeroBit Set Set specified bit of stored integer to oneBitwise Operator Specified bitwise operation on inputs Combinatorial Logic Implement truth tableCompare To Constant Determine how signal compares to specified constant Compare To Zero Determine how signal compares to zeroDetect Change Detect change in signal valueDetect Decrease Detect decrease in signal valueDetect Fall Negative Detect falling edge when signal value decreases to strictly negative value,and its previous value was nonnegativeDetect Fall Nonpositive Detect falling edge when signal value decreases to nonpositive value,and its previous value was strictly positiveDetect Increase Detect increase in signal valueDetect Rise Nonnegative Detect rising edge when signal value increases to nonnegative value,and its previous value was strictly negativeDetect Rise Positive Detect rising edge when signal value increases to strictly positive value,and its previous value was nonpositiveExtract Bits Output selection of contiguous bits from input signal Interval Test Determine if signal is in specified intervalInterval Test Dynamic Determine if signal is in specified intervalLogical Operator Perform specified logical operation on input Relational Operator Perform specified relational operation on inputs Shift Arithmetic Shift bits or binary point of signal(6)Lookup TablesDirect LookupTable(n-D)Index into N-dimensional table to retrieve element,column,or 2-D matrixInterpolation Using Prelookup Use precalculated index and fraction values to accelerate approximation of N-dimensional functionLookup Table Approximate one-dimensional functionLookup Table(2-D) Approximate two-dimensional functionLookup Table(n-D) Approximate N-dimensional functionLookup TableDynamicApproximate one-dimensional function using dynamic table Prelookup Compute index and fraction for Interpolation Using Prelookup blockSine,Cosine Implement fixed-point sine or cosine wave using lookup table approach that exploits quarter wave symmetry(7)Math OperationsAbs Output absolute value of inputAlgebraic Constraint Constrain input signal to zeroAssignment Assign values to specified elements of signalBias Add bias to inputComplex toMagnitude-AngleCompute magnitude and/or phase angle of complex signal Complex to Real-Imag Output real and imaginary parts of complex input signalDivide Divide one input by anotherDot Product Generate dot product of two vectorsFind Find nonzero elements in arrayGain Multiply input by constantMagnitude-Angle toComplexConvert magnitude and/or a phase angle signal to complex signal Math Function Perform mathematical functionMatrix Concatenate,Vector Concatenate Concatenate input signals of same data type to create contiguous output signalMinMax Output minimum or maximum input valueMinMax RunningResettableDetermine minimum or maximum of signal over time Permute Dimensions Rearrange dimensions of multidimensional array dimensions Polynomial Perform evaluation of polynomial coefficients on input valuesProduct Multiply and divide scalars and nonscalars or multiply and invert matricesProduct of Elements Copy or invert one scalar input,or collapse one nonscalar input Real-Imag to Complex Convert real and/or imaginary inputs to complex signalReshape Change dimensionality of signalRounding Function Apply rounding function to signalSign Indicate sign of inputSine Wave Function Generate sine wave,using external signal as time sourceSlider Gain Vary scalar gain using sliderSqrt,SignedSqrt,Reciprocal SqrtCalculate square root,signed square root,or reciprocal of square root Squeeze Remove singleton dimensions from multidimensional signal Sum,Add,Subtract,Sum of ElementsAdd or subtract inputsTrigonometricFunctionSpecified trigonometric function on inputUnary Minus Negate inputWeighted SampleTime MathSupport calculations involving sample time(8)Model VerificationAssertion Check whether signal is zeroCheck Discrete Gradient Check that absolute value of difference between successive samples of discrete signal is less than upper boundCheck Dynamic Gap Check that gap of possibly varying width occurs in range of signal's amplitudesCheck DynamicLower BoundCheck that one signal is always less than another signalCheck Dynamic Range Check that signal falls inside range of amplitudes that varies from time step to time stepCheck Dynamic UpperBoundCheck that one signal is always greater than another signal Check InputResolutionCheck that input signal has specified resolutionCheck Static Gap Check that gap exists in signal's range of amplitudesCheck Static Lower Bound Check that signal is greater than(or optionally equal to)static lower boundCheck Static Range Check that signal falls inside fixed range of amplitudesCheck Static UpperBoundCheck that signal is less than(or optionally equal to)static upper bound(9)Model-WideUtilitiesBlock Support Table View data type support for Simulink blocksDocBlock Create text that documents model and save text with modelModel Info Display revision control information in modelTimed-BasedGenerate linear models in base workspace at specific times LinearizationTrigger-BasedGenerate linear models in base workspace when triggered Linearization(10)Ports&SubsystemsTrigger Add trigger port to model or subsystemAction Port Implement Action subsystems used by if and switch control flow statements in Simulink softwareConfigurableSubsystemRepresent any block selected from user-specified library of blocks Enable Add enabling port to subsystemEnabled and Triggered Subsystem Represent subsystem whose execution is enabled and triggered by external inputEnabled Subsystem Represent subsystem whose execution is enabled by external inputFor Each Enable blocks inside For Each Subsystem to process elements or subarrays of input signal independentlyFor Each Subsystem Repeatedly perform algorithm on each element or subarray of input signal and concatenate resultsFor Iterator Repeatedly execute contents of subsystem at current time step until iteration variable exceeds specified iteration limitFor Iterator Subsystem Represent subsystem that executes repeatedly during simulation time stepFunction-Call Generator Execute function-call subsystem specified number of times at specified rateFunction-Call Split Provide junction for splitting function-call signalFunction-CallSubsystemRepresent subsystem that can be invoked as function by another block If Model if-else control flowIf Action Subsystem Represent subsystem whose execution is triggered by If blockInport Create input port for subsystem or external inputModel Include model as block in another modelOutport Create output port for subsystem or external outputSubsystem,AtomicSubsystem,NonvirtualSubsystem,CodeReuseSubsystemRepresent system within another systemSwitch Case Implement C-like switch control flow statementSwitch Case ActionSubsystemRepresent subsystem whose execution is triggered by Switch Case block Triggered Subsystem Represent subsystem whose execution is triggered by external inputWhile Iterator Subsystem Represent subsystem that executes repeatedly while condition is satisfied during simulation time step(11)Signal AttributesSignal Specification Specify desired dimensions,sample time,data type,numeric type,and other attributes of signalBus to Vector Convert virtual bus to vectorData Type Conversion Convert input signal to specified data typeData Type Conversion Inherited Convert from one data type to another using inherited data type and scalingData Type Duplicate Force all inputs to same data typeData Type Propagation Set data type and scaling of propagated signal based on information from reference signalsData Type ScalingStripRemove scaling and map to built in integer IC Set initial value of signalProbe Output signal's attributes,including width,dimensionality,sample time,and/or complex signal flagRate Transition Handle transfer of data between blocks operating at different rates Signal Conversion Convert signal to new type without altering signal values Weighted SampleTimeSupport calculations involving sample timeWidth Output width of input vector(12)Signal RoutingBus Assignment Replace specified bus elementsBus Creator Create signal busBus Selector Select signals from incoming busData Store Memory Define data storeData Store Read Read data from data storeData Store Write Write data to data storeDemux Extract and output elements of vector signalEnvironment Controller Create branches of block diagram that apply only to simulation or only to code generationFrom Accept input from Goto blockGoto Pass block input to From blocksGoto Tag Visibility Define scope of Goto block tagIndex Vector Switch output between different inputs based on value of first input Manual Switch Switch between two inputsMerge Combine multiple signals into single signalMultiport Switch Choose between multiple block inputsMux Combine several input signals into vectorSelector Select input elements from vector,matrix,or multidimensional signalSwitch Switch output between first input and third input based on value of second input(13)SinksDisplay Show value of inputOutport Create output port for subsystem or external output Scope and FloatingDisplay signals generated during simulationScopeStop Simulation Stop simulation when input is nonzeroTerminator Terminate unconnected output portTo File Write data to fileTo Workspace Write data to MATLAB workspaceXY Graph Display X-Y plot of signals using MA TLAB figure window (14)SourcesBand-Limited WhiteNoiseIntroduce white noise into continuous system Chirp Signal Generate sine wave with increasing frequency Clock Display and provide simulation time Constant Generate constant valueCounter Free-Running Count up and overflow back to zero after reaching maximum value for specified number of bitsCounter Limited Count up and wrap back to zero after outputting specified upper limit Digital Clock Output simulation time at specified sampling interval Enumerated Constant Generate enumerated constant valueFrom File Read data from MAT-fileFrom Workspace Read data from workspaceGround Ground unconnected input portInport Create input port for subsystem or external inputPulse Generator Generate square wave pulses at regular intervalsRamp Generate constantly increasing or decreasing signalRandom Number Generate normally distributed random numbersRepeating Sequence Generate arbitrarily shaped periodic signalRepeating Sequence Interpolated Output discrete-time sequence and repeat,interpolating between data pointsRepeating SequenceStairOutput and repeat discrete time sequenceSignal Builder Create and generate interchangeable groups of signals whose waveforms are piecewise linearSignal Generator Generate various waveformsSine Wave Generate sine wave,using simulation time as time source Step Generate step functionUniform RandomNumberGenerate uniformly distributed random numbers(15)User-DefinedFunctionsEmbedded MATLABInclude MATLAB code in models that generate embeddable C code FunctionFcn Apply specified expression to inputLevel-2 M-FileUse Level-2 M-file S-function in modelS-FunctionMATLAB Fcn Apply MATLAB function or expression to inputS-Function Include S-function in modelS-Function Builder Create S-function from C code that you provide(16)AdditionalMath&DiscreteAdditional Discrete Provide additional discrete math supportAdditional Increment or decrement value of signal by oneMath:Increment—Dec rement。
simulink各模块中文详解

simulink各模块中文详解Simulink是一种基于模块化建模方式的仿真软件,它可以用来进行系统级的设计、建模和仿真。
Simulink提供了丰富的模块库,包括信号处理、控制系统、通信系统等各个领域的模块,这些模块可以通过连接线连接起来,构成一个完整的系统模型。
在Simulink中,每个模块都有特定的功能和参数设置,下面我们将对Simulink的一些常用模块进行中文详解。
一、信号源模块信号源模块是Simulink中最基础的模块之一,它用于生成各种不同类型的信号。
常见的信号源模块包括正弦波信号源、方波信号源、脉冲信号源等。
这些信号源模块可以设置信号的幅值、频率、起始时间等参数,用于模拟各种不同的输入信号。
二、数学运算模块数学运算模块用于进行各种数学运算,比如加法、减法、乘法、除法等。
Simulink提供了各种数学运算模块,包括加法器、乘法器、除法器等。
这些模块可以对输入信号进行各种数学运算,生成输出信号。
三、滤波器模块滤波器模块用于对信号进行滤波处理,常见的滤波器模块包括低通滤波器、高通滤波器、带通滤波器等。
这些模块可以通过设置滤波器的截止频率、阶数等参数,对输入信号进行滤波,去除不需要的频率成分,得到所需的输出信号。
四、控制系统模块控制系统模块用于建立和仿真各种控制系统,包括PID控制器、状态空间模型、传递函数模型等。
这些模块可以通过设置控制器的参数,对输入信号进行控制,使系统输出达到期望值。
五、状态空间模块状态空间模块用于建立和仿真线性时不变系统的状态空间模型。
状态空间模型描述了系统的状态变量和输入输出关系,可以通过状态空间模块进行系统的分析和控制。
六、通信系统模块通信系统模块用于建立和仿真各种通信系统,包括调制解调器、信道模型、误码率计算器等。
这些模块可以模拟通信系统的发送、传输和接收过程,对信号进行调制解调、传输信道建模等操作。
七、数据存储模块数据存储模块用于存储和读取仿真过程中的数据,包括存储器、查找表、文件读写模块等。
Simulink的模块库

Simulink模块库一、Continuous:它包括以下七个功能模块:1.Derivative:输入信号微分模块;2.Integrator:输入信号积分模块;3.State-Space:线性状态空间系统模型;4.Transfer-Fcn:线性传递函数模型;5.Transport Delay:输入信号延时一个固定时间再输出;6.Variable Transport Delay:输入信号延时一个可变时间再输出;7.Zero-Pole:以零极点表示的传递函数模型。
二、Discrete它包括以下九个功能模块:1.Discrete Transfer-Fcn:离散传递函数模型;2.Discrete Zero-Pole:以零极点表示的离散传递函数模型;3.Discrete Filter:实现无限脉冲响应(IIR)与有限脉冲响应(FIR)滤波器;4.Discrete State-Space:离散状态空间系统模型;5.First-Order Hold:实现一阶采样和保持器;6.Memory:存储上一个时刻的状态值;7.Unit Delay:一个采样周期的延时;8.Discrete-time Integrator:离散时间积分器;9.-Order Hold:实现零阶采样和保持器。
三、Look-Up Tables(查询表模块库)它包括以下六个功能模块:1.Direct Look-Up Table(n-D):检索n维表,以重新获得标量、向量或2维矩阵2.Interpolation(n-D)using PreLook-Up:执行高精度的常值或线性插值3.Look-Up Table:使用指定的查表方法近似一维函数,即建立输入信号的查询表4.Look-Up Table(2-D): 使用指定的查表方法近似二维函数,即建立两个输入信号的查询表5.Look-Up Table(n-D):执行n个输入定常数、线性或样条插值映射6.PreLook-Up Index Search:在设置的断点处为输入执行检索查找和小数计算四、Math Operations(数学运算模块库)它包括以下25个功能模块:1.Abs:对输入信号求绝对值运算;2.Sum:加减运算,可以加减标量、向量和矩阵;3.Product:对输入信号求积和商运算;4.Dot Product:点积(内积)运算;5.Gain:比例运算,或称为常量增益(输入信号乘以常数);6.Sign:表明输入符号信号或符号函数;7.MinMax:输出输入信号的最小值和最大值(即极值运算);8.Slider Gain:可以用滑动条来改变增益;9.Matrix Gain:矩阵增益,即输入信号乘以矩阵;10.Math Function:包括指数、对数函数、求平方、开根号等常用数学运算函数;11.Rounding Function:取整运算函数;12.Trigonometric Function:三角函数,包括正弦、余弦、正切等;13.Logical Operator:逻辑运算14.Relational Operator:关系运算15.Complex to Magnitude-Angle:由复数输入信号转为幅值和相角输出;16.Magnitude-Angle to Complex:由幅值和相角输入信号合成复数输出;17.Complex to Real-Imag:由复数输入信号转为实部和虚部输出;18.Real-Imag to Complex:由实部和虚部输入信号合成复数输出。
simulink各模块详解

【例2_2】 测量下图所示电路的电流I。
见Sim6_2_2.mdl
说 明
CCCS的仿真模型
设置电流增益
取得控制电流Ix
受控电流源 注意参考方向
4. “Measurements”模块库
其中包括的是5种测量模块 功能说明 测量电流值 测量电路两节点之间的 电阻值 测量多个器件、支路的 电流电压值 测量电路中的三相 电流、电压值 测量电压值
5. “Power Electronics”模块库
其中包括的是9类功率电子器件模块
功能说明 详尽型半导体闸流管
2. “Electrical Sources”模块库
其中包括7个用于产生电源信号的模块 功能说明 可编辑三相电源 三相电源
交流电流源
交流电压源 受控电流源 受控电压源
直流电压源
3. “Elements”模块库
其中包括的是线性及非线性的电路网络元件模块,可分为 Elements(元件类)、Lines(导线类)、Circuit Breaker(开关类)、 Transformer(变压器类)共四类24个模块
7. “Extra Library”模块库
其中包含Simpower模块库中各类模块的扩充模块
二、 直流电路仿真
【例2_1】 测量下图所示电路的节点电压。
见Sim6_2_1.mdl
说 明
1. 模块库中没有直流电流源模块,可对“AC Current Source”模块进行适当设置:
2. 模块库中没有单独的电阻模块,可对 “Series RLC Branch”模块进行适当设置:
3. 电压测量及显示
Simulink的“Display”模块(位于节点下的Sinks中) 不能直接接在被测元件两端测量电压,需以“Voltage Measurement”模块作为连接
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
图 18
x F
.
26
解法1: 构建常微分方程
根据牛顿运动定律,得到小车的运动方程 kx fx mx F 将相关参数代入上式得 x 4 x 3x F 将上述微分方程改写为
x u(t ) 4 x 3x
.
6
图7
.
7
图8
3、数据类型转换模块
Data type conversion 可将输入数据类型转换为 指定输出类型。具体选择有:inherit(与输入数据保 持一致)、double、single、int8等。同时可以选择取 整方向。Zero:向零取整;nearest:向最接近整数取 整;floor:向负无穷取整;ceiling:向正无穷取整。
.
8
4、积分模块
Integrator模块为连续时间积分单元。双击图9中 该模块,在initial condition可设置积分其初始值,在 limit output可设置输出最大和最小值。仿真运行结果 如图10所示。
.
9
图9
图 10
. 10
5、离散时间积分模块
Discrete time integrator(离散时间积分),可完 成离散系统积分作用。如图11所示,双击离散积分模 块,设置gainvalue(积分增益值),改变积分速度。 在sample time文本框可设置离散积分采样时间,如设 置为-1,表示与输入信号采样时间一致。在limit output可设置积分输出上下限。在图11中设置 Discrete time integrator1模块增益值为2,采样时间为 0.5,仿真结果如图12所示。
6.1常用模块库
初学simulink,常用模块 (commonly used blocks)使用最为频繁。 在Simulink浏览器中, 单击左侧“commonly used blocks”节点,可打 开常用模块库。
图 1 常用模块库
.
1
常用模块库包括:Bus creator(总线信号产生 器),commonly bus selector(常用总线信号选择 器),constant(常数模块),data type conversation (数据类型转换),demux(信号分离器),mux(信号 合成器),gain(增益)等。
. 11
图 11
.、乘法与加法模块
product乘法器模块用以求输入信号的乘积, 双击模块可设置端口数。Sum模块用来求输入 信号的加、减。在list of signs可设置加减法符 号。在Icon shape列表可修改其外形。
.
14
7、关系操作及逻辑操作模块
Relation operator关系操作模块可用来比 较两个输入信号的大小关系。Logic operator逻 辑操作模块可用来求两输入变量的逻辑操作。
. 23
图 . 17
24
连续模块组
传递函数模块
状态方程模块 零极点增益模块 微分器、积分器、延迟、PID控制器
. 25
图18所示为弹簧—质量—阻尼器系统。图中,小车所 受外力为F,小车位移为x。设小车质量为m=1,弹簧 弹性系数k=3,阻尼系数f=4。设系统的初始状态设为 静止平衡点 x(0) x(0) 0 外力函数为幅值等于1的阶跃 量,仿真此小车的运动。
图 14
. 18
图 15
. 19
这里使用Signal Routing模块库中的Switch模块 实现切换功能。Switch模块有三个输入端口,它根据 第二个输入端口(中间的输入)的值来判断输出第一个 输入端口(最上面的端口)或第三个输入端口(最下面的 端口)的值,因此,第一个输入和第三个输入被称为数 据输入,而第二个输入则被称为控制输入。图16是 Switch模块的参数对话框。
.
2
1、总线信号生成与总线信号选择模块
Bus creator用于将多个信号合成为一个总线信号; Bus selector选择总线信号的一个或多个。 如图2所示,有三种输入信号:正弦、阶跃、脉冲。 为便于观察,设置阶跃信号阶跃时间为1.2s,初始值 为0,终止值为0.5(如图3所示)。Bus creator输入 信号改为3(图4)。Bus selector选择信号1和3(图 5)。双击scope模块,再单击Parameters参数,将坐 标数改为2。最终运行效果如图6所示。
. 3
图2
.
4
图3
图4
图5
.
5
图6
2、信号合成与信号分离模块
mux和demux功能与总线信号生成和总线信号选 择模块近似。但是mux与demux是对所有信号进行合 成与分离的。 双击mux模块,在参数对话框将number of inputs 参数改为3。同样设置demux,将number of outputs 参数改为3。仿真结果如图8所示。
.
15
.
16
图 13
例:此系统可用如下方程表示
y 2 * u y 10 * u if t 5 if t 5
系统的输出只与当前的输入值有关,而且 随着仿真时间的继续在两个不同的代数方程之 间切换。
. 17
利用 Math 库中的 模块表示代数关系 和逻辑关系
利用 Signal Routing 库 中的开关和限幅模块实 现开关和限幅动作
.
20
图 16
. 21
8、增益、输入、输出及终端模块
Gain可用来设置信号的放大倍数;in1(输入) 在建子系统时作为信号的输入接口; out1(输 出)在建子系统时作为信号的输出接口;终端 (Terminator)可用来连接没有与其它模块连接的 输出端口。
.
22
6.2连续系统模块库
严格说来,一个具体的物理系统通常都是非线性 系统,而且是以分布参数的形式存在的,但是由这样 的非线性系统建立的数学模型,在需要求解非线性方 程和偏微分方程时,是非常困难的。因此,在误差允 许的范围内,可以将非线性模型线性化,或者直接用 线性集总参数模型描述物理系统。 Simulink中的Continuous模块库提供了适用于建 立线性连续系统的模块,包括积分器模块、传递函数 模块、状态空间模块和零-极点模块等,这些模块为用 户以不同形式建立线性连续系统模型提供了方便,如 图17所示。