Margin package

Requirements.Examples.Elementary.Margin  ยท source

Icon of Margin

Library of examples asserting the margin outputs of the check blocks against closed-form values

Extends Modelica.Icons.ExamplesPackage

Every check block of the library carries a margin output since version 0.9.0: the signed distance of the check to its limit divided by the block's scale (the requirement's tolerance), ≥ 0 exactly when the check holds. These examples assert the margins against closed-form values at every instant and the sign invariant (satisfied ⇔ margin ≥ 0) continuously, one example per block family; each is a case in the regression lists beside this library, with the margins stored.

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Contents

NameKindDescription
DuringmodelA ramp against a threshold: During's margin is (8 - u)/scale in closed form
BandmodelA sine against a band: During's margin is min(u - lo, hi - u)/scale in closed form, the worst 0.5 at t = 7.5 s
DurationmodelMin/Max/BandDuration on one condition phase: the margin is the running duration against its limit, piecewise linear
RisingmodelThe five count checks on one edge train: the margins are count differences, scale 1
RisingFrequencymodelA 2 Hz edge train against MaxRisingFrequency(3 Hz): the margin is 1 Hz once the frequency is known
WithinDomainmodelA point crossing a square: the margin is the signed distance to the nearest edge over scale, in closed form
SlidingIncreasemodelA ramp against MaxIncrease: the margin is upperLimit - increase, with increase = min(t, window) in closed form
FFTmodelWithinAbsoluteDomain with a scale: the margin is scaledDistance/scale and agrees in sign with the verdict
GatedmodelWithinBand and GreaterEqual behind a pulsed condition and a delay: the margins in closed form while active, Undefined otherwise
StableSignalmodelStableSignal on a sine that stops: the moving average of |du/dt| and the margin in closed form, and the hysteresis