Buildings.Controls.OBC.CDL.Reals.Validation
Collection of models that validate the continuous blocks of the CDL
Information
This package contains models that validate the blocks in Buildings.Controls.OBC.CDL.Reals.
The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.
Package Content
Name | Description |
---|---|
Abs | Validation model for the absolute block |
Acos | Validation model for the Acos block |
Add | Validation model for the add block |
AddParameter | Validation model for the AddParameter block |
Asin | Validation model for the Asin block |
Atan | Validation model for the Atan block |
Atan2 | Validation model for the Atan2 block |
Average | Validation model for the Average block |
Cos | Validation model for the Cos block |
Derivative | Test model for the derivative block |
Divide | Validation model for the Divide block |
Exp | Validation model for the Exp block |
Greater | Validation model for the Greater block |
GreaterThreshold | Validation model for the GreaterThreshold block |
Hysteresis | Validation model for the Hysteresis block |
IntegratorWithReset | Test model for integrator with reset |
Less | Validation model for the Less block |
LessThreshold | Validation model for the LessThreshold block |
LimitSlewRate | Validation model for the LimitSlewRate block |
Limiter | Validation model for the Limiter block |
Line | Validation model for the Line block |
Log | Validation model for the Log block |
Log10 | Validation model for the Log10 block |
MatrixGain | Validation model for the MatrixGain block |
MatrixMax | Validation model for the MatrixMax block |
MatrixMin | Validation model for the MatrixMin block |
Max | Validation model for the Max block |
Min | Validation model for the Min block |
Modulo | Validation model for the Modulo block |
MovingAverage | Validation model for the MovingAverage block |
MovingAverage_nonZeroStart | Validation model for the MovingAverage block |
MultiMax | Validation model for the MultiMax block |
MultiMin | Validation model for the MultiMin block |
MultiSum | Model to validate the application of MultiSum block |
Multiply | Validation model for the Multiply block |
MultiplyByParameter | Validation model for the Gain block |
PID | Test model for PID controller |
PIDInitialDerivativeOutput | Test model for LimPID controller with initial output of the derivative term specified |
PIDInitialState | Test model for LimPID controller with initial state specified |
PIDScale | Test model for PID controller with scaling of the control error |
PIDWithReset | Test model for LimPID controller with reset trigger |
PIDWithResetScale | Test model for PID controller with reset and scaling of the control error |
Ramp | Validation model for the Ramp block |
Round | Validation model for the Round block |
Sin | Validation model for the Sin block |
Sort | Validation model for the Sort block |
Sqrt | Validation model for the Sqrt block |
Subtract | Validation model for the Subtract block |
Switch | Validation model for the Switch block |
Tan | Validation model for the Tan block |
Buildings.Controls.OBC.CDL.Reals.Validation.Abs
Validation model for the absolute block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Abs. The input varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Acos
Validation model for the Acos block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Acos.
The input u
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Add
Validation model for the add block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Add.
The input u1
varies from -2 to +2, input u2
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.AddParameter
Validation model for the AddParameter block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.AddParameter.
The input u
varies from -2 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Asin
Validation model for the Asin block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Asin.
The input u
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Atan
Validation model for the Atan block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Atan.
The input u
varies from -2 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Atan2
Validation model for the Atan2 block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Atan2.
The input u1
varies from -2 to +2,
The input u2
varies from +1 to +3.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Average
Validation model for the Average block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Average.
The input u1
varies from -2.0 to +6.0, input u2
varies from +1.5 to +4.5
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Cos
Validation model for the Cos block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Cos.
The input u
varies from 0.0 to +6.283.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Derivative
Test model for the derivative block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Reals.Derivative.
The model integrates a time varying signal, and the differentiates this integrated signal.
Hence, the output der1.y
matches the non-integrated signal intWitRes.u
,
within a small approximation tolerance.
The instance der1
uses a varying input for T
which controls the accuracy of
the derivative approximation. At the start of the simulation, T
is small and hence
the output der1.y
matches the signal intWitRes.u
well.
As expected, the approximation error increases with increasing der1.T
.
The instance der2
uses a gain of 2, and it initializes the output to 0.
Hence, there is a fast transient at the beginning, and afterwards the output matches der1.y = der2.y / 2
.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Divide
Validation model for the Divide block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Divide.
The input u1
varies from -2 to +2, input u2
varies from +1 to +3.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Exp
Validation model for the Exp block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Exp.
The input u
varies from 0.0 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Greater
Validation model for the Greater block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Reals.Greater.
The instance gre
has no hysteresis, and the
instance greHys
has a hysteresis.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.GreaterThreshold
Validation model for the GreaterThreshold block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold.
The instance gre
has no hysteresis, and the
instance greHys
has a hysteresis.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Hysteresis
Validation model for the Hysteresis block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Hysteresis.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.IntegratorWithReset
Test model for integrator with reset
Information
This model tests the implementation of Buildings.Controls.OBC.CDL.Reals.IntegratorWithReset with and without reset, and with different start values and reset values.
The integrator intWitRes1
is triggered by a sample trigger
which becomes true at t=0, while intWitRes2
is triggered
by a boolean pulse with is true at t=0.
Hence, intWitRes1
starts with y(0)=y_reset
while
intWitRes2
starts with y(0)=y_start
.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Less
Validation model for the Less block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Reals.Less.
The instance les
has no hysteresis, and the
instance lesHys
has a hysteresis.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.LessThreshold
Validation model for the LessThreshold block
Information
Validation test for the block
Buildings.Controls.OBC.CDL.Reals.LessThreshold.
The instance les
has no hysteresis, and the
instance lesHys
has a hysteresis.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.LimitSlewRate
Validation model for the LimitSlewRate block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.LimitSlewRate.
The input ramp1.u
varies from 0 to +1.5,
in 1 s
.
The increase and decrease rate limits are [increase/incDt, -decrease/decDt]
, which is [1, -1]
here.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Limiter
Validation model for the Limiter block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Limiter.
The input u
varies from 0.0 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Line
Validation model for the Line block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Line.
The input u
varies from 0.0 to +2.
The block outputs y = a + b u
,
where
u
is an input
and the coefficients a
and b
are determined so that the line intercepts the two input points
specified by the two points x1
and f1
,
and x2
and f2
.
The parameters limitBelow
and limitAbove
determine whether x1
and x2
are also used
to limit the input u
.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Log
Validation model for the Log block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Log.
The input u
varies from +1 to +6.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Log10
Validation model for the Log10 block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Log10.
The input u
varies from +1 to +10.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixGain
Validation model for the MatrixGain block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MatrixGain.
The input vector output two identical values u[1]
and
u[2]
that vary from 0.0 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMax
Validation model for the MatrixMax block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MatrixMax.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MatrixMin
Validation model for the MatrixMin block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MatrixMin.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Max
Validation model for the Max block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Max.
The input u1
varies from -2 to +2, input u2
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Min
Validation model for the Min block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Min.
The input u1
varies from -2 to +2, input u2
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Modulo
Validation model for the Modulo block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Modulo.
The input u1
varies from -2.0 to +6.0, input u2
varies from +1.5 to +4.5
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage
Validation model for the MovingAverage block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MovingAverage.
The input sinInpNoDel
, sinInp50sDel
,
sinInp100sDel
, generate sine outputs with same frequency of
1/80 Hz
, but different start times of 0 second
,
50 second
, 100 second
.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MovingAverage_nonZeroStart
Validation model for the MovingAverage block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MovingAverage.
The inputs sinInpNoDel
, sinInp50sDel
and
sinInp100sDel
generate sine outputs with the same frequency of
1/80
Hertz, but different start times of 0
seconds,
50
seconds and 100
seconds.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MultiMax
Validation model for the MultiMax block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MultiMax.
The input vectorcon
has size 5 and its element values are {1,2,3,4,5}
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Integer | sizOfVec | 5 | Size of the input vector |
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MultiMin
Validation model for the MultiMin block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MultiMin.
The input vectorcon
has size 5 and its element values are {1,2,3,4,5}
.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Integer | sizOfVec | 5 | Size of the input vector |
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MultiSum
Model to validate the application of MultiSum block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MultiSum.
The inputs and gains are configured as follows:
- u1 varies from -2 to +2, with gain k = 1.
- u2 varies from -1 to +1, with gain k = 0.5.
- u3 varies from -1 to +2, with gain k = 0.1.
- u4 varies from -2 to +1, with gain k = 1.
- u5 varies from -3 to 0, with gain k = 2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Multiply
Validation model for the Multiply block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Multiply.
The input u1
varies from -2 to +2, input u2
varies from -1 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.MultiplyByParameter
Validation model for the Gain block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter.
The input u
varies from 0.0 to +2.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PID
Test model for PID controller
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID. This tests the different settings for the controller types.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialDerivativeOutput
Test model for LimPID controller with initial output of the derivative term specified
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.
This model validates setting the initial output of the controller to a specified value. Note that the control error must be zero for the initial output to be at the specified value. See the description of Buildings.Controls.OBC.CDL.Reals.PID.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PIDInitialState
Test model for LimPID controller with initial state specified
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.
This model validates setting the initial state of the controller to a specified value.
The model sets the initial values xi_start=0.25
of the integrator for both instances of the controller.
For the instance limPID
, it also sets the initial value of the state of the
derivative block xd_start=-0.5
.
The derivative block obtains as an input signal the value
u=-0.5 because the set point weight for the derivative action is wd=0
.
Therefore, an initial state of x(t0)=-0.5 causes the state of the derivative
block to be at steady-state, because
dx(t)/dt = (u - x)/T.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PIDScale
Test model for PID controller with scaling of the control error
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID with and without setting of the parameter that scales the control error.
The test has two combinations of a PID controller and a plant.
In PIDSca
, the control error is scaled inside the controller, whereas
in the configuration that has PIDNoSca
, the setpoint signal and the
measurement signal is scaled outside of the controller.
Both controllers and plants have the same trajectory, thereby validating that
the scaling is implemented correctly.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithReset
Test model for LimPID controller with reset trigger
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PID.
This model validates the controller for different settings of the control output reset.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.PIDWithResetScale
Test model for PID controller with reset and scaling of the control error
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.PIDWithReset with and without setting of the parameter that scales the control error.
The test has two combinations of a PID controller and a plant.
In PIDSca
, the control error is scaled inside the controller, whereas
in the configuration that has PIDNoSca
, the setpoint signal and the
measurement signal is scaled outside of the controller.
Both controllers and plants have the same trajectory, thereby validating that
the scaling is implemented correctly.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Ramp
Validation model for the Ramp block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Ramp.
-
The instances
ramUp
andramUp1
shows ramping up the input in different speed. -
The instance
ramUpDow
shows ramping up and down the input in the same speed. It also shows that the output will be the ramped input if the boolean inputactive
istrue
. -
The instance
ramUpDow1
shows ramping up and down the input in the different speed.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Round
Validation model for the Round block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Round.
The input u
varies from -3.5 to +3.5.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Sin
Validation model for the Sin block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Sin.
The input u
varies from 0.0 to +2π.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Sort
Validation model for the Sort block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Sort.
The input u1
varies from -2 to +2, input u2
varies from -1 to +2,
input u3
varies from +2 to -2, input u4
varies from +3 to +2,
input u5
varies from 0 to +4,
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Sqrt
Validation model for the Sqrt block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Sqrt.
The input u
varies from 0.0 to +9.0.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Subtract
Validation model for the Subtract block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Subtract.
The input u1
varies from -2 to +2, input u2
varies from -1 to +1.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Switch
Validation model for the Switch block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Switch.
Modelica definition
Buildings.Controls.OBC.CDL.Reals.Validation.Tan
Validation model for the Tan block
Information
Validation test for the block Buildings.Controls.OBC.CDL.Reals.Tan.
The input u
varies from -1.5 to +1.5.