FixedRising block

Requirements.ChecksInFixedWindow.FixedRising  ยท source

Icon of FixedRising

In every true condition phase, a defined number of check rising edges must occur

Extends Requirements.Interfaces.PartialCheck

Syntax

property = FixedRising(condition=..., check=..., nRising=1).y;

Description

In every duration where the Boolean input condition is true, a number of nRising edges of the Boolean input check must occur. The default for nRising=1 (so exactly one rising edge). Property output y is initialized to Undefined (not applicable) if condition=false, and to Undecided if condition=true. When condition becomes true (so entering a duration), property output y = Undecided, as long as the number of rising edges < nRising. If condition is true and the number of rising edges == nRising, output y = Satisfied. If the number of rising edges > nRising or the number of rising edges ≠ nRising at the end of a true condition phase, y = Violated.

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, -abs(countRising - nRising) with output countRising the number of rising edges of the phase so far, 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. The margin of an exact count is 0 when satisfied and negative otherwise: it carries the sign, not headroom.

Parameters

NameTypeDescription
nRising parameterIntegerNumber of required check rising edges

Components and variables

NameTypeDescription
countRisingModelica.Blocks.Interfaces.IntegerOutputNumber of check rising edges in the current (or last) true condition phase