scieee AI-readable full text Open interactive document viewer

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

Kaczmarczyk, Václav; Fiedler, Petr; Bradáč, Zdeněk

Abstract

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 defined, 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.

Full text

energies Article A Heuristic Algorithm to Compute Multimodal Criterial Function Weights for Demand Management in Residential Areas Vaclav Kaczmarczyk *, Zdenek Bradac †and Petr Fiedler † CEITEC—Central European Institute of Technology, Brno University of Technology, Purkynova 656/123, 612 00 Brno, Czech; [email protected].cz (Z.B.); petr[email protected].cz (P.F.) *Correspondence: vaclav.kaczmar[email protected].cz; Tel.: +420-541-146-395; Fax: +420-541-146-451 † These authors contributed equally to this work. Received: 22 May 2017; Accepted: 12 July 2017; Published: 20 July 2017 Abstract: 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 defined, 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. Keywords: demand response; building energy manager; quadratic optimization; thermal model; smart appliances 1. 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. Energies 2017,10, 1049; doi:10.3390/en10071049 www.mdpi.com/journal/energies Energies 2017,10, 1049 2 of 28 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 5presents the case study, namely, the definition and computational results; the conclusions and discussion are provided in Section 6. 2. 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 Energies 2017,10, 1049 3 of 28 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. 3. 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 ]to1hin[ 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 Energies 2017,10, 1049 4 of 28 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 – 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, EDE , specifies the amount of energy consumed by appliances within individual time intervals of the working cycle. The matrix PDE 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: eDE a,t=1 60 · 15·t ∑ i=15·(t−1) εi∀t∈(1...n)(1) pDE a,t=15·t max i=15·(t−1)εi, (2) 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 ra,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 T ∑ t=1 ra,t=1. ∀a∈A(3) 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 lDE 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=lDE a . Apparently, if βa−αalDE a , the EMS can plan a cycle in a wide range of times, and thus there is a higher probability of better optimization results. ra,t=0∀t/∈nαa,βa−lDE ao,∀a∈A(4) 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 eDE a,t and with it the maximum appliance power pDE a,t . Being a property shared by all the appliances, reduction of the maximum power is described in Section 3.6. ra,t=1=⇒sa=t∀a∈A,t∈T(5) sa2≥cDE a1,a2·sa1+lDE a1+1∀a1,a2∈A,t∈T(6) Energies 2017,10, 1049 5 of 28 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 cDE a1,a2 in the matrix CDE . If this value equals 1, then device a1 must complete its cycle before the cycle of appliance a2 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. 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 lIN 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 eIN i . The maximum continuous appliance run time is given by value sIN i , while the minimum run time after switch-on (or idle time after switch-off) is expressed via value uIN i, possibly dIN 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 mi,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 αIN i and its end by βIN i . The requirement is formally defined as Equation (8). T ∑ t=1 mi,t=lIN i∀i∈I(7) mi,t=0∀i∈I,t∈ hαIN i,βIN ii(8) The demand for limiting the maximum appliance run time ( sIN 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 Energies 2017,10, 1049 6 of 28 requirements for the minimum appliance run time after switch-on (denoted by uIN i ) or the minimum idle time after switch-off (dIN i). t+sIN i ∑ k=t mi,k≤sIN i+M·(1−ni,t)∀i∈I,t∈ h1, T−sIN i+1i(9) ni,t≤mi,t−mi,t−1∀i∈I,t∈(1, Ti(10) t ∑ k=t−uIN i+1 ni,k≤mi,k∀t∈ hαIN i+uIN i+1, βIN ii(11) t ∑ k=t−dIN i+1 ni,k≤1−mi,k·t−dIN i∀t∈ hαIN i+dIN i+1, βIN ii(12) 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 – 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 CO2 . 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. Energies 2017,10, 1049 7 of 28 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 ˙x=Ax+f(x,u) + d(t)(13) y=Cx, 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 ˙x=Ax+Bu(14) y=Cx. (15) 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. u≤T(16) u≤T+ε(17) 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, xt= (x1,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, ut= (u1,t , · · · , u|H|,t , tamb t)| , 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. Energies 2017,10, 1049 8 of 28 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 ci,i= 1, ∀i∈ |H| and ci,j= 0, ∀i6=j . Equation (19) formally determines the output temperature pattern th,tin time tfor individual devices h∈H. We have xt+1=Axt+But∀t(18) Tt=Cxt.∀t(19) 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 umin h,t and umax 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 Umin and Umax always have to satisfy the condition (21). ζmin h,t−umin h,t≤Th,t≤ζmax h,t+umax h,t∀h,t(20) umin h,t≥0, umax h,t≥0∀h,t(21) 0≤ph,t≤PTC max,h∀h,t(22) A finite output power of a TCA appliance can be described by constant pTC h,t and must be less than the maximum output power Pmax,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,umin,umax,wΘ,wTH) = wΘ·∆· T ∑ t=1 Θt· |H| ∑ h=1 ph,t+wTH · T ∑ t=1 |H| ∑ h=1umin h,t 2+umax h,t 2. (23) 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. Energies 2017,10, 1049 9 of 28 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, w1. . . wT , 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]. pRE W(t) =      Θ(vw,t)vα≤vw,t≤vβ Pnvβ≤vw,t≤vγ 0otherwise ∀t∈ h1 . . . Ti(24) 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 ( vw≤vα ), the power is 0. The linear or quadratic relationship Θ(vw,t) can be applied for medium speeds ( vα≤vw≤vβ ). The maximum generated power is reached at high wind speeds ( vβ≤vw≤vγ ). Above the value vγ , the turbine must be stopped due to possible damage. The currently measured ( w0 ) and predicted ( w1. . . wT ) values are, according to the above Expr. (24), used to calculate the vector PRE 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. 3.5. Accumulators The integration of electromobile batteries into an energy management system is analyzed within references [ 39 – 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 Energies 2017,10, 1049 16 of 28 Figure 2. The setpoints for all the 4 rooms related to a weekday and weekend. 5.1.4. 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 XST c∼ U( 20, 32 ) and XST 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 XST range ∼ N ( 40, 100 ) for each day. 5.1.5. 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 · s −1 , 1 m · s −1 ], (1 m · s −1 , 2 m · s −1 ], ..., ( n− 1 m · s −1 , n m · s −1 ]. 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 Pk 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]). 5.1.6. 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. Figure 3. The ambient temperatures for the simulation period. Energies 2017,10, 1049 17 of 28 Figure 4. The power generated by the wind turbine during the first 31 simulation days. 5.2. 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 5then 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. Table 6. The normalization coefficients calculated by the heuristic algorithm. Appliances Type Symbol Minimal Ψmin ♦Maximal Ψmax ♦ DE Price ΨΘ,DE 0 11.41 DE Comfort ΨDE 0 732.5 TCA Price ΨΘ,TH 19.61 69.15 TCA Comfort ΨTH 0 16 TCA Control action ΨTH,P2.788 ×10−32.788 ×10−2 IN Price ΨΘ,IN 3.58 30.32 ST Price ΨΘ,ST 0 31.58 The diagram in Figure 5indicates 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). Energies 2017,10, 1049 18 of 28 Figure 5. The minimal and maximal values of ΨΘfor all types of appliances. 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). 5.3. 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 6indicates 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. Figure 6. The incremental costs of appliances run during simulation period. Figure 7then 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 Energies 2017,10, 1049 19 of 28 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. Figure 7. The values of the individual parts of the criteria function. 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 8. The DE and IN appliance cycles for the first 96 simulation hours. Figure 9displays 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. Energies 2017,10, 1049 20 of 28 Figure 9. The temperatures for the first 96 simulation hours. Figure 10. The energy accumulated in the battery for the first 96 simulation hours. 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. Figure 11. The power balance for the first 96 h. 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 Energies 2017,10, 1049 21 of 28 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. 5.4. 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−ω♦). 5.4.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. Figure 12. The criteria function member values as the function of ωΘ. 5.4.2. 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. Energies 2017,10, 1049 22 of 28 Figure 13. The criteria function member values as the function of ωDE. 5.4.3. 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. Figure 14. The criteria function member values as the function of ωTH. 5.4.4. Preference of Reducing the Control Action of TCA The pattern of the values of the individual members of the optimization function at various weight levels, ωTH,P , is presented in Figure 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. Energies 2017,10, 1049 23 of 28 Figure 15. The criteria function member values as the function of ωTH,P. 6. 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 Energies 2017,10, 1049 24 of 28 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. Acknowledgments: This work was realised in CEITEC - Central European Institute of Technology with research infrastructure supported by the project CZ.1.05/1.1.00/02.0068 financed from European Regional Development Fund. Author Contributions: Vaclav Kaczmarczyk designed the mathematical model, performed the experiments, and wrote a significant portion of the paper. Zdenek Bradac played an important role in designing the optimization problem and participated in writing the paper. Petr Fiedler provided his theoretical knowledge of optimization in the energy domain. Conflicts of Interest: The authors declare no conflict of interest. Abbreviations Symbol Description TNumber of coarse timeslots tCoarse timeslot index ∆Length of a coarse timeslot (hours) T0Number of fine timeslots t0Fine timeslot index ∆0Length of a fine timeslot (hours) ΘVector describing hourly electricity prices over a prediction horizon PMAINS MAX Maximum peak power consumed from mains ASet of all DE appliances aIndex of a specific DE appliance τNumber of timeslots corresponding to the longest DE appliance cycle PDE Matrix (|A| × τ)specifying the peak power of DE appliances during their cycles; vector pDE adefines the peak power of appliance aduring the planning horizon; element pDE a,tdenotes the peak power of appliance aduring timeslot t EDE Matrix (|A| × τ)specifying the energy consumed by DE appliances during their cycles; the meaning of vector eDE aand the element eDE a,tis identical with the description above CDE Matrix (|A| × α)of time consequences for DE appliances lDE Vector |A|specifying the integer multiple of timeslots corresponding to the DE appliance cycle length Energies 2017,10, 1049 25 of 28 αDE Vector |A|of user preferences for DE appliance starts βDE Vector |A|of user preferences for DE appliance ends ISet of all IN appliances iIndex of a specific IN appliance lIN Vector |I|denoting the requested number of timeslots for IN appliance run sIN Vector |I|denoting the maximum time an IN appliance is allowed to run uIN Vector |I|denoting the minimal time an IN appliance is required to run after switch-on dIN Vector |I|denoting the minimal time an IN appliance is required to stand by after switch-off αIN Vector |I|of user preferences for IN appliance starts βIN Vector |I|of user preferences for IN appliance ends eIN Vector |I|denoting the energy consumed by IN appliances HSet of all TC appliances hIndex 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 tamb Vector of ambient temperatures Pmax,hMaximum output power of TC appliance h A,B,CMatrices of a thermodynamical model pTC max Vector |H|of the TCAs’ peak power vwVector of wind speed prediction over the scheduling horizon pRE 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β PnMaximal power generated by the wind turbine for wind speed interval vβ−vγ eST min Minimal amount of energy remaining in the battery eST max Maximal amount of energy remaining in the battery eST α,qST αRemaining amount of energy when connected to the EMS system eST β,qST βRequested amount of energy when disconnected from the EMS system αST Timeslot before which the battery is connected to the EMS system βST Timeslot after which the battery is disconnected from the EMS system cST max Largest amount of energy charged within one timeslot dST max Largest amount of energy discharged within one timeslot κSelf-discharge coefficient ηcCharging efficiency ηdDischarging efficiency pMAINS tVector denoting the maximal power consumed from mains during the prediction horizon ra,tBinary variable denoting whether a DE appliance astarts its cycle in timeslot t saInteger index of the timeslot during which a DE appliance astarts its cycle mi,tBinary variable denoting whether an IN appliance iperforms its cycle in timeslot t ni,tAuxiliary binary variable for an IN appliance iand timeslot t umin h,tRelaxing variable for the minimal acceptable temperature of a room hand timeslot t umax h,tRelaxing variable for the maximal acceptable temperature of a room hand timeslot t xt,iState variable for timeslot tand state i th,tRoom htemperature for timeslot t ph,tTCA hpower for timeslot t ctVariable denoting the amount of energy charged to the battery in timeslot t dtVariable denoting the amount of energy discharged from the battery in timeslot t ftAuxiliary binary variable for charging the battery in timeslot t gtAuxiliary binary variable for discharging the battery in timeslot t qtVariable denoting the remaining battery capacity in timeslot t umains tRelaxing variable for ensuring the feasibility of the model in timeslot t