StableSignal model

Requirements.Examples.Elementary.ChecksInFixedWindow.StableSignal  ยท source

Icon of StableSignal

Example for StableSignal (a slow and a fast sine, always and sometimes active)

Extends Modelica.Icons.Example

Check block StableSignal with the default limit of 0.01 s-1 on the moving average of |du/dt|, each check feeding a Verify.Requirement with violation statistics and margin:

  • staSigOn and staSigPul check a slow sine, 0.5 + 0.5 sin(2πt/1200 s), over a 120 s window, always active and active in the first half of every 600 s. Its average speed is at most 0.5·2π/1200 s = 0.0026 s-1: satisfied, after an Undecided first window of each phase.
  • staSigOn1 and staSigPul1 check a fast sine, 0.5 + 0.5 sin(2πt/120 s), over the default 360 s window, always active and active in the first half of every 1200 s. Its average speed is (2/π)·0.5·2π/120 s = 0.0167 s-1: violated once the first window is complete.

Every check sets Td = 1 s, the derivative filter's time constant (the default is 0.1 s since version 0.18.0): the rule of the block's Choosing Td -- at most a hundredth of the window and a tenth of the fastest movement -- gives about 1 s for windows of 120 s and 360 s and sines of 120 s and 1200 s. A smaller Td measures nothing more here and costs accuracy over the hour: at 100 times the rtol, the fast sine's final average moves by 0.26 % with Td = 0.1 s and by 0.01 % with Td = 1 s (Modelon Impact, 2026-11-19).

This is the validation model Buildings_Requirements.Validation.StableContinuousSignal of modelica-buildings-requirements (M. Wetter, LBNL), ported with the block in version 0.13.0. The verdicts are the original's, except that an inactive check is Undefined (4) where the original reported Undecided (2), and the original's hysteresis of upperLimit/20 is not set (default h = 0); neither signal comes near the limit, so the verdicts do not depend on it. The requirements' statistics use method = WorstMarginMethod.Ratchet: the fast sine's window holds a whole number of periods, so its average and margin are constant up to numerical noise, and the default continuous search for the margin's extrema would fire an event at every sign change of that noise (35,000 events in this hour). Copyright (c) 1998-2024 The Regents of the University of California, through Lawrence Berkeley National Laboratory, and contributors; see UsersGuide.BuildingsLicense.

Copyright © 2026 Model Based Innovation LLC (the port). All rights reserved.

Components and variables

NameTypeDescription
sinModelica.Blocks.Sources.SineSlow: a period of 1200 s
sin1Modelica.Blocks.Sources.SineFast: a period of 120 s
onRequirements.Sources.BooleanConstantAlways active
booPulModelica.Blocks.Sources.BooleanPulseActive in the first half of every 600 s
booPul1Modelica.Blocks.Sources.BooleanPulseActive in the first half of every 1200 s
staSigOnRequirements.ChecksInFixedWindow.StableSignalSlow sine, always active: satisfied
staSigPulRequirements.ChecksInFixedWindow.StableSignalSlow sine, sometimes active: satisfied
staSigOn1Requirements.ChecksInFixedWindow.StableSignalFast sine, always active: violated
staSigPul1Requirements.ChecksInFixedWindow.StableSignalFast sine, sometimes active: violated
reqStaSigOnRequirements.Verify.RequirementRequirement on staSigOn, ratchet worst margin
reqStaSigPulRequirements.Verify.RequirementRequirement on staSigPul, ratchet worst margin
reqStaSigOn1Requirements.Verify.RequirementRequirement on staSigOn1, ratchet worst margin
reqStaSigPul1Requirements.Verify.RequirementRequirement on staSigPul1, ratchet worst margin
printViolations innerRequirements.Verify.PrintViolationsPrints the requirement summary at 3600 s