Limit the output to within a min/max boundary.
Source:
function clamp extends TRANSFORM.Icons.Function; import Modelica.Math; input Real x "Value"; input Real min "Minimum value below which x val holds as x = min"; input Real max "Maximum value above which x val holds as x = min"; output Real y "Result"; end clamp;