HOUSEHOLD ELECTRICITY USAGE OPTIMIZATION USING MPC AND MIXED INTEGER PROGRAMMING

This paper discusses the control of the electric energy consumption in a household equipped with smart devices. The household consumption pattern is the result of a two-level optimization framework. The scheduling of the electric appliances is determined by the first optimization, receiving Time of Use tariffs proposed by the utility company. The scheduler considers the consumer’s preferences on the powering on for each appliance. Secondly a model predictive controller is developed to control the electric heating system based on energy constraints resulting from the appliance scheduling. Simulations show the energy efficiency and an optimized electricity cost of the strategy proposed.


Introduction
Providing the sufficient electric power to the demand side to allow each household to run the appliances throughout the day may be a challenge for the utility company. Surges in consumption may require of the integration of new power generation sources, which represents an expensive solution especially if they remain unused outside the surge periods. For the power consumption side, the price of the electricity in the day remains unchangeable; therefore, an optimized electricity cost is not required. Smart grid concepts with households equipped by smart meter devices are introduced recently

The electricity consumption model of the household
In the proposed model, the household's appliances are divided into two categories, non-thermal appliances that are either on/off or operate in a batch-like fashion e.g. dishwasher, electric vehicle, etc. and thermal appliances that function continuously based on requested performance and are susceptible to instantaneous variations in power consumption e.g. electric heating system and AC. The electricity consumption model of appliances was constructed to tackle the scheduling problem.
The non-thermal set A can be further divided into two subsets depending on the operational flexibility of the appliance over the time. The  is assumed and it is supposed to be unmanageable by the BMSC.
The household envelope is assumed to be perfectly isolated where any thermal exchanges between the household rooms are neglected. Therefore, the indoor temperature in this case is considered homogeneous. The electric heating system model was based on thermal law and reads ( ) and the overall temperature model is given as where heat Q is the heat produced by the electric heater (J); M is the air flow rate (Kg/min); p c is the specific heat capacity of the materiel (J/KgK); heater T is the temperature of the air coming out from the heater (°C); in T is the household's temperature; m Q is the stored heat in the household; c Q is the conductive heat transfer and k Q is the heat flow by convection between the interior and exterior surface of the household. The scheduling optimization of the appliances and the control of the electric heating system are discussed in Section 3 and Section 4, respectively.

