Automated scheduling of Household Appliances using Predictive Mixed Integer Programming

In this work, an algorithm for the scheduling of household appliances to reduce the energy cost and the peak-power consumption is proposed. The system architecture of a home energy management system (HEMS) is presented to operate the appliances. The dynamics of thermal and non-thermal appliances is represented into state-space model to formulate the scheduling task into a mixed-integer-linear-programming (MILP) optimization problem. Model predictive control (MPC) strategy is used to operate the appliances in real-time. The HEMS schedules the appliances in dynamic manner without any a priori knowledge of the load-consumption pattern. At the same time, HEMS responds to the real-time electricity market and the external environmental conditions (solar radiation, ambient temperature etc). Simulation results exhibit the benefits of proposed HEMS by showing the reduction of upto 47% in electricity cost and upto 48% in peak power consumption.


Nomenclature
(U A) t Thermal conductance of the water tank (U A) f r heat transfer coefficient between floor and room air (U A) ra heat transfer coefficient between room air and ambient (U A) w f heat transfer coefficient between water and floor η efficiency of heat pump η h efficiency of heating element in the water tank A set of appliances P set of thermal appliances Q set of non-thermal appliances Ω j total running time of j th non-thermal appliance to complete the task φ s solar radiation power C t specific heat capacity of the water tank C p, f heat capacity of floor C p,r heat capacity of room air C p,w heat capacity of water p fraction of incident solar radiation on floor P h controlled power consumption by heating element in the water tank Q c energy consumed from the water tank T a ambient temperature T f floor temperature T i inlet water temperature T r room air temperature T t water tank temperature T w water temperature W c work done by the compressor

Introduction
Building energy consumption contributes approximately 20% to 40% to the total energy consumption in developed countries and has exceeded other major sectors like industrial and transportation [1].Smart grid is a major step forward to an energy efficient future of the humankind which allows integration of advanced sensing and communication technologies and various control methodologies in order to achieve optimum energy flow [2].One of the important features of smart grid is the development and incorporation of demand-response strategies [3].
Demand-response [4], [5] refers to "the change in electric usage by end-use customer from their normal consumption patterns in response to change in price of electricity over time, or incentive payments designed to induce lower electricity use at times of high wholesale market prices or when system reliability is jeopardized" [6].In simple words, it is the change in power consumption by the customer to better match the load-demand with the power supply.The customer may adjust the load-demand by postponing some tasks that require larger amount of electric power or may decide to pay higher prices for the electricity in order to complete the tasks.Obviously, it is difficult for the consumer to manually participate in demand-response programs.This explicates the need of an automated system to communicate with smart grid and make optimal decisions on behalf of the customer to achieve the goal of demand-response strategy.
This automated system usually called home energy management system (HEMS) is connected to smart-grid by means of bi-directional communications.Advanced sensors and smart-meters are employed to receive/send data and control signals between smart-home and the power utility [7].Advanced control algorithms are incorporated into HEMS to schedule or operate the appliances in the desired way.The development of appropriate scheduling algorithms has been isolated as one of the crucial challenges for the next generation of real-time systems [8].Extensive research has been dedicated to the problem of electric load scheduling with focus on different objectives such as customer comfort [9], minimization of electricity cost [10], reduction of energy usage [11] and shifting the electric load [12] etc.Moreover, various methods have been used to investigate this problem which include, mixed-integer programming [13][14][15], stochastic programming [16,17], evolutionary algorithms [18,19], heuristic-based algorithms [20? ?,21] and learning-based algorithms [22,23].
Setlhaolo et al. [24] presented a study on optimal scheduling of typical household appliances.The scheduling model has been formulated as a non-linear integer program by considering the electricity cost, participation incentive and scheduling-inconvenience in the objective function.The approach showed a 25 % reduction in the electricity cost for the particular case.Shirazi et.al. [14] proposed a home energy management system for a smart home equipped with distributed energy resources (DERs) and thermal storage facility.The proposed scheduling technique considered the energy cost and the peak-load demand in the multi-objective function and analysed the results under different weather season scenarios.Sou et al. [15] investigated deterministic problem of day ahead scheduling of appliances by modelling the decision problem in more realistic way and show benefit of the proposed approach by looking into two case studies based on different tariffs in Sweden and NYC.However, the cost calculation in the approach is not based on real-time prices but on tariff which is known 24 hours in advance.A few studies on the appliance-scheduling with different pricing schemes such as time-of-use (TOU) pricing [24], inclining block rate (IBR) pricing [11] and their combination have also been reported in the literature.In [25], a new pricing scheme active consumption level pricing scheme (ACLP), based upon the consumption level (CL) of consumers has been proposed.The scheme encourages consumers to keep their energy consumption within a price-invariant-band (PIB).The proposed scheme is able to reduce the electricity cost by up to 53% and peak load by up to 35%.In addition to that, some researchers have focused on the load-scheduling based upon the priorities of the appliance operation [26,27].The authors in [28] design a price-based HEM framework where priorities of operating different appliances are interpreted as the value of loss load (VOLL).The reliability cost which is a function of VOLL is incorporated in the objective function.The results demonstrated 7.5% and 12% reduction in electricity cost with TOU and IBR pricing schemes respectively.
The above mentioned studies do not consider the dynamic characteristic of the appliance scheduling.In other words, the optimization problem is solved once for the whole day rather than updating at each time step, which may not be optimal since the load-demand may not be same for each day.The immediate load-demand can not be met with the above approaches.In these cases, prior information (either expected or real) about the load-demand needs to be available.The MPC (receding horizon control) is the solution to this issue.MPC is an advanced method of control that emerges from application in process industry in late 70s and early 80s [29].MPC represents a class of advanced control methods in which the model of the process is considered explicitly to predict the future evolution of the process to optimize the control input while respecting certain constraints.So, in this case, the optimization problem is solved at each time step with updated values of the load-demand, electricity prices and other relevant information like external weather conditions.A few studies have investigated the use of MPC strategy for appliance-scheduling.The authors in [30] investigated the problem of load-scheduling of thermal and non-thermal appliances using MPC under different price schemes and achieves the total electricity cost saving of up to 20%.But the previous study do not focus on the peak-load reduction by employing constraints on the total maximum power consumption.In [31], the author addressed the similar problem of deferrable appliance-scheduling considering distributed generation (DG) using a multi-time stochastic MPC to consider the uncertainty emerged due to the intermittent DG power.In the best case scenario, the total electricity cost reduction of 53% is achieved in this study.The limitation of the previous study is that some deferrable appliances are operated during a fixed optimal time interval only which is obtained using genetic algorithm.This takes away the flexibility for the customer to intervene for using the appliances at desired time intervals.

