MaxPercentageIncrease block

Requirements.ChecksInSlidingWindow.MaxPercentageIncrease  ยท source

Icon of MaxPercentageIncrease

In every sliding time window, the percentage increase of the input is limited

Syntax

percentageIncreaseLimited = MaxPercentageIncrease(window=..., upperPercentageLimit=...).y;

Description

In any (sliding) time window of length window, the percentage increase of input u is limited by parameter upperPercentageLimit, that is

percentageIncrease(t) = 100*(u(t) - u(t-window)/max(|u(t-window)|,usmall), if t ≥ t0 + window
                      = 100*(u(t) - u(t0)/max(|u(t0)|,usmall), if t < t0 + window
                 y(t) = percentageIncrease(t) ≤ upperPercentageLimit

Whenever this property is fulfilled, Boolean output y = true, otherwise y = false.

The denominator of the percentageIncrease uses the max(...,usmall)) construction to guard against division by 0.

Note, percentageIncrease and upperPercentageLimit have unit [%].

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, upperPercentageLimit - percentageIncrease (in %), 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.

Parameters

NameTypeDescription
window parameterSI.TimeLength of sliding time window (> 0)
upperPercentageLimit parameterReal(in [%]) In sliding time window, percentageIncrease <= upperPercentageLimit of input u required
u_small parameterRealSmall number to guard against a division by zero
scale parameterRealScale of the margin: margin = (upperPercentageLimit - percentageIncrease)/scale, with scale the requirement's tolerance (1 = raw)
computeMargin parameterBoolean= true, if the normalized margin output is provided

Components and variables

NameTypeDescription
yModelica.Blocks.Interfaces.BooleanOutput= true if percentageIncrease <= upperPercentageLimit
percentageIncreaseModelica.Blocks.Interfaces.RealOutputIncrease of the input signal in the sliding time window in [%]
marginRequirements.Interfaces.MarginOutputNormalized margin of the check: >= 0 exactly when the check holds, in units of scale
uModelica.Blocks.Interfaces.RealInputReal input signal