MaxAccumulatedDuration block

Requirements.ChecksInSlidingWindow.MaxAccumulatedDuration  ยท source

Icon of MaxAccumulatedDuration

In every sliding time window, the accumulated time duration where check was true must be below an upper limit

Extends Interfaces.PartialCheckInSlidingWindowWithBooleanOutput

Syntax

accumulatedDurationLimited = MaxAccumulatedDuration(check=..., window=..., upperLimit=...).y;

Description

In any (sliding) time window of length window, the accumulated time duration where the Boolean input check was true (= accumulatedDuration) must be ≤ parameter upperLimit. Whenever this property is fulfilled, Boolean output y = true, otherwise y = false:

y =  accumulatedDuration ≤ upperLimit;

Example

The property is demonstrated with the following example calling the block as:

results in

simulation result

Margin

Output margin (present if computeMargin = true, the default) is the signed distance of the check to its limit, upperLimit - accumulatedDuration, 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. Before the end of the first window the margin is provisional; a consumer takes the worst value over the decided points only. The sliding buffer holds 20 elements, so a margin over a busier window is approximate, as the property is.

Parameters

NameTypeDescription
upperLimit parameterSI.TimeIn sliding time window, accumulatedDuration(check=true) <= upperLimit required

Components and variables

NameTypeDescription
accumulatedDurationModelica.Blocks.Interfaces.RealOutputAccumulated time duration in the sliding time window where check was true