The scheduling of non-thermal appliances
The purpose of the appliance scheduling is to shift the appliances with high energy consumption to off-peak provided that the amount of available electric power is limited at any given time. As the price proposed by the utility company changes along the day, the scheduler needs to find the optimal time for operating each appliance with the aim of minimizing the energy costs. The ToU pricing scheme used in this paper is characterized by three features established based on the cost of producing electricity in the power generation side and the changes of the demand side. Off-peak designates the period with the lowest price, and on-peak designates the highest price period. The ToU pricing, denoted by the vector k Price is considered here to be similar along the days of the week, and it represents an input to the algorithms developed later. The day is divided into time slots starting from 7 AM to the end of the 24 hours, each time slot refers to a time interval of minutes 15 ∆ = t . In total, the day is divided into 96 = slot N time slot.
In this paper, the algorithm schedules the shiftable (manageable) appliances only. Let app N denote the number of appliances in the set shift A . An appliance shift i A A ∈ is characterized by its power vector i P . The vector i P has i nload elements. It is supposed that the operation of the appliance is uninterruptible during i nload time slots. As an example, the appliance 1 A has an operation program of one hour and its power load vector is Every appliance operation has duration i A nload Dur i = , and its starting time can be controlled throughout the day, and each load phase takes t ∆ to run. For instance, appliance i A operation has an execution window of 60 minutes (60 minutes/15 minutes =4 time slots), and along this duration the load phases (4 load phases) are executed one by one.
The smart appliances have fixed energy consumption at each operation, and it is characterized by two states: whether the appliance is ON and the phases of the power load are executed sequentially during the program duration or OFF. It is supposed here that all the shiftable appliances have to be scheduled and to run one time. However if it is desired for a specific appliance to run multiple times in one day or to not be scheduled, it is sufficient to duplicate the energy consumption vector of the appliance in the appliances' set or to replace its vector by zeros. The optimization proposed in this paper is on the consumer side, precisely on the ON and OFF states of the smart appliances (shiftable/manageable). The optimization is based on the ToU electricity tariffs, while respecting every appliance's operation window as time constraints. It is also based on input data provided by the utility company; which is the energy allowed at every time slot k av P , and the total power day P assigned to the household in 24 hours.
Recall that the power limits for the time slots must be consistent with the daily power limit: ( The unmanageable appliances nonshift A consume a small amount of power comparing to the shift A set. For that, an additional fixed power vector nonshift P was allocated for the operation of nonshift A set to be consumed in 24 hours. Therefore, it is necessary to subtract it from the power available per slot k av P .
The scheduler has to determine the switching on time of the appliances, and the resulting energy consumption schedule of the appliance is denoted by indicates that the phase j of the appliance i A is already finished in the time slot k. It means that whether at the time slot k, and the sum of these variables should be at every scheduled time slot

Constraints
When the appliance i A is operated, all load phases of i A should be in ON state.
Therefore, the decision variable The load phases of the same appliance are uninterruptible and executed sequentially. This constraint reads The energy consumed by the appliance i A in each time slot k of should not exceed the power available during the time slot k. Moreover, the total energy consumed by the appliances in 24 hours should not exceed day P . These constraints read: To schedule the appliances, additional constraint are taken into account since the consumer may specify the earliest switching on and the latest switching off times of the shiftable appliance, denoted time ON and time OFF respectively:

The cost function
The optimal electricity cost of the power consumed by the household's appliances in 24 hours is formulated as follow: by optimizing the cost function (12) subject to constraints (3)- (11), an optimal schedule of the household's appliances operation for one day is allocated, and the optimal starting times will be transferred to the smart appliances by the BMSC.

The electric heating system control
For the sake of simplicity, an electric heating system in the household is considered. An air conditioning (i.e. cooling) system tackled following the same ideas. The consumption of the electric heating system discussed in this paper is bounded by a minimal and maximal power consumption bounds as in [17]. This interval determines the amount of power that may be consumed in each time slot by the heating system. The power interval for the smart electric heating system operation is denoted by max 0 P P heater ≤ ≤ , where heater P is the actual consumed power of the actuated electric heating system, max P is the maximum nominal power consumption of the heating system and it is determined by the technical specifications of the electric heating system.
Scheduling the ON and OFF type home appliances leaves a power margin margin P for the operation of the heating system in the household. In this paper, the power margin is limited by k av k margin k appliances P P P ≤ < and contains the future heater P controlled to achieve a certain required performance.
To cope with the thermal dynamics of the household temperature, with dynamical constraints of the input and with dynamic ToU pricing as well, a real-time control is necessary to fulfill the task. Therefore, an MPC was developed and a closed loop control problem is formulated where the temperature of the household is the controlled variable and it is fed back to the MPC with the aim of reaching the comfort level desired by the consumer.
The MPC algorithm is developed to control the power of the electric heating system to maintain its consumption in its power interval and on the consumption appliances P of the non-thermal appliances obtained by the optimal scheduling. The MPC receives the The power consumed by the electric heating system is constrained by day total P P ≤ , where total P designates the total power consumption of all the appliances of the household. And the output constraint reads The optimal control law will be computed at each time slot by minimizing the cost function (13) subject to constraints (3) and (14)- (16) and to the temperature dynamics of the household (1) and (2).

Simulation results
In this section, some simulation results are discussed. All simulations are executed in Matlab/Simulink R2018a. Consider kW 5 . 5 = k av P and slot k av day N P P ⋅ = .

The non-thermal appliance scheduling
To facilitate the communication between the consumer and the optimization algorithm, a GUI was also designed offering two options. The first option is to choose the ability to assign the appliances randomly to optimal time slots. The other option is to schedule with the time constraints imposed by the consumer.
A sample household is considered where the appliances to be scheduled are = shift A = {washing machine, dishwasher, oven, electric car}. The power consumption to charge the electric car is considered as constant during a fixed time operation window. The parameters needed for the optimal scheduler are shown in Table I. and the appliances' program can be modified.
The ToU electricity tariff k Price is considered to be known. The scheduling optimization is solved by the YALMIP toolbox [18] available in Matlab using the GUROBI solver. The scheduling optimization took 0.14 second. Simulations are done in a computer with an Intel Core i5 3 GHz, processor with 8 GB of RAM and Windows 10. Two scenarios is simulated and they are presented in the next subsections.

Simulation scenario 1
The optimal schedule of the appliances is given in Fig. 1, it illustrates the power consumption assigned at each time slot for the set shift A . The power consumption of the smart appliances is distributed on off-peak and mid-peak period because apriority distribution of the appliances' operation was set beforehand to prevent some appliances from operating in inconvenient times. Thus, the total cost of the electricity consumed is optimal without crossing the power available for the day. The simulation results are explored in Fig. 2, which shows the optimal schedule of the appliances that is distributed based on the consumer requested time. There is only a part of one appliance scheduled in on-peak period and it is mainly because of the random time choices made by the consumer. , and kW 2 max = P .

Simulation scenario 1
In Fig. 3 the electric heating system in the first slots uses the available power to reach desired T , then adjust the power consumption to maintain the household temperature in the comfort zone bounded by min T and max T . When the price is high, the heater uses the minimum energy to maintain desired T and then goes off. It also goes off when the energy available is not sufficient for its operation. Consequently, as in Fig. 4 it can be seen that the proposed method balances and economizes the total energy consumption of the household without exceeding k av P and day P of the household, and also allows the consumer to pay an optimal electricity cost while maintaining the requested temperature.

Simulation scenario 2
In this scenario, the power available per slot is set to to evaluate the ability of the MPC in adopting to any energy changes, even to smaller amount of energy. Fig. 5 shows the temperature in the comfort level zone and the total power consumption also is under the limits of k av P , which demonstrates the ability of the MPC to adopt to the imposed energy constraints.

Conclusion
In this paper a two-level optimization framework is suggested based on ToU tariffs to optimize the electricity cost and balance the energy consumed in a smart household. A MILP algorithm was adopted to schedule the smart appliances and an MPC-based approach was developed to control the electric heating system using its power interval feature and the resulting schedule from the first optimization level. The loads are shifted to the off-peak and the temperature of the household reached the consumer's comfort level and is maintained by balancing the energy available throughout the day and optimizing the total electricity cost. The framework proposed is efficient and able to shift the loads with higher consumption and demonstrates the ability of the MPC to adopt to any energy changes. In further research work, new constraints will be introduced. For instance, optimizing the energy stored in the electric vehicle's battery in charge mode and retrieving the energy from the battery when needed. Various ToU tariffs will be considered along the week, holidays, and seasons. The iteration of the two level optimization will also be developed to have efficient power consumption.