A Hybrid Optimization Approach for Residential Energy Management

In the past few years, the development of demand response (DR) programs for smart grid systems has provided residential customers with a real opportunity to participate in DR-driven projects. One typical DR-related application now available is automated energy scheduling for residential building, which can be used to help reduce energy costs. Residential energy scheduling focuses on saving cost by managing the operation time and energy consumption level of different appliances. Demand Response programs present as NP-hard problems, the equations are non-convex mixed integer non-linear problems (MINLP), for which it is difficult to obtain an optimal solution. In relation to residential DR, we propose a hybrid approach here that is able to solve an MINLP. The problem is decomposed into discrete and continuous variables. The discrete variables are optimized by using a particle swarm optimization (PSO) algorithm, whilst the continuous variables are determined by using a gradient-based deterministic algorithm. The superiority of the proposed algorithm was demonstrated by compared with commercial optimization software and heuristic based algorithm. Furthermore, the effectiveness of the proposed method in residential DR was tested and the results were presented.

INDEX TERMS Mixed integer nonlinear programming; Residential energy management; Particle swarm optimization; In recent decades, the worldwide rise in energy demand has led to a profound change in existing energy infrastructures. The smart grid is an intelligent electricity system that integrates advanced communications, sensing technology and control methodologies to transform the traditional grid into something more efficient. To meet the distribution side of consumer's expectations, for instance, there needs to be more detailed research undertaken regarding smart grid components such as demand response. Demand response (DR) programs can play a vital role in the smart grid. If the smart grid can properly facilitate them, DR programs can bring about reductions in peak load, energy consumption, and carbon emission. They can also facilitate greater penetration of intermittently available renewable resources. DR programs can be applied across the residential, commercial and industrial consumer sectors [1,2]. It is much more complicated to design an efficient DR program for residential consumers compared to the other two sectors. That is mainly due to complex appliance loads and random consumption patterns. Since the technical difficulties in residential sectors, it is therefore urgent to develop cost-effective and practical methods to control energy consumption in residential dwellings [3].
Micro combined heat and power (micro-CHP) generation has been considered a promising on-site generation method in residential-side energy management [4][5]. Residential DR can benefit from micro-CHP to simultaneously generate electricity and heat, and thus provide energy services at increased overall efficiency. The utilization of micro-CHP systems in residential, commercial and industrial sectors to improve energy efficiency have been reported in many researches [6][7][8].
In order to enable CHP respond to different kind of optimization strategies, control strategies need to be able to provide effective solutions to optimization problems. Therefore, optimization algorithm is the focus of research. These can be divided into two main categories, linear and non-linear optimizer. Linear optimizers (such as linear programming and mixed integer programming) have the advantage of fast computation speed, and most of them apply Mixed-Integer Linear Programming (MILP) techniques to optimize the CHP power system. Some methods, such as Lagrange relaxation method (LR) [9], Genetic Algorithm [10], Particle Swarm Optimization [11], Branch and Bound (BB) [12] and Sequential Quadratic Programming (SQP) [13], have been applied to scheduling these MILP systems [14]. In order to provide accurate solutions, many works model the actual system as MINLP formulation. A MINLP approach for scheduling CHP units in day-ahead electricity markets is proposed in Ref. [15]. The scheduling of manufacturing system and CHP system under a Time-of-Use (TOU) electricity tariff is implemented, and a near optimal solution with reasonable computational cost is found in [16] by using PSO method. In addition, a stochastic programming framework with uncertainties of CHP units is considered in [17].
Nonetheless, MINLP technology may be difficult to find a solution close to the global optimum [18].
In this paper, we focus on the application of CHP in electricity load management of typical residential building with the various types of appliance. In order to formulate a more accurate appliance model, a MINLP model is built. However, as mentioned above, the structure of MINLP is NP-hard problem, and it is hard to obtain a global solution. Despite the difficulties in solving MINLP problem, a number of different methods have been proposed. In general, a solution is brought about by using either deterministic or stochastic algorithms.
Deterministic algorithms, such as non-linear branch and bound [19], outer approximation [20,21], and generalized bender-decomposition [25], take different approaches to solve MINLP. In [25], by formulating the DR program as an MINLP, they can obtain optimal electricity load dispatch by using the generalized bender-decomposition approach. When deterministic algorithms are used, the whole problem is usually decomposed into discrete and continuous vectors, and a solution being arrived at through mutual iteration. However, deterministic methods alone cannot guarantee global optimization. Without good initial estimates, poor, sub-optimal or even infeasible solutions maybe obtained. On the other hand, stochastic methods, such as PSO [22], genetic algorithms (GA) [23], and differential evolution [24], have shown themselves to be capable of handling the MINLP easily. Stochastic algorithms tend to use random initializations to search for global or near-global values. However, stochastic algorithms are typically slow to converge and cannot guarantee finding a feasible solution within a finite amount of time.
In order to obtain an optimal solution, a hybrid optimization method is proposed in [26][27] to solve a bilevel programming problem. In this paper, a hybrid algorithm is proposed to solve the non-convex MINLP, which combines the advantages of stochastic and deterministic algorithms. As is normal indeterministic methods, the MINLP problem is decomposed into discrete and continuous variables. However, unlike traditional deterministic methods, in order to increase the diversity, we also use a stochastic method to solve the discrete variables. In this paper, PSO is used to determine discrete variables. This increases the chances of finding an optimal solution. At the same time, a gradient-based deterministic algorithm solves the continuous non-linear optimization with fixed discrete variables, as one would expect with a stochastic method. In order to verify the performance of the proposed algorithm, several computational experiments have been carried out.
The major contributions of this paper can be summarized as follows: 1) Unlike previously published study [35][36][37] based on MILP model, a more complex non-convex MINLP model is proposed and applied to a household scenario in this paper. The smart building is equipped with the following types of appliances: interruptible appliances, deferrable appliances, battery-assisted appliances, thermostatically-controlled appliances and fuel cells (FC).
2) Instead of solving the non-convex MINLP by using either a deterministic algorithm or a stochastic approach, we use a hybrid deterministic and stochastic algorithm. This is capable of achieving a near-optimal solution. Its performance is compared with commercial optimization software and heuristic based algorithm.
The article is organized as follows: Section 2 provides a brief description of the mathematical model. A detailed solution methodology is proposed in section 3. Illustrative case studies are presented in section 4. Section 5 provides a summary and conclusion.

