Buildings.Controls.Predictors.BaseClasses

Package with base classes

Information

This package contains base classes that are used to construct the models in Buildings.Controls.Predictors.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Controls.Predictors.BaseClasses.average average Average of past 10 days
Buildings.Controls.Predictors.BaseClasses.partialBaselinePrediction partialBaselinePrediction Partial function for baseline load prediction
Buildings.Controls.Predictors.BaseClasses.sampleStart sampleStart Start time for sampling
Buildings.Controls.Predictors.BaseClasses.weatherRegression weatherRegression Linear weather regression model
Buildings.Controls.Predictors.BaseClasses.Examples Examples Collection of models that illustrate model use and test models

Buildings.Controls.Predictors.BaseClasses.average

Average of past 10 days

Information

Function that predicts the current load using the average of the previous loads. The argument k determines how many data points will be used to compute the average. This is needed as during the start of the simulation, the complete history is not yet built up.

Extends from partialBaselinePrediction (Partial function for baseline load prediction).

Inputs

TypeNameDefaultDescription
PowerP[:] Vector of power consumed in each interval of the current time of day [W]
Integerk Number of history terms that have already been stored

Outputs

TypeNameDescription
PoweryBaseline power consumption [W]

Modelica definition

function average "Average of past 10 days" extends partialBaselinePrediction; algorithm if k == 0 then y := 0; else y :=sum(P[i] for i in 1:k)/k; end if; end average;

Buildings.Controls.Predictors.BaseClasses.partialBaselinePrediction

Partial function for baseline load prediction

Information

Partial function that defines the input and output arguments for the base load predictions.

Inputs

TypeNameDefaultDescription
PowerP[:] Vector of power consumed in each interval of the current time of day [W]
Integerk Number of history terms that have already been stored

Outputs

TypeNameDescription
PoweryBaseline power consumption [W]

Modelica definition

partial function partialBaselinePrediction "Partial function for baseline load prediction" input Modelica.Units.SI.Power P[:] "Vector of power consumed in each interval of the current time of day"; input Integer k "Number of history terms that have already been stored"; output Modelica.Units.SI.Power y "Baseline power consumption"; end partialBaselinePrediction;

Buildings.Controls.Predictors.BaseClasses.sampleStart Buildings.Controls.Predictors.BaseClasses.sampleStart

Start time for sampling

Information

Function that returns the time at which the sampling needs to start.

This function takes as arguments the sampling interval and the current time. It returns the time at which the sampling will start. The start of the sampling will be such that a sample instant coincides with t=0.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
Timet Simulation time [s]
TimesamplePeriod Sample Period [s]

Outputs

TypeNameDescription
TimesampleStartTime at which first sample happens [s]

Modelica definition

function sampleStart "Start time for sampling" extends Modelica.Icons.Function; input Modelica.Units.SI.Time t "Simulation time"; input Modelica.Units.SI.Time samplePeriod "Sample Period"; output Modelica.Units.SI.Time sampleStart "Time at which first sample happens"; algorithm sampleStart :=ceil(t/samplePeriod)*samplePeriod; end sampleStart;

Buildings.Controls.Predictors.BaseClasses.weatherRegression

Linear weather regression model

Information

Function that predicts the current load using a linear regression model. The load is assumed to be linear in the temperature. The argument k determines how many data points will be used for the regression. This is needed as during the start of the simulation, the complete history is not yet built up.

Extends from partialBaselinePrediction (Partial function for baseline load prediction).

Inputs

TypeNameDefaultDescription
PowerP[:] Vector of power consumed in each interval of the current time of day [W]
Integerk Number of history terms that have already been stored
TemperatureTCur Current temperature [K]
TemperatureT[:] Vector of temperatures of each interval of the current time of day [K]

Outputs

TypeNameDescription
PoweryBaseline power consumption [W]

Modelica definition

function weatherRegression "Linear weather regression model" extends partialBaselinePrediction; input Modelica.Units.SI.Temperature TCur "Current temperature"; input Modelica.Units.SI.Temperature T[:] "Vector of temperatures of each interval of the current time of day"; protected Modelica.Units.SI.Temperature TAve "Average temperature"; Modelica.Units.SI.Power PAve "Average power"; Real den(unit="K2") "Denominator"; Real a "Intercept"; Real b "Slope"; algorithm if k == 0 then y := 0; else TAve :=sum(T[i] for i in 1:k)/k; PAve :=sum(P[i] for i in 1:k)/k; den := sum((T[i]-TAve)^2 for i in 1:k); if den > Modelica.Constants.eps then b := sum((T[i]-TAve)*(P[i]-PAve) for i in 1:k)/den; else b := 0; end if; a := PAve - b * TAve; y := a + b*TCur; end if; end weatherRegression;