Research Contribution
After identifying the gap in the literature, in the present study, an architecture of HEMS is presented for automated scheduling of appliances with an objective of reducing the peak-power consumption and the total electricity cost.It is assumed that the bi-directional communication between the house and the power grid is present, which enables the HEMS to receive/ send data and control signal from the power utility.HEMS is employed in real-time electricity pricing environment and is designed to operate in two modes of operation (MOO) based upon the load category (thermal/ non-thermal).
The optimization problem is formulated and solved at each time step using receding horizon framework.In the Mode 2, only the thermal-appliances are activated.The optimization problem is formulated into a linear-program (LP) with constraints and the objective of reducing the energy cost.At each time step, updated system state and predicted information by the forecaster becomes available which is used by the HEMS.The Mode 1 is switched on when the customer requests to run a non-thermal appliance.In the Mode 1, a predictive MILP is formulated with the same objective.However, additional constraints are introduced to ensure that the task assigned to the non-thermal appliance is finished by the specified deadline.In both the modes, soft constraints on the maximum power consumption of the appliances is also imposed.This way, the total peak power consumption is maintained under the specified peak-consumption capacity.The constraint values are decided by the utility company or the aggregator based upon the demand of electricity and operational cost of the grid.These values are communicated to the smart-meter in homes for a fixed duration in advance and updated at each time step.
The implemented scheduling algorithm does not require a priori knowledge of the load-demand and gives flexibility to the customer to activate the non-thermal appliance at any time.The customer set the deadline at the time of activation by which task assigned to the appliance should be finished.It must be assured by the customer that the specified deadline is not less than the total running time of the appliance.The HEMS should give the warning to the customer in such case.

Load Categorization
Before going into a detailed description and working methodology of the HEMS, the classification of electrical load is detailed in this section.The load is classified based upon the dynamics of the appliances.The classification is important for the HEMS, based upon this classification it makes the choice that in which MOO it should run.So, the overall electrical load is divided into two categories.

