检查参考
Check that model signal tracks reference signal during simulation
- Library:
金宝appSimulink设计优化/ Model Verification
金宝appSimulink设计优化/信号约束
描述
Check that a signal remains within the tolerance bounds of a reference signal during simulation.
如果信号根据s all bounds, the block does nothing.
If the signal does not satisfy a bound, a warning message appears in the MATLAB®command window. You can also specify that the block:
评估matlab表达。
Stop the simulation and return an error message.
在仿真期间,块也可以返回逻辑断置信号。
如果信号根据s all bounds, the assertion signal is true (
1
).如果信号不满足绑定,则断言信号为false(
0
).
You can add检查参考blocks to multiple signals to check that they track reference signals. You can also plot the reference signal on a time plot to graphically verify the signal tracking.
该块和模型验证库中的另一个块在指定的时域特征范围内保持信号仍然存在。当模型不违反任何绑定时,可以通过清除断言选项来禁用块。如果修改模型,则可以重新启用断言以确保您的更改不会导致模型违反绑定。
If the signal does not satisfy the bounds, you can optimize the model parameters to satisfy the bounds. If you have金宝app®Control Design™软件,您可以添加频域界限,例如BODE幅度,并优化模型响应以满足时间域和频域要求。
这block can be used in all simulation modes for signal monitoring, but only inNormal
or加速器
simulation mode for response optimization.
港口
输入
port_1(u)
- 信号要检查指定的参考信号
scalar | vector | matrix
Signal to check against the reference signal specified inAmplitudesand时代在模拟期间。
数据类型:single
|双倍的
|int8
|INT16
|INT32.
|INT64.
|uint8.
|uint16
|uint32
|uint64
|fixed point
|枚举
|bus
Output
Port_1 (out)
— Output assertion signal
1
|0
Output signal indicating if the input signal is within bounds of the specified assertion signal. At each time step, the output is returned as one of the following:
真的 (
1
) if the assertion succeeds, that is, the input signal satisfies all bounds错误的 (
0
) if the assertion fails, that is, the signal violates a bound
这data type of the output signal is double by default. To set the output data type as Boolean for all blocks that generate logic signals in your Simulink model, select Implement logic signals as Boolean data in Configuration Parameters.
Dependencies
To enable this port, on the断言tab, select theOutput assertion signal范围。
数据类型:布尔
|双倍的
Parameters
Show Plot
— Open plot window
按钮
Use the plot to view the following.
System characteristics and signals computed during simulation — Click this button before you simulate the model to view the system characteristics or signal.
You can display additional characteristics, such as the peak response time, by right-clicking the plot and selecting特征.
Bounds — You can specify bounds on theBoundstab or by right-clicking the plot and selectingBounds>New Bound.
You can modify bounds by dragging the bound segment or by right-clicking the plot and selectingBounds>编辑绑定. Before you simulate the model, clickUpdate Block更新块参数中的绑定值。
Typical tasks that you perform in the plot window include:
Opening the Block Parameters dialog box by clicking
or selectingEdit.
Finding the block that the plot window corresponds to by clicking
or selecting看法>Highlight Simulink Block. This action makes the model window active and highlights the block.
Simulating the model by clicking
. This action also linearizes the portion of the model between the specified linearization input and output.
Adding a legend on the linear system characteristic plot by clicking
.
在块打开时显示绘图
— Double-click block to open plot
off
(默认)|on
Open the plot window instead of the block parameters when you double-click the block in the Simulink model.
如果您愿意打开和执行任务,例如在绘图窗口而不是块参数中执行任务,请执行此参数,例如添加或修改界限。如果要从绘图窗口访问块参数,请选择Editor click.
For more information on the plot, see theShow plot范围。
Programmatic Use
范围:LaunchViewOnOpen |
Type:字符向量 |
Value:'on' |'离开' |
Default:'离开' |
响应优化
— Open Response Optimizer
按钮
Open the响应优化器优化模型响应以满足指定的设计要求Bounds标签。
See Also
Bounds Tab
Include reference signal tracking in assertion
— Check that signal tracks reference signal
on
(默认)|off
Check that the input signal to the block tracks the reference signal specified inAmplitudesand时代在模拟期间。如果信号不跟踪参考信号,则该软件显示警告。
什么时候you disable this parameter, the software stops checking that the input signal tracks the reference during simulation.
To view only the reference signal on the plot, disableEnable assertion.
如果选择,则参考信号显示在时间图上Show plot,如图所示。
Dependencies
To use this parameter, selectEnable assertion在块参数中。什么时候Enable assertionis disabled, the software does not use the reference signal for assertion, but it continues to appear on the plot.
Programmatic Use
范围:EnableReferenceBound |
Type:字符向量 |
Value:'on' |'离开' |
Default:'on' |
时代
— Time vector
Linspace(0,10)
(默认)|vector of positive values | MATLAB expression
以秒为单位的参考信号的时间向量,指定为正值增加的正值向量。您还可以指定评估向量的MATLAB表达式。使用该指定相应的幅度Amplitudes范围。这时代矢量必须具有与此相同的维度Amplitudes向量。
Programmatic Use
范围:ReferenceTimes |
Type:vector |
Value:vector of positive values | MATLAB expression |
Default:Linspace(0,10) |
Amplitudes
- 参考信号幅度
1-exp(-linspace(0,10)/2)
(默认)|矢量|matlab表达
参考信号的幅度,指定为真实和有限的向量,对应于指定的时间向量时代. You can also specify a MATLAB expression that evaluates to a vector. TheAmplitudes矢量必须具有与此相同的维度时代(seconds)向量。
Programmatic Use
范围:参考eamplitudes. |
Type:vector |
Value:矢量|matlab表达 |
Default:1-exp(-linspace(0,10)/2) |
Absolute tolerance
— Absolute tolerance for signal
eps^(1/3)
(默认)|积极的标量
Absolute tolerance used to determine bounds as the input signal approaches the reference signal, specified as a positive real scalar. During simulation, the signal must remain within upper and lower limits respective to the reference signal given by
yu= (1 +RELTOL.)yr+ab
yl= (1 –RELTOL.)yr–ab
Here:
yris the value of the reference at a certain time.
yuis the upper tolerance bound corresponding to that time point.
ylis the lower tolerance bound corresponding to that time point.
RELTOL.在每个时间步骤设置输入和参考信号幅度之间的相对容差。设置RELTOL., use the相对宽容范围。
absets the absolute tolerance between input and reference signal amplitudes at each time step. To setab, use theAbsolute tolerance范围。
这block asserts if the signal violates these limits.
Programmatic Use
范围:aberance |
Type:scalar |
Value:积极的标量 |
Default:eps^(1/3) |
相对宽容
— Relative tolerance for signal
0.01
(默认)|积极的标量
相对宽容used to determine bounds as the input signal approaches the reference signal, specified as a positive real scalar. During simulation, the signal must remain within upper and lower limits respective to the reference signal given by
yu= (1 +RELTOL.)yr+ab
yl= (1 –RELTOL.)yr–ab
Here:
yris the value of the reference at a certain time.
yu是较高的绑定。
ylis the lower tolerance bound.
RELTOL.在每个时间步骤设置输入和参考信号幅度之间的相对容差。设置RELTOL., use the相对宽容范围。
absets the absolute tolerance between input and reference signal amplitudes at each time step. To setab, use theAbsolute tolerance范围。
这block asserts if the signal violates these limits.
Programmatic Use
范围:重新理由 |
Type:scalar |
Value:积极的标量 |
Default:0.01 |
断言选项卡
Enable assertion
— Enable or disable check
on
(默认)|off
启用块以检查指定的界限,包括在断言中Bounds在仿真期间满足选项卡。如果不满足绑定,则断言失败。报告断言失败的警告显示在Matlab提示符。
If the assertion fails, you can optionally specify that the block:
执行一个matlab表达式,指定Simulation callback when assertion fails (optional).
Stop the simulation and return an error message, by selectingStop simulation when assertion fails.
This parameter has no effect if you do not specify any bounds.
什么时候you disable this parameter, the block no longer checks that the input signal satisfies the specified bounds. The block icon also updates to indicate that assertion is disabled.
在Simuli金宝appnk模型中,在配置参数中,模型验证块启用parameter lets you enable or disable all model verification blocks in a model, regardless of the setting of this option in the block.
Programmatic Use
范围:启用 |
Type:字符向量 |
Value:'on' |'离开' |
Default:'on' |
Simulation callback when assertion fails (optional)
— Expression to evaluate when assertion fails
''
(默认)|matlab表达
MATLAB表达式在断言失败时执行。
Because the expression is evaluated in the MATLAB workspace, first define all variables used in the expression in the workspace.
Dependencies
To enable this parameter, selectEnable assertion.
Programmatic Use
范围:callback |
Type:字符向量 |
Value:matlab表达 |
Default:'' |
Stop simulation when assertion fails
— Halt simulation when assertion fails
off
(默认)|on
当输入信号违反指定的绑定时停止模拟Boundstab during simulation, that is, when assertion fails.
If you run the simulation from a Simulink model window, the Simulation Diagnostics window opens to display an error message. The block where the bound violation occurs is highlighted in the model.
Because selecting this option stops the simulation as soon as the assertion fails, the software does not report assertion failures that might occur later during the simulation. If you want to reportall断言失败,请勿选择此选项。
Dependencies
To enable this parameter, selectEnable assertion.
Programmatic Use
范围:stopwhenassertionfail. |
Type:字符向量 |
Value:'on' |'离开' |
Default:'离开' |
Output assertion signal
- 创建输出信号
off
(默认)|on
输出一个布尔信号,在每次步骤,是:
真的 (
1
) if assertion succeeds, that is, the input signal satisfies all bounds错误的 (
0
)如果断言失败,也就是说,输入信号违反绑定
这data type of the output signal is double by default. To set the output data type as Boolean for all blocks that generate logic signals in your Simulink model, select Implement logic signals as Boolean data in Configuration Parameters.
Selecting this parameter adds an output port to the block that you can connect to any block in the model.
Use this parameter to design complex assertion logic. For an example, see使用仿真软件验证模型控制设计和Sim卡金宝appulink Verification Blocks(Simulink Control Design).
Programmatic Use
范围:export |
Type:字符向量 |
Value:'on' |'离开' |
Default:'离开' |
Model Examples
扩展能力
C / C ++代码生成
使用Simulink®Coder™生成C和C ++代码。金宝app
代码生成只有在Output assertion signalparameter is enabled.
matlab命令
You clicked a link that corresponds to this MATLAB command:
在MATLAB命令窗口中输入它来运行命令。Web浏览器不支持MATLAB命令。金宝app
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América拉丁(Español)
- Canada(英语)
- United States(英语)