check that model signal satisfies step response bounds during simulation -凯发k8网页登录
check that model signal satisfies step response bounds during simulation
libraries:
simulink design optimization /
model verification
simulink design optimization /
signal constraints
description
check that a signal satisfies the step response bounds during simulation.
if the signal satisfies 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:
evaluate a matlab expression.
stop the simulation and return an error message.
during simulation, the block can also return a logical assertion signal.
if the signal satisfies all bounds, the assertion signal is true (
1
).if the signal does not satisfy a bound, the assertion signal is false (
0
).
you can add check step response characteristics blocks to multiple signals to check that they satisfy the bounds. you can also plot the bounds on a time plot to graphically verify that the signal satisfies the bounds.
this block and the other blocks in the model verification library test that a signal remains within specified time-domain characteristic bounds. when a model does not violate any bound, you can disable the block by clearing the assertion option. if you modify the model, you can re-enable assertion to ensure that your changes do not cause the model to violate a bound.
if the signal does not satisfy the bounds, you can optimize the model parameters to satisfy the bounds. if you have simulink® control design™ software, you can add frequency-domain bounds, such as the bode magnitude, and optimize the model response to satisfy both time-domain and frequency-domain requirements.
the block can be used in all simulation modes for signal monitoring, but only in
normal
or accelerator
simulation
mode for response optimization.
examples
ports
input
port_1 (u) — signal to check against specified bounds
scalar | vector | matrix
signal to check against the specified step response characteristics during simulation.
data types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fixed point
| enumerated
| 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:
true (
1
) if the assertion succeeds, that is, the signal satisfies all boundsfalse (
0
) if the assertion fails, that is, the signal violates a bound
the 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 assertion tab, select the output assertion signal parameter.
data types: boolean
| double
parameters
show plot — open plot window
button
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 characteristics.
bounds — you can specify bounds on the bounds tab or by right-clicking the plot and selecting bounds > new bound.
you can modify bounds by dragging the bound segment or by right-clicking the plot and selecting bounds > edit bound. before you simulate the model, click update block to update the bound value in the block parameters.
typical tasks that you perform in the plot window include:
opening the block parameters dialog box by clicking or selecting edit.
finding the block that the plot window corresponds to by clicking or selecting view > 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 .
show plot on block open — double-click block to open plot
off
(default) | on
open the plot window instead of the block parameters when you double-click the block in the simulink model.
use this parameter if you prefer to open and perform tasks, such as adding or modifying bounds, in the plot window instead of the block parameters. if you want to access the block parameters from the plot window, select edit or click .
for more information on the plot, see the show plot parameter.
programmatic use
parameter:
launchviewonopen |
type: character vector |
value:
'on' | 'off' |
default:
'off' |
response optimization — open response optimizer
button
open the response optimizer to optimize the model response to meet design requirements specified on the bounds tab.
see also
bounds tab
include step response bound in assertion — check that signal satisfies step response bounds
on
(default) | off
check that the signal satisfies all the step response characteristics specified on the bounds tab. the software displays a warning if the signal violates the specified step response characteristics.
to view the specified step response bounds on a plot, click show plot.
by default, the line segments represent the following step response requirements:
amplitude greater than or equal to –0.01 up to the rise time of 5 seconds for 1% undershoot
amplitude greater than or equal to 0.8 between 5 and 7 seconds for 80% rise
amplitude less than or equal to 1.1 up to the settling time of 7 seconds for 10% overshoot
amplitude between 0.99 and 1.01 beyond the settling time for 1% settling
when you disable this parameter, the software stops checking that the input signal satisfies the bounds during simulation. the bound segments are also grayed out on the plot.
to view only the bounds and input signal on the plot, clear enable assertion.
dependencies
to use this parameter, on the assertion tab, select enable assertion. if you clear enable assertion, the software does not use the bounds for assertion, but they continue to appear on the plot.
programmatic use
parameter:
enablestepresponsebound
|
type: character vector |
value:
'on' | 'off'
|
default:
'on'
|
step time — time when step response bounds start
0
(default) | nonnegative scalar
time, in seconds, when the step response bounds start, specified as a finite, real, nonnegative scalar.
to modify the step time value from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in step time. click update block before simulating the model.
to check that the input signal satisfies the step time value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
steptime |
type: character vector |
value: nonnegative scalar |
default:
0 |
initial value — signal value before step
0
(default) | scalar
value of the signal before the step occurs, specified as a finite real scalar not equal to the final value parameter.
to modify the initial value from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in initial value. click update block before simulating the model.
to check that the input signal satisfies the initial value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
initialvalue
|
type: character vector |
value: scalar |
default:
0
|
final value — signal value after step
1
(default) | scalar
value of the signal after the step occurs, specified as a finite real scalar not equal to the initial value parameter.
to modify the final value from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in final value. you must click update block before simulating the model.
to check the input signal satisfies the final value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
finalvalue |
type: character vector |
value: scalar |
default:
1
|
rise time — time taken to reach specified percentage of step range
5
(default) | positive scalar
time taken, in seconds, for the signal to reach the percentage of the step range (final value – initial value) specified in % rise, specified as a finite, positive, real scalar less than the settling time parameter.
to modify the rise time from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in rise time. click update block before simulating the model.
to check that the input signal satisfies the rise time value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
risetime
|
type: character vector |
value: positive scalar |
default:
5
|
% rise — percentage of step range value for rise time
80
(default) | scalar in range 0–100
the percentage of the step range value to use along with rise time to define the overall rise time characteristics, specified as a real finite scalar in range 0–100 and less than 100 – % settling.
to modify the percent rise from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in % rise. click update block before simulating the model.
to check that the input signal satisfies the percent rise value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
percentrise
|
type: character vector |
value: scalar in range 0–100 |
default:
80
|
settling time (seconds) — time taken to reach settling range
7
(default) | positive scalar
the time taken, in seconds, for the signal to settle within a specified range around the final value, specified as a finite positive real scalar greater than rise time. this settling range is defined as the final value plus or minus the settling range value. specify the settling range in the % settling parameter.
to modify the settling time from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in settling time. click update block before simulating the model.
to check that the input signal satisfies the settling time value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
settlingtime |
type: character vector |
value: positive scalar |
default:
7 |
% settling — settling range around final value
1
(default) | scalar in range 0–100
the percentage of the step range value (final value – initial value) that defines the settling range of the settling time characteristic, specified as a finite real scalar in the range 0–100. specify a value less than both 100 – % rise and % overshoot.
to modify the percent settling from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in % settling. click update block before simulating the model.
to check that the input signal satisfies the percent settling value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
percentsettling
|
type: character vector |
value: scalar in range 0–100 |
default:
1
|
% overshoot — amount by which signal can exceed final value
10
(default) | scalar in range 0–100
the amount by which the signal can exceed the final value before settling, specified as a positive real scalar in the range 0–100 and greater than % settling. this amount is specified as a percentage of step range. the step range is the difference between the final and initial values.
to modify the percent overshoot from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in % overshoot. click update block before simulating the model.
to check that the input signal satisfies the percent overshoot value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
percentovershoot
|
type: character vector |
value: scalar in range 0–100 |
default:
10
|
% undershoot — amount by which signal can undershoot initial value
1
(default) | scalar in range 0–100
the amount by which the signal can undershoot the initial value before rising, specified as a positive real scalar in the range 0–100. this amount is specified as a percentage of the step range. the step range is the difference between the final and initial values.
to modify the percent undershoot from the plot window, drag the corresponding bound segment. alternatively, right-click the segment, and select edit. specify the new value in % undershoot. click update block before simulating the model.
to check that the input signal satisfies the percent undershoot value, select both include step response bound in assertion and enable assertion.
programmatic use
parameter:
percentundershoot
|
type: character vector |
value: scalar in range 0–100 |
default:
1
|
enable zero-crossing detection — evaluate model at bound edges
on
(default) | off
ensure that the software simulates the model to produce output at the bound edges. simulating the model at the bound edges prevents the simulation solver from missing an assertion that the signal satisfies that bound at its edge.
for more information, see .
programmatic use
parameter:
zerocross |
type: character vector |
value:
'on' | 'off' |
default:
'on' |
assertion tab
enable assertion — enable or disable check
on
(default) | off
enable the block to check that bounds specified and included for assertion on the bounds tab are satisfied during simulation. assertion fails if a bound is not satisfied. a warning, reporting the assertion failure, appears at the matlab prompt.
if the assertion fails, you can optionally specify that the block:
execute a matlab expression, specified in simulation callback when assertion fails (optional).
stop the simulation and return an error message, by selecting stop simulation when assertion fails.
this parameter has no effect if you do not specify any bounds.
when 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.
in the simulink model, in the configuration parameters, the model verification block enabling 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
parameter:
enabled |
type: character vector |
value:
'on' | 'off' |
default:
'on' |
simulation callback when assertion fails (optional) — expression to evaluate when assertion fails
''
(default) | matlab expression
matlab expression to execute when assertion fails.
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, select enable assertion.
programmatic use
parameter:
callback |
type: character vector |
value: matlab expression |
default:
'' |
stop simulation when assertion fails — halt simulation when assertion fails
off
(default) | on
stop the simulation when the input signal violates a bound specified on the bounds tab 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 report all assertion failures, do not select this option.
dependencies
to enable this parameter, select enable assertion.
programmatic use
parameter:
stopwhenassertionfail |
type: character vector |
value:
'on' | 'off' |
default:
'off' |
output assertion signal — create output signal
off
(default) | on
output a boolean signal that, at each time step, is:
true (
1
) if assertion succeeds, that is, the input signal satisfies all boundsfalse (
0
) if assertion fails, that is, the input signal violates a bound
the 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 (simulink control design).
programmatic use
parameter:
export |
type: character vector |
value:
'on' | 'off' |
default:
'off' |
extended capabilities
c/c code generation
generate c and c code using simulink® coder™.
code generation is available only when the output assertion signal parameter is enabled.
version history
introduced in r2011b
see also
|
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
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
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)