A Heuristic Algorithm to Compute Multimodal Criterial Function Weights for Demand Management in Residential Areas

: We present the conceptual design of a collective control scheme for appliances within a smart home. Based on the relevant energy acquisition procedures, three appliance groups are deﬁned, modeled, and completed with an energy storage as well as a generator using renewable sources. At the following stage, a mixed quadratic optimization problem is presented, with the solution consisting in a time plan to regulate the operation of the individual devices. Importantly, the paper also proposes a heuristic algorithm securing consistent functionality of the computational process even despite the varying input and user conditions given in the receding horizon.


Introduction
Electricity consumption currently plays a central role in all fields of human activity.In the last 100 years, the world population has increased to such an extent that, at present, ample food or potable water to sustain the existing human community cannot be produced without electricity.In this context, however, it is also important to note that although the generation of electrical energy from fossil fuels has revolutionized the basic social processes, the resulting benefits are not without a major consequence: the irreversible changes of Earth's environment could be largely regarded as following from the intensive use of the said fuels.The dwindling volumes and growing prices of these resources correspondingly increase the cost of energy, and the search for alternative energies has become ever more urgent.The gradual growth of energy costs is accompanied by increasing willingness on the part of users to change their behavior with the aim to cut the electricity expenditures or, in the very least, to maintain them at an acceptable level.Consumers are thus more inclined to purchase advanced energy saving devices and to install local generators of energy or technologies that facilitate its preservation and use at a later time.
This article discusses a universal method for optimal electricity consumption planning in residential areas and presents a software implementation to validate the related procedures.Based on end user demands, the technique coordinates the operation of electrical appliances, local generators, and accumulators within an intelligent home; it also considers changes in the input parameters such as ambient temperature, wind speed, and the level of sunlight.Moreover, the method also considers hourly basis electricity price fluctuation.The main benefit of the paper rests in a heuristic algorithm securing consistent functionality of the computational process even despite the varying input and user conditions given in the receding horizon.
Before the actual designing of optimal control, home appliances have to be categorized according to their typical usage and the offered possibilities with respect to a working cycle deferral or electricity consumption cutback.If the mathematical descriptions of appliances within the proposed classes are merged into a bundle, we obtain a model of the entire system, which represents a complex optimization problem.
A set of appliances can be managed via various optimality criteria.Two of these are intuitively definable as the most significant ones: the price paid for the consumed energy, and the preservation of a certain user comfort level.Specialized papers nevertheless present a number of other criteria, such as the minimization of carbon dioxide consumption in cases where the distributor provides updated information on the share of individual electrical energy sources in the actual production of electricity.Another criterion can then be, for example, accurate monitoring of the bidding curves given by the distributor.By combining the separate demands, it is possible to ensure the desired behavior of the entire system; however, as the said requirements can be partly or wholly contradictory, the tuning of their mutual priorities is not trivial, and the quid pro quo principle applies.
The following portion of this paper is organized as follows: The extended introduction is outlined in Section 2; the mathematical model, together with a discussion of relevant sources on each appliance category, is provided in Section 3; the optimization problem and criteria functions are specified in Section 4; Section 5 presents the case study, namely, the definition and computational results; the conclusions and discussion are provided in Section 6.