II. Models of the DR Problem
In this section, the objective functions and constraints for scheduling based on the previously described models are briefly described.

A.Overview of a demand response program
An overview of a demand response system in form of a residential building is shown in Fig.1 [28].
The proposed residential building consists of main grid, FC, battery, thermostatically-controlled appliance, deferrable appliances, interruptible appliances, thermal load, electrical load, and natural gas. It should be noted that the FC works as CHP system to increase its efficiency. The heat generated by the FC can supply the thermal load. The main grid, FC, or the battery can supply the electrical load. The main role of the DR is to minimize operating costs when meeting the load demand of the individual house. It is assumed that the components of the residential building have already been installed, so installation cost is not considered.

B.Objective Function
This paper introduces an efficient DR to minimize daily electricity cost in a residential building. Mathematical formulation of the proposed residential building is given below.
Residential building economic optimization is achieved by choosing an objective function that represents the operational costs to be minimized. The objective of DR program in a residential building is to determine the best operation schedules of appliances to minimize the electricity cost while satisfying the appliance's physical constraints. The objective function is expressed as follows: C.Appliance constraints 1) ELECTRICAL DEMAND-SUPPLY BALANCE Each electric generation system should be able to supply electric demand. The mentioned sentence is formulated as equation (2):

2) THERMAL DEMAND-SUPPLY BALANCE
The thermal demand-supply balance constraint can be expressed as follow: It can be seen from Eq.(3) that the heat power produced by natural gas and fuel cell should meet the total thermal consumption.

3) BATTERY CONSTRAINTS
The battery can help to minimize the overall operation cost by acting in the charging or discharge mode. Battery is only allowed to work on one state at each moment. The charge or discharge value of power of the battery storage must be in rated range. In order to prolong the life time of the battery storage, the battery storage must not be within range [

4) THERMOSTATICALLY-CONTROLLED APPLIANCE CONSTRAINTS
The thermostatically-controlled appliance adjusted their energy consumption at each sub-interval to meet the requirement of setting temperature. Its performance at each sub-interval depends not only on the current energy consumption at previous sub-intervals. In this paper, the air conditioner is taken as an example. According to Pedrasa [29], the building temperature at each hour is obtained by: Where Δ=1h and   RC . The values used were R=18•C/kW, C=0.525kWh/•C and the initial room temperature was 20•C. Constraints can be imposed to specify the operating range and associated temperature range as:

5) INTERRUPTIBLE APPLIANCE CONSTRAINTS
For the interruptible appliance, we assume that it only operate in either 'on' or 'off' statuses within user's preferred time range [α a ,β b ], It consumes fixed energy at each sub-interval if the appliance is turned on. Therefore, constraints needed by the interruptible appliance can be written as follows:

