The applicability of the demand response approach within a smart home directly depends on the presence of a central device, a building energy manager system (EMS), which uses the communication network to control the various appliances, heating or cooling systems, solar panels, and related components. In addition to the data from the connected appliances, the manager acquires also information from other sources: for example, it utilizes a smart meter to receive data on the current energy consumption rate. The information on the energy price, its prediction, and possibly also the properties of a tariff for the concrete user are communicated to the BEM by either the smart meter or another channel. The weather forecast details, a very important item within the discussed data portfolio, are acquired from a suitable internet service; the current outer temperature, sunlight intensity, and wind velocity can be supplied from the EMS’s own measurement or conveyed by some of the appliances. Based on the acquired information, the EMS then creates and maintains a mathematical model of the entire system.
For modeling purposes, home appliances have to be classified into several categories according to their dynamic behavior over an examined time period, considering the magnitude of the time slot (i.e., the interval during which the appliances’ energy input is regarded as constant; it is the shortest time of a device run between two switch-offs or its idling between two switch-ons). In this paper, the time slot length chosen for calculation is 15 min. Appliances whose working cycles appear markedly shorter than the time slot length (such as electric kettles) or whose run cannot be predicted with at least a minor degree of certainty, for example, multimedia devices, are not analyzed in this article. In currently available papers on the topic, time slot magnitudes exhibit substantial variance, extending from 1 min in paper [
5] to 1 h in [
6]). The present report describes 5 appliance categories: deferrable appliances, interruptible appliances, thermostatically controlled appliances, distributed generators, and accumulators.
3.1. Deferrable Appliances
The concept involves appliances triggered only once or twice a day (if at all); in these devices, the working cycle length oscillates between a few minutes and several hours. The appliances are controlled by the energy manager, which—considering the user preferences—decides when to execute the relevant cycle. The interruption of an already running cycle, although theoretically possible, is not assumed in this paper. Typical representatives of the discussed appliances include a washing machine and a dishwasher.
The basic categorization of appliances, with a focus on deferrable ones, is outlined in references [
3,
5]. Consumption shifting is analyzed by multiple authors, such as those of [
6,
7,
8,
9,
10]. The referenced paper [
1] presents a method for optimizing energy offtake and realizing cost minimization within various tariff models. Further, source [
11] proposes a technique to ensure, within a finite time, the achievement of at least one suboptimal solution. The referenced article [
12] characterizes a model of a group of deferrable appliances, whose optimum running is secured via a Monte-Carlo simulation. Another approach, structured in [
13], describes and solves the optimization problem using MILP, proposing a scheme of interaction between intelligent appliances and the user.
For modeling purposes, the cycle of each deferrable appliance is described by two parameter matrices, whose dimension corresponds to the number of appliances and the number of time intervals during which the working cycles of devices are executed. The first of these matrices,
, specifies the amount of energy consumed by appliances within individual time intervals of the working cycle. The matrix
then describes the maximum value of devices energy input for every time slot of the cycle. Thus, if the length of the time slot is 15 min and measured values of energy taken off the grid (
) are available for the device with the period of 1 min, we can define the following expressions:
where
n denotes the length of the appliance cycle expressed in timeslot multipliers. Let
be the set of all deferrable appliances; then, for each appliance
a from this set, we shall define the vector
of a length corresponding to the length of the planning horizon
T (the planning horizon denotes the number of time slots considered for planning). In each on-coming time slot
t, we have
if the cycle of an appliance
a is to be triggered in the corresponding time slot. In all other cases, the elements of this vector are zero. This condition is embodied in Equation (
3) below, namely
The user, however, mostly requires the device cycle to be executed within a time interval narrower than the full planning horizon. The value
represents the earliest start, and the value
denotes the latest cycle end in the appliance
a. The executed cycle length is then given by the value
. Further, expression (
4) ensures that the appliance cycle will start only in such a time slot where the entire cycle will finish within the user-specified interval. The user may select a fixed interval to run the appliance cycle by setting
. Apparently, if
, the EMS can plan a cycle in a wide range of times, and thus there is a higher probability of better optimization results.
In the course of its run, an appliance
a does not exhibit uniform energy consumption. Thus, in the model, we can define for each time slot
t different consumption
and with it the maximum appliance power
. Being a property shared by all the appliances, reduction of the maximum power is described in
Section 3.6.
In planning a higher number of devices, the user may require that the consecution of the cycles of one or more appliances be taken into account; such consecution is defined by value
in the matrix
. If this value equals 1, then device
must complete its cycle before the cycle of appliance
can be run. To enable the definition of this prerequisite in the linear problem, we first introduce an integral variable
s, which—for each appliance—denotes the sequence of the time slots where the cycle of the given device is activated. Equation (
5) describes the relationship between vector
and the discussed variable
s. If the variable
s is used, we can easily define the time sequence of an appliance, as shown in Equation (6). Please make sure the format consistent throughout the Equation.
3.2. Interruptible Appliances
Generally, this group comprises devices which have to run for a certain period during a day, and it is not important when their cycles will be executed; however, we need to guarantee the required cycle length. The actual run of an appliance can be interrupted at any time, but the concrete device or technology may necessitate and define stricter rules.
Unlike the above-outlined category, interruptible appliances have been discussed in only a relatively limited number of studies. The devices are explicitly mentioned by, for example, research reports [
11,
12]; these papers also define a relevant linear mathematical model, for which optimum operating values are sought. Interestingly, source [
14] characterizes such a model as a Markov decision process, and the author introduces his own algorithm to yield an optimum solution. However, other approaches to the modeling of interruptible appliances are available too: reference [
9] describes a linear mathematical model applicable in the simulation of deferrable and, with certain restraints, interruptible units. A similar concept was proposed also by our research team [
10]; the adopted method nevertheless produces a complex, computationally demanding model.
Such appliances include, for example, the swimming-pool pump, which ensures water circulation through filters, or an electrical boiler (the addition of a boiler into this category is possible only if certain simplifying conditions—its non-linear behavior in particular—are accepted. In any other case, the boiler must be considered a thermostatically controlled appliance, as presented in the following section of this paper). For modeling purposes, we use index IN to denote parameters related to interruptible appliances; value then describes the number of time slots during which an appliance is to be run. Further, it is assumed that, in the course of its run, an interruptible appliance takes off a constant amount of electricity (it operates with an invariable energy input). Thus, the energy withdrawn by a device during one time slot can be described with value . The maximum continuous appliance run time is given by value , while the minimum run time after switch-on (or idle time after switch-off) is expressed via value , possibly .
Let
be the set of all interruptible devices; then, for each appliance
i of this set, we shall define the vector
m of a length corresponding to the length of the planning horizon
T. We have
for each time slot
t if an appliance
i is to run in this time slot. In an opposite case, the vector element contains value 0. This behavior is described in Equation (
7). The user may define the time slot in which a concrete interruptible appliance can be run; outside this interval, the device is not allowed to operate. For each appliance
i from the set
, the beginning of the interval is denoted by
and its end by
. The requirement is formally defined as Equation (8).
The demand for limiting the maximum appliance run time (
) is formally characterized in Equation (
9) (the symbol
M denotes a sufficiently large positive number). The auxiliary variable
n used in this equation is determined within rule (10); rules (11) or (12) utilize this variable to model the requirements for the minimum appliance run time after switch-on (denoted by
) or the minimum idle time after switch-off (
).
3.3. Thermostatically Controlled Appliances
The basic function assigned to the devices discussed within this section is to maintain a required temperature (setpoint) in a certain room. The prerequisite for any effective incorporation of these appliances into a EMS system consists in prior availability of the physical model of the room whose temperature is to be maintained. In this category, the most prominent energy consumers are heating and air conditioning [
15], and thus they constitute the main focus of this paper in the given respect. However, after simplification and modest adjustment, the proposed procedures can be applied in other thermostatically controlled devices too. Typical examples of the discussed type of appliances include, above all, heating, air conditioning, refrigerator, and freezer.
In addition to basic temperature regulation, current HVAC systems consider also the air humidity and, in some cases, carbon dioxide levels in the home [
16]. The systems are being developed for two main purposes: First, the research and development of appliances to achieve more effective use of energy [
17]; second, the investigation of methods to control the discussed systems [
18,
19,
20]. However, the latter of these processes has become more prominent as already deployed and working HVAC systems cannot be changed if merely partial energy savings are desired, and thus the present paper will employ the said perspective to optimize the volume of energy consumed by concrete appliances.
At present, the mathematical modeling of HVAC systems embodies a major step in not only designing such systems for use in new buildings but also optimizing the energy consumption of already installed setups. Within this domain, multiple modeling or simulating applications are usable, including EnergyPlus [
21] or TRNSYS [
22]. The models generated via these applications nevertheless exhibit considerable complexity and difficulty to design a control scheme, mainly because they exploit comprehensive analyses of the physical properties of buildings [
23]. The modeling of a thermal system comprising a HVAC appliance and utilizing physical principles is interestingly outlined in studies [
24,
25], among other papers.
Contrary to the above approach, articles [
23,
26] use parametric regression to identify the parametric model. Source [
27] then presents the inclusion of such a model in a complex mathematical problem, together with a relevant solution based on commercial software, and report [
28] resolves the optimization problem via dynamic programming. Besides the temperature and humidity, the actual user comfort is, as indicated above, markedly influenced by the concentration of
. A model respecting such concentration is optimized in [
16].
The last option offered in corresponding studies combines both of the methods introduced above. The structure of the model and the initial parameters are then based on knowing the physical principles of heat transfer through houses. During the operation of the system, the model becomes progressively refined [
29], exploiting the measurement of the input/output quantities inside the given building.
A concrete instance of the model setup is proposed in study [
30]. The result of modeling the individual parts (thermal capacities) of a building and their interrelations is a system of non-linear differential equations, which can be written in the matrix form as
where
is the non-linearity in the form (
), and
denotes the vector of the time-variable errors affecting the system (the model variant presented in this paper assumes the influence of the outer temperature). As in this case it is presumed that the system condition (the set of inner temperatures) will be set close to a specific temperature (e.g., 21 °C) for most of the time, we can perform the linearization and discretization; the resulting discrete system can then be written as
While the optimal run of deferrable appliances can be planned within a rather coarse time scale (the cost of energy does usually not change oftener than once an hour, and the value of 15 min thus appears to be sufficient [
9,
31]), controlling a thermodynamic system requires more frequent correction of the control actions. In this paper, the period of 1 min is used. However, as it is not possible or beneficial to solve the entire optimization problem at such fine resolution, we introduced two time scales: the coarse scale, which—in addition to the optimal planning of the other appliance groups—is also used as the framework for solving the coarse estimate of thermostatically controlled appliances (TCA) activity, and the fine scale, finding application in tuning a concrete TCA control action based on more specific data.
The optimization problem must be defined as robust from the perspective of model uncertainty and noise, namely, its design must not contain any strict constraints on the output variable, as defined by Equation (
16) [
32]. The said restrictions may, owing to the effect of the stochastic component, lead to the infeasibility of the model. Thus, the bounds need to be relaxed via the addition of slack variables, forming Equation (17); the minimization of the slack variable
then constitutes a part of the criteria function. Furthermore, a suitable selection of value
W will enable us to achieve the required system behavior. In view of the above description, robustness is a property characterizing an optimization problem that does not comprise any strict constraints other than those bounding the control action.
The expression describes the set of all TCAs. The physical model is, after discretization, represented by three matrices: the state matrix , the input matrix , and the output matrix . The dimensions of these matrices correspond to the following model properties: , , and , where is the order of the model and the number of devices. The order of the model is given by the number of thermal capacities (not only the capacities of the heated rooms but also those of the walls and other assumed parts of the building).
The state of the model during calculation is, in each time slot, fully described by the state variables’ vector,
. As regards the model described in this paper, the individual state variables correspond directly to the temperatures of relevant materials of the building. The vector of system inputs,
, then represents the energy outputs of the TCAs; its last element is the outer temperature. Then, formula (
18) is the state equation of the model defining its dynamic behavior in time.
As already mentioned above, in the model proposed herein the particular state variables correspond to temperatures of the particular materials;
therefore denotes a rectangular matrix, where
and
. Equation (19) formally determines the output temperature pattern
in time
t for individual devices
. We have
For each room and appliance
h, the user is able to set the range of values between which the room temperature is to settle. Vectors
or
denote the minimum or maximum user-accepted room
h temperature for all time slots
t. Equation (
20) defines this requirement formally. Without softening, the presented condition could result in the infeasibility of the optimization problem. However, by introducing variables
and
together with their minimization in the criteria function (
23), the condition is softened, and the limits set by the user can be overstepped (yet at the expense of certain penalization in the criteria function). The slack variables matrices
and
always have to satisfy the condition (21).
A finite output power of a TCA appliance can be described by constant
and must be less than the maximum output power
(rule 22). Generally, a TCA is capable of both heating and cooling the given room. The simultaneous mode option (or the heating and cooling), namely, the configuration where it is possible to warm or cool based on the instantaneous difference of temperatures, has not found wide application in real conditions (the switching between the modes is usually performed twice a year only: during the spring and autumn periods) and, for this reason, is not discussed in this paper. The criteria function is as follows:
3.4. Distributed Generators
This class of devices can be divided into two parts. The first subsection then comprises generators whose output power directly depends on the weather; thus, the generators are characterized by markedly limited controllability, and the energy production is predictable only with difficulty. In the second subsection, small micro-combined heat and power units (CHP) are comprised; these devices produce electricity together with heat, which is then utilized as a source to heat or cool the building and to provide for warm water. Typical local generators include wind turbines, photovoltaic elements, solar thermal cells, and micro-combined heat and power units. In this paper, energy generation via wind turbines is considered.
Optimization models for systems with
CHP units are proposed within studies [
33,
34]. Thanks to their favorable cost and operating potential, cogeneration units are currently often employed to satisfy the heat and electricity requirements of multiple homes simultaneously; this option is analyzed in, for instance, study [
31]. Further, sources [
35,
36] utilize wind speed prediction at the planning horizon to optimize energy production and transfer through wind generators; while the former paper assembles a MILP model to be resolved with an available solver, the latter one focuses on particle swarm optimization.
To ensure optimal use of the energy produced by a wind turbine, it is vital to possess a highly precise production estimate at the prediction horizon, and thus also an estimate of the wind flow velocity. The acquisition of such estimates is, due to the inhomogeneity of the atmosphere and constantly changing conditions, a complex and long-term problem analyzed systematically by meteorologists and mathematicians. An estimate of the future velocity of wind can be acquired either from an external source (weather forecast) or via compiling a probabilistic model based on historical data, as described in [
37]. It is also possible to combine these two techniques, and such a procedure will enable us to use the probabilistic model for sufficiently accurate prediction to cover the first 4 h. The relationship between the generated energy volume and the velocity of wind is non-linear and depends on the concrete type of turbine and generator.
Before the actual optimization, the best prediction of the future values of wind flow velocity,
, is determined in each time slot via applying the current data and the relevant historical model. The initial period of no more than first 3 h is defined through the most probable value from the model defined by Markov chains, and the rest of the planning horizon is predicted using publicly available mathematical model data. This technique, in spite of not being designed upon a solid scientific basis, provides very good results in real conditions [
38].
The amount of power generated by a turbine depends on the wind speed. The function describing this dependency is not linear (Equation (
24)). For low wind speeds (
), the power is 0. The linear or quadratic relationship
can be applied for medium speeds (
). The maximum generated power is reached at high wind speeds (
). Above the value
, the turbine must be stopped due to possible damage. The currently measured (
) and predicted (
) values are, according to the above Expr. (
24), used to calculate the vector
, whose individual elements then specify the predicted volume of energy produced by the wind turbine for the separate time slots on the planning horizon.
3.5. Accumulators
The integration of electromobile batteries into an energy management system is analyzed within references [
39,
40,
41]; the benefits of connecting an electromobile are then discussed in detail by the authors of study [
42]. In this context, let us note that energy storage within EMSs can be performed not only via batteries but also using other means, including, for example, fuel cells (as proposed in articles [
43,
44]). By extension, paper [
45] outlines the connection of electric vehicles to the grid (V2G), and article [
46] then examines, within the V2G problem, the planning of simultaneous charging in a large group of electromobiles from the perspective of cost optimization. Interestingly, study [
47] describes the possibility of a large peak demand being generated during early night hours (namely, when large-scale charging of electromobiles is assumed); the paper also formulates a quadratic optimization problem to investigate different issues and economic benefits related to the various levels of the usage of electromobiles across the populace. The relevant paper [
48] considers the stochastic character of the building energy management system; the introductory part of the study formulates the deterministic MILP. Further, a two-stage stochastic demand side management problem is created that addresses the stochastic nature of renewable energy generation, loads, EV availabilities, and EV energy demands.
If the system comprises an accumulator, then energy can be taken off and stored at times of cheaper or easily available electricity and subsequently used whenever energy acquisition is expensive. Generally, it holds true that the higher the accumulator capacity, the wider the possibilites within the demand response system [
39]; however, we also need to consider the relevant physical limitations, energy loss in time, and projected life of the accumulator.
Within the optimization problem, the battery condition is fully described by its remaining capacity in each time slot
t, denoted as
. Due to the technical limitations of a concrete battery, this variable must lie within interval
(Equation (
25)). As follows from the relevant economic prospect [
30], these two values may represent the battery discharge level corresponding to the maximum number of kilometers in a daily car trip and also the optimal charge level (which may amount to only 90% of energy due to the technical limitations of the given technology).
The energy remaining in the battery at the moment of the electromobile being connected to the system in time slot is denoted as (Equation (26)). By analogy, the desired energy in the battery after disconnection from the system in time slot is expressed with (Equation (27)). Outside the time interval represented by constants , , the battery remains disconnected (Equation (30)).
The energy volume charged into the battery in each time slot
t is represented by the value of variable
; similarly, then, the discharged energy volume is denoted by the value of variable
. Equations (28) and (29) prevent the maximum energy volume charged during one time slot from exceeding
and, in the same sense, they ensure that the maximum discharged volume will not exceed
.
The process of energy charging and discharging into/out of a battery, as described in Equation (
31), is burdened with loss. Its efficiency is specified by constants
for charging, or
for discharging (
). Energy storage in a battery is accompanied by self-discharging; the proportional amount of energy drop in the battery during one time slot
is described by the constant
(
). We have
The amortization to be considered for every 1 kWh of energy taken off the battery is denoted as
and can be traced in the criteria function, which is further described in
Section 4.