Demand Response
Electrical grids are currently facing a large number of problems and challenges, of which the most significant include aging infrastructure, insufficient capacity, and multiple system limitations.Owing to these issues, national governments across continents have reacted by supporting the various initiatives and efforts to introduce smart grid networks at a larger scale.This grid concept comprises a multitude of different technologies, solutions, and end user products, which are all required to comply with diverse technical and official regulations.
In order to reduce the required peak transmission capacity, it is desirable to ensure that the generated energy is consumed as close as possible to the place and time of its production.Even with the utilization of energy storage systems, there remains the persistent difficulty to achieve such an ambitious goal at a local scale.As the cross-regional power flows do not need to be zero, the task can be managed at regional and national levels.Moreover, the ability to keep the typical peak power flows reasonably low contributes to the resilience of the grid.To achieve the outlined goal, we first need to eliminate numerous technical limitations and secure an effective use of accurate wind flow and sunlight intensity predictions as inputs for sophisticated optimization algorithms.Based on the corresponding outputs, we can then decide on consuming or storing the energy via concrete technical means.Wholesale market electricity prices mostly fluctuate during a day: while high at peak hours, they generally remain low in off-peak periods [1].This variation nevertheless relates to only a small proportion of consumers as the suppliers assigned fixed conditions and prices to most end users.Smart grids, however, would enable these users to enjoy the demand response mode, which further allows the customers to swiftly respond to electricity price changes between various periods of the day; thus, the cost of electricity for a home can be minimized and the required comfort maintained.The basic function and prerequisite of demand response consists in that the end user is able to partly reduce his or her energy consumption in the high price interval and then proportionally increase his offtake as soon as the price drops [2].The resulting lower energy expenditures subsequently constitute the main benefit for the customer, who is nevertheless also burdened with the fact that any use of the demand response mode in conjunction with dynamic price tariffs makes the cost-minimizing consumption planning a complex activity [3].
From the perspective of the network operator, demand response is an instrument to improve the distribution grid stability via suppressing energy demand during shortage times at the expense of demand increase in surplus periods [4].The obtained balance then positively reflects in the distribution grid properties and quality of the supplied energy.Moreover, the ever-intensifying requirements for the transmission of growing energy volumes causes increasing demands on the distribution infrastructure.Rational implementation of demand response methods can reduce such demands.
End customers are generally motivated via tariff programs.These are subdivided into two categories: energy price schedules and user stimuli.A typical price-based program is Day-Ahead Pricing (DAP), namely, a tariff where the market operator releases information on the energy price valid for the next day.The resulting price for the given period is a compromise between the supply and the demand.An example of stimuli-based programs consists in Interruptible/Curtailable Load (ICL), a mode built upon stimulating users, who-if they respond to calls to reduce peak time offtakes-are rewarded for their effort.
As demand response tariffs are usually capable of saving approximately 10% of consumed energy, which is markedly less than users commonly desire, it is vital to maintain the "set and forget" approach in implementing the discussed tariff, meaning that the system behavior is automatically modified based on user preferences upon a variation of the input conditions.In general, we may claim that users are not willing to consciously change their behavioral patterns related to their use of electrical appliances, but, simultaneously, they expect their demand response (DR) compatible devices to "do the right things at the right times" without increasing the risk of disproportionate growth in energy costs.