6) DEFERRABLE APPLIANCES CONSTRAINTS
Different from the interruptible appliance mentioned previously, the deferrable appliance should run until completion once started. Also, let H be the number of time slots that the deferrable appliance need to operate at a defined energy level. Appliances such as a dishwasher usually operate with deferrable tasks. The characteristics of the deferrable appliance were described as Eqs. (14)- (16). Equation (14) indicates that the task should start within a operational windows [ ,

7) FUEL CELL OPERATION CONSTRAINTS
The fuel cell is a major part of home energy management system, which can generate electrical and thermal energy at the same time. The rate of changes in the output power of the fuel cell is limited to upper and lower boundaries [30]. So the fuel cell should meet the following constraints.
The part load ratio (PLR) is the ratio of electrical power generated by the fuel cell to its power rating, which affects the fuel cell efficiency and the ratio of electrical to the thermal. . . ( , , ) 0 ( , , ) 0 ( , ) x y F f x y q s t h x y q g x y q The function of the scheduler is to determine the optimal operations x and y to save operational costs. x= [ , ] defe inte x x are binary variables and y= [ , , , ] ta FC batt gas y y y y are continuous variables. q is a continuous vector of the dependent state variables that are determined by x and y. A global solution could potentially be obtained by using a commercial optimization solution [31]. However, these are currently too expensive to be implemented. For these kinds of problems, local deterministic methods are often employed but these methods cannot guarantee global optimality. Without good initial estimates, infeasible or poor, sub-optimal solutions are often obtained. If one starts from good initial estimates, there is a high probability of finding a high-quality solution. However, it is also the case that stochastic optimization methods can obtain global or near-global solutions using random initializations. Thus, in this paper, a population-based stochastic algorithm is deployed to randomly initialize the fixed discrete variables. All the continuous variables are then optimized using CONOPT (CONOPT is a solver for large-scale nonlinear optimization developed and maintained by ARKI Consulting & Development A/S in Bagsvaerd).

