Buildings.Controls.Predictors.Validation.BaseClasses
Package with base classes for Buildings.Controls.Predictors.Examples
Information
This package contains base classes that are used to construct the models in Buildings.Controls.Predictors.Validation.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
PartialSimpleTestCase | Partial base class for simple test case of base load prediction |
Buildings.Controls.Predictors.Validation.BaseClasses.PartialSimpleTestCase
Partial base class for simple test case of base load prediction
Information
Partial base class to build test for the load prediction.
This model has been added to the library to verify and demonstrate the correct implementation of the load prediction model based on a simple input scenario.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | tPeriod | 24*3600 | Period [s] |
Time | tSample | 3600 | Sampling period [s] |
Integer | nPre | 12 | Number of time steps to predict |
Modelica definition
partial model PartialSimpleTestCase
"Partial base class for simple test case of base load prediction"
extends Modelica.Icons.Example;
parameter Modelica.SIunits.Time tPeriod=24*3600 "Period";
parameter Modelica.SIunits.Time tSample=3600 "Sampling period";
parameter Integer nPre(min=1) = 12 "Number of time steps to predict";
ElectricalLoad baseLoad(
final nPre=nPre,
use_dayOfAdj=false,
predictionModel=Buildings.Controls.Predictors.Types.PredictionModel.Average)
"Baseload prediction";
Modelica.Blocks.Sources.BooleanPulse tri(
width=4/24*100/7,
period=7*tPeriod,
startTime=1.5*tPeriod) "Sample trigger";
Sources.DayType dayType(nout=2)
"Outputs the type of the day for each hour where load is to be predicted";
Modelica.Blocks.Logical.Not notEventDay
"Output true if it is not an event day";
// The Sampler is reimplemented to avoid in Dymola 2016 the translation warning
// for the models in the parent package:
// The initial conditions for variables of type Boolean are not fully specified.
// Dymola has selected default initial conditions.
// Assuming fixed default start value for the discrete non-states:
// ...firstTrigger(start = false)
// ...
protected
block Sampler
extends Modelica.Blocks.Discrete.Sampler(firstTrigger(start=false, fixed=true));
end Sampler;
equation
connect(tri.y, notEventDay.u);
connect(notEventDay.y, baseLoad.storeHistory);
connect(dayType.y, baseLoad.typeOfDay);
end PartialSimpleTestCase;
Buildings.Controls.Predictors.Validation.BaseClasses.PartialSimpleTestCase.Sampler
Information
Extends from Modelica.Blocks.Discrete.Sampler (Ideal sampling of continuous signals).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Time | samplePeriod | Sample period of component [s] | |
Time | startTime | 0 | First sample time instant [s] |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | u | Continuous input signal |
output RealOutput | y | Continuous output signal |
Modelica definition
block Sampler
extends Modelica.Blocks.Discrete.Sampler(firstTrigger(start=false, fixed=true));
end Sampler;