Building Energy Management
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.

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, E DE , specifies the amount of energy consumed by appliances within individual time intervals of the working cycle.The matrix P DE 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 A be the set of all deferrable appliances; then, for each appliance a from this set, we shall define the vector r 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 r a,t = 1 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 α a represents the earliest start, and the value β a denotes the latest cycle end in the appliance a.The executed cycle length is then given by the value l DE a .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 β a − α a = l DE a .Apparently, if β a − α a l DE a , 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 e DE a,t and with it the maximum appliance power p DE a,t .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 c DE a1,a2 in the matrix C DE .If this value equals 1, then device a 1 must complete its cycle before the cycle of appliance a 2 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 r 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.

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 l I N i 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 e I N i .The maximum continuous appliance run time is given by value s I N i , while the minimum run time after switch-on (or idle time after switch-off) is expressed via value u I N i , possibly d I N i .Let I 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 m i,t = 1 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 I, the beginning of the interval is denoted by α I N i and its end by β I N i .The requirement is formally defined as Equation (8).
The demand for limiting the maximum appliance run time (s I N i ) 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 u I N i ) or the minimum idle time after switch-off (d I N i ).

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 CO 2 .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 f (x, u) is the non-linearity in the form (input • state), and d(t) 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 H describes the set of all TCAs.The physical model is, after discretization, represented by three matrices: the state matrix A, the input matrix B, and the output matrix C. The dimensions of these matrices correspond to the following model properties: |A| = (γ × γ), |B| = (γ, |H| + 1), and |C| = (|H|, γ), where γ is the order of the model and |H| 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, x t = (x 1,t , • • • , x γ,t ) .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; C therefore denotes a rectangular matrix, where c i,i = 1, ∀i ∈ |H| and c i,j = 0, ∀i = j.Equation ( 19) formally determines the output temperature pattern t h,t in time t for individual devices h ∈ H.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 ζ min h or ζ max h 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 u min h,t and u max h,t 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 U min and U max always have to satisfy the condition (21).
A finite output power of a TCA appliance can be described by constant p TC h,t and must be less than the maximum output power P max,h (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: min J(Θ, ∆, P, u min , u max , w Θ , w TH ) = (23)

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, w 1 . . .w T , 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 (v w ≤ v α ), the power is 0. The linear or quadratic relationship Θ(v w,t ) can be applied for medium speeds (v α ≤ v w ≤ v β ).The maximum generated power is reached at high wind speeds (vβ ≤ v w ≤ v γ ).Above the value v γ , the turbine must be stopped due to possible damage.The currently measured (w 0 ) and predicted (w 1 . . .w T ) values are, according to the above Expr.(24), used to calculate the vector P RE W , whose individual elements then specify the predicted volume of energy produced by the wind turbine for the separate time slots on the planning horizon.

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 q t .Due to the technical limitations of a concrete battery, this variable must lie within interval e ST  min , e ST max (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 α ST is denoted as e ST α (Equation ( 26)).By analogy, the desired energy in the battery after disconnection from the system in time slot β ST is expressed with e ST β (Equation ( 27)).Outside the time interval represented by constants α ST , β ST , 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 c t ; similarly, then, the discharged energy volume is denoted by the value of variable d t .Equations ( 28) and ( 29) prevent the maximum energy volume charged during one time slot from exceeding c ST max and, in the same sense, they ensure that the maximum discharged volume will not exceed d ST max .
0 ≤ e ST min ≤ q t ≤ e ST max ∀t (25) 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 η c for charging, or η d for discharging (η c ∈ (0, 1), η d ∈ (0, 1)).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 κ (κ → 0).We have The amortization to be considered for every 1 kWh of energy taken off the battery is denoted as θ ST unit and can be traced in the criteria function, which is further described in Section 4.

Energy Balance
The rules for modeling separate classes of home appliances have hitherto been defined separately; all these appliances nevertheless operate jointly within a single system, and they also consume shared electrical energy.In the mathematical model, this property is determined by the energy balance Equation (32).The left-hand side of the equation describes the total power taken off by a household, namely, the sum of the inputs of appliances included in the relevant categories (DE, IN, TH) and the input charged into the accumulator c t for the given time slot t; the right-hand side then specifies the supplied power.Here, the sum is that of the power taken off the accumulator, d t ; the power acquired via the generator from renewable resources, p RE t ; and the power taken off the grid, p

Optimization Problem
For EMSs, this paper defines a mixed integer quadratic problem (MIQP) consisting of the following elements: the rules and bounds for individual appliances defined within previous chapters; global technical and other restrictions (such as energy balance); and criteria function, whose shape corresponds to the selected strategy.For this article, we chose several requirements specified in [30]; these requirements and the resulting control strategy are described below.

Price Minimization
The basic end user requirement addressed at the demand response system is to reduce the relevant cost.The expression Ψ Θ in function (39) indicates the total cost of energy consumed by all appliance categories for the entire prediction horizon.This price is obtained as the product of the unit price in time slot Θ t and the energy taken off the grid in individual time slots (96 intervals, each 15 min long).For each time slot, the extracted energy is calculated as the sum of the following components: the energy consumed by deferrable (DE, Equation ( 35)), interruptible (IN, Equation ( 36)), and thermostatically controlled (TH, Equation ( 37)) appliances; the energy charged into the accumulator; the negatively assumed value of energy discharged from the accumulator (Equation ( 38)); and the values of energy produced by the wind turbine p RE t .

Observation of Preferred Times to Run DE Appliances
The minimization of Equation ( 40) leads to such system behavior in which the working cycle of deferrable appliances is executed as early as possible within the user-selected interval.
In Real-time pricing (RTP) tariffs, where it is necessary to rely significantly on the prediction of future energy prices (as described by, for example, [49]), the combination of the requirements for observing the preferred times and minimizing the price eventually reduces the risk of wrong price estimation.The prediction reliability is generally highest at the beginning of the predicted interval and gradually decreases into the future.In simple words, shifting the appliance cycle far into the future is not beneficial, because the corresponding price is predicted with only low probability.While this paper does not consider RTP tariffs, minimizing the criteria function below does not provide any value added for this study; however, we present the relevant formula to demonstrate the ability of the optimization algorithm.We have

Maximization of Thermal Comfort
The minimization of Equation ( 41) ensures the observance of optimal temperature patterns in individual rooms (maximizes the thermal comfort) because it penalizes higher values of slack variables u min and u max , which constitute the difference between the real temperature and the minimum/maximum temperature desired by the user under simultaneous adherence to the restricting conditions for a concrete device.The optimum solution of this equation leads to maintaining the temperature at the mean value between the minimum and maximum limits within the entire planning horizon:

Minimizing the Frequency of Control Actions
In cases when a control action in thermostatically controlled appliances is changed via an electromechanical element (such as a servo drive), it appears suitable that the controller minimize the frequency of desired control actions.To satisfy such a condition, we can either add rules which will ensure the equality of control actions always in several neighboring action slots or adjust the criteria function.For simplicity, this paper utilizes the method of modifying the said function by adding Equation (42), which is to guarantee the minimization of the difference between control actions always in two neighboring time slots.We define (42)

Multicriteria Optimization and the Heuristic Algorithm
During multicriteria optimization, the setting of preferences (weights of individual members) constitutes a key problem, especially because each of the variables Ψ Θ , Ψ DE , Ψ T H , and Ψ T H,P may assume different values, and these may differ by up to several orders.At the same time, however, the magnitudes of the variables change substantially in individual control cycles with receding horizon.
If, in optimization, the setting of the weights of particular members is to be meaningful, we have to ensure that individual variables assume only values within certain limits.Thus, it is necessary to establish the presumed lowest and highest values of each of the variables and perform normalization, which will not only approximately unify (within an order) the values of the variables but also compensate for their large variations during the run of the system.
The limits Ψ min and Ψ max of individual variables thus have to be determined before each optimization process, always on the basis of actual input parameters.In this paper, a heuristic algorithm to calculate the said limits is presented.This algorithm has to be invariably triggered with current parameters before the optimization of the model within a new time slot.The algorithm determines the price limits related to the consumed energy (Ψ Θ for individual appliance classes: Ψ Θ,DE , Ψ Θ,I N , Ψ Θ,T H and Ψ Θ,ST ), the range of variables Ψ DE and Ψ T H for determining the comfort of devices DE and TH, and the range of variable Ψ T H,P for restricting the magnitude of the control action of TH appliances.

•
In deferrable appliances, the procedure of determining the lower limit Ψ min Θ,DE involves a simple search of such positioning of the device within the user-preferred interval that will ensure the lowest price of the consumed energy.The upper limit Ψ max Θ,DE is then determined as the average of several random simulated runs of the appliance within the said interval.

•
The discussed procedure in interruptible appliances is trivial only if no additional rules are defined for their run (Equations ( 10)-( 12)).In such a case, the lower limit Ψ min Θ,I N is calculated with positioning the appliance cycles into the time slots that exhibit the lowest price, and the upper limit Ψ max Θ,I N is then established as the average price for several random cycle positions.As regards the situation where further rules are defined for the running of interruptible appliances, a detailed description is available in [30].

•
In thermostatically controlled appliances, the upper limit Ψ max Θ,T H is determined by the algorithm, which simulates a simple two-state regulator on the prediction horizon.The lower limit Ψ min Θ,T H is then established via calculation as a proportional part of the upper limit or based on the results of previous optimizations.

•
The boundaries for the index of comfort violation in deferrable appliances, Ψ min DE or Ψ max DE , can be easily determined from the knowledge of the user-preferred time window to run the appliance.If no explicit definition of the preferred time window is available, we can use its beginning or, possibly, a half of the whole interval.The limits of the other variables, such as the comfort violation levels Ψ T H and Ψ T H,P , are obtained based on empirically defined input parameters.
After establishing the above-presented parameters, individual variables in the criteria function can be normalized according to formulas ( 43)- (46).We have

Weight Setting
Upon user decision, each of the specified criteria, , and Ψ T H,P (• ), is assigned a weight w, which then decides on the relative importance of the given criterion.While cost-conscious users accentuate price minimization, and thus a higher weight has to be allocated to this objective, those preferring thermal comfort naturally behave in a different manner.Optimization therefore enables us to set all the criteria in the required balance, and some of them can also be excluded from the calculation by assigning zero value to the corresponding weights.The resulting criteria function for the energy manager then corresponds to the sum of individual weighted variables, and the whole optimization task is formally defined as Due to the normalization described within the last subsection, we can set the individual weighting coefficients as indicated below: The optimization problem solution can be found using algorithms specialized in searching a solution to combinatorial optimization problems.In this paper, the CPLEX solver [50] is exploited as a tool to effectively compute the overall optimization problem solution.

Case Study
To verify the functionality of the proposed method, we use in this section a concrete mathematical model of a system for all types of appliances.

Building Energy Management Model
Within this section, we define five groups of appliances, corresponding to the classification introduced previously in Section 3.

Deferrable Appliances
We modeled three deferrable appliances: a washing machine (WM), a dishwasher (DW), and a tumble dryer (TD).According to source [51], we determined the average number of cycles per year to obtain the probability of running a specific appliance during a specific simulation day (Table 1).The energy consumption and peak power cycles were yielded through a measurement of real appliances.Relevant examples are shown in Figure 1.The user preferences for a particular appliances' schedule are summarized within Table 2 (the earliest start and latest end of an appliance cycle for a simulation day are uniformly distributed values).

Interruptible Appliances
We modeled two interruptible appliances: a pool pump (PP) and an electric water heater (EWH).Table 3 summarizes all the necessary parameters for these appliances.Both the devices are scheduled for all the simulation days.The restriction for scheduling a specific appliance only during particular time slots was not applied in this case study.

Thermostatically Controlled Appliances
We used a simplified model of a building with 4 equally large rooms [30]; for simplicity, no windows are considered.Moreover, only the thermal conduction principle is used to exchange thermal energy between the rooms.An electrical heating unit (2350 watts of input power) is employed to heat each room.The inner dynamics of the unit are neglected as they are significantly faster than the building thermal dynamics.The system of differential equations corresponds to the equivalent electrical circuit described in [30].Table 4 describes the physical parameters of the particular rooms, while Table 5 characterizes the physical parameters of the walls.The thermal transmittance values h in and h out are selected to be 7.6923, and 25, respectively.The thermal power of each heating unit is 1170 watts, the corresponding hot air volume amounts to 106 m 3 •h −1 , and the temperature equals 43 °C.
Table 5.The physical parameters of the particular walls.For the first stage of the simulation, the initial values for all the room temperatures are set to a half of the interval specified by the user setpoints.The temperature of the walls is set to a half of the temperature difference between neighboring rooms, or a half of the temperature difference between the room and the ambient temperature.
For clarity, the user setpoints are equal for all the rooms and throughout the simulation.The setpoints for a regular weekday are shown in Figure 2 on the left-hand side, whereas the setpoints for the weekend are available on the right-hand side.

Accumulators
In this case study, we model an accumulator used in a Nissan Leaf EV.A detailed description of this accumulator and its technical parameters is provided in reference [52].The first and last time slots to connect or disconnect the accumulator in the EMS are characterized as uniformly distributed random variables X ST c ∼ U (20, 32) and X ST d ∼ U (60, 76), respectively, for each day.The amount of kilometers driven by the EV before its connection to the system is computed as X ST range ∼ N (40, 100) for each day.

Wind Turbine
The wind energy generation problem comprises two parts.The probabilistic model adopted from paper [53] was constructed based on historical wind speed measurements at Brno Airport (LKTB) between the years of 2004 and 2014.All the values are handled as follows: The fractional parts are cut and the values branched into categories; for each hour of the day, there are categories according to the wind speed, namely, (0 m Each of these describes the number of the occurrences of a particular wind speed at a particular hour of the day.For each hour k, the first order Markov Chain with transition matrix P k is created.The elements (i, j) of this matrix then characterize the probability that the wind speed i m•s −1 will change to the value j m•s −1 during the hour k.More details of the probabilistic model are defined in study [30].For the simulation, we selected a three blade wind turbine with the diameter of 2.5 m for the nominal wind speed 8 m•s −1 (detailed information is available in [54]).

Other Simulation Parameters
To simulate the system behavior, a winter period (November 2014-January 2015) was considered.The ambient temperature (Figure 3) was adopted from source [55].The model is influenced by not only the ambient temperature but also the wind speed.Based on the parameters described within Section 5.1.5,we calculated the expected power to be generated through the wind turbine.The computed values for the first simulation month are available in Figure 4.

Results
The case study contains two interconnected parts.While the former section verifies the functionality of the complete proposed model, the latter one responds to the question of how it is possible to simulate various user preferences (reduced costs-timely triggering of appliances-maintenance of thermal comfort & technical aspects) by tuning the individual parameters of the optimization function; the above-outlined user settings are then used to describe differences in the system behavior.Thus, the heuristic algorithm functionality is verified to facilitate the estimation of the limits of the criteria function variables.
The study encompasses a period of three months, during which we simulate the use of home appliances according to preassigned parameters over weekdays, weekends, and holidays (this being a time when the users are not present in the monitored homes).Based on the type of day, the actual manner of running the individual appliances progressively changes.
For each simulated day, the data are processed by means of the heuristic algorithm to calculate the normalization coefficients.The mean values of the coefficients are summarized in the corresponding Table 6, and Figure 5 then shows the graphically represented values for the individual components of the total cost (each concrete color field denotes, for separate days, the lowest Ψ min ♦ and highest Ψ max ♦ values for concrete appliance types.Thus, for instance, the first simulated day shows the difference between the minimum and maximum prices for the TCAs Ψ DE Θ amounting to 31 CZK.The diagram in Figure 5 indicates the evolution of the lowest and highest values of the individual cost components during the simulation interval.Here, it becomes obvious that, while the cost of operating thermostatically controlled appliances remains (excepting the holiday) without major differences throughout the entire interval, the cost of operating deferrable appliances is markedly volatile, depending on which appliances are triggered and run during a concrete day.Generally, the price fluctuation would not constitute an essential problem if absolute values for the other normalization coefficients did not differ by up to several orders, as outlined in Table 6.The optimization function specified as Equation ( 48) therefore must comprise the normalized values obtained by substituting the calculated coefficients Ψ min ♦ a Ψ max ♦ into the expressions in Equations ( 43)- (46).After normalization, the individual members of the optimization function can be weighted via multiplication by the constants.This action enables emphasizing or suppressing the significance of the cost reduction (ω Θ ), preferred running interval of deferrable appliances (ω DE ), maintenance of thermal comfort (ω TH ), and reduction of the magnitude and frequency of control action in thermostatically controlled appliances (ω TH,P ).

Verification of the System Model
In this section, we simulate the system behavior with the weights set to ω Θ = 0.33, ω DE = 0.33, ω TH = 0.33, and ω TH,P = 0.01. Figure 6 indicates the cost of running the individual types of appliances during the simulated period.As regards the days on which the values of the diagram start from the negative section of the price axis Θ t , the local generator supplied the system with energy at a corresponding cost, and the total bill is thus reduced by this amount.The diagram shows a marked drop of cost in interruptible appliances and accumulator charging between the 30th and 40th days defined within the input conditions.Although the said days involved also reduction of the desired temperature in the building, this fact did not visually reflect in the cost of energy for thermostatically controlled appliances; such behavior can be attributed to the lower outer temperature during the monitored period, and thus the difference between the outer and inner desired temperatures was approximately the same as in other periods of simulation., roughly oscillate between 0 and 1, while the last one, (Ψ TH,P ), whose weight was markedly lower, reached multiply higher levels.We can also notice that the values are not strictly enclosed in the above interval, and thus, for example, the price criterion values (Ψ Θ ) assume also a negative character.This is given by both the design of the heuristic algorithm and the fact that the calculated values constitute only estimates of the upper and lower limits of the individual values.Such behavior, however, is not a difficulty.The operation of separate appliances within the first four simulation days is shown in Figures 8-10.For all the figures, the deepness of the red in the background corresponds to the energy price fluctuation in time (the deeper the color, the more expensive the energy for the time slot).The first of the figures referred to above, Figure 8, describes the activity of interruptible (patterns WM, DW, TD) and deferrable (patterns PP, EWH) appliances.In the diagram, the gray tinge indicates the user preferences, or the allowed run intervals in separate appliances.Even though the scheduling of these intervals may appear flawed because some appliances are run at times when the cost of energy stands at the highest level, Figure 11 informs us that the power needed for the actual triggering was not taken off the grid but acquired from an accumulator or a local energy source.Figure 9 displays the behavior of temperatures in separate spaces.For simplicity, we chose the same patterns for all four rooms involved, and as these rooms and the relationships between them are modeled identically, we also obtain identical optimal patterns of the desired values.
Figure 10 then shows the optimal behavior of residual energy in the accumulator for each day between its connection (accumulator discharged, start of the green block) and disconnection (accumulator charged, end of the green block).The connection and disconnection times, as well as the residual capacity at connection and the desired capacity at disconnection, are given by the input conditions.The figure below (Figure 11) presents the balance between the energy input and output during the first four days of simulation, and it captures the expected optimal behavior of the system in time.The negative section of the diagram relates to the power supplied to the system, and the concrete power sources are as follows: the black path determines the power taken off the distribution grid (limited to the value of 3850 W indicated via the dashed line; the green path indicates the output provided by the accumulator; and the yellow one defines the predicated output supplied by the local generator.The positive values represent the inputs of the individual appliance classes, namely, the deferrable (violet), interruptible (cyan), and thermostatically controlled (blue) groups.The power loaded in the accumulator is then displayed with the red path.The sum of the outputs in each time slot equals zero.The text above summarizes the results obtained for one concrete setting of the weights of the criteria function members.The presented diagrams were outlined to provide the simplest possible view of the functionality of the model of the entire system; the correct functioning of the model for EMSs was verified via the testing and detailed analysis of both the patterns and the numerical results.

Heuristic Algorithm Validation
As we have already pointed out, multicriteria optimization was used in several studies published previously; however, in all these papers it was necessary to set experimentally the weights of the members in the optimization function.The said drawback is effectively solved via applying the heuristic algorithm; then, based on the obtained result, the optimization function members can be simply weighted.
This chapter describes four optimization cases to which there correspond four members in the optimization function and four different weighting variables.The actual testing was performed such that for each of the weights ω ♦ we progressively set the values 0, 0.01, 0.1, 0.2,. ..,0.8, 0.9, 0.99, 1, and the other weights ω were invariably assigned values according to the formula ω = 1  3 • (1 − ω ♦ ).

Price Preference
Figure 12 displays the patterns of the individual optimization function members.The member Ψ Θ represents the gradually decreasing price in relation to its increasing preference ω Θ .It becomes obvious that as soon as we have ω Θ = 0, the price is not included in the optimization function and thus exhibits a high value (the vertical axis of the diagram has a logarithmic scale).With the progressive price preference growth, the price decreases at the expense of the other three properties of the system.At the moment when the weight ω Θ = 1 is set, the price is optimized regardless of the values of the other members, and the cost specification for this variant is missing in the logarithmic diagram because the calculation here yields a small negative value (the negative value of the member does not constitute a problem: it only refers to the fact that the heuristic normalization algorithm did not calculate the minimum value precisely.In this case, at ω Θ = 1, the system reaches a state when (for example) TCA appliances are not triggered at all, a condition for which the algorithm is not designed).The values of the other three members then increase abruptly.

Preference of the Deferrable Appliances Comfort
The results of this option are presented in Figure 13.The first sight reveals that a change of the weight ω DE does not markedly affect the behavior of the system in the given case; this is caused by a favorable combination of the time behavior of the energy price, the user preferences in deferrable appliances, and the fact that the discussed member is not too closely connected with the other members considered.Thus, during optimization, it is not difficult to set up an optimal value of the member Ψ DE to obtain an optimal solution.In an extreme case, ω DE = 1, the other members of the criteria function are weighted by the value of 0 (the price member Ψ Θ in particular), a large number of the model parts are not applied, and the optimization process generates incorrect results.

Thermal Comfort Preference
The variation of the system behavior based on a weight change in the thermal comfort member ω TH is shown in Figure 14.The model behavior becomes extreme also in cases ω TH = 0 and ω TH = 1.As regards the former case, then again no triggering of thermostatically controlled appliances occurs: the normalized member for price minimization, Ψ Θ , equals 0, in the same manner as the member to minimize the control action for TCA Ψ TH,P (which is a logical condition, given the fact that the said member is defined in the criteria function as a sum of the output differences characterizing the TCA appliances in the adjacent time slots).With the growing weight of ω TH , we can observe a gradual decrease of the member Ψ TH , meaning an improvement in the quality of the thermal comfort within the building.However, excessive suppression of the other weights (ω TH > 0.9) affects the magnitude of the other members: the optimization algorithm is not forced to minimize their sizes, and again the system behaves incorrectly.15.As its magnitude grows, the value of this weight becomes an influence on "softening" the alteration of the control action for TCAs.This characteristic then manifests itself especially via a decrease of thermal comfort, in which-assuming this concrete case-the system is not capable of reacting to fast demand changes.In the case of ω TH,P = 0, the member Ψ TH,P is ignored, and the control action is not modified in any manner.The opposite condition, ω TH,P = 1, again involves the suppression of the weights of the other criteria function members, which then reflects in a rapid increase of their values, and the system ceases to function as required.

Evaluation and Conclusions
The above-presented scenarios indicate how the behavior of the system changes under variation of the constants weighting individual members of the criteria function.Generally, the investigation of the discussed cases and patterns allows us to formulate the following points:

•
As the individual members of the optimization function are normalized using values obtained through applying the heuristic algorithm, it is possible to influence the system behavior comprehensively via multiplying the normalized members by weighting coefficients within the range of between 0 and 1.The sum of all weighting coefficients may equal 1, but this does not constitute a necessary precondition.However, if the weighting coefficients were set directly by the user over the corresponding system interface, the sum of the individual request weights equal to 1 (or 100%) would retain in the user an awareness of the quid pro quo principle.

•
Setting any of the weights to the value of 0 or 1 would lead to its complete omission or one-sided preference; however, the technique of defining the optimization problem is not ready for such a scenario, and the results are unusable.For this reason, the discussed type of setting has to be avoided to preclude unnecessary difficulties.
This work presents a design of a universal method for optimal electricity consumption planning in a smart home.The technique was validated via software implementation.We considered not only home appliances but also local electricity sources, and these entities were classified into five categories (according to their typical use and related properties) as follows: devices with deferrable and uninterruptible cycles; interruptible cycle appliances; thermostatically controlled devices; accumulators and local generators operating on the basis of renewable sources.Each of the categories was subsequently complemented with a relevant mathematical model.By extension, the article also partly considers the problem of non-controllable appliances.The proposed method enables the end user to utilize the demand response principle in optimizing the cost of consumed electricity.In view of the above facts, it is important to note that the concept introduced herein assumes the inclusion of an energy manager, namely, a tool to coordinate the triggering of individual smart home appliances based on a series of input data, including information acquired from the distributor's infrastructure.An energy manager is a comprehensive instrument for maintaining a mathematical model synthetized from models of separate appliances, and this instrument also secures the implementation of the method designed to resolve the complex optimization problem.The basic purpose of the manager consists in ensuring cost reduction at the level of appliance operation comfort adopted by the user.Significantly, the discussed tool is also capable of respecting the technical limitations of the individual devices.Within this paper, we solve a part of the above-defined task, which relates to optimizing the run of appliances in a single home.The solution of the optimization task consists in minimizing the quadratic function formed by a weighted sum of partial functions representing individual demands with respect to linear bounds, namely, the function defined for separate appliances and also user preferences (the problem is therefore one of mixed integer quadratic programming).Considering the fact that the requirements are often contradictory, the optimization task solution falls within the set of multicriteria combinatorial problems.By changing the values of the weighting constants of the individual parts of the criteria function, we can then emphasize or suppress a certain behavioral aspect.
The proposed method, extended with the heuristic algorithm, was validated using a pair of universal software tools: Matlab (MathWorks, Massachusetts, United States) and CPLEX (IBM, New York, United States) Optimization Studio.While the former toolkit enabled us to generate the input parameters and present the results, the latter one ensured the solution of the actual optimization task.Within the research related to this paper, we also created a software simulation tool to model the behavior of a group of deferrable cycle appliances on a receding horizon.This tool was compiled as a contribution to project FP7-ARTEMIS (333020-ACCUS-Adaptive Cooperative Control in Urban Subsystems).Using the described software, we then carried out several case studies facilitating the verification of the desired properties of the system.
The implementation of the above-specified technique into a device coordinating the run of appliances in a smart home system will enable us to materialize the demand response principle; thus, the system will be capable of swiftly reacting to a change in the input conditions by adjusting the electricity consumption rate.Importantly, the case study has shown that the proposed solution satisfies the conditions stipulated within the underlying research presented via this paper.

Table 1 .Figure 1 .
Figure 1.The detailed power cycles for the WMs and DWs.

Figure 2 .
Figure 2. The setpoints for all the 4 rooms related to a weekday and weekend.

Figure 3 .
Figure 3.The ambient temperatures for the simulation period.

Figure 4 .
Figure 4.The power generated by the wind turbine during the first 31 simulation days.

Figure 5 .
Figure 5.The minimal and maximal values of Ψ Θ for all types of appliances.

Figure 6 .
Figure 6.The incremental costs of appliances run during simulation period.

Figure 7
Figure7then presents, for the entire simulated period, the resulting values of the individual parts of the criterion after the end of the optimization.It is obvious from this figure that the values correspond to the input requirements given by the individual weights: the first three values (Ψ Θ , Ψ DE , and Ψ TH ), roughly oscillate between 0 and 1, while the last one, (Ψ TH,P ), whose weight was markedly lower, reached multiply higher levels.We can also notice that the values are not strictly enclosed

Figure 7 .
Figure 7.The values of the individual parts of the criteria function.

Figure 8 .
Figure 8.The DE and IN appliance cycles for the first 96 simulation hours.

Figure 9 .
Figure 9.The temperatures for the first 96 simulation hours.

Figure 10 .
Figure 10.The energy accumulated in the battery for the first 96 simulation hours.

Figure 11 .
Figure 11.The power balance for the first 96 h.

Figure 12 .
Figure 12.The criteria function member values as the function of ω Θ .

Figure 13 .
Figure 13.The criteria function member values as the function of ω DE .

Figure 14 .
Figure 14.The criteria function member values as the function of ω TH .

Figure 15 .
Figure 15.The criteria function member values as the function of ω TH,P .

Table 2 .
The user preferences for the related DE appliances' schedule.

Table 3 .
The parameters of the IN appliances.

Table 4 .
The physical parameters of the particular rooms.

Table 6 .
The normalization coefficients calculated by the heuristic algorithm.

α
DE Vector |A| of user preferences for DE appliance starts β DE Vector |A| of user preferences for DE appliance ends I Set of all IN appliances i Index of a specific IN appliance l I N Vector |I| denoting the requested number of timeslots for IN appliance run s I N Vector |I| denoting the maximum time an IN appliance is allowed to run u I N Vector |I| denoting the minimal time an IN appliance is required to run after switch-on d I N Vector |I| denoting the minimal time an IN appliance is required to stand by after switch-off α I N Vector |I| of user preferences for IN appliance starts β I N Vector |I| of user preferences for IN appliance ends e I N Vector |I| denoting the energy consumed by IN appliances H Set of all TC appliances h Index of a specific TC appliance ζ min Matrix (|H| × T) specifying the minimal temperature accepted by a user for all the rooms and timeslots ζ max Matrix (|H| × T) specifying the maximal temperature accepted by a user for all the rooms and timeslots t amb Vector of ambient temperatures P max,h Maximum output power of TC appliance h A, B, C Matrices of a thermodynamical model p TC max Vector |H| of the TCAs' peak power v w Vector of wind speed prediction over the scheduling horizon p RE Vector of the electrical energy amount generated over the scheduling horizon v α Cut-in speed of the wind turbine v β Rated output speed of the wind turbine v γ Cut-out speed of the wind turbine Θ(• ) Function denoting the power generated for wind speed interval v α − v β P n Maximal power generated by the wind turbine for wind speed interval v β − v γ Vector denoting the maximal power consumed from mains during the prediction horizon r a,t Binary variable denoting whether a DE appliance a starts its cycle in timeslot t s a Integer index of the timeslot during which a DE appliance a starts its cycle m i,t Binary variable denoting whether an IN appliance i performs its cycle in timeslot t n i,t Auxiliary binary variable for an IN appliance i and timeslot t u min Relaxing variable for the minimal acceptable temperature of a room h and timeslot t u max Relaxing variable for the maximal acceptable temperature of a room h and timeslot t x t,i State variable for timeslot t and state i t h,t Room h temperature for timeslot t p h,t TCA h power for timeslot t c t Variable denoting the amount of energy charged to the battery in timeslot t d t Variable denoting the amount of energy discharged from the battery in timeslot t f t Auxiliary binary variable for charging the battery in timeslot t g t Auxiliary binary variable for discharging the battery in timeslot t q tVariable denoting the remaining battery capacity in timeslot t u mains

t
Relaxing variable for ensuring the feasibility of the model in timeslot t