A.Stochastic Optimization
PSO is one of the most prominent meta-heuristic evolutionary stochastic algorithms. It has been proven to be very efficient in solving optimization problem with both discrete and continuous variables. The algorithm is initialized by creating a swarm with random positions. Every particle is shown as a vector ( , , is the personal best position found by the particles. Also, a best position gbest p of the entire population is computed to update the particle velocity. The velocity of the i th particle is updated as follows: Traditional PSO is used to solve real value optimization. In order to solve binary variable, a binary version of PSO (BPSO) was proposed by [32]. In binary PSO, the particle position has two possible values, '0' or '1'. The velocity of BPSO is calculated as the PSO algorithm then, it is transferred into a sigmoid function in the interval [0,1] as follows: r a n d s v

B. Deterministic algorithm
In this paper, the continuous values are solved using commercial NLP solver CONOPT. CONOPT is a gradientbased NLP method for static and dynamic large-scale nonlinearly constrained optimization problems. This algorithm projects the gradient of the objective onto a linearization of the constraints and makes progress toward the solution by reducing the objective [33].

C.Hybrid CONOPT and PSO Algorithm
Our proposed algorithm combines a PSO stochastic algorithm with a gradient-based deterministic NLP algorithm to solve the non-convex MINLP. In the hybrid algorithm, the values of the discrete variables are optimized using PSO and all the continuous values are calculated using a gradient-based NLP solver (CONOPT). The general structure of the algorithm is shown in Fig.2. The major steps can be summarized as follows: Step 1: To start the program, initialize the relative parameters of the home energy management system (HEMS).
Step 2: Randomly initialize the discrete variables. A PSO algorithm generates an initial random population of N number of particles. Each particle randomly generates the variables x= [ , ] defe inte x x that need to be optimized. As can been seen, x represents binary values, which are solved by using binary PSO.
Step 3: Deterministic optimization. The continuous variables y= [ , , , ] ta FC batt gas y y y y are optimized using the gradient-based CONOPT together with the fixed discrete variables obtained by PSO. All the discrete particles are folded into the generation.
Step 4: Evaluation of fitness value. The fitness value of each particle is calculated based on the discrete value x= [ , ] defe inte x x and the continuous value y= [ , , , ] ta FC batt gas y y y y . Step 5: Each particle is ranked according to its fitness value. The global and individual best particles are selected and the PSO operators are applied according to Eqs. (24)(25)to create a new population. The population of the new generation is compared to that of the previous generation and the best particles are selected as the new generation.
Step 6: Terminate the computation if a pre-defined maximum number of generations is satisfied. The solution contained in the current generation represents the best solution. It will include the best PSO particle and its CONOPT value. If the criteria are not satisfied, the iteration continues.

IV. SIMULATION RESULTS
In this work, we took an overall planned framework that divides a day into 24 one-hour periods. This applies to a residential building that we assumed will be equipped with a wide variety of appliances, including a fuel cell, battery, a thermostatically-controlled appliance, deferrable appliances, interruptible appliances and natural gas, each of which would need modeling. The data for the modeling was taken from relevant literature [34] and previously published studies [35][36][37]. Variations in normalized thermal and electrical demand during one day are shown in Fig.3 [35][36][37]. The day-ahead price of electricity supplied to terminal loads is also shown in Fig. 3. Parameters for the presumed household scenario are provided in Tables 1 and 2. These parameters were obtained and modified from previously published studies [33][34][35].
FIGURE3. Must-run electrical and thermal demand and real-time price Table I. Data for residential appliances

A. Algorithm analysis
In order to assess the effects of the optimization framework, three different methods were considered for evaluating the proposed scheduling scheme. For each case we applied a numerical simulation. Case 1. The MINLP problem was solved using a traditional PSO algorithm [38].The algorithm was programmed using the MATLAB programming language with a population of 200 particles.
Case 2. The MINLP problem was solved using the commercial solver Knitro, which was modeled in A Mathematical Programming Language (AMPL) [33]. Knitro is a special non-linear solver that uses state-ofthe-art algorithmic options to accommodate various objective and constrained non-linearities in continuous and integer variables. It is designed for large-scale problems and can handle hundreds of thousands of variables.
Case 3.The MINLP problem was solved using our own proposed hybrid algorithm with a population of 100 particles. The deterministic problem was solved by CONOPT and the stochastic problem was solved using binary PSO.
All of the tests were performed on a PC with an Intel dual-core 2.6 GHz processor running a Windows XP operating system.
Each approach was executed five times and the overall average was recorded. The statistical simulation results are listed in Table III.  Table III, it can be seen that the problem cannot be successfully solved using a traditional PSO algorithm. This may be due to the fact that the MINLP problem is too complex. The PSO easily managed to converge to a local optimal value, but it cannot satisfy all of the constraints necessary to obtain the optimal solution.
Due to the non-convexity of the problem, Knitro, a commercial solver, can obtain a feasible solution, but it was only a local optimal solution. In our hybrid approach, the problem is divided into discrete and continuous variables.
The continuous variables are solved using CONOPT, and the discrete variables are solved using a stochastic PSO algorithm. The results show that the performance of the proposed algorithm is better than Knitro, a commercial solver. This may be due to the fact that the performance of deterministic MINLP algorithm depends mainly on its initialization. The embedded population-based PSO algorithm increases the chance of acquiring good initialization. Therefore, the PSO algorithm as the initial value for CONOPT can improve the performance of the whole algorithm. However, the algorithm in this paper is at the cost of different initialization, so it will also increase the cost of calculation.

B. Scheduling procedure
Further analysis was used to explore the effects of the proposed algorithm.
Interruptible and deferrable appliances play an important role in achieving economic operation. The schedule results of interruptible and deferrable appliances are presented in Fig.4. As expected, both deferrable and interruptible appliances are scheduled to operate at low-price electricity periods (i.e., 5:00, 12:00-16:00and 20:00-24:00) to save costs. Further analysis of optimization results have been cited in a previously published study [23][24][25].

FIGURE4. Scheduling results for interruptible and deferrable appliance
The scheduling results for the continuous appliances are plotted in Fig.5.

FIGURE 5. Controlled appliances and building temperature
The power drawn by the thermal energy equipment is relatively stable. Outside of start-up, it works at maximum power because it is has to meet the constrained requirement of moving from an initial temperature of 20 oC to a temperature within the set range[24 oC ,26 oC ].
As expected, the fuel cell had to work at a relatively high power because it needed to reduce cost by generating heat and electricity simultaneously.

V. CONLUSIONS
In this paper, we have proposed anon-convex MINLP solution for residential building. The proposed solution has been designed for the scheduling of both discrete and continuous appliances. As this presents as a non-convex MINLP we compared our proposed approach to other potentially relevant solutions, namely, the commercial software Knitro and a traditional heuristic algorithm. Due to the non-convex nature of the problem, the traditional heuristic algorithm was not able to achieve a feasible solution. The commercial solver Knitro converged easily, but to a suboptimal solution. By contrast, our proposed hybrid algorithm was able to solve the non-convex MINLP in an optimal fashion. This hybrid algorithm increases the possibility of locating a successful global solution because it deals with a whole population of possible solutions at any one time. Further analysis, based on an extensive simulation study that modeled an actual residential scenario, found that the proposed algorithm is effective for realworld applications.