MaxDuration block
Requirements.ChecksInFixedWindow.MaxDuration
ยท source
In every true condition phase, check must be true for at most the defined duration
Extends Requirements.Interfaces.PartialCheck
Syntax
property = MaxDuration(condition=..., check=..., durationMax=...).y;
Description
In every duration where the Boolean input condition is true, the Boolean input check must be true for at most the time span defined by parameter durationMax. Whenever this property is fulfilled, property output y = Satisfied. If this property is not fulfilled during a true condition phase, property output y = Violated. If condition=false during initialization, property output y = Undefined (not applicable). Output y keeps its value, until one of the above conditions occur.
Violated, Undecided, and Satisfied are elements of enumeration Property.
Example
This block is demonstrated with the following example:
results in
![]() | |
| simulation result |
Margin
Output margin (present if computeMargin = true, the default) is the signed distance of the check
to its limit, durationMax - duration with output duration the running accumulated duration of the phase, divided by parameter scale: margin ≥ 0 exactly when the check holds,
margin = 1 is one scale of headroom, margin < 0 a violation by that many. Set scale to the
requirement's tolerance so that margins of different requirements compare; with the default scale = 1 the margin
is the raw robustness in the quantity's unit. The block computes the instantaneous value only; the worst value
over a run and the instant it occurs are taken from the stored trajectory.
During a phase in which the property is still Undecided the margin is provisional (the duration is still accumulating); a consumer takes the worst value over the decided points only.
Parameters
| Name | Type | Description |
|---|---|---|
durationMax parameter | SI.Time | Maximum duration in true condition phase |
Components and variables
| Name | Type | Description |
|---|---|---|
duration | Modelica.Blocks.Interfaces.RealOutput | Accumulated time in the current (or last) true condition phase in which check was true |

