RegionFraction model

Requirements.Examples.Elementary.ChecksInFixedWindow.RegionFraction  · source

Icon of RegionFraction

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 of hot: 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

NameTypeDescription
n parameterIntegerNumber of cells of the rod
w[…] parameterRealWeight of each cell (the end cells are half cells)

Components and variables

NameTypeDescription
T[…]RealCell temperatures [K]: a 100 K peak of half-width 15 % of the rod travelling along it in 1 s
onRequirements.Sources.BooleanConstantAlways active
hotRequirements.ChecksInFixedWindow.RegionFractionAbove 350 K over at most 30 % of the rod: satisfied
tightRequirements.ChecksInFixedWindow.RegionFractionAbove 350 K over at most 15 % of the rod: violated
coolRequirements.ChecksInFixedWindow.RegionFractionAt most 350 K over at least 70 % of the rod: satisfied
reqHotRequirements.Verify.RequirementRequirement on hot
reqTightRequirements.Verify.RequirementRequirement on tight
reqCoolRequirements.Verify.RequirementRequirement on cool
printViolations innerRequirements.Verify.PrintViolationsPrints the requirement summary at 1 s