MaxPercentageIncrease block
Requirements.ChecksInSlidingWindow.MaxPercentageIncrease
ยท source
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
| Name | Type | Description |
|---|---|---|
window parameter | SI.Time | Length of sliding time window (> 0) |
upperPercentageLimit parameter | Real | (in [%]) In sliding time window, percentageIncrease <= upperPercentageLimit of input u required |
u_small parameter | Real | Small number to guard against a division by zero |
scale parameter | Real | Scale of the margin: margin = (upperPercentageLimit - percentageIncrease)/scale, with scale the requirement's tolerance (1 = raw) |
computeMargin parameter | Boolean | = true, if the normalized margin output is provided |
Components and variables
| Name | Type | Description |
|---|---|---|
y | Modelica.Blocks.Interfaces.BooleanOutput | = true if percentageIncrease <= upperPercentageLimit |
percentageIncrease | Modelica.Blocks.Interfaces.RealOutput | Increase of the input signal in the sliding time window in [%] |
margin | Requirements.Interfaces.MarginOutput | Normalized margin of the check: >= 0 exactly when the check holds, in units of scale |
u | Modelica.Blocks.Interfaces.RealInput | Real input signal |