Thermal load
This category includes the electrical load consumed by the appliances which are thermal in nature i.e. their system dynamics include temperature as a system-state.e.g.heat pump, room heater, water heater, refrigerator etc.

Non-thermal load
In this category, electrical load consumed by the appliances which are non-thermal in nature is included.These non-thermal appliances are assumed to have following characteristics.
• Preemptive -The appliance can be paused or interrupted whenever needed.
• Fixed duration -The appliance run for a fixed duration (Ω) to finish the task assigned to it.
• Deadline -The appliance has a deadline associated by which it needs to finish the task assigned to the appliance.The deadline is chosen by the user and cannot be smaller than the running duration of the appliance which is an operational constraint [30].Examples include washing machine, clothes dryer, dishwasher etc.

System Architecture
This section provides a detailed description of the HEMS.The system architecture of the HEMS is presented in the Figure 1.The main components of the HEMS are described below.
• The first component of the HEMS is the forecaster.It is deputized to make predictions about the external weather and the heat-gains due to solar irradiance in the house.Data-driven prediction techniques [32], [33] are commonly used to make these predictions based on available historical data about the variable.The second component of the HEMS uses these predictions to optimally schedule the thermal appliances.• The second and the key component of the HEMS is the Predictive MILP controller.This component operates in two MOO, which is determined automatically within the component based upon the electrical load categories (see section 3).In each mode, a different mathematical optimization problem is solved by exploiting the predictions made by the forecaster about the weather conditions.The electricity prices and the consumption-capacity profile is provided to HEMS by the smart-grid operator using smart-meter communication.

State-space model
In order to apply the proposed scheduling algorithm, the dynamics of all the appliances are modelled mathematically into a discrete linear time-invariant state-space representation.The discrete state-space model of a linear system with control inputs (m), outputs (p), state variables (n) and external disturbances (r) is written as following in equation 1 [34]  x ∈ R n is the state vector, u ∈ R m is the control vector, y ∈ R p is called the output vector and d ∈ R r is called the disturbance vector.Similarly, A ∈ R n×n is the state matrix, B ∈ R n×m is the control matrix, C ∈ R p×n is the output matrix and E ∈ R r×n is the disturbance matrix.k denotes the time instant.

Thermal load appliances modelling
For purpose of heating the indoor environment, the house is considered to be equipped with a ground-source heat pump through floor heating pipes [35].For hot water requirements, building is connected to a solar water heater system.The dynamics of both the systems is influenced by the solar irradiance and the ambient temperature.

Heat pump
A reduced order model of a residential building equipped with a ground source heat-pump is developed in [35] and [36] as follows The system of equations ( 2) is discretized with appropriate sample time using zero-order-hold model and written into state-space representation as in equation (1).Subsequently for heat pump state-space model, we get

Solar water tank
The heat dynamics of the solar water tank is described using simple first-order differential equations as follows [37] C

Non-thermal load appliances modelling
In the present work, a washing machine and a dishwasher are considered in the non-thermal load appliances category.Any non-thermal load appliance can be modelled in the same way since they have the same characteristics as described in section 3.
The dynamics of a non-thermal load appliance is modelled in the following way where ζ is the variable defined to keep track of the duration up to which the appliance has run and ψ is a binary integer variable which can have the values from the set {0,1}.It represents that if the appliance is running at time instant k then the value of ψ(k) will be 1 and if the appliance is halted, ψ(k) will be 0.
In both the cases, the value of ψ is added to ζ.Therefore, for non-thermal appliances, equation ( 4) can be represented in form of equation ( 1) which subsequently gives x = y = ζ and u = ψ.It should be noted that whenever ψ take the value of 1, a certain amount of power is consumed by the appliance.

Problem Formulation and Scheduling Algorithm
In this section, the task of the scheduling of appliances is formulated as an MILP.The appropriate constraints associated with the appliances are also described.The objective of the program is to reduce the total electricity cost and peak power consumption at the same time.As mentioned previously, an MPC framework is applied to operate the appliances.At each time step an MILP is formulated with a prediction horizon of N time steps ahead from the current time step.

