Buildings.Controls.DemandResponse

Package with models for demand response controllers

Information

This package contains components models for demand response controllers.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Controls.DemandResponse.Client Client Demand response client
Buildings.Controls.DemandResponse.Examples Examples Collection of models that illustrate model use and test models
Buildings.Controls.DemandResponse.BaseClasses BaseClasses Package with base classes

Buildings.Controls.DemandResponse.Client Buildings.Controls.DemandResponse.Client

Demand response client

Buildings.Controls.DemandResponse.Client

Information

Model for a data-driven demand response client that predicts the future load and allows to apply a load shedding factor.

This model takes as a parameter the number of samples in a day, which is generally 24 for one hour sampling or 96 for 15 minute sampling. Input to the model are the consumed energy up to the current time instant, the current temperature, the type of the day, which may be a working day, non-working day or holiday as defined in Buildings.Controls.Types.Day, a boolean signal that indicates whether it is an event day, and a signal that if true, causes the load to be shed. The input signal yShed determines how much of the load will be shed if shed=true. If shed=false, then this signal is ignored.

Output of the model is the prediction of the power that will be consumed in the current sampling interval, i.e., generally in the next 1 hour or the next 15 minutes. If the parameter nPre > 1, then the prediction is done for multiple time intervals. All of these predictions can be obtained from the output PPreNoShe. This output does not take into account yShed. The output PPre is PPre = yShed * PPreNoShe[1] if shed=true, otherwise it is PPre = PPreNoShe[1].

The baseline prediction is computed in Buildings.Controls.Predictors.ElectricalLoad.

Extends from Modelica.Blocks.Icons.DiscreteBlock (Graphical layout of discrete block component icon).

Parameters

TypeNameDefaultDescription
IntegernSam Number of samples in a day. For 1 hour sampling, set to 24
IntegernPre1Number of intervals for which future load need to be predicted (set to one to only predict current time, or to nSam to predict one day)
IntegernHis10Number of history terms to be stored for baseline computation
PredictionModelpredictionModelBuildings.Controls.Predictor...Load prediction model

Connectors

TypeNameDescription
input DayTypeInputtypeOfDay[integer((nPre - 1)/nSam) + 2]Type of day for the current and the future days for which a prediction is to be made. Typically, this has dimension 2 for predictions up to and including 24 hours, and 2+n for any additional day
input BooleanInputisEventDayIf true, this day remains an event day until midnight
input RealInputEConConsumed electrical power [J]
input BooleanInputshedSignal, true if load needs to be shed at the current time
input RealInputyShedAmount of load to shed. Set to 0.5 to shed 50% of load [1]
input RealInputTOutOutside air temperature [K]
input RealInputTOutFut[nPre - 1]Future outside air temperatures [K]
output RealOutputPPrePredicted power consumption for the current time interval, taking into account yShed [W]
output RealOutputPPreNoShe[nPre]Predicted power consumption for the current and future time intervals, not taking into account yShed [W]

Modelica definition

model Client "Demand response client" extends Modelica.Blocks.Icons.DiscreteBlock; final parameter Modelica.Units.SI.Time tPeriod=24*3600 "Period, generally one day"; parameter Integer nSam "Number of samples in a day. For 1 hour sampling, set to 24"; parameter Integer nPre(min=1) = 1 "Number of intervals for which future load need to be predicted (set to one to only predict current time, or to nSam to predict one day)"; parameter Integer nHis(min=1) = 10 "Number of history terms to be stored for baseline computation"; parameter Buildings.Controls.Predictors.Types.PredictionModel predictionModel= Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression "Load prediction model"; Buildings.Controls.Interfaces.DayTypeInput typeOfDay[integer((nPre-1)/nSam)+2] "Type of day for the current and the future days for which a prediction is to be made. Typically, this has dimension 2 for predictions up to and including 24 hours, and 2+n for any additional day"; Modelica.Blocks.Interfaces.BooleanInput isEventDay "If true, this day remains an event day until midnight"; Modelica.Blocks.Interfaces.RealInput ECon(unit="J") "Consumed electrical power"; Modelica.Blocks.Interfaces.BooleanInput shed "Signal, true if load needs to be shed at the current time"; Modelica.Blocks.Interfaces.RealInput yShed(min=-1, max=1, unit="1") "Amount of load to shed. Set to 0.5 to shed 50% of load"; Modelica.Blocks.Interfaces.RealInput TOut(unit="K", displayUnit="degC") if (predictionModel == Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression) "Outside air temperature"; Modelica.Blocks.Interfaces.RealInput TOutFut[nPre-1](each unit="K") if (predictionModel == Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression) "Future outside air temperatures"; Modelica.Blocks.Interfaces.RealOutput PPre(unit="W") "Predicted power consumption for the current time interval, taking into account yShed"; Modelica.Blocks.Interfaces.RealOutput PPreNoShe[nPre](each unit="W") "Predicted power consumption for the current and future time intervals, not taking into account yShed"; protected OBC.CDL.Reals.Multiply she "Outputs load taking shed signal into account"; OBC.CDL.Routing.RealExtractor extIndRea; OBC.CDL.Integers.Sources.Constant conInt(k=1) "Outputs 1 to extract the first signal of the demand prediction array"; BaseClasses.BaselinePrediction comBasLin( final nSam=nSam, final nHis=nHis, final nPre=nPre, final predictionModel=predictionModel) "Baseline prediction"; Modelica.Blocks.Logical.Switch switch "Switch to select normal or shedded load"; equation connect(comBasLin.ECon, ECon); connect(isEventDay, comBasLin.isEventDay); connect(comBasLin.TOut, TOut); connect(typeOfDay, comBasLin.typeOfDay); connect(comBasLin.TOutFut, TOutFut); // Only PPre[1] will take into account the shedded load. connect(switch.y, PPre); connect(comBasLin.PPre, PPreNoShe); connect(switch.u1, she.y); connect(yShed, she.u2); connect(shed, switch.u2); connect(comBasLin.PPre, extIndRea.u); connect(conInt.y, extIndRea.index); connect(switch.u3, extIndRea.y); connect(extIndRea.y, she.u1); end Client;