diff --git a/Buildings/Controls/OBC/CDL/Reals/Sort.mo b/Buildings/Controls/OBC/CDL/Reals/Sort.mo index 1ba7b3a4bad..0894cf6d076 100644 --- a/Buildings/Controls/OBC/CDL/Reals/Sort.mo +++ b/Buildings/Controls/OBC/CDL/Reals/Sort.mo @@ -13,11 +13,15 @@ block Sort Buildings.Controls.OBC.CDL.Interfaces.RealOutput y[nin] "Connector of Real output signals" annotation (Placement(transformation(extent={{100,-20},{140,20}}))); - + Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yIdx[nin] + "Indices of the sorted vector with respect to the original vector" + annotation (Placement(transformation(extent={{100,-80},{140,-40}}), + iconTransformation(extent={{100,-80},{140,-40}}))); equation - y=Modelica.Math.Vectors.sort( + (y, yIdx)=Modelica.Math.Vectors.sort( u, ascending=ascending); + annotation ( defaultComponentName="sort", Icon( @@ -42,10 +46,12 @@ equation info="

Block that sorts the elements of the input signal u. -If the parameter ascending = true, then the output signal satisfies +If the parameter ascending = true, then the output signal y satisfies yi <= yi+1 for all i ∈ {1, ..., n-1}. Otherwise, it satisfies yi >= yi+1 for all i ∈ {1, ..., n-1}. +The output signal yIdx contains the indices of the sorted elements, +with respect to the input vector u.

Usage

@@ -62,10 +68,14 @@ In real controllers, measurement noise may cause the output to change frequently This block may for example be used in a variable air volume flow controller to access the position of the dampers that are most open.

-", - revisions=" +", revisions="