Energy cost of thermal appliances
The electricity cost occurred by only the energy consumption of thermal appliances is described in equation (5) below where N ∈ {1, 2, . . ., N}, N is the prediction horizon.J P is the energy cost for next N time steps for running the thermal appliances.c k is the real-time electricity price at k th time step.u k,i represents the power consumption by the i th thermal appliance at the time step k.

Comfort zone constraints of thermal appliances
The user would prefer to keep the temperature of the building into a prescribed comfort zone.Similarly, temperature of water in the water tank also should be in a certain temperature range according to users' preferences.These constraints are imposed in the equation (6) as where y max,i and y min,i are upper and lower bound on the temperature of the i th thermal appliance.

Maximum power consumption constraint of thermal appliances
Each thermal appliance is assumed to consume up-to a certain amount of power at each time step and can not exceed that value i.e.
where u min,i and u max,i represent the upper and lower bound on the power consumption of i th thermal appliance.

Energy cost of non-thermal appliances
Same as the thermal appliances, the electricity cost induced by the non-thermal appliances energy consumption can be considered as J Q is the total energy cost for operating the activated non-thermal appliances.P k,j is the power consumed by j th non-thermal appliance at k th time step.ψ k,j is the binary variable associated to the j th non-thermal appliance at k th time step, which indicates that the appliance is ON or OFF if the value of ψ is 1 or 0 respectively.

Deadline constraint of non-thermal appliances
Each non-thermal appliance run for a fixed duration as described in the section 3. It has an associated deadline by which it should finish the assigned task.This deadline is set by the user while activating the appliance and can not be less than the running time of appliance i.e. if user set a smaller deadline then HEMS will give a warning to reset the deadline.This can be assured by imposing the constraint in equation ( 9) where Ω j is total running time of j th appliance for which the appliance has to run in order to finish the task.e j and b j is the deadline (end time) and activation time (beginning time) of the j th appliance.It is assumed, when the appliance is turned on HEMS does not schedule it immediately rather it waits for current time slot to complete or next nearest time step to start.

The non-thermal appliance start-up cost
In order to prevent the non-thermal appliances from being interrupted very often, there is a start-up cost associated with the each appliance which can be represented as equation ( 10) γ j refers to the start-up cost of j th non-thermal appliance.

Operation time constraint of non-thermal appliances
To finish the task assigned, the non-thermal appliances need to run for a fixed duration Ω.This condition can be imposed as the following constraint The constraint in equation (11) ensures that appliance run for the its total running time between the activation time and the deadline of the appliance.

Total capacity constraint
This constraint put a restrain to the maximum total power consumption by all the appliances at each time step.It can be represented as following C k is the total maximum power available for consumption at the time step k.The capacity constraint value is decided by the utility company.In reality, the capacity constraint value can be time varying based upon the demand of electricity and operational cost of the grid.

Soft constraints
Slack variables are introduced to allow the violation of some of the relevant constraints in equation (13).For instance, if the desired temperature is not achieved or total power consumption exceeds the maximum available capacity, optimization routine automatically compromises between the optimal scheduling and minimization of constraint violation.
where v and w are the introduced slack variable to allow violation of constraints.

Scheduling Algorithm
As the HEMS is invoked, first, it checks if any non-thermal appliance is activated from the value of activation flag (1 or 0) associated with each non-thermal appliance.If the value of activation flag is 1 then that particular non-thermal appliance is running otherwise not.Based on the value of the activation flag, the HEMS decides to operate in the following two modes:

Mode 1
The HEMS operates in this mode if any one or more than one non-thermal appliances are activated.In this case, the optimization problem is formulated as an MILP as follows min u,v,w subject to the constraints ( 7), ( 11) and ( 13).
Here α v (v) ≥ 0 and β w (w) ≥ 0 are convex penalty cost functions associated with the slack variables v and w.It should be noted that, the value of β w (w) is time dependent and is specified by the power utility depending upon the power-grid operation and stability.This information is shared with HEMS dynamically on a real-time basis.

Mode 2
In the Mode 2, since only the thermal appliances are running, the optimization problem is formulated just as a linear program (LP) rather than MILP min J P (15) subject to the constraints ( 7), ( 13) and the following capacity constraint The above constraint considers the total power consumption by only the thermal appliances, since no non-thermal appliance is running.For the present study, it is assumed that perfect electricity prices forecast and weather forecast are available as this is not the focus of the paper.

