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 |
---|---|
Abs | Output the absolute value of the input |
Add | Output the sum of the two inputs |
AddParameter | Output the sum of an input plus a parameter |
Change | Output whether the Integer input changes values, increases or decreases |
Equal | Output y is true, if input u1 is equal to input u2 |
Greater | Output y is true, if input u1 is greater than input u2 |
GreaterEqual | Output y is true, if input u1 is greater or equal than input u2 |
GreaterEqualThreshold | Output y is true, if input u is greater or equal than threshold |
GreaterThreshold | Output y is true, if input u is greater than a threshold |
Less | Output y is true, if input u1 is less than input u2 |
LessEqual | Output y is true, if input u1 is less or equal than input u2 |
LessEqualThreshold | Output y is true, if input u is less or equal than a threshold |
LessThreshold | Output y is true, if input u is less than a threshold |
Max | Pass through the largest signal |
Min | Pass through the smallest signal |
MultiSum | Sum of Integers, y = k[1]*u[1] + k[2]*u[2] + ... + k[n]*u[n] |
Multiply | Output product of the two inputs |
OnCounter | Increment the output if the input switches to true |
Stage | Output total stages that should be enabled |
Subtract | Output the difference of the two inputs |
Switch | Switch between two integer signals |
Sources | Package with blocks that generate source signals |
Validation | 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 sum of the
two Integer input signals u1
and u2
,
y = u1 + u2.
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.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 | Value to be added |
Connectors
Type | Name | Description |
---|---|---|
input IntegerInput | u | Connector of Integer input signal |
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
u
changes, the outputy
will betrue
, otherwise it will befalse
. -
When the input
u
increases, the outputup
will betrue
, otherwise it will befalse
. -
When the input
u
decreases, the outputdown
will 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 | 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 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] | Connector of Integer input signals |
output IntegerOutput | y | Connector of Integer output signal |
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 | 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.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.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 | Maximum 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 | Real input 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 | 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.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 | Integer input signal |
input BooleanInput | u2 | Boolean switch input signal, if true, y=u1, else y=u3 |
input IntegerInput | u3 | Integer input signal |
output IntegerOutput | y | Integer output signal |