WithinBand block

Requirements.ChecksInFixedWindow.WithinBand  ยท source

Icon of WithinBand

In every true condition phase (after an optional delay), the Real input must stay within a lower and an upper limit

Extends Requirements.Interfaces.PartialCheck

Syntax

property = WithinBand(condition=..., u=..., u_min=..., u_max=..., delayTime=...).y;

Description

In every duration where the Boolean input condition is true, the Real input u must satisfy u_min ≤ u ≤ u_max (both limits included). The check applies delayTime after each rising edge of condition (default 0: at once), which skips the transient that follows, for example, switching a plant on. While the check applies, property output y = Satisfied if u is within the band and y = Violated otherwise. While condition is false, and during the delay, y = Undefined: the check is not applicable.

This is During with check = u_min ≤ u ≤ u_max and its margin, plus the delay. Use it when the monitored quantity is a signal with a band, the most common requirement on a controlled variable. While the check does not apply, the band test is evaluated on the middle of the band instead of on u, so an inactive check generates no state events.

Margin

Output margin (present if computeMargin = true, the default) is the signed distance of u to the nearer limit, min(u - u_min, u_max - u), divided by parameter scale: margin ≥ 0 exactly when the check holds, margin = 1 is one scale of headroom, margin < 0 a violation by that many. While the check does not apply, the margin is that of the middle of the band, (u_max - u_min)/2/scale; a consumer takes the worst value over the applicable points only, as Verify.ViolationStatistics does.

Example

Examples.Elementary.ChecksInFixedWindow.WithinBand and, with the margin asserted in closed form, Examples.Elementary.Margin.Gated.

Origin

Ported in version 0.13.0 from block Buildings_Requirements.WithinBand of modelica-buildings-requirements (M. Wetter, Lawrence Berkeley National Laboratory, 2024-2025), whose activation input and delay became condition and delayTime. Changes: a check block (Property and margin output) rather than a complete requirement, so it combines with the other blocks of this library and feeds Verify.Requirement; y = Undefined, not Undecided, while the check does not apply (four-valued logic, version 0.8.0); no dependency on the Buildings library. Copyright (c) 1998-2024 Modelica Association, International Building Performance Simulation Association (IBPSA), 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.

Parameters

NameTypeDescription
u_max parameterRealUpper limit
u_min parameterRealLower limit
delayTime parameterSI.TimeTime after each rising edge of condition before the check applies (to skip a start-up transient)

Components and variables

NameTypeDescription
uModelica.Blocks.Interfaces.RealInputMonitored quantity