Margin package
Requirements.Examples.Elementary.Margin
ยท source
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
| Name | Kind | Description | |
|---|---|---|---|
| During | model | A ramp against a threshold: During's margin is (8 - u)/scale in closed form | |
| Band | model | A 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 | |
| Duration | model | Min/Max/BandDuration on one condition phase: the margin is the running duration against its limit, piecewise linear | |
| Rising | model | The five count checks on one edge train: the margins are count differences, scale 1 | |
| RisingFrequency | model | A 2 Hz edge train against MaxRisingFrequency(3 Hz): the margin is 1 Hz once the frequency is known | |
| WithinDomain | model | A point crossing a square: the margin is the signed distance to the nearest edge over scale, in closed form | |
| SlidingIncrease | model | A ramp against MaxIncrease: the margin is upperLimit - increase, with increase = min(t, window) in closed form | |
| FFT | model | WithinAbsoluteDomain with a scale: the margin is scaledDistance/scale and agrees in sign with the verdict | |
| Gated | model | WithinBand and GreaterEqual behind a pulsed condition and a delay: the margins in closed form while active, Undefined otherwise | |
| StableSignal | model | StableSignal on a sine that stops: the moving average of |du/dt| and the margin in closed form, and the hysteresis |