Simulation setup
As mentioned previously, we consider heat pump and solar water heater as thermal appliances for current simulation studies.Table 1 contains the values of the parameters used in modelling of thermal appliances as described in [35] and [37].To put a constraint on the indoor air temperature, (18 • C,22 • C) is specified as the desired comfort range.These constraints can be chosen to be time varying also.The heat pump is considered to consume maximum of 1 kW power at each time step.Similarly, the water temperature in the solar water heater tank is kept bounded between (50 • C,70 • C) and the maximum power consumption of the water heater is considered to be 2 kW.Everyday water withdrawal demand profile is obtained from the DHWcalc toolbox [38], which generates realistic domestic hot water demand depending upon various characteristics like number of households, total mean daily draw off volume etc.
Without any loss of generality, washing machine and dishwasher are considered as the non-thermal household appliances.Table 2 details the parameter values for the washing machine and the dishwasher.Every day, non-thermal appliance requests are activated at random time steps with a random deadline which is greater than the total running time of the appliance.The entire simulation setup is implemented in Matlab.For simulation purpose, ambient temperature T a and solar radiation φ s are obtained from ASHRAE IWEC (International Weather for Energy Calculations) weather data files for Dublin, Ireland [39].The electricity prices are taken from wholesale Danish Energy Market data [40] and employed for real time implementation of the proposed algorithm.A maximum capacity constraint of 4 kW is imposed on the total power consumption of all the appliances.In reality, the capacity constraints can be time varying.The setup is simulated over 7 days period with a prediction horizon of 24 hours (Mode 1).To solve the MILP, Gurobi solver is used in integration with YALMIP toolbox [41] and Matlab.the subjected comfort zone boundaries and the constraint on the power consumption of the heat pump is also satisfied.Similarly, Figure 3 presents the temperature variation of water in the water tank, and the power consumed by the water heater respectively.The initial water temperature is considered to be at 20 • C (see Figure 3a).As the time passes, the temperature gradually increases over next few hours and then it is maintained inside the specified temperature range.This also explains the fact that the power consumed by the water heater is high in beginning of the simulation period in Figure 3b.

Results and Discussion
Figure 4a and Figure 4b shows the power consumed by the washing machine and the dishwasher respectively.It can be seen that the appliances operation is interrupted occasionally in order to minimize the electricity cost and satisfy the capacity constraints.It should be noted that, the HEMS has no knowledge about the arrival request of washing-machine and dishwasher.The arrival requests are generated randomly to investigate the capability of the HEMS to handle immediate request situations.In order to evaluate the effectiveness of the HEMS, a different scenario is considered.In this case, there is no HEMS to schedule the appliances.The thermal appliances are operated using On-Off control strategy.The thermal appliances turn-on when the temperature is below the lower threshold of the specified range.Since, there is no control over the non-thermal appliances, so once turned-on, they run continuously for their respective runtimes.Figure 5a shows the total power consumption of all the appliances in this case.It can be seen that the peak power consumption is around 9 kW which occurs on the fourth day of the week.
Figure 6 presents the operation schedule of the appliances in this case.Clearly, we see that the non-thermal appliances are never interrupted and run continuously once started.In figure 6, on the noon of the fourth day of the week, the water heater, washing machine and dishwasher are operating all together at their respective maximum rated-power which brings the total power consumption to 9 kW.The operation of thermal appliances using on-off control strategy is a basic control technique, so another different scenario is considered.Similar to the previous case, there is no HEMS to schedule the appliances in this case also.But, the thermal appliances are operated using MPC strategy which is an advanced control technique in comparison to on-off control.

Preprints
Figure 5b shows the total power consumption in this case.It is seen that the peak power consumption in this case is reduced to around 7.5 kW which occurs at around 12:30 PM on the fourth day.It is seen in the Figure 7 that all the appliances (thermal and non-thermal appliances) are in operation at this time which implies that only 0.5 kW power is consumed by the thermal appliances.This happen because the MPC has prior knowledge of the external disturbances (MPC) so it operates the appliances to comply with the subjected constraint of maximum peak-power consumption.Clearly, using MPC instead of on-off controller is useful to reduce the peak-power consumption.

