RegionFraction model
Requirements.Examples.Elementary.ChecksInFixedWindow.RegionFraction
· source
Example for RegionFraction (a temperature wave along a rod of 10 cells, held over at most 30 % of the rod)
Extends Modelica.Icons.Example
Check block RegionFraction on a rod of 10 cells (weights 0.5, 1, ..., 1, 0.5: the end cells are half cells, the rod is 9 weight units long) whose temperature carries a 100 K triangular peak of half-width 0.15 travelling from one end to the other in 1 s. Above 350 K is the middle half of the peak, 0.15 of the rod long, so it covers at most two cells at a time:
hot: above 350 K over at most 30 % of the rod. The fraction never exceeds 2/9 = 22.2 %: satisfied, worst margin (0.3 - 2/9)/0.05 = 1.56, largest (0.3 - 1/18)/0.05 = 4.89 when only an end cell is hot.tight: the same over at most 15 %: violated whenever two full cells are hot (2/9 > 15 %), worst margin (0.15 - 2/9)/0.05 = -1.44.cool: at most 350 K over at least 70 % of the rod, the complement ofhot: satisfied, the same worst margin 1.56 (the asserts check that the two fractions add up to 1).
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Parameters
| Name | Type | Description |
|---|---|---|
n parameter | Integer | Number of cells of the rod |
w[…] parameter | Real | Weight of each cell (the end cells are half cells) |
Components and variables
| Name | Type | Description |
|---|---|---|
T[…] | Real | Cell temperatures [K]: a 100 K peak of half-width 15 % of the rod travelling along it in 1 s |
on | Requirements.Sources.BooleanConstant | Always active |
hot | Requirements.ChecksInFixedWindow.RegionFraction | Above 350 K over at most 30 % of the rod: satisfied |
tight | Requirements.ChecksInFixedWindow.RegionFraction | Above 350 K over at most 15 % of the rod: violated |
cool | Requirements.ChecksInFixedWindow.RegionFraction | At most 350 K over at least 70 % of the rod: satisfied |
reqHot | Requirements.Verify.Requirement | Requirement on hot |
reqTight | Requirements.Verify.Requirement | Requirement on tight |
reqCool | Requirements.Verify.Requirement | Requirement on cool |
printViolations inner | Requirements.Verify.PrintViolations | Prints the requirement summary at 1 s |