Buildings.Controls.OBC.CDL.Integers
Package with blocks for integer variables
Information
Package with blocks for elementary mathematical functions for integer variables.
Package Content
| Name | Description |
|---|---|
| Output the absolute value of the input | |
| Output the sum of the two inputs | |
| Output the sum of an input plus a parameter | |
| Output whether the Integer input changes values, increases or decreases | |
| Output y is true, if input u1 is equal to input u2 | |
| Output y is true, if input u1 is greater than input u2 | |
| Output y is true, if input u1 is greater or equal than input u2 | |
| Output y is true, if input u is greater or equal than a threshold | |
| Output y is true, if input u is greater than a threshold | |
| Output y is true, if input u1 is less than input u2 | |
| Output y is true, if input u1 is less or equal than input u2 | |
| Output y is true, if input u is less or equal than a threshold | |
| Output y is true, if input u is less than a threshold | |
| Pass through the largest signal | |
| Pass through the smallest signal | |
| Sum of Integers, y = k[1]*u[1] + k[2]*u[2] + ... + k[n]*u[n] | |
| Output product of the two inputs | |
| Increment the output if the input switches to true | |
| Output total stages that should be enabled | |
| Output the difference of the two inputs | |
| Switch between two integer signals | |
| Package with blocks that generate source signals | |
| Collection of models that validate the integer blocks of the CDL |
Buildings.Controls.OBC.CDL.Integers.Abs
Output the absolute value of the input
Information
Block that outputs y = abs(u),
where
u is an Integer input.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input for absolute function |
| output IntegerOutput | y | Absolute value of the input |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Add
Output the sum of the two inputs
Information
Block that outputs y as the sum of the
two Integer input signals u1 and u2,
y = u1 + u2.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input to be added |
| input IntegerInput | u2 | Input to be added |
| output IntegerOutput | y | Sum of the two inputs |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.AddParameter
Output the sum of an input plus a parameter
Information
Block that outputs y = u + p,
where p is parameter and u is an input.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | p | Parameter to be added to the input |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input to be added to the parameter |
| output IntegerOutput | y | Sum of the parameter and the input |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Change
Output whether the Integer input changes values, increases or decreases
Information
Block that evaluates the integer input u to check if its value
changes.
-
When the input
uchanges, the outputywill betrue, otherwise it will befalse. -
When the input
uincreases, the outputupwill betrue, otherwise it will befalse. -
When the input
udecreases, the outputdownwill betrue, otherwise it will befalse.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | pre_u_start | 0 | Start value of pre(u) at initial time |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Integer to be monitored for a change in value |
| output BooleanOutput | y | Output that is true when the input changes its value |
| output BooleanOutput | up | Output that is true when the input increased its value |
| output BooleanOutput | down | Output that is true when the input decreased its value |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Equal
Output y is true, if input u1 is equal to input u2
Information
Block that outputs true if the Integer input u1
is equal to the Integer input u2.
Otherwise the output is false.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input to be checked for equality with other input |
| input IntegerInput | u2 | Input to be checked for equality with other input |
| output BooleanOutput | y | Outputs that is true if the two inputs are equal, and false otherwise |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Greater
Output y is true, if input u1 is greater than input u2
Information
Block that outputs true if the Integer input u1
is greater than the Integer input u2.
Otherwise the output is false.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | First input u1 |
| input IntegerInput | u2 | Second input u2 |
| output BooleanOutput | y | Outputs true if u1 is greater than u2 |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.GreaterEqual
Output y is true, if input u1 is greater or equal than input u2
Information
Block that outputs true if Integer the input u1
is greater than or equal to the Integer input u2.
Otherwise the output is false.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | First input u1 |
| input IntegerInput | u2 | Second input u2 |
| output BooleanOutput | y | Outputs true if u1 is greater or equal than u2 |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.GreaterEqualThreshold
Output y is true, if input u is greater or equal than a threshold
Information
Block that outputs true if the Integer input is greater than or equal to
the parameter t.
Otherwise the output is false.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | t | 0 | Threshold against which the input is compared to |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input to be compared against the threshold |
| output BooleanOutput | y | Outputs true if u is greater or equal than the threshold |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold
Output y is true, if input u is greater than a threshold
Information
Block that outputs true if the Integer input is greater than
the parameter t.
Otherwise the output is false.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | t | 0 | Threshold against which the input is compared to |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input to be compared against the threshold |
| output BooleanOutput | y | Outputs true if u is greater than the threshold |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Less
Output y is true, if input u1 is less than input u2
Information
Block that outputs true if the Integer input u1
is less than the Integer input u2.
Otherwise the output is false.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | First input u1 |
| input IntegerInput | u2 | Second input u2 |
| output BooleanOutput | y | Outputs true if u1 is less than u2 |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.LessEqual
Output y is true, if input u1 is less or equal than input u2
Information
Block that outputs true if the Integer input u1
is less than or equal to the Integer input u2.
Otherwise the output is false.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | First input |
| input IntegerInput | u2 | Second input |
| output BooleanOutput | y | Outputs true if u1 is less or equal than u2 |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.LessEqualThreshold
Output y is true, if input u is less or equal than a threshold
Information
Block that outputs true if the Integer input is less than or equal to
the parameter t.
Otherwise the output is false.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | t | 0 | Threshold for comparison |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input to be compared |
| output BooleanOutput | y | Outputs true if u is less or equal than the threshold |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.LessThreshold
Output y is true, if input u is less than a threshold
Information
Block that outputs true if the Integer input is less than
the parameter t.
Otherwise the output is false.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | t | 0 | Threshold for comparison |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Input to be compared against the threshold |
| output BooleanOutput | y | Outputs true if u is less than the threshold |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Max
Pass through the largest signal
Information
Block that outputs y = max(u1, u2),
where
u1 and u2 are inputs.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input to the max function |
| input IntegerInput | u2 | Input to the max function |
| output IntegerOutput | y | Maximum of the inputs |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Min
Pass through the smallest signal
Information
Block that outputs y = min(u1, u2),
where
u1 and u2 are inputs.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input to the min function |
| input IntegerInput | u2 | Input to the max function |
| output IntegerOutput | y | Minimum of the inputs |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.MultiSum
Sum of Integers, y = k[1]*u[1] + k[2]*u[2] + ... + k[n]*u[n]
Information
Block that outputs
y = ∑i=1n ki ui,
where k is a parameter with n elements and u is an input of the same length. The dimension of u can be enlarged by drawing an additional connection line. The connection is automatically connected to this new free index.
If no connection to the input connector u is present, the output is y=0.
See Buildings.Controls.OBC.CDL.Integers.Validation.MultiSum for an example.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | k[nin] | fill(1, nin) | Input gains |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u[nin] | Inputs to be multipled with gain and added |
| output IntegerOutput | y | Sum of inputs multiplied by the gain |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Multiply
Output product of the two inputs
Information
Block that outputs y = u1 * u2,
where
u1 and u2 are Integer inputs.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input for multiplication |
| input IntegerInput | u2 | Input for multiplication |
| output IntegerOutput | y | Product of the inputs |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.OnCounter
Increment the output if the input switches to true
Information
Block that outputs how often the trigger input changed to true
since the last invocation of reset.
This block may be used as a counter. Its output y starts
at the parameter value y_start.
Whenever the input signal trigger changes to true,
the output is incremented by 1.
When the input reset changes to true,
then the output is reset to y = y_start.
If both inputs trigger and reset change
simultaneously, then the ouput is y = y_start.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | y_start | 0 | Initial and reset value of y if input reset switches to true |
Connectors
| Type | Name | Description |
|---|---|---|
| input BooleanInput | trigger | Trigger, when set to true, the counter increases |
| input BooleanInput | reset | Reset, when true, the counter is set to y_start |
| output IntegerOutput | y | Counter value |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Stage
Output total stages that should be enabled
Information
Block that outputs the total number of stages to be enabled.
The block compares the input u with the threshold of each stage. If the input is greater
than a stage threshold, the output is set to that stage.
The block outputs the total number of stages to be enabled.
The parameter n specifies the maximum number of stages.
The stage thresholds are evenly distributed, i.e. the thresholds
for stages [1, 2, 3, ... , n] are
[0, 1/n, 2/n, ... , (n-1)/n], plus a hysteresis which is by default
h=0.02/n.
Once the output changes, it cannot change for at least holdDuration seconds.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | Number of stages that could be enabled | |
| Real | holdDuration | Minimum time that the output needs to be held constant. Set to 0 to disable hold time [s] | |
| Real | h | 0.02/n | Hysteresis for comparing input with threshold |
| Integer | pre_y_start | 0 | Value of pre(y) at initial time |
Connectors
| Type | Name | Description |
|---|---|---|
| input RealInput | u | Input between 0 and 1 for specifying stages |
| output IntegerOutput | y | Total number of stages that should be enabled |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Subtract
Output the difference of the two inputs
Information
Block that outputs y as the difference of the
two input signals u1 and u2,
y = u1 - u2
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input u1 for the minuend |
| input IntegerInput | u2 | Input u2 for the subtrahend |
| output IntegerOutput | y | Output with the difference u1-u2 |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Switch
Switch between two integer signals
Information
Block that outputs one of two integer input signals based on a boolean input signal.
If the input signal u2 is true,
the block outputs y = u1.
Otherwise, it outputs y = u3.
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Input u1 |
| input BooleanInput | u2 | Boolean switch input signal, if true, y=u1, else y=u3 |
| input IntegerInput | u3 | Input u3 |
| output IntegerOutput | y | Output with u1 if u2 is true, else u3 |