With HEMS
In this scenario, there is HEMS employed in the house to schedule the appliances.All the appliances are scheduled using MPC strategy in this case.Figure 5c clearly depicts the benefits of using HEMS and presents the total power consumed by all the household appliances.In Figure 5c, it can be seen that for initial time steps, total power consumption goes beyond the capacity limit of 4 kW, which happens due to the high power consumption of water heater since initial water temperature in the tank is low.At later time steps, it can be seen that the maximum total power consumed by all the appliances stays around the capacity limit.The constraints on the capacity limit are allowed to violate to ensure the feasibility of the optimization problem (soft constraints).
Figure 8 shows the operation schedule of the appliances in this case.It can be seen that, the non-thermal appliances are interrupted occasionally to satisfy the capacity constraints and minimize the electricity cost.For example, at the noon of the fourth day of the week, washing-machine and the dishwasher is not running rather they are shifted to run later in the day.The total electricity cost as per the time varying prices used in this study, is detailed in the Table 3.In comparison to the case without HEMS and On-Off controller for the thermal appliances, a reduction of 47 % is achieved in total electricity cost by using the HEMS.Similarly, in comparison to the case without HEMS and MPC controller for the thermal appliances, the HEMS achieves a reduction of 45 %.
To see the effectiveness of HEMS in reducing the peak-load, the total violation of the capacity constraint over the simulation period and the maximum peak-load consumed by the appliances for all the cases is presented in Table 5.The total violation for the case when appliances are scheduled with HEMS is about 10 times lower than the case of no HEMS with On-Off control and MPC control for thermal appliances.Similarly, by using HEMS, the peak power consumption is reduced by 48 % and 36% in comparison with the case of no HEMS with On-Off control and MPC control for thermal appliances respectively.The PAR for all the cases is detailed in the Table 4.It is observed that by using the HEMS, PAR is reduced by 38 % and 24% in comparison to other two cases.

Conclusions
In this work, the problem of scheduling of appliances to achieve reduction in the peak-load and total electricity cost has been investigated using model predictive control (MPC).An architecture of a home energy management system (HEMS) is presented which operate in two modes of operations (MOOs) based upon the categorization of the appliances (thermal and non-thermal).The system dynamics of the appliances have been modelled into a state-space formulation.
The proposed approach is able to schedule the appliances dynamically as the optimization problem is formulated and solved at each time step.The proposed framework is shown to provide flexibility to the user to turn the non-thermal appliances at any time step while achieving the objectives.The simulation results showed the reductions of up-to 47% in the total electricity cost and up-to 48% in the peak power consumption also.The operation schedule of appliances with and without HEMS has also been compared.The non-thermal appliances were able to interrupt and shift to the low electricity price periods while finishing the task by the deadline.The future work includes the consideration of energy storage facility, renewable energy generation and integration of plug-in electric vehicle (PEVs) into the framework.Also, the framework will be scaled up to a small community or a group of houses to investigate the demand-response from the perspective of power utility or aggregator companies.

Figure 2
Figure2depicts the variation of the indoor air temperature and the power consumed by the heat pump to maintain that temperature.During the entire simulation, the indoor temperature stays within

Figure 5 .
Figure 5. (a) Total power consumption of the appliances without HEMS and on-off control for the thermal appliances, (b) Total power consumption of the appliances without HEMS and MPC control for the thermal appliances (c) Total power consumption of the appliances with HEMS

PreprintsFigure 6 .Figure 7 .Figure 8 .
Figure 6.The operation schedule of the appliances without HEMS and on-off control for the thermal appliances

preprints.org) | NOT PEER-REVIEWED | Posted: 27 February 2019 Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 27 February 2019 doi:10.20944/preprints201902.0256.v1 formulated
In both the modes, at each time step, a control decision policy {u * k } N k=1 is obtained for next N time steps by solving the formulated optimization MILP and only the first control input {u * 1 } is applied to the system and rest of the control inputs {u * and solved again in the similar manner at the next time step as per the receding horizon strategy.
k } N k=2 are discarded.The optimization problem is Preprints (www.

Table 1 .
Thermal appliance parameters

Table 2 .
Non-thermal appliance parameters

Table 3 .
The total electricity cost for the entire simulation duration

Table 4 .
Peak to Average Ratio

Table 5 .
Total violation of capacity contrsaint during the simulation period