StableSignal model
Requirements.Examples.Elementary.Margin.StableSignal
ยท source
StableSignal on a sine that stops: the moving average of |du/dt| and the margin in closed form, and the hysteresis
Extends Modelica.Icons.Example
u = sin(2πt / 20 s) until 100 s, 0 after, against StableSignal with a 40 s window (two periods) and the derivative filter's time constant Td = 0.1 s. Over whole periods the moving average of |du/dt| is (2/π) ω/√(1 + (ω Td)2) = 0.1999 s-1 with ω = 2π/20 s, asserted from 42 s (after the filter's start-up has left the window) until the sine stops:
- during the first 40 s all three checks are Undecided and rateAverage is 0;
stable1(limit 0.25) is satisfied with margin (0.25 − 0.1999)/0.05 = 1.0,stable2(limit 0.15) violated with margin −1.0, and the sign of stable2's margin is its verdict throughout;- after 100 s the oscillation slides out of the window and the average falls. At 115 s it is about 0.12: stable2 is
satisfied again, while
stable3, the same check with hysteresis h = 0.06, is still violated although its margin is already positive -- the documented price of a hysteresis. At 145 s, with the average below 0.09, it is satisfied too.
Copyright © 2026 Model Based Innovation LLC. All rights reserved.
Components and variables
| Name | Type | Description |
|---|---|---|
u | Modelica.Blocks.Sources.RealExpression | sin(2 pi t / 20 s) until 100 s, 0 after |
always | Requirements.Sources.BooleanConstant | Condition, always true |
stable1 | Requirements.ChecksInFixedWindow.StableSignal | Limit above the sine's average speed: satisfied |
stable2 | Requirements.ChecksInFixedWindow.StableSignal | Limit below it: violated while the sine runs |
stable3 | Requirements.ChecksInFixedWindow.StableSignal | As stable2, with hysteresis: stable again only at or below 0.09 |