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 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 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 Reals, y = k[1]*u[1] + k[2]*u[2] + ... + k[n]*u[n] | |
| Increment the output if the input switches to true | |
| Output product of the two inputs | |
| 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 | Connector of Integer input signals |
| output IntegerOutput | y | Connector of Integer output signals |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Add
Output the sum of the two inputs
Information
Block that outputs y as the weighted sum of the
two Integer input signals u1 and u2,
y = k1*u1 + k2*u2;
where k1 and k2 are Integer parameters.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | k1 | +1 | Gain of upper input |
| Integer | k2 | +1 | Gain of lower input |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u1 | Connector of Integer input signal 1 |
| input IntegerInput | u2 | Connector of Integer input signal 2 |
| output IntegerOutput | y | Connector of Integer output signal |
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 |
|---|---|---|---|
| Boolean | y_start | false | Initial value of y |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Connector of Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
| output BooleanOutput | up | Connector of Boolean output signal indicating input increase |
| output BooleanOutput | down | Connector of Boolean output signal indicating input decrease |
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 | Connector of first Integer input signal |
| input IntegerInput | u2 | Connector of second Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of first Integer input signal |
| input IntegerInput | u2 | Connector of second Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of first Integer input signal |
| input IntegerInput | u2 | Connector of second Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.GreaterEqualThreshold
Output y is true, if input u is greater or equal than 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 | Comparison with respect to a threshold |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Connector of Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 for comparison |
Connectors
| Type | Name | Description |
|---|---|---|
| input IntegerInput | u | Connector of Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of first Integer input signal |
| input IntegerInput | u2 | Connector of second Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of first Integer input signal |
| input IntegerInput | u2 | Connector of second Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of Integer input signal |
| output BooleanOutput | y | Connector of Boolean output signal |
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 | Connector of Integer input signal 1 |
| input IntegerInput | u2 | Connector of Integer input signal 2 |
| output IntegerOutput | y | Connector of Integer output signal |
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 | Connector of Integer input signal 1 |
| input IntegerInput | u2 | Connector of Integer input signal 2 |
| output IntegerOutput | y | Connector of Integer output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.MultiSum
Sum of Reals, 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] | Connector of Integer input signals |
| output IntegerOutput | y | Connector of Integer output signal |
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 | Boolean input signal |
| input BooleanInput | reset | Reset the counter |
| output IntegerOutput | y | Integer output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Integers.Product
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 | Connector of Integer input signal 1 |
| input IntegerInput | u2 | Connector of Integer input signal 2 |
| output IntegerOutput | y | Connector of Integer output signal |