RegionFraction block
Requirements.ChecksInFixedWindow.RegionFraction
· source
In every true condition phase, the weighted fraction of n places where a check holds must stay within a lower and an upper limit
Extends Requirements.Interfaces.PartialCheck
Syntax
property = RegionFraction(condition=..., n=..., checks=..., weight=..., fractionMin=..., fractionMax=...).y;
Description
A spatial measure: the counterpart over a region of MaxDuration and MinDuration over time. The region is discretized into n places (the nodes of a pipe, the cells of a wall, the layers of a plate), each with a weight, its share of the region (default: all equal). The Boolean vector input checks tells at each place whether the checked state holds there. Output fraction is the weighted fraction of the region where it holds:
fraction = sum(weight[i] for checks[i]) / sum(weight)
In every duration where the Boolean input condition is true, property output y = Satisfied while
fractionMin ≤ fraction ≤ fractionMax and y = Violated otherwise; while condition is false,
y = Undefined. A requirement such as "the wall temperature shall be above 80 °C over at most 10 % of the
wall" is checks[i] = T[i] > 353.15, fractionMax = 0.1; "over at least 90 %" is
fractionMin = 0.9. The check holds at each instant; the verdict over a run is the worst instant, as for
During.
The weights are those of the discretization: a finite-volume pipe's cells weigh their volume (or length), a nodal discretization a node's share of the region (half a cell at either end). A fraction of places with equal weights is a fraction of the region only on a uniform grid.
Margin
Output margin (present if computeMargin = true, the default) is the distance of the fraction to the
nearer limit, min(fraction - fractionMin, fractionMax - fraction), divided by parameter scale
(a fraction too: scale = 0.02 is a tolerance of 2 %). A limit left at its default (fractionMin = 0,
fractionMax = 1) bounds nothing and does not enter the margin; with neither set, the robustness is 1. The fraction
moves in steps of a place's weight, so the margin does too.
Example
Examples.Elementary.ChecksInFixedWindow.RegionFraction.
Origin
New in this library: Chaperone's spatial-measure requirement shape RegionFraction ("<state> shall
be ... over at least / at most <p> % of the region"), which Chaperone decides in Python over a field
solver's places and this block decides over the places of a Modelica model.
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Parameters
| Name | Type | Description |
|---|---|---|
n parameter | Integer | Number of places (nodes, cells or layers of a discretized region) |
weight[…] parameter | Real | Weight of each place, its share of the region (volume, area or length; only the ratios count) |
fractionMin parameter | Real | Smallest permitted fraction of the region where checks holds (0: no lower limit) |
fractionMax parameter | Real | Largest permitted fraction of the region where checks holds (1: no upper limit) |
Components and variables
| Name | Type | Description |
|---|---|---|
checks[…] | Modelica.Blocks.Interfaces.BooleanInput | Per place: = true where the checked state holds |
fraction | Real | Weighted fraction of the region where checks holds (0 to 1) |