Buildings.Controls.OBC.CDL.Discrete
Package with discrete blocks
Information
This package contains discrete control blocks with fixed sample period. Every component of this package is structured in the following way:
- A component has continuous Real input and output signals.
- The input signals are sampled by the given sample period
defined via parameter
samplePeriod
. The first sample instant is defined by the parameterstartTime
. - The output signals are computed from the sampled input signals.
Package Content
Name | Description |
---|---|
DayType | Block that outputs a signal that indicates week-day or week-end |
FirstOrderHold | First order hold of a sampled-data system |
Sampler | Ideal sampler of a continuous signal |
TriggeredMax | Output the maximum, absolute value of a continuous signal at trigger instants |
TriggeredMovingMean | Triggered discrete moving mean of an input signal |
TriggeredSampler | Triggered sampling of continuous signals |
UnitDelay | Output the input signal with a unit delay |
ZeroOrderHold | Output the input signal with a zero order hold |
Examples | Collection of models that illustrate model use and test models |
Buildings.Controls.OBC.CDL.Discrete.DayType
Block that outputs a signal that indicates week-day or week-end
Information
This block outputs a signal that indicates the type of the day. It can for example be used to generate a signal that indicates whether the current time is a work day or a non-working day. The output signal is of type Buildings.Controls.OBC.CDL.Types.Day.
The parameter nout
determines how many days should be
sent to the output. For applications in which only the current day
is of interest, set nout=1
.
For applications in which the load is predicted for the next 24 hours,
set nout=2
in order to output the type of day for today and for
tomorrow.
The transition from one day type to another always happens when the simulation time is a multiple of 1 day. Hence, if the simulation starts for example at t=-3600 seconds, then the first transition to another day will be at t=0.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Integer | nout | 2 | Number of days to output. Set to two for one day predictions |
Day | days[:] | {Buildings.Controls.OBC.CDL.... | Array where each element is a day indicator |
Integer | iStart | 1 | Index of element in days at simulation start |
Connectors
Type | Name | Description |
---|---|---|
output DayTypeOutput | y[nout] | Type of the day for the current and the next (nout-1) days |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.FirstOrderHold
First order hold of a sampled-data system
Information
Block that outputs the extrapolation through the values of the last two sampled input signals.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | samplePeriod | Sample period of component [s] |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
output RealOutput | y | Continuous output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.Sampler
Ideal sampler of a continuous signal
Information
Block that outputs the input signal, sampled at a sampling rate defined
via parameter samplePeriod
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | samplePeriod | Sample period of component [s] |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
output RealOutput | y | Continuous output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.TriggeredMax
Output the maximum, absolute value of a continuous signal at trigger instants
Information
Block that outputs the input signal whenever the trigger input
signal is rising (i.e., trigger changes to
true
). The maximum, absolute value of the input signal
at the sampling point is provided as the output signal.
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Connector with a Real input signal |
output RealOutput | y | Connector with a Real output signal |
input BooleanInput | trigger | Connector for trigger |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.TriggeredMovingMean
Triggered discrete moving mean of an input signal
Information
Block that outputs the triggered moving mean value of an input signal.
At the start of the simulation, and whenever the trigger signal is rising
(i.e., the trigger changes to true
), the block samples
the input, computes the moving mean value over the past n
samples,
and produces this value at its output y
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Integer | n | Number of samples over which the input is averaged |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
input BooleanInput | trigger | Boolean signal that triggers the block |
output RealOutput | y | Discrete averaged signal |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler
Triggered sampling of continuous signals
Information
Samples the continuous input signal whenever the trigger input
signal is rising (i.e., trigger changes from false
to
true
) and provides the sampled input signal as output.
Before the first sampling, the output signal is equal to
the initial value defined via parameter y_start
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | y_start | 0 | Initial value of output signal |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Connector with a Real input signal |
output RealOutput | y | Connector with a Real output signal |
input BooleanInput | trigger | Signal that triggers the sampler |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.UnitDelay
Output the input signal with a unit delay
Information
Block that outputs the input signal with a unit delay:
1 y = --- * u z
that is, the output signal y
is the
input signal u
of the
previous sample instant. Before the second sample instant,
the output y
is identical to parameter y_start
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | samplePeriod | Sample period of component [s] | |
Real | y_start | 0 | Initial value of output signal |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
output RealOutput | y | Continuous output signal |
Modelica definition
Buildings.Controls.OBC.CDL.Discrete.ZeroOrderHold
Output the input signal with a zero order hold
Information
Block that outputs the sampled input signal at sample time instants. The output signal is held at the value of the last sample instant during the sample points. At initial time, the block feeds the input directly to the output.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | samplePeriod | Sample period of component [s] |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
output RealOutput | y | Continuous output signal |