WithinDomain model
Requirements.Examples.Elementary.Margin.WithinDomain
ยท source
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
| Name | Type | Description |
|---|---|---|
withinDomain | Requirements.ChecksInFixedWindow.WithinDomain | The point must stay inside the square [0, 2] x [0, 2], tolerance 0.25 |
px | Requirements.Sources.RealExpression | x = 1, the middle of the square |
py | Requirements.Sources.RealExpression | y = 0.5 + 0.1 t, moving up inside the square |
always | Requirements.Sources.BooleanConstant | Condition, always true |