MinDuration block

Requirements.ChecksInFixedWindow.MinDuration  ยท source

Icon of MinDuration

In every true condition phase, check must be true for at least the defined duration

Extends Requirements.Interfaces.PartialCheck

Syntax

property = MinDuration(condition=..., check=..., durationMin=...).y;

Description

In every duration where the Boolean input condition is true, the Boolean input check must be true for at least the time span defined by parameter durationMin. Whenever this property is fulfilled, property output y = Satisfied. If this property is not fulfilled at the end of a true condition phase, property output y = Violated. At initialization with condition = false, property output y = Undefined (the check is not applicable before the first true condition phase); when entering a true condition phase, property output y = Undecided. 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, duration - durationMin 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

NameTypeDescription
durationMin parameterSI.TimeMinimum duration in true condition phase

Components and variables

NameTypeDescription
durationModelica.Blocks.Interfaces.RealOutputAccumulated time in the current (or last) true condition phase in which check was true