WithinDomain model

Requirements.Examples.Elementary.Margin.WithinDomain  ยท source

Icon of WithinDomain

A point crossing a square: the margin is the signed distance to the nearest edge over scale, in closed form

Extends Modelica.Icons.Example

The point (1, 0.5 + 0.1 t) moves up through the square [0, 2] × [0, 2] against WithinDomain(scale = 0.25): the block's distance to the nearest edge is min(0.5 + 0.1 t, 1.5 − 0.1 t) (the bottom edge, then the top one) and the margin is that over 0.25, asserted in closed form; the farthest point from any edge is the centre at t = 5 s, four tolerances away.

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

Components and variables

NameTypeDescription
withinDomainRequirements.ChecksInFixedWindow.WithinDomainThe point must stay inside the square [0, 2] x [0, 2], tolerance 0.25
pxRequirements.Sources.RealExpressionx = 1, the middle of the square
pyRequirements.Sources.RealExpressiony = 0.5 + 0.1 t, moving up inside the square
alwaysRequirements.Sources.BooleanConstantCondition, always true