# A Novel Multiobjective Optimization Algorithm for Home Energy Management System in Smart Grid

Authors: Yanyu Zhang; Peng Zeng; Shuhui Li; Chuanzhi Zang; Hepeng Li
Journal: Mathematical Problems in Engineering
 (2015)

---

## Abstract

Demand response (DR) is an effective method to lower peak-to-average ratio of demand, facilitate the integration of renewable resources (e.g., wind and solar) and plug-in hybrid electric vehicles, and strengthen the reliability of power system. In smart grid, implementing DR through home energy management system (HEMS) in residential sector has a great significance. However, an algorithm that only optimally controls parts of HEMS rather than the overall system cannot obtain the best results. In addition, single objective optimization algorithm that minimizes electricity cost cannot quantify user’s comfort level and cannot take a tradeoff between electricity cost and comfort level conveniently. To tackle these problems, this paper proposes a framework of HEMS that consists of grid, load, renewable resource (i.e., solar resource), and battery. In this framework, a user has the ability to sell electricity to utility grid for revenue. Different comfort level indicators are proposed for different home appliances according to their characteristics and user preferences. Based on these comfort level indicators, this paper proposes a multiobjective optimization algorithm for HEMS that minimizes electricity cost and maximizes user’s comfort level simultaneously. Simulation results indicate that the algorithm can reduce user’s electricity cost significantly, ensure user’s comfort level, and take a tradeoff between the cost and comfort level conveniently.


---

## Body

## 1. Introduction

Over the past several decades, with the development of economy, the electricity demand of the whole world increased dramatically, which makes the power system encounter stress conditions frequently. At the same time, the pressure of natural resources and environmental problems have attracted great attention to incorporation of clean, renewable generation sources, such as wind and solar power [1, 2]. However, due to the variable and uncertainty characteristics, the increasing penetration of renewable generation sources introduces further challenges to the power system [3]. In addition to these factors, the emergence of a large number of plug-in hybrid electric vehicles (PHEVs) has the potential to increase peak demand significantly, overload distribution lines, degenerate distribution transformers, and threaten the reliability of the power system [4–6]. To alleviate these problems, demand response (DR) plays an important role.DR is an effective method to lower peak-to-average ratio of demand, improve the utilization of power assets, strengthen the reliability of power system, and facilitate the integration of renewable resources and PHEVs [7–11]. DR has been successfully applied in industrial and commercial sectors. On the other hand, in residential sector, it is difficult to implement DR effectively because of little power consumption of single residential customer, large numbers of customers, and the lack of corresponding technologies and incentives in conventional power grid. However, take the USA, as example, according to the report of the US Energy Information Administration (EIA), the residential sector consumes 20% of the total energy supply and dominates 60% of peak load in certain parts of the country [12]. From this point of view, implementing DR in the residential sector has a great significance.In recent years, with the emergence of smart grid, DR in residential sector is getting more and more attention. Different from the conventional grid, the smart grid has two-way energy and information flows, which provides the base to implement DR in the residential sector. Residents can control the operations of their home appliances, batteries, PHEVs, and distributed generation through home energy management system (HEMS). Optimal scheduling algorithm is one of the key components of HEMS and a hot topic in smart grid.Many papers have been published about the optimal scheduling algorithms in HEMS. Most papers [1, 13–21] focus on minimizing users’ electricity usage cost, while retaining users’ comfort level at a predefined range. For example, in [16], the authors developed a smart-grid strategy that matches renewable energy generation (i.e., wind and solar power) with the heating, ventilation, and air conditioning (HVAC) load. In [19], the thermostatically controlled household loads are scheduled based on electricity price and energy consumption forecasts by considering users’ comfort level to minimize electricity cost. In order to minimize the energy payment, the authors in [20] proposed a multistage optimization-based real-time residential load management algorithm that takes into account load uncertainty. These algorithms are single objective optimization algorithms, where user comfort is transformed into a set of constraints. These algorithms do not quantitatively consider users’ comfort level during operation. However, from the users’ point of view, in addition to monetary expense, high comfort level is another objective that they pursue. Unfortunately, the objectives of cost and comfort level are conflicting. Therefore, compared with single objective optimization algorithms that only consider energy payment, the multiobjective optimization algorithm that not only minimizes monetary expense but also maximizes comfort level simultaneously is more attractive and natural.For the moment, the multiobjective optimal scheduling algorithm for HEMS has not been well investigated. In [22], the authors proposed an optimal residential energy consumption scheduling framework to achieve a tradeoff between minimizing payment and waiting time for the operation of each household appliance. In [22], waiting time is used to indicate user’s comfort level. Although this method is suitable to washing machine (WM), clothes dryer (CD), and dishwasher (DW), it is meaningless for HVAC and electric water heater (EWH), where the user’s concern is temperature. In [23], the authors developed a multiobjective air conditioning control algorithm based on immune clonal selection programming to determine the day-ahead 24 h temperature schedule for air conditioning. In addition to electricity cost, the expected error for the desired indoor temperature is introduced as a user comfort level indicator and optimized as an objective of the algorithm. However, this indicator cannot reflect users’ temperature preferences in different seasons.In smart grid, a residential customer not only has home appliances that consume electricity, but also may have distributed renewable generation (e.g., wind and PV) and batteries which may have extra electricity sold to the grid for revenue as presented [1, 14]. However, the optimal scheduling algorithms proposed in those papers did not consider the power distribution relationships among loads, batteries, distributed renewable generation, and grid. For example, the algorithms in [17–23] only schedule the operation of loads. The systems proposed in [13–16] include load, storage system, and distributed renewable generation, where the ability to sell electricity to the grid is not considered. Although the system described in [1, 14] consists of loads, batteries, and renewable generation and the user has the ability to sell electricity to the grid, the power distribution relationships among different components of HEMS are not thoroughly investigated.This paper proposes a HEMS framework that includes loads, batteries, and renewable generation interconnected with the grid through a smart mater. In this framework, the user can sell the electricity generated by renewable sources or stored in batteries to the grid for profit. A set of comfort level indicators are proposed for different home appliances. Based on these indicators, a multiobjective optimal schedule model is built, which minimizes monetary expense and maximizes user comfort level simultaneously. An improved hybrid discrete particle swarm optimization (PSO) is employed to solve the model, and a multiobjective optimization algorithm for HEMS is proposed. The algorithm schedules the operation of home appliances, batteries, and renewable generation (i.e., PV) as well as the optimal power distribution among loads, batteries, renewable generation, and grids.The rest of this paper is organized as follows. Section2 proposes a framework of HEMS and presents models and constraints of home appliances and batteries. Section 3 describes the comfort level indicators for different home appliances and the formulation of the HEMS optimization problem, including the optimization objectives and constraints. Section 4 presents a multiobjective optimization algorithm based on an improved hybrid discrete PSO technique. Section 5 provides a case study and compares the simulation results of the proposed algorithm with other algorithms proposed in the literature. Section 6 concludes the paper.


## 2. System Model

### 2.1. DR Abilities of Different Home Appliances

In terms of the schedulability, home appliances can be divided into two categories: schedulable appliances (SAs) and nonschedulable appliances (NSAs). SAs refer to the appliances whose operations can be scheduled to a certain extent without reducing user’s comfort level, such as WM, CD, DW, HVAC, and EWH. On the contrary, NSAs are the appliances whose operations must be started immediately when users need their services, such as computer, television, microwave oven, and light. NSAs are also called critical loads. SAs can be further classified into two groups: interruptible loads and uninterruptible loads. For example, PHEVs are interruptible loads. Uninterruptible loads refer to the appliances whose operations can be delayed, but after being started, they must be kept working until the tasks are completed, such as WM and DW.Although several papers investigate the controlling methods for low power consumption appliances, such as refrigerators and coffee maker, they are not evident for DR due to their low power consumption compared with the overall household power consumption [24]. In this paper, we choose HVAC, EWH, PHEV, WM, CD, and DW as scheduling objects to implement DR in household.Battery is another important kind of interruptible SA. The battery can be used to store surplus energy generated by renewable sources (e.g., PV) or the energy from the grid when the electricity price is low. The stored electric energy can be supplied to loads or sold back to the grid for revenue when the price is high. Therefore, battery is another scheduling object in this paper.


### 2.2. Framework of the HEMS

The framework of HEMS proposed in this paper is shown in Figure1. As mentioned above, the framework includes loads (i.e., NSAs, SAs, and PHEV), home energy storage battery, and renewable generation (i.e., PV). It must be pointed out that PHEV is a special kind of loads. Different from other loads, a PHEV not only can act as a load that absorbs electricity from the grid or renewable generation, but also, in some special cases, acts as a power source through the vehicle-to-grid (V2G) or vehicle-to-home (V2H) function [25, 26]. In this paper, the PHEV is considered as a load only.Figure 1
Framework of the HEMS in smart grid.The two-way energy and information exchange between HEMS and the grid is realized through a smart meter. The smart meter is responsible for transmitting consumption data from home appliances to the utility company and it also relays the electricity price signal from the utility company back to a controller. For the moment, there are different time-based pricing tariffs including time-of-use (TOU) tariff, critical peak pricing (CPP) tariff, and real-time pricing (RTP) tariff [27]. This paper uses day-ahead RTP; in other words, the electricity price of every hour is published by the utility company to residents one day ahead.The controller is the kernel of HEMS. Each HEMS component communicates with the controller over a home area network (HAN), which can be realized through Zigbee communication technology [28]. The controller connects with the Internet by a broadband access unit (BAU) and gets weather information including outdoor temperature forecast via the Internet. Through the controller, the user can set parameters and configure the system.In the framework, the schedulable appliances (i.e., HVAC, EWH, WM, CD, and DW), PHEV, and battery are scheduled by the controller to minimize the electricity cost and maximize user comfort level according to the electricity price, user preferences, and PV power output.


### 2.3. Power Distribution Relationships of the HEMS

In the proposed framework, the power distribution relationships among loads, battery, PV, and grid are shown in Figure2. In this figure, the components enclosed by the dash line, that is, loads, PV, and battery, are owned by the user, and they are the scheduling objects of the proposed algorithm. ptG2L is the power that is transmitted from grid to loads at time t. Similarly, ptP2L and ptB2L are the power transmitted from PV and battery to loads, ptG2B and ptP2B represent the power transmitted to the battery from grid, and PV, ptP2G, and ptB2G stand for the power transmitted to grid from PV and battery at time t, respectively. The values of these power distributions are equal to or greater than zero.Figure 2
Power distribution relationships of the HEMS in smart grid.Under the RTP scheme, the scheduling of loads and power distribution among different components affect the total monetary expense. As a result, besides load management, optimal control of the power distributions among grid, loads, battery, and PV is another important issue for the optimization goals. This problem will be discussed in detail in Section3.


### 2.4. Models and Constraints of Individual Appliances

The model of each appliance used in this paper and the corresponding constraints are described as follows.


#### 2.4.1. HVAC

The HVAC model developed in [29] is adopted in this paper. In this model, the room temperature is calculated as(1)Tt+1Room=TtRoom+Δt·GtΔc+Δt·CHVACΔc·StHVAC,where TtRoom and Tt+1Room are the room temperatures (°F) in time slots t and t+1, respectively; Δt is the length of time slot t in hours; Gt is the heat gain rate of the house in Btu/h during time slot t; Δc is the energy needed to change the temperature of the air in the room by 1°F (Btu/°F); CHVAC is the cooling/heating capacity of HVAC in Btu/h, positive for heating and negative for cooling; StHVAC is the working status of HVAC in time slot t, 1 for on and 0 for off. For simplicity, it is assumed that the HVAC runs with its rated power, PHVAC (kW), when it is turned on.In order to ensure the comfort preference, HVAC should regulate the room temperature within the certain range prespecified by the user. This constraint is depicted in(2)Tmin⁡Room≤TtRoom≤Tmax⁡Room,where Tmin⁡Room and Tmax⁡Room stand for the minimum and maximum room temperatures, respectively.


#### 2.4.2. EWH

The model presented in [2] is employed in this paper to calculate the temperature of hot water inside the EWH tank:(3)Tt+1EWH=TtEWH·e-1/Rt′·C·Δt+GEWH·Rt′·TtEWH,env+Bt·Rt′·TtEWH,in+Qt·Rt′·1-e-1/Rt′·C·Δt,where TtEWH and Tt+1EWH are the hot water temperatures (°F) inside the EWH tank in time slots t and t+1, respectively; TtEWH,env and TtEWH,in are the temperatures (°F) of ambient environment and inlet water in time slot t, respectively; C is the equivalent thermal mass (Btu/°F); Δt is the length of a time slot in hours; GEWH is the ratio of the surface area of EWH to the thermal resistance of the tank. Bt, Rt′, and Qt are calculated according to the following equations, respectively:(4)Bt=dwater×Ft×Cp,(5)Rt′=1GEWH+Bt,(6)Qt=3.4121×10-8×PEWH×StEWH,where dwater is the density of water, Cp is the specific heat of water, and Ft represents hot water flow rate in time slot t. PEWH is the rated power of the EWH (kW) and StEWH is the status of the EWH in time slot t.The EWH has two statuses, on and off. When turned on, it runs with the rated power, and the hot water temperature increases exponentially; otherwise, the temperature decreases. Similar to HVAC, the EWH should maintain the hot water temperature within a prespecified rangeTmin⁡EWH,Tmax⁡EWH, where Tmin⁡EWH and Tmax⁡EWH are the minimum and maximum water temperatures set by a user, respectively. This constraint is expressed by(7)Tmin⁡EWH≤TtEWH≤Tmax⁡EWH.


#### 2.4.3. PHEV

The battery state-of-charge (SOC) relationship of PHEV [29] is calculated according to(8)SOCt+1PHEV=SOCtPHEV+ptPHEV·ΔtCsizePHEV,where SOCtPHEV and SOCt+1PHEV are the PHEV battery SOC in time slots t and t+1, respectively; CsizePHEV is the rated capacity of PHEV battery (kW·h); Δt is the length of a time slot in hours; ptPHEV is the charging power of PHEV in time slot t (kW); in this paper, it is assumed that the charging power is constant, that is, the rated charging power of PHEV, PPHEV (kW). Therefore, ptPHEV is determined by(9)ptPHEV=PPHEV·StPHEV,where StPHEV is the charging status of PHEV in time slot t, with 1 representing on and 0 representing off.To protect the PHEV battery from damage, the battery SOC should be maintained in a safe range ofSOCmin⁡PHEV,SOCmax⁡PHEV, where SOCmin⁡PHEV and SOCmax⁡PHEV are the minimum and maximum allowable PHEV battery SOC. To satisfy user’s transportation demand, the PHEV battery should be charged each day with a SOC equal to or greater than the prespecified SOC, SOCfinalPHEV. These two constraints are depicted in the following, respectively:(10)SOCmin⁡PHEV≤SOCtPHEV≤SOCmax⁡PHEV,(11)SOCfinalPHEV≤SOCNslotPHEV≤SOCmax⁡PHEV,where SOCNslotPHEV is the PHEV battery SOC in the final time slot (i.e., time slot Nslot) of the scheduling horizon. Nslot denotes the total number of the time slots in the scheduling horizon.


#### 2.4.4. WM, CD, and DW

In this paper, WM, CD, and DW are taken as noninterruptible appliances; in other words, these appliances have two statuses, on and off. Once they are turned on, they must keep working with the rated power until their tasks are completed. The task starting time and the number of time slots that are needed for completing the task of each appliance are set by the user. They should meet the constraints(12)1≤Nstarta≤Nslot-Ntaska,Sta=1t=Nstarta,Nstarta+1,…,Nstarta+Ntaska-10otherwise,∑t=1NslotSta=Ntaska,where a∈{WM,CD,DW}; Nstarta is the time slot in which the task of home appliance a is started; Ntaska is the number of time slots that are needed to complete the task of appliance a; Sta is the working status of appliance a in time slot t, with 1 representing on and 0 representing off.The power of appliancea in time slot t, pta, is calculated as(13)pta=Pa·Sta,where Pa is the rated power of appliance a.


#### 2.4.5. Battery

In order to prevent the home energy storage battery from overcharge and overdischarge, the battery SOC should always be maintained within a specified rangeSOCmin⁡Bat,SOCmax⁡Bat, where SOCmin⁡Bat and SOCmax⁡Bat are the minimum and maximum allowable SOC of the battery, respectively. This constraint is depicted in(14)SOCmin⁡Bat≤SOCtBat≤SOCmax⁡Bat.The battery SOC associated with the charge and discharge of the battery is calculated by the following equations, respectively:(15)SOCt+1Bat=SOCtBat+ptBat,ch·Δt·ηchBatCsizeBat,(16)SOCt+1Bat=SOCtBat-ptBat,disch·ΔtηdischBat·CsizeBat,where CsizeBat is the rated battery capacity (kW·h); SOCtBat and SOCt+1Bat are the battery SOC in time slots t and t+1, respectively; ptBat,ch and ptBat,disch represent the charging and discharging power in time slot t, respectively, ηchBat is the charging efficiency; and ηdischBat is the discharging efficiency.To ensure the safety of operation, the charging and discharging powers should be controlled to be equal to or smaller than the maximum allowable values. As shown in Figure2, the battery can be charged by power from the grid ptG2B and PV ptP2B; on the other hand, the battery can also supply electricity to loads ptB2L and grid ptB2G. Consequently, the constraints about charging and discharging power are formulated as follows, respectively:(17)0≤ptBat,ch=ptP2B+ptG2B≤Pmax⁡Bat,ch,(18)0≤ptBat,disch=ptB2L+ptB2G≤Pmax⁡Bat,disch,where Pmax⁡Bat,ch and Pmax⁡Bat,disch are the maximum allowable charging and discharging power of the battery, respectively.The battery is not allowed to supply electricity to loads or the grid when it is in charging state, or to be charged when it is supplying electricity to loads or the grid. This constraint is formulated as(19)ptB2L+ptB2G·ptP2B+ptG2B=0∀t∈1,2,…,Nslot.


#### 2.4.6. Other Constraints

Besides the constraints mentioned above, other constraints are described as follows:(20)ptP2L+ptP2B+ptP2G=ptPV,∑a∈Apta+ptCL=ptP2L+ptB2L+ptG2LA=HVAC,EWH,PHEV,WM,CD,DW,where ptPV is the power output of PV in time slot t in kW and ptCL is the total power of the critical loads (i.e., nonschedulable loads) in time slot t in kW.


## 2.1. DR Abilities of Different Home Appliances

In terms of the schedulability, home appliances can be divided into two categories: schedulable appliances (SAs) and nonschedulable appliances (NSAs). SAs refer to the appliances whose operations can be scheduled to a certain extent without reducing user’s comfort level, such as WM, CD, DW, HVAC, and EWH. On the contrary, NSAs are the appliances whose operations must be started immediately when users need their services, such as computer, television, microwave oven, and light. NSAs are also called critical loads. SAs can be further classified into two groups: interruptible loads and uninterruptible loads. For example, PHEVs are interruptible loads. Uninterruptible loads refer to the appliances whose operations can be delayed, but after being started, they must be kept working until the tasks are completed, such as WM and DW.Although several papers investigate the controlling methods for low power consumption appliances, such as refrigerators and coffee maker, they are not evident for DR due to their low power consumption compared with the overall household power consumption [24]. In this paper, we choose HVAC, EWH, PHEV, WM, CD, and DW as scheduling objects to implement DR in household.Battery is another important kind of interruptible SA. The battery can be used to store surplus energy generated by renewable sources (e.g., PV) or the energy from the grid when the electricity price is low. The stored electric energy can be supplied to loads or sold back to the grid for revenue when the price is high. Therefore, battery is another scheduling object in this paper.


## 2.2. Framework of the HEMS

The framework of HEMS proposed in this paper is shown in Figure1. As mentioned above, the framework includes loads (i.e., NSAs, SAs, and PHEV), home energy storage battery, and renewable generation (i.e., PV). It must be pointed out that PHEV is a special kind of loads. Different from other loads, a PHEV not only can act as a load that absorbs electricity from the grid or renewable generation, but also, in some special cases, acts as a power source through the vehicle-to-grid (V2G) or vehicle-to-home (V2H) function [25, 26]. In this paper, the PHEV is considered as a load only.Figure 1
Framework of the HEMS in smart grid.The two-way energy and information exchange between HEMS and the grid is realized through a smart meter. The smart meter is responsible for transmitting consumption data from home appliances to the utility company and it also relays the electricity price signal from the utility company back to a controller. For the moment, there are different time-based pricing tariffs including time-of-use (TOU) tariff, critical peak pricing (CPP) tariff, and real-time pricing (RTP) tariff [27]. This paper uses day-ahead RTP; in other words, the electricity price of every hour is published by the utility company to residents one day ahead.The controller is the kernel of HEMS. Each HEMS component communicates with the controller over a home area network (HAN), which can be realized through Zigbee communication technology [28]. The controller connects with the Internet by a broadband access unit (BAU) and gets weather information including outdoor temperature forecast via the Internet. Through the controller, the user can set parameters and configure the system.In the framework, the schedulable appliances (i.e., HVAC, EWH, WM, CD, and DW), PHEV, and battery are scheduled by the controller to minimize the electricity cost and maximize user comfort level according to the electricity price, user preferences, and PV power output.


## 2.3. Power Distribution Relationships of the HEMS

In the proposed framework, the power distribution relationships among loads, battery, PV, and grid are shown in Figure2. In this figure, the components enclosed by the dash line, that is, loads, PV, and battery, are owned by the user, and they are the scheduling objects of the proposed algorithm. ptG2L is the power that is transmitted from grid to loads at time t. Similarly, ptP2L and ptB2L are the power transmitted from PV and battery to loads, ptG2B and ptP2B represent the power transmitted to the battery from grid, and PV, ptP2G, and ptB2G stand for the power transmitted to grid from PV and battery at time t, respectively. The values of these power distributions are equal to or greater than zero.Figure 2
Power distribution relationships of the HEMS in smart grid.Under the RTP scheme, the scheduling of loads and power distribution among different components affect the total monetary expense. As a result, besides load management, optimal control of the power distributions among grid, loads, battery, and PV is another important issue for the optimization goals. This problem will be discussed in detail in Section3.


## 2.4. Models and Constraints of Individual Appliances

The model of each appliance used in this paper and the corresponding constraints are described as follows.


### 2.4.1. HVAC

The HVAC model developed in [29] is adopted in this paper. In this model, the room temperature is calculated as(1)Tt+1Room=TtRoom+Δt·GtΔc+Δt·CHVACΔc·StHVAC,where TtRoom and Tt+1Room are the room temperatures (°F) in time slots t and t+1, respectively; Δt is the length of time slot t in hours; Gt is the heat gain rate of the house in Btu/h during time slot t; Δc is the energy needed to change the temperature of the air in the room by 1°F (Btu/°F); CHVAC is the cooling/heating capacity of HVAC in Btu/h, positive for heating and negative for cooling; StHVAC is the working status of HVAC in time slot t, 1 for on and 0 for off. For simplicity, it is assumed that the HVAC runs with its rated power, PHVAC (kW), when it is turned on.In order to ensure the comfort preference, HVAC should regulate the room temperature within the certain range prespecified by the user. This constraint is depicted in(2)Tmin⁡Room≤TtRoom≤Tmax⁡Room,where Tmin⁡Room and Tmax⁡Room stand for the minimum and maximum room temperatures, respectively.


### 2.4.2. EWH

The model presented in [2] is employed in this paper to calculate the temperature of hot water inside the EWH tank:(3)Tt+1EWH=TtEWH·e-1/Rt′·C·Δt+GEWH·Rt′·TtEWH,env+Bt·Rt′·TtEWH,in+Qt·Rt′·1-e-1/Rt′·C·Δt,where TtEWH and Tt+1EWH are the hot water temperatures (°F) inside the EWH tank in time slots t and t+1, respectively; TtEWH,env and TtEWH,in are the temperatures (°F) of ambient environment and inlet water in time slot t, respectively; C is the equivalent thermal mass (Btu/°F); Δt is the length of a time slot in hours; GEWH is the ratio of the surface area of EWH to the thermal resistance of the tank. Bt, Rt′, and Qt are calculated according to the following equations, respectively:(4)Bt=dwater×Ft×Cp,(5)Rt′=1GEWH+Bt,(6)Qt=3.4121×10-8×PEWH×StEWH,where dwater is the density of water, Cp is the specific heat of water, and Ft represents hot water flow rate in time slot t. PEWH is the rated power of the EWH (kW) and StEWH is the status of the EWH in time slot t.The EWH has two statuses, on and off. When turned on, it runs with the rated power, and the hot water temperature increases exponentially; otherwise, the temperature decreases. Similar to HVAC, the EWH should maintain the hot water temperature within a prespecified rangeTmin⁡EWH,Tmax⁡EWH, where Tmin⁡EWH and Tmax⁡EWH are the minimum and maximum water temperatures set by a user, respectively. This constraint is expressed by(7)Tmin⁡EWH≤TtEWH≤Tmax⁡EWH.


### 2.4.3. PHEV

The battery state-of-charge (SOC) relationship of PHEV [29] is calculated according to(8)SOCt+1PHEV=SOCtPHEV+ptPHEV·ΔtCsizePHEV,where SOCtPHEV and SOCt+1PHEV are the PHEV battery SOC in time slots t and t+1, respectively; CsizePHEV is the rated capacity of PHEV battery (kW·h); Δt is the length of a time slot in hours; ptPHEV is the charging power of PHEV in time slot t (kW); in this paper, it is assumed that the charging power is constant, that is, the rated charging power of PHEV, PPHEV (kW). Therefore, ptPHEV is determined by(9)ptPHEV=PPHEV·StPHEV,where StPHEV is the charging status of PHEV in time slot t, with 1 representing on and 0 representing off.To protect the PHEV battery from damage, the battery SOC should be maintained in a safe range ofSOCmin⁡PHEV,SOCmax⁡PHEV, where SOCmin⁡PHEV and SOCmax⁡PHEV are the minimum and maximum allowable PHEV battery SOC. To satisfy user’s transportation demand, the PHEV battery should be charged each day with a SOC equal to or greater than the prespecified SOC, SOCfinalPHEV. These two constraints are depicted in the following, respectively:(10)SOCmin⁡PHEV≤SOCtPHEV≤SOCmax⁡PHEV,(11)SOCfinalPHEV≤SOCNslotPHEV≤SOCmax⁡PHEV,where SOCNslotPHEV is the PHEV battery SOC in the final time slot (i.e., time slot Nslot) of the scheduling horizon. Nslot denotes the total number of the time slots in the scheduling horizon.


### 2.4.4. WM, CD, and DW

In this paper, WM, CD, and DW are taken as noninterruptible appliances; in other words, these appliances have two statuses, on and off. Once they are turned on, they must keep working with the rated power until their tasks are completed. The task starting time and the number of time slots that are needed for completing the task of each appliance are set by the user. They should meet the constraints(12)1≤Nstarta≤Nslot-Ntaska,Sta=1t=Nstarta,Nstarta+1,…,Nstarta+Ntaska-10otherwise,∑t=1NslotSta=Ntaska,where a∈{WM,CD,DW}; Nstarta is the time slot in which the task of home appliance a is started; Ntaska is the number of time slots that are needed to complete the task of appliance a; Sta is the working status of appliance a in time slot t, with 1 representing on and 0 representing off.The power of appliancea in time slot t, pta, is calculated as(13)pta=Pa·Sta,where Pa is the rated power of appliance a.


### 2.4.5. Battery

In order to prevent the home energy storage battery from overcharge and overdischarge, the battery SOC should always be maintained within a specified rangeSOCmin⁡Bat,SOCmax⁡Bat, where SOCmin⁡Bat and SOCmax⁡Bat are the minimum and maximum allowable SOC of the battery, respectively. This constraint is depicted in(14)SOCmin⁡Bat≤SOCtBat≤SOCmax⁡Bat.The battery SOC associated with the charge and discharge of the battery is calculated by the following equations, respectively:(15)SOCt+1Bat=SOCtBat+ptBat,ch·Δt·ηchBatCsizeBat,(16)SOCt+1Bat=SOCtBat-ptBat,disch·ΔtηdischBat·CsizeBat,where CsizeBat is the rated battery capacity (kW·h); SOCtBat and SOCt+1Bat are the battery SOC in time slots t and t+1, respectively; ptBat,ch and ptBat,disch represent the charging and discharging power in time slot t, respectively, ηchBat is the charging efficiency; and ηdischBat is the discharging efficiency.To ensure the safety of operation, the charging and discharging powers should be controlled to be equal to or smaller than the maximum allowable values. As shown in Figure2, the battery can be charged by power from the grid ptG2B and PV ptP2B; on the other hand, the battery can also supply electricity to loads ptB2L and grid ptB2G. Consequently, the constraints about charging and discharging power are formulated as follows, respectively:(17)0≤ptBat,ch=ptP2B+ptG2B≤Pmax⁡Bat,ch,(18)0≤ptBat,disch=ptB2L+ptB2G≤Pmax⁡Bat,disch,where Pmax⁡Bat,ch and Pmax⁡Bat,disch are the maximum allowable charging and discharging power of the battery, respectively.The battery is not allowed to supply electricity to loads or the grid when it is in charging state, or to be charged when it is supplying electricity to loads or the grid. This constraint is formulated as(19)ptB2L+ptB2G·ptP2B+ptG2B=0∀t∈1,2,…,Nslot.


### 2.4.6. Other Constraints

Besides the constraints mentioned above, other constraints are described as follows:(20)ptP2L+ptP2B+ptP2G=ptPV,∑a∈Apta+ptCL=ptP2L+ptB2L+ptG2LA=HVAC,EWH,PHEV,WM,CD,DW,where ptPV is the power output of PV in time slot t in kW and ptCL is the total power of the critical loads (i.e., nonschedulable loads) in time slot t in kW.


## 2.4.1. HVAC

The HVAC model developed in [29] is adopted in this paper. In this model, the room temperature is calculated as(1)Tt+1Room=TtRoom+Δt·GtΔc+Δt·CHVACΔc·StHVAC,where TtRoom and Tt+1Room are the room temperatures (°F) in time slots t and t+1, respectively; Δt is the length of time slot t in hours; Gt is the heat gain rate of the house in Btu/h during time slot t; Δc is the energy needed to change the temperature of the air in the room by 1°F (Btu/°F); CHVAC is the cooling/heating capacity of HVAC in Btu/h, positive for heating and negative for cooling; StHVAC is the working status of HVAC in time slot t, 1 for on and 0 for off. For simplicity, it is assumed that the HVAC runs with its rated power, PHVAC (kW), when it is turned on.In order to ensure the comfort preference, HVAC should regulate the room temperature within the certain range prespecified by the user. This constraint is depicted in(2)Tmin⁡Room≤TtRoom≤Tmax⁡Room,where Tmin⁡Room and Tmax⁡Room stand for the minimum and maximum room temperatures, respectively.


## 2.4.2. EWH

The model presented in [2] is employed in this paper to calculate the temperature of hot water inside the EWH tank:(3)Tt+1EWH=TtEWH·e-1/Rt′·C·Δt+GEWH·Rt′·TtEWH,env+Bt·Rt′·TtEWH,in+Qt·Rt′·1-e-1/Rt′·C·Δt,where TtEWH and Tt+1EWH are the hot water temperatures (°F) inside the EWH tank in time slots t and t+1, respectively; TtEWH,env and TtEWH,in are the temperatures (°F) of ambient environment and inlet water in time slot t, respectively; C is the equivalent thermal mass (Btu/°F); Δt is the length of a time slot in hours; GEWH is the ratio of the surface area of EWH to the thermal resistance of the tank. Bt, Rt′, and Qt are calculated according to the following equations, respectively:(4)Bt=dwater×Ft×Cp,(5)Rt′=1GEWH+Bt,(6)Qt=3.4121×10-8×PEWH×StEWH,where dwater is the density of water, Cp is the specific heat of water, and Ft represents hot water flow rate in time slot t. PEWH is the rated power of the EWH (kW) and StEWH is the status of the EWH in time slot t.The EWH has two statuses, on and off. When turned on, it runs with the rated power, and the hot water temperature increases exponentially; otherwise, the temperature decreases. Similar to HVAC, the EWH should maintain the hot water temperature within a prespecified rangeTmin⁡EWH,Tmax⁡EWH, where Tmin⁡EWH and Tmax⁡EWH are the minimum and maximum water temperatures set by a user, respectively. This constraint is expressed by(7)Tmin⁡EWH≤TtEWH≤Tmax⁡EWH.


## 2.4.3. PHEV

The battery state-of-charge (SOC) relationship of PHEV [29] is calculated according to(8)SOCt+1PHEV=SOCtPHEV+ptPHEV·ΔtCsizePHEV,where SOCtPHEV and SOCt+1PHEV are the PHEV battery SOC in time slots t and t+1, respectively; CsizePHEV is the rated capacity of PHEV battery (kW·h); Δt is the length of a time slot in hours; ptPHEV is the charging power of PHEV in time slot t (kW); in this paper, it is assumed that the charging power is constant, that is, the rated charging power of PHEV, PPHEV (kW). Therefore, ptPHEV is determined by(9)ptPHEV=PPHEV·StPHEV,where StPHEV is the charging status of PHEV in time slot t, with 1 representing on and 0 representing off.To protect the PHEV battery from damage, the battery SOC should be maintained in a safe range ofSOCmin⁡PHEV,SOCmax⁡PHEV, where SOCmin⁡PHEV and SOCmax⁡PHEV are the minimum and maximum allowable PHEV battery SOC. To satisfy user’s transportation demand, the PHEV battery should be charged each day with a SOC equal to or greater than the prespecified SOC, SOCfinalPHEV. These two constraints are depicted in the following, respectively:(10)SOCmin⁡PHEV≤SOCtPHEV≤SOCmax⁡PHEV,(11)SOCfinalPHEV≤SOCNslotPHEV≤SOCmax⁡PHEV,where SOCNslotPHEV is the PHEV battery SOC in the final time slot (i.e., time slot Nslot) of the scheduling horizon. Nslot denotes the total number of the time slots in the scheduling horizon.


## 2.4.4. WM, CD, and DW

In this paper, WM, CD, and DW are taken as noninterruptible appliances; in other words, these appliances have two statuses, on and off. Once they are turned on, they must keep working with the rated power until their tasks are completed. The task starting time and the number of time slots that are needed for completing the task of each appliance are set by the user. They should meet the constraints(12)1≤Nstarta≤Nslot-Ntaska,Sta=1t=Nstarta,Nstarta+1,…,Nstarta+Ntaska-10otherwise,∑t=1NslotSta=Ntaska,where a∈{WM,CD,DW}; Nstarta is the time slot in which the task of home appliance a is started; Ntaska is the number of time slots that are needed to complete the task of appliance a; Sta is the working status of appliance a in time slot t, with 1 representing on and 0 representing off.The power of appliancea in time slot t, pta, is calculated as(13)pta=Pa·Sta,where Pa is the rated power of appliance a.


## 2.4.5. Battery

In order to prevent the home energy storage battery from overcharge and overdischarge, the battery SOC should always be maintained within a specified rangeSOCmin⁡Bat,SOCmax⁡Bat, where SOCmin⁡Bat and SOCmax⁡Bat are the minimum and maximum allowable SOC of the battery, respectively. This constraint is depicted in(14)SOCmin⁡Bat≤SOCtBat≤SOCmax⁡Bat.The battery SOC associated with the charge and discharge of the battery is calculated by the following equations, respectively:(15)SOCt+1Bat=SOCtBat+ptBat,ch·Δt·ηchBatCsizeBat,(16)SOCt+1Bat=SOCtBat-ptBat,disch·ΔtηdischBat·CsizeBat,where CsizeBat is the rated battery capacity (kW·h); SOCtBat and SOCt+1Bat are the battery SOC in time slots t and t+1, respectively; ptBat,ch and ptBat,disch represent the charging and discharging power in time slot t, respectively, ηchBat is the charging efficiency; and ηdischBat is the discharging efficiency.To ensure the safety of operation, the charging and discharging powers should be controlled to be equal to or smaller than the maximum allowable values. As shown in Figure2, the battery can be charged by power from the grid ptG2B and PV ptP2B; on the other hand, the battery can also supply electricity to loads ptB2L and grid ptB2G. Consequently, the constraints about charging and discharging power are formulated as follows, respectively:(17)0≤ptBat,ch=ptP2B+ptG2B≤Pmax⁡Bat,ch,(18)0≤ptBat,disch=ptB2L+ptB2G≤Pmax⁡Bat,disch,where Pmax⁡Bat,ch and Pmax⁡Bat,disch are the maximum allowable charging and discharging power of the battery, respectively.The battery is not allowed to supply electricity to loads or the grid when it is in charging state, or to be charged when it is supplying electricity to loads or the grid. This constraint is formulated as(19)ptB2L+ptB2G·ptP2B+ptG2B=0∀t∈1,2,…,Nslot.


## 2.4.6. Other Constraints

Besides the constraints mentioned above, other constraints are described as follows:(20)ptP2L+ptP2B+ptP2G=ptPV,∑a∈Apta+ptCL=ptP2L+ptB2L+ptG2LA=HVAC,EWH,PHEV,WM,CD,DW,where ptPV is the power output of PV in time slot t in kW and ptCL is the total power of the critical loads (i.e., nonschedulable loads) in time slot t in kW.


## 3. Multiobjective Optimization of HEMS

### 3.1. Electricity Cost

In this paper, minimizing the overall electricity cost over the next 24 hours (i.e., next day) is one of optimization objectives based on the forecasted outdoor temperature and power output of PV over the next 24 hours, which can be obtained using the corresponding prediction algorithms [30, 31]. However, these algorithms have limitations due to the prediction accuracy. In this study, scenarios are used to capture the uncertainties of forecasted outdoor temperature and power output of the PV. The overall net electricity cost over the scheduling horizon is formulated as (21), which consists of three parts: the first item represents the overall electricity cost of buying electricity from the grid, the second item stands for the degradation cost ($) of the home energy storage battery, and the third item denotes the overall revenue of selling electricity to the grid:(21)Fcost=∑s1∈Stemp∑s2∈SPVps1ps2·∑t=1NslotptG2L,s1s2+ptG2B,s1s2×Δt×ctgrid+∑t=1NslotptP2B,s1s2+ptG2B,s1s2+ptB2L,s1s2+ptB2G,s1s2×Δt×cDegs1s2-∑t=1NslotptP2G,s1s2+ptB2G,s1s2×Δt×ctsell,where stemp and sPV denote the outdoor temperature and PV power output scenario sets, respectively; s1 represents an outdoor temperature scenario and s2 stands for a PV power output scenario; ps1 and ps2 denote the occurrence possibility of scenario s1 and s2, respectively; ctgrid is the electricity price in time slot t when the user buys electricity from the grid; and ctsell is the electricity price in time slot t when the user sells electricity to the grid. ptG2L,s1s2 denotes the power transmitted from the grid to loads in the scenario when s1 and s2 occur at the same time, and other symbols have similar meanings. cDegs1s2 is the battery degradation cost ($/kW·h); the detailed description and calculation method of it can be found in [3].


### 3.2. Comfort Level Indicator for Home Appliances

In practice, a residential user has different concerns for different home appliances. For example, for HVAC and EWH, the user pays more attention to temperature; however, for PHEV, WM, CD, and DW, the user focuses on when the tasks of these appliances are completed. Therefore, a set of comfort level indicators are proposed based on appliance type.


#### 3.2.1. HVAC

To quantify a user’s comfort level under the operation of HVAC, this paper proposes a comfort level indicator whose definition is based on the assumption that when the room temperature is equal to the user setting temperature, the user is most comfortable; if the room temperature deviates from the setting value to a certain extent, the user’s comfort level will be decreased [32]. The indicator is calculated as(22)IHVAC=100Nslot∑t=1NslotdtRoomΔTmax⁡Room,where ΔTmax⁡Room=max⁡TsetRoom-Tmin⁡Room,Tmax⁡Room-TsetRoom. dtRoom is determined by(23)dtRoom=TsetRoom-TtRoomTmin⁡Room≤TtRoom<TsetRoom-ΔTLRoom0TsetRoom-ΔTLRoom≤TtRoom≤TsetRoom+ΔTURoomTtRoom-TsetRoomTsetRoom+ΔTURoom<TtRoom≤Tmax⁡RoomΔTmax⁡Roomotherwise,where TsetRoom is the desired indoor temperature set by the user and ΔTLRoom and ΔTURoom are two parameters that are related to the temperature deadband of HVAC and the user’s preference. For example, in summer, the user prefers cool. Consequently, in this case, ΔTLRoom>ΔTURoom>0. According to the definition of IHVAC, it is within 0,100.The relationships among parametersTmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, and ΔTURoom are demonstrated in Figure 3. The indoor temperature horizon is divided into three zones by these parameters: comfortable zone, tolerable zone, and intolerable zone.Figure 3
Relationships among parameters of HVAC comfort level indicator.


#### 3.2.2. EWH

The definition of comfort level indicator for EWH is similar to that for HVAC, and it is calculated as(24)IEWH=100Nslot∑t=1NslotdtEWHΔTmax⁡EWH,dtEWH=TsetEWH-TtEWHTmin⁡EWH≤TtEWH<TsetEWH-ΔTLEWH0TsetEWH-ΔTLEWH≤TtEWH≤TsetEWH+ΔTUEWHTtEWH-TsetEWHTsetEWH+ΔTUEWH<TtEWH≤Tmax⁡EWHΔTmax⁡EWHotherwise,where ΔTmax⁡EWH=max⁡TsetEWH-Tmin⁡EWH,Tmax⁡EWH-TsetEWH and TsetEWH, ΔTLEWH, and ΔTUEWH are user setting parameters whose meanings are similar to the parameters of HVAC comfort level indicator. IEWH is in the range of 0,100 too.


#### 3.2.3. PHEV

A user’s comfort level about PHEV is determined by the charging finish time. The user is most satisfied in the case where once a PHEV is plugged in and it is kept charging until the PHEV battery SOC reaches the specified value. In reality, the user can tolerate some delay of the charging finish time, which makes the PHEV a flexible load. However, this tolerance is limited; if the delay is too long, the user will be unsatisfied. Based on these facts, the comfort level indicator for PHEV is calculated as(25)IPHEV=dPHEVtend-tplug+tcharge+tdelay×100,dPHEV=0tplug+tcharge≤tfsocPHEV≤tplug+tcharge+tdelaytfsocPHEV-tplug+tcharge+tdelaytfsocPHEV>tplug+tcharge+tdelay,where tplug is the time shot when the PHEV is plugged in; tcharge is the number of time slots that are needed to complete a charging task; tdelay is the maximum tolerant delay of charging completion time in time slot; tfsocPHEV is the time slot in which the PHEV battery SOC reaches the specified value; tend is the last time slot of the scheduling horizon. According to the definition, IPHEV is within 0,100. Figure 4 illustrates the relationships among these parameters.Figure 4
Relationships among parameters of PHEV comfort level indicator.


#### 3.2.4. WM, CD, and DW

The comfort level indicators for WM, CD, and DW share the same expression, and they are calculated as(26)Ia=0tmin⁡a≤tstarta≤tideala+tdelayatstarta-tideala+tdelayatmax⁡a-tworka-tideala+tdelaya×100tideala+tdelaya<tstarta≤tmax⁡a-tworkaa∈WM,CD,DW,where tmin⁡a and tmax⁡a specify the valid working interval for appliance a; tideala is the ideal time slot in which the appliance a is started, and it is set by a user; tstarta is the actual starting time slot of appliance a; tworka denotes the number of time slots that are needed by appliance a to complete its task; tdelaya is the tolerant delay of task finish time. The relationships of these parameters are depicted in Figure 5. Ia is in the range of 0,100 too.Figure 5
Relationships among parameters of CW, CD, and DW comfort level indicators.For home appliancea, if its task is started before or in the time slot tideala+tdelaya, the user will be satisfied; if the task is started in the range of tideala+tdelaya,tmax⁡a-tworka, the task can be completed before the deadline; however, the user’s comfort level will be decreased.It must be pointed out that, according to the comfort level indicators’ definitions, the smaller these indicators, the more comfortable the user. For example, the user is most comfortable whenIHVAC is equal to zero.Based on the above definitions, the user’s overall comfort level during the scheduling horizon is formulated as(27)Fcomfort=∑s1∈Stemp∑s2∈SPVps1ps21NA∑a∈AIas1s2A=HVAC,EWH,PHEV,WM,CD,DW,where Ias1s2 denotes the comfort level indicator value of appliance a in the scenario when outdoor temperature scenario s1 and PV power output scenario s2 occur at the same time and NA is the number of appliances in schedule home appliance set A. Fcomfort is within 0,100. When Fcomfort is zero, the user is most comfortable.


### 3.3. Multiobjective Optimization Model

The multiobjective optimization model for HEMS is formulated as(28)min⁡Fcostmin⁡Fcomforts.t.2,7,(10)–(12),14,(17)–(20).In this model, the working status of HVAC, EWH, and PHEV in each time slot and the task starting times of WM, CD, and DW are decision variables. Minimizing electricity cost and maximizing user comfort level are the two objectives.


## 3.1. Electricity Cost

In this paper, minimizing the overall electricity cost over the next 24 hours (i.e., next day) is one of optimization objectives based on the forecasted outdoor temperature and power output of PV over the next 24 hours, which can be obtained using the corresponding prediction algorithms [30, 31]. However, these algorithms have limitations due to the prediction accuracy. In this study, scenarios are used to capture the uncertainties of forecasted outdoor temperature and power output of the PV. The overall net electricity cost over the scheduling horizon is formulated as (21), which consists of three parts: the first item represents the overall electricity cost of buying electricity from the grid, the second item stands for the degradation cost ($) of the home energy storage battery, and the third item denotes the overall revenue of selling electricity to the grid:(21)Fcost=∑s1∈Stemp∑s2∈SPVps1ps2·∑t=1NslotptG2L,s1s2+ptG2B,s1s2×Δt×ctgrid+∑t=1NslotptP2B,s1s2+ptG2B,s1s2+ptB2L,s1s2+ptB2G,s1s2×Δt×cDegs1s2-∑t=1NslotptP2G,s1s2+ptB2G,s1s2×Δt×ctsell,where stemp and sPV denote the outdoor temperature and PV power output scenario sets, respectively; s1 represents an outdoor temperature scenario and s2 stands for a PV power output scenario; ps1 and ps2 denote the occurrence possibility of scenario s1 and s2, respectively; ctgrid is the electricity price in time slot t when the user buys electricity from the grid; and ctsell is the electricity price in time slot t when the user sells electricity to the grid. ptG2L,s1s2 denotes the power transmitted from the grid to loads in the scenario when s1 and s2 occur at the same time, and other symbols have similar meanings. cDegs1s2 is the battery degradation cost ($/kW·h); the detailed description and calculation method of it can be found in [3].


## 3.2. Comfort Level Indicator for Home Appliances

In practice, a residential user has different concerns for different home appliances. For example, for HVAC and EWH, the user pays more attention to temperature; however, for PHEV, WM, CD, and DW, the user focuses on when the tasks of these appliances are completed. Therefore, a set of comfort level indicators are proposed based on appliance type.


### 3.2.1. HVAC

To quantify a user’s comfort level under the operation of HVAC, this paper proposes a comfort level indicator whose definition is based on the assumption that when the room temperature is equal to the user setting temperature, the user is most comfortable; if the room temperature deviates from the setting value to a certain extent, the user’s comfort level will be decreased [32]. The indicator is calculated as(22)IHVAC=100Nslot∑t=1NslotdtRoomΔTmax⁡Room,where ΔTmax⁡Room=max⁡TsetRoom-Tmin⁡Room,Tmax⁡Room-TsetRoom. dtRoom is determined by(23)dtRoom=TsetRoom-TtRoomTmin⁡Room≤TtRoom<TsetRoom-ΔTLRoom0TsetRoom-ΔTLRoom≤TtRoom≤TsetRoom+ΔTURoomTtRoom-TsetRoomTsetRoom+ΔTURoom<TtRoom≤Tmax⁡RoomΔTmax⁡Roomotherwise,where TsetRoom is the desired indoor temperature set by the user and ΔTLRoom and ΔTURoom are two parameters that are related to the temperature deadband of HVAC and the user’s preference. For example, in summer, the user prefers cool. Consequently, in this case, ΔTLRoom>ΔTURoom>0. According to the definition of IHVAC, it is within 0,100.The relationships among parametersTmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, and ΔTURoom are demonstrated in Figure 3. The indoor temperature horizon is divided into three zones by these parameters: comfortable zone, tolerable zone, and intolerable zone.Figure 3
Relationships among parameters of HVAC comfort level indicator.


### 3.2.2. EWH

The definition of comfort level indicator for EWH is similar to that for HVAC, and it is calculated as(24)IEWH=100Nslot∑t=1NslotdtEWHΔTmax⁡EWH,dtEWH=TsetEWH-TtEWHTmin⁡EWH≤TtEWH<TsetEWH-ΔTLEWH0TsetEWH-ΔTLEWH≤TtEWH≤TsetEWH+ΔTUEWHTtEWH-TsetEWHTsetEWH+ΔTUEWH<TtEWH≤Tmax⁡EWHΔTmax⁡EWHotherwise,where ΔTmax⁡EWH=max⁡TsetEWH-Tmin⁡EWH,Tmax⁡EWH-TsetEWH and TsetEWH, ΔTLEWH, and ΔTUEWH are user setting parameters whose meanings are similar to the parameters of HVAC comfort level indicator. IEWH is in the range of 0,100 too.


### 3.2.3. PHEV

A user’s comfort level about PHEV is determined by the charging finish time. The user is most satisfied in the case where once a PHEV is plugged in and it is kept charging until the PHEV battery SOC reaches the specified value. In reality, the user can tolerate some delay of the charging finish time, which makes the PHEV a flexible load. However, this tolerance is limited; if the delay is too long, the user will be unsatisfied. Based on these facts, the comfort level indicator for PHEV is calculated as(25)IPHEV=dPHEVtend-tplug+tcharge+tdelay×100,dPHEV=0tplug+tcharge≤tfsocPHEV≤tplug+tcharge+tdelaytfsocPHEV-tplug+tcharge+tdelaytfsocPHEV>tplug+tcharge+tdelay,where tplug is the time shot when the PHEV is plugged in; tcharge is the number of time slots that are needed to complete a charging task; tdelay is the maximum tolerant delay of charging completion time in time slot; tfsocPHEV is the time slot in which the PHEV battery SOC reaches the specified value; tend is the last time slot of the scheduling horizon. According to the definition, IPHEV is within 0,100. Figure 4 illustrates the relationships among these parameters.Figure 4
Relationships among parameters of PHEV comfort level indicator.


### 3.2.4. WM, CD, and DW

The comfort level indicators for WM, CD, and DW share the same expression, and they are calculated as(26)Ia=0tmin⁡a≤tstarta≤tideala+tdelayatstarta-tideala+tdelayatmax⁡a-tworka-tideala+tdelaya×100tideala+tdelaya<tstarta≤tmax⁡a-tworkaa∈WM,CD,DW,where tmin⁡a and tmax⁡a specify the valid working interval for appliance a; tideala is the ideal time slot in which the appliance a is started, and it is set by a user; tstarta is the actual starting time slot of appliance a; tworka denotes the number of time slots that are needed by appliance a to complete its task; tdelaya is the tolerant delay of task finish time. The relationships of these parameters are depicted in Figure 5. Ia is in the range of 0,100 too.Figure 5
Relationships among parameters of CW, CD, and DW comfort level indicators.For home appliancea, if its task is started before or in the time slot tideala+tdelaya, the user will be satisfied; if the task is started in the range of tideala+tdelaya,tmax⁡a-tworka, the task can be completed before the deadline; however, the user’s comfort level will be decreased.It must be pointed out that, according to the comfort level indicators’ definitions, the smaller these indicators, the more comfortable the user. For example, the user is most comfortable whenIHVAC is equal to zero.Based on the above definitions, the user’s overall comfort level during the scheduling horizon is formulated as(27)Fcomfort=∑s1∈Stemp∑s2∈SPVps1ps21NA∑a∈AIas1s2A=HVAC,EWH,PHEV,WM,CD,DW,where Ias1s2 denotes the comfort level indicator value of appliance a in the scenario when outdoor temperature scenario s1 and PV power output scenario s2 occur at the same time and NA is the number of appliances in schedule home appliance set A. Fcomfort is within 0,100. When Fcomfort is zero, the user is most comfortable.


## 3.2.1. HVAC

To quantify a user’s comfort level under the operation of HVAC, this paper proposes a comfort level indicator whose definition is based on the assumption that when the room temperature is equal to the user setting temperature, the user is most comfortable; if the room temperature deviates from the setting value to a certain extent, the user’s comfort level will be decreased [32]. The indicator is calculated as(22)IHVAC=100Nslot∑t=1NslotdtRoomΔTmax⁡Room,where ΔTmax⁡Room=max⁡TsetRoom-Tmin⁡Room,Tmax⁡Room-TsetRoom. dtRoom is determined by(23)dtRoom=TsetRoom-TtRoomTmin⁡Room≤TtRoom<TsetRoom-ΔTLRoom0TsetRoom-ΔTLRoom≤TtRoom≤TsetRoom+ΔTURoomTtRoom-TsetRoomTsetRoom+ΔTURoom<TtRoom≤Tmax⁡RoomΔTmax⁡Roomotherwise,where TsetRoom is the desired indoor temperature set by the user and ΔTLRoom and ΔTURoom are two parameters that are related to the temperature deadband of HVAC and the user’s preference. For example, in summer, the user prefers cool. Consequently, in this case, ΔTLRoom>ΔTURoom>0. According to the definition of IHVAC, it is within 0,100.The relationships among parametersTmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, and ΔTURoom are demonstrated in Figure 3. The indoor temperature horizon is divided into three zones by these parameters: comfortable zone, tolerable zone, and intolerable zone.Figure 3
Relationships among parameters of HVAC comfort level indicator.


## 3.2.2. EWH

The definition of comfort level indicator for EWH is similar to that for HVAC, and it is calculated as(24)IEWH=100Nslot∑t=1NslotdtEWHΔTmax⁡EWH,dtEWH=TsetEWH-TtEWHTmin⁡EWH≤TtEWH<TsetEWH-ΔTLEWH0TsetEWH-ΔTLEWH≤TtEWH≤TsetEWH+ΔTUEWHTtEWH-TsetEWHTsetEWH+ΔTUEWH<TtEWH≤Tmax⁡EWHΔTmax⁡EWHotherwise,where ΔTmax⁡EWH=max⁡TsetEWH-Tmin⁡EWH,Tmax⁡EWH-TsetEWH and TsetEWH, ΔTLEWH, and ΔTUEWH are user setting parameters whose meanings are similar to the parameters of HVAC comfort level indicator. IEWH is in the range of 0,100 too.


## 3.2.3. PHEV

A user’s comfort level about PHEV is determined by the charging finish time. The user is most satisfied in the case where once a PHEV is plugged in and it is kept charging until the PHEV battery SOC reaches the specified value. In reality, the user can tolerate some delay of the charging finish time, which makes the PHEV a flexible load. However, this tolerance is limited; if the delay is too long, the user will be unsatisfied. Based on these facts, the comfort level indicator for PHEV is calculated as(25)IPHEV=dPHEVtend-tplug+tcharge+tdelay×100,dPHEV=0tplug+tcharge≤tfsocPHEV≤tplug+tcharge+tdelaytfsocPHEV-tplug+tcharge+tdelaytfsocPHEV>tplug+tcharge+tdelay,where tplug is the time shot when the PHEV is plugged in; tcharge is the number of time slots that are needed to complete a charging task; tdelay is the maximum tolerant delay of charging completion time in time slot; tfsocPHEV is the time slot in which the PHEV battery SOC reaches the specified value; tend is the last time slot of the scheduling horizon. According to the definition, IPHEV is within 0,100. Figure 4 illustrates the relationships among these parameters.Figure 4
Relationships among parameters of PHEV comfort level indicator.


## 3.2.4. WM, CD, and DW

The comfort level indicators for WM, CD, and DW share the same expression, and they are calculated as(26)Ia=0tmin⁡a≤tstarta≤tideala+tdelayatstarta-tideala+tdelayatmax⁡a-tworka-tideala+tdelaya×100tideala+tdelaya<tstarta≤tmax⁡a-tworkaa∈WM,CD,DW,where tmin⁡a and tmax⁡a specify the valid working interval for appliance a; tideala is the ideal time slot in which the appliance a is started, and it is set by a user; tstarta is the actual starting time slot of appliance a; tworka denotes the number of time slots that are needed by appliance a to complete its task; tdelaya is the tolerant delay of task finish time. The relationships of these parameters are depicted in Figure 5. Ia is in the range of 0,100 too.Figure 5
Relationships among parameters of CW, CD, and DW comfort level indicators.For home appliancea, if its task is started before or in the time slot tideala+tdelaya, the user will be satisfied; if the task is started in the range of tideala+tdelaya,tmax⁡a-tworka, the task can be completed before the deadline; however, the user’s comfort level will be decreased.It must be pointed out that, according to the comfort level indicators’ definitions, the smaller these indicators, the more comfortable the user. For example, the user is most comfortable whenIHVAC is equal to zero.Based on the above definitions, the user’s overall comfort level during the scheduling horizon is formulated as(27)Fcomfort=∑s1∈Stemp∑s2∈SPVps1ps21NA∑a∈AIas1s2A=HVAC,EWH,PHEV,WM,CD,DW,where Ias1s2 denotes the comfort level indicator value of appliance a in the scenario when outdoor temperature scenario s1 and PV power output scenario s2 occur at the same time and NA is the number of appliances in schedule home appliance set A. Fcomfort is within 0,100. When Fcomfort is zero, the user is most comfortable.


## 3.3. Multiobjective Optimization Model

The multiobjective optimization model for HEMS is formulated as(28)min⁡Fcostmin⁡Fcomforts.t.2,7,(10)–(12),14,(17)–(20).In this model, the working status of HVAC, EWH, and PHEV in each time slot and the task starting times of WM, CD, and DW are decision variables. Minimizing electricity cost and maximizing user comfort level are the two objectives.


## 4. Algorithm Design

### 4.1. Model Transformation

For simplicity the multiobjective optimization model proposed in Section3.3 is transformed into a single objective optimization model by weighting method:(29)min⁡Ftotal=αFcost+1-αFcomforts.t.2,7,(10)–(12),14,(17)–(20),where α is called user preference factor, 0≤α≤1, through which a user can take a tradeoff between the electricity cost and the comfort level conveniently.To handle the constraints of model (29), the penalty function method is used. Model (29) is further transformed into (30), which is a nonconstraint single objective optimization model and easy to solve:(30)min⁡Ffinal=Ftotal+M·Fviol,where Ffinal is the final objective function, M is a positive figure that is big enough, and Fviol is the overall violation value: (31)Fviol=∑s1∈Stemp∑s2∈SPVps1ps2·∑t=1Nslotmax⁡⁡0,TtRoom-Tmax⁡Room,Tmin⁡Room-TtRoomTmax⁡Room-Tmin⁡Room+∑t=1Nslotmax⁡⁡0,TtEWH-Tmax⁡EWH,Tmin⁡EWH-TtEWHTmax⁡EWH-Tmin⁡EWH+∑t=1Nslotmax⁡⁡0,SOCtPHEV-SOCmax⁡PHEV,SOCmin⁡PHEV-SOCtPHEVSOCmax⁡PHEV-SOCmin⁡PHEV.F
viol only considers constraints (2), (7), and (10). Other constraints can be guaranteed to be satisfied by other methods presented in Section 4.3.Model (30) is solved by an improved high-dimensional hybrid discrete particle swam optimization algorithm presented in the following section.


### 4.2. Improved Particle Swarm Optimization

PSO is originally proposed by Kennedy to solve unconstrained continuous single objective optimization problems [33], and it is a kind of stochastic search algorithms. Due to its simplicity, strong search ability, and robustness, PSO has been explored in depth, many improved PSO algorithms have been proposed in the literature, and its application has not been limited to continuous optimization problems anymore. Algorithms based on PSO have been applied in many engineering optimization fields [34–37]. Therefore, in this paper, an improved PSO is employed to solve the optimization model depicted in (30).Although the basic PSO has many advantages, it has the drawback of premature convergence and local optima [38]. The performance of PSO algorithm can be improved by identifying the particles which fell into local optimal area and performing crossover, mutation, local search, reset, or reinitialization on these particles during operation [39]. For this purpose, [40] assigns a counter for each particle in the population; at each iteration, the fitness value of each particle is compared with the global best particle’s fitness value. If the absolute value of the fitness value difference between a particle and the global best particle is smaller than a predefined threshold, the particle’s counter is increased by 1, and then the counter is checked as to whether it reaches the specified maximum value; if so, the particle’s position and velocity vectors are initialized and the corresponding counter is reset. This method is effective in some cases. However, if the particle which fell into local optimal area is not in the same area with the global best particle that keeps evolving, the absolute value of the fitness value difference may be kept greater than the specified threshold. As a result, the particle which fell into local optimal area cannot be identified.To overcome this problem, a novel “worst particles” identification method is proposed to find out the particles that fell into local optimal area based on the update of each particle’s personal best position vector and the sorted particle fitness values. This method is described as follows.Similar to [40], each particle in the population has a counter. However, different form [40], the counter is used to record the number of iterations in which the particle’s personal best position vector is not updated successively. The counter is named personal-best-update counter and updated as(32)Cik=Cik-1+1Pbestik=Pbestik-10Pbestik≠Pbestik-1,where Ci(k) and Ci(k-1) denote the counter values of particle i at iterations k and k-1, respectively and Pbesti(k) and Pbesti(k-1) are the personal best position vectors of particle i at iterations k and k-1, respectively.After updating each particle’s counter, the particles in the population are sorted decreasingly according to their fitness values. If the optimization is minimization, the smaller the function value is, the greater the fitness value will be. Within the lastNc sorted particles, the particles whose counters are equal to or greater than the specified threshold Cth are selected to create a particle set named worst-particle-set. Λ(k) denotes the worst-particle-set created at iteration k, and the number of the particles in the set is Λ(k), 0≤Λ(k)≤Nc. If Λ(k)=0, the last particle of the sorted particles is selected as the worst particle; if Λ(k)=1, the particle in Λ(k) is selected; if Λ(k)>1, a particle is selected randomly from Λ(k) as the worst particle. Finally, the selected worst particle is initialized and the corresponding counter is reset.


### 4.3. Algorithm Based on Improved Hybrid PSO

Based on the improved PSO algorithm described in Section4.2, a multiobjective optimization algorithm for HEMS is described in this section.In this optimization algorithm, theith decision vector of the optimization model (30) is depicted as(33)Xid=SHVAC,SEWH,SPHEV,Tstart,where(34)SHVAC=S1HVAC,S2HVAC,…,SNslotHVAC;SEWH=S1EWH,S2EWH,…,SNslotEWH;SPHEV=StplugPHEV,Stplug+1PHEV,…,SNslotPHEV;Tstart=tstartCW,tstartCD,tstartDW.As shown,SHVAC, SEWH, and SPHEV are binary vectors, and Tstart is a discrete vector. Therefore, the decision vector Xid is a typical hybrid vector with a dimension of 3Nslot+4-tplug. The dimension is related to the time slot when the PHEV is plugged in. For example, in the case that the scheduling horizon is 24 hours and is evenly divided into 120 time slots (i.e., the length of each time slot is 12 minutes) and the PHEV is plugged in at time slot 91, the dimension of (33) is 273. In this paper, it is assumed that the PHEV can be guaranteed to be plugged in power grid through HEMS during tplug,Nslot.In the algorithm, the position vector of each particle represents a decision vector of model (30). The principal procedure of the proposed multiobjective optimization algorithm for HEMS in smart grid is described as follows.Step 1.
Get electricity price and forecasted weather information of the scheduling horizon from the utility company and the Internet, respectively. Based on the weather forecast information, the power output of PV during the scheduling horizon is predicted.Step 2.
Generate a set of outdoor temperature scenarios and PV power output scenarios using Monte Carlo simulations.Step 3.
Set parameters of PSO, such as population sizeNpop, maximum iteration number kmax⁡, maximum velocity weight wmax⁡, minimum velocity weight wmin⁡, thresholds Cth, and Nc.Step 4.
Set user preference parameters, such as preference factorα, Tmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, ΔTURoom, and tplug.Step 5.
Initialize particle population:(1)
Initialize position vectorXi, velocity vector Vi, and personal best vector Pbesti.(2)
Calculate power distribution vectorsPG2L, PG2B, PP2L, PP2B, PP2G, PB2G, and PB2L based on electricity price, PV power output, and Xi (i.e., [SHVAC,SEWH,SPHEV,Tstart]). Here, PG2L=p1G2L,p2G2L,…,pNslotG2L, and the other power distribution vectors have similar forms. The calculation procedure of these vectors is described in Section 4.4.(3)
Calculate the objective function value according to (30).(4)
After initializing all particles in the population, initialize the global best particle’s position vector.(5)
Reset iteration counterk and personal-best-update counter of each particle.Step 6.
Compute the velocity weightw(k) [38] at iteration k as(35)wk=wmax⁡-kwmax⁡-wmin⁡kmax⁡.Step 7.
For each particle in the population, perform the following operations.(1)
Update the velocity vector as(36)vi,jk+1=wkvi,jk+c1r1pi,j-xi,jk+c2r2pg,j-xi,jk,where vi,j(k) and vi,j(k+1) denote the values of the jth dimension of particle i at iterations k and k+1, respectively; r1 and r2 are two random uniform distribution stochastic variables within 0,1; c1=c2=2 are two learning factors; pi,j is the jth dimension of the personal best vector of particle i; pg,j is the jth dimension of the global best position vector.(2)
Update the position vectorXi.
The first part ofXi, that is, SHVAC,SEWH,SPHEV, is updated as(37)xi,jk+1=1r3<1.01+exp⁡-vi,jk+10otherwisej=1,2,…,3Nslot+1-tplug,where r3 is a random uniform distribution stochastic variable within 0,1.
The second part ofXi, that is, Tstart, is updated as(38)xi,jk+1=xi,jk+vi,jk+1j=3Nslot+2-tplug,…,3Nslot+4-tplug,where the symbol  denotes rounding to zero.(3)
Calculate power distribution vectorsPG2L, PG2B, PP2L, PP2B, PP2G, PB2G, and PB2L.(4)
Calculate the objective function value according to (30).(5)
Update the personal best position vector according to (39) and the personal-best-update counter according to (32):(39)Pbestik+1=Xik+1FfinalXik+1<FfinalPbestikPbestikFfinalXik+1≥FfinalPbestik.(6)
Update the global best position vector:(40)Pgk+1=argmin⁡1≤i≤NpopFfinalPbestik+1.Step 8.
Identify the worst particle which fell into local optimal area as follows:(1)
Create the worst-particle-set following the method described in Section4.2.(2)
Select the worst particle and reinitialize it and reset the corresponding personal-best-update counter.Step 9.
Increase the iteration counter by 1. Check whether the iteration counter reaches the maximum numberkmax⁡ or not. If not, jump to Step 6; if so, continue Step 10.Step 10.
Calculate the electricity cost indicator and comfort level indicator as follows:(1)
Output the global best position vector.(2)
Calculate the power distribution vectors.(3)
Calculate the electricity cost indicator and comfort level indicator according to (21) and (27), respectively. Check whether the user is satisfied with the indicators or not. If not, jump to Step 4; if so, continue Step 11.Step 11.
Control the operations of HVAC, EWH, PHEV, WM, CD, and DW according to the vectorPg, the final global best particle’s position vector. In each time slot, the power distribution among loads, battery, renewable generation, and power grid is determined through the method described in Section 4.4.


### 4.4. Calculation Methods of Power Distribution Vectors

In time slott, the values of ptG2L, ptG2B, ptP2L, ptP2B, ptP2G, ptB2L, and ptB2G are determined following the flowchart shown in Figure 6.Figure 6
Flowchart of power flow vectors calculation method.As shown in Figure6, the power output of PV is supplied to loads first. If there is extra energy, it is used to charge the home energy storage battery or sold to the utility grid for revenue; if the PV power output cannot meet the load demand, the shortage is met by the home energy storage battery or the grid. In this paper, the production cost of PV is assumed to be negligible.c
t
Bat denotes the price of the energy stored in the home energy storage battery in time slot t, its value is determined by charging operation, and it is not affected by discharging. ctBat is calculated as follows [1]:(41)ct+1Bat=ctBat·EtBat+ptG2B·Δt·ctgridEt+1Bat,Et+1Bat=EtBat+ptG2B+ptP2B·Δt·ηchBat,where EtBat and Et+1Bat denote the energy in kW·h stored in the home energy storage battery in time slots t and t+1, respectively.c
t
Bat
,
sell stands for a threshold of grid electricity price in time slot t. If the grid electricity price ctgrid is greater than ctBat,sell, the home energy storage battery is allowed to sell the stored energy to the grid for revenue. ctBat,sell is calculated as(42)ctBat,sell=βsell·max⁡c1grid,c2grid,…,cNslotgrid0<βsell<1.β
sell controls the possibility of selling the energy stored in the home energy storage battery to the grid in time slot t; the smaller βsell is, the greater the possibility will be.c
t
Bat
,
buy is another threshold of grid electricity price in time slot t. If the grid electricity price ctgrid is smaller than ctBat,buy, the home energy storage battery is allowed to buy electricity from the grid for charging. ctBat,buy is calculated as(43)ctBat,buy=βbuy·max⁡ctgrid,ct+1grid,…,cNslotgrid0<βbuy<1.β
buy controls the possibility of buying electricity from the grid to charge the home energy storage battery in time slot t. The greater the βbuy is, the greater the possibility will be.From the algorithm described in Section4.3 and the power distribution vector calculation method presented in this section, it can the said that the constraints of (30), that is, constraints (11)-(12), (14), and (17)–(20), are ensured to be satisfied.


## 4.1. Model Transformation

For simplicity the multiobjective optimization model proposed in Section3.3 is transformed into a single objective optimization model by weighting method:(29)min⁡Ftotal=αFcost+1-αFcomforts.t.2,7,(10)–(12),14,(17)–(20),where α is called user preference factor, 0≤α≤1, through which a user can take a tradeoff between the electricity cost and the comfort level conveniently.To handle the constraints of model (29), the penalty function method is used. Model (29) is further transformed into (30), which is a nonconstraint single objective optimization model and easy to solve:(30)min⁡Ffinal=Ftotal+M·Fviol,where Ffinal is the final objective function, M is a positive figure that is big enough, and Fviol is the overall violation value: (31)Fviol=∑s1∈Stemp∑s2∈SPVps1ps2·∑t=1Nslotmax⁡⁡0,TtRoom-Tmax⁡Room,Tmin⁡Room-TtRoomTmax⁡Room-Tmin⁡Room+∑t=1Nslotmax⁡⁡0,TtEWH-Tmax⁡EWH,Tmin⁡EWH-TtEWHTmax⁡EWH-Tmin⁡EWH+∑t=1Nslotmax⁡⁡0,SOCtPHEV-SOCmax⁡PHEV,SOCmin⁡PHEV-SOCtPHEVSOCmax⁡PHEV-SOCmin⁡PHEV.F
viol only considers constraints (2), (7), and (10). Other constraints can be guaranteed to be satisfied by other methods presented in Section 4.3.Model (30) is solved by an improved high-dimensional hybrid discrete particle swam optimization algorithm presented in the following section.


## 4.2. Improved Particle Swarm Optimization

PSO is originally proposed by Kennedy to solve unconstrained continuous single objective optimization problems [33], and it is a kind of stochastic search algorithms. Due to its simplicity, strong search ability, and robustness, PSO has been explored in depth, many improved PSO algorithms have been proposed in the literature, and its application has not been limited to continuous optimization problems anymore. Algorithms based on PSO have been applied in many engineering optimization fields [34–37]. Therefore, in this paper, an improved PSO is employed to solve the optimization model depicted in (30).Although the basic PSO has many advantages, it has the drawback of premature convergence and local optima [38]. The performance of PSO algorithm can be improved by identifying the particles which fell into local optimal area and performing crossover, mutation, local search, reset, or reinitialization on these particles during operation [39]. For this purpose, [40] assigns a counter for each particle in the population; at each iteration, the fitness value of each particle is compared with the global best particle’s fitness value. If the absolute value of the fitness value difference between a particle and the global best particle is smaller than a predefined threshold, the particle’s counter is increased by 1, and then the counter is checked as to whether it reaches the specified maximum value; if so, the particle’s position and velocity vectors are initialized and the corresponding counter is reset. This method is effective in some cases. However, if the particle which fell into local optimal area is not in the same area with the global best particle that keeps evolving, the absolute value of the fitness value difference may be kept greater than the specified threshold. As a result, the particle which fell into local optimal area cannot be identified.To overcome this problem, a novel “worst particles” identification method is proposed to find out the particles that fell into local optimal area based on the update of each particle’s personal best position vector and the sorted particle fitness values. This method is described as follows.Similar to [40], each particle in the population has a counter. However, different form [40], the counter is used to record the number of iterations in which the particle’s personal best position vector is not updated successively. The counter is named personal-best-update counter and updated as(32)Cik=Cik-1+1Pbestik=Pbestik-10Pbestik≠Pbestik-1,where Ci(k) and Ci(k-1) denote the counter values of particle i at iterations k and k-1, respectively and Pbesti(k) and Pbesti(k-1) are the personal best position vectors of particle i at iterations k and k-1, respectively.After updating each particle’s counter, the particles in the population are sorted decreasingly according to their fitness values. If the optimization is minimization, the smaller the function value is, the greater the fitness value will be. Within the lastNc sorted particles, the particles whose counters are equal to or greater than the specified threshold Cth are selected to create a particle set named worst-particle-set. Λ(k) denotes the worst-particle-set created at iteration k, and the number of the particles in the set is Λ(k), 0≤Λ(k)≤Nc. If Λ(k)=0, the last particle of the sorted particles is selected as the worst particle; if Λ(k)=1, the particle in Λ(k) is selected; if Λ(k)>1, a particle is selected randomly from Λ(k) as the worst particle. Finally, the selected worst particle is initialized and the corresponding counter is reset.


## 4.3. Algorithm Based on Improved Hybrid PSO

Based on the improved PSO algorithm described in Section4.2, a multiobjective optimization algorithm for HEMS is described in this section.In this optimization algorithm, theith decision vector of the optimization model (30) is depicted as(33)Xid=SHVAC,SEWH,SPHEV,Tstart,where(34)SHVAC=S1HVAC,S2HVAC,…,SNslotHVAC;SEWH=S1EWH,S2EWH,…,SNslotEWH;SPHEV=StplugPHEV,Stplug+1PHEV,…,SNslotPHEV;Tstart=tstartCW,tstartCD,tstartDW.As shown,SHVAC, SEWH, and SPHEV are binary vectors, and Tstart is a discrete vector. Therefore, the decision vector Xid is a typical hybrid vector with a dimension of 3Nslot+4-tplug. The dimension is related to the time slot when the PHEV is plugged in. For example, in the case that the scheduling horizon is 24 hours and is evenly divided into 120 time slots (i.e., the length of each time slot is 12 minutes) and the PHEV is plugged in at time slot 91, the dimension of (33) is 273. In this paper, it is assumed that the PHEV can be guaranteed to be plugged in power grid through HEMS during tplug,Nslot.In the algorithm, the position vector of each particle represents a decision vector of model (30). The principal procedure of the proposed multiobjective optimization algorithm for HEMS in smart grid is described as follows.Step 1.
Get electricity price and forecasted weather information of the scheduling horizon from the utility company and the Internet, respectively. Based on the weather forecast information, the power output of PV during the scheduling horizon is predicted.Step 2.
Generate a set of outdoor temperature scenarios and PV power output scenarios using Monte Carlo simulations.Step 3.
Set parameters of PSO, such as population sizeNpop, maximum iteration number kmax⁡, maximum velocity weight wmax⁡, minimum velocity weight wmin⁡, thresholds Cth, and Nc.Step 4.
Set user preference parameters, such as preference factorα, Tmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, ΔTURoom, and tplug.Step 5.
Initialize particle population:(1)
Initialize position vectorXi, velocity vector Vi, and personal best vector Pbesti.(2)
Calculate power distribution vectorsPG2L, PG2B, PP2L, PP2B, PP2G, PB2G, and PB2L based on electricity price, PV power output, and Xi (i.e., [SHVAC,SEWH,SPHEV,Tstart]). Here, PG2L=p1G2L,p2G2L,…,pNslotG2L, and the other power distribution vectors have similar forms. The calculation procedure of these vectors is described in Section 4.4.(3)
Calculate the objective function value according to (30).(4)
After initializing all particles in the population, initialize the global best particle’s position vector.(5)
Reset iteration counterk and personal-best-update counter of each particle.Step 6.
Compute the velocity weightw(k) [38] at iteration k as(35)wk=wmax⁡-kwmax⁡-wmin⁡kmax⁡.Step 7.
For each particle in the population, perform the following operations.(1)
Update the velocity vector as(36)vi,jk+1=wkvi,jk+c1r1pi,j-xi,jk+c2r2pg,j-xi,jk,where vi,j(k) and vi,j(k+1) denote the values of the jth dimension of particle i at iterations k and k+1, respectively; r1 and r2 are two random uniform distribution stochastic variables within 0,1; c1=c2=2 are two learning factors; pi,j is the jth dimension of the personal best vector of particle i; pg,j is the jth dimension of the global best position vector.(2)
Update the position vectorXi.
The first part ofXi, that is, SHVAC,SEWH,SPHEV, is updated as(37)xi,jk+1=1r3<1.01+exp⁡-vi,jk+10otherwisej=1,2,…,3Nslot+1-tplug,where r3 is a random uniform distribution stochastic variable within 0,1.
The second part ofXi, that is, Tstart, is updated as(38)xi,jk+1=xi,jk+vi,jk+1j=3Nslot+2-tplug,…,3Nslot+4-tplug,where the symbol  denotes rounding to zero.(3)
Calculate power distribution vectorsPG2L, PG2B, PP2L, PP2B, PP2G, PB2G, and PB2L.(4)
Calculate the objective function value according to (30).(5)
Update the personal best position vector according to (39) and the personal-best-update counter according to (32):(39)Pbestik+1=Xik+1FfinalXik+1<FfinalPbestikPbestikFfinalXik+1≥FfinalPbestik.(6)
Update the global best position vector:(40)Pgk+1=argmin⁡1≤i≤NpopFfinalPbestik+1.Step 8.
Identify the worst particle which fell into local optimal area as follows:(1)
Create the worst-particle-set following the method described in Section4.2.(2)
Select the worst particle and reinitialize it and reset the corresponding personal-best-update counter.Step 9.
Increase the iteration counter by 1. Check whether the iteration counter reaches the maximum numberkmax⁡ or not. If not, jump to Step 6; if so, continue Step 10.Step 10.
Calculate the electricity cost indicator and comfort level indicator as follows:(1)
Output the global best position vector.(2)
Calculate the power distribution vectors.(3)
Calculate the electricity cost indicator and comfort level indicator according to (21) and (27), respectively. Check whether the user is satisfied with the indicators or not. If not, jump to Step 4; if so, continue Step 11.Step 11.
Control the operations of HVAC, EWH, PHEV, WM, CD, and DW according to the vectorPg, the final global best particle’s position vector. In each time slot, the power distribution among loads, battery, renewable generation, and power grid is determined through the method described in Section 4.4.


## 4.4. Calculation Methods of Power Distribution Vectors

In time slott, the values of ptG2L, ptG2B, ptP2L, ptP2B, ptP2G, ptB2L, and ptB2G are determined following the flowchart shown in Figure 6.Figure 6
Flowchart of power flow vectors calculation method.As shown in Figure6, the power output of PV is supplied to loads first. If there is extra energy, it is used to charge the home energy storage battery or sold to the utility grid for revenue; if the PV power output cannot meet the load demand, the shortage is met by the home energy storage battery or the grid. In this paper, the production cost of PV is assumed to be negligible.c
t
Bat denotes the price of the energy stored in the home energy storage battery in time slot t, its value is determined by charging operation, and it is not affected by discharging. ctBat is calculated as follows [1]:(41)ct+1Bat=ctBat·EtBat+ptG2B·Δt·ctgridEt+1Bat,Et+1Bat=EtBat+ptG2B+ptP2B·Δt·ηchBat,where EtBat and Et+1Bat denote the energy in kW·h stored in the home energy storage battery in time slots t and t+1, respectively.c
t
Bat
,
sell stands for a threshold of grid electricity price in time slot t. If the grid electricity price ctgrid is greater than ctBat,sell, the home energy storage battery is allowed to sell the stored energy to the grid for revenue. ctBat,sell is calculated as(42)ctBat,sell=βsell·max⁡c1grid,c2grid,…,cNslotgrid0<βsell<1.β
sell controls the possibility of selling the energy stored in the home energy storage battery to the grid in time slot t; the smaller βsell is, the greater the possibility will be.c
t
Bat
,
buy is another threshold of grid electricity price in time slot t. If the grid electricity price ctgrid is smaller than ctBat,buy, the home energy storage battery is allowed to buy electricity from the grid for charging. ctBat,buy is calculated as(43)ctBat,buy=βbuy·max⁡ctgrid,ct+1grid,…,cNslotgrid0<βbuy<1.β
buy controls the possibility of buying electricity from the grid to charge the home energy storage battery in time slot t. The greater the βbuy is, the greater the possibility will be.From the algorithm described in Section4.3 and the power distribution vector calculation method presented in this section, it can the said that the constraints of (30), that is, constraints (11)-(12), (14), and (17)–(20), are ensured to be satisfied.


## 5. Case Studies

In this section, to validate the effectiveness of the algorithm proposed in this paper, simulations were performed extensively. All simulation programs were coded in C language in the environment of Microsoft Visual Studio 2008 and were run on a Windows 7 (32 bit) Intel Core i7-3540 M@3.00 GHz computer with an 8.00 GB memory.


### 5.1. Input Data and Parameter Setting

The scheduling horizon is 24 hours, and it is divided evenly into 120 time slots with each time slot being 12 minutes; that is,Nslot=120, Δt=0.2 h.The data of real-time electricity price and outdoor temperature from [41], hot water usage from [42], and critical load from [43] are utilized. The electricity price, outdoor temperature, hot water usage, and critical load are shown in Figures 7, 8, 9, and 10, respectively.Figure 7
Electricity price.Figure 8
Forecasted outdoor temperature.Figure 9
Hot water usage profile.Figure 10
Critical load profile.In this paper, it is assumed that the capacity of the PV system in Figure1 is 5.75 kW and the PV power output during scheduling horizon is as shown in Figure 11. In each time slot, the price of selling electricity to the power grid by a user, ctsell, is assumed to be equal to the price that he/she pays for buying electricity from the grid, ctgrid.Figure 11
Forecasted PV power output.Based on the forecasted outdoor temperature and PV power output, two sets of stochastic scenarios were generated which are shown in Figures12 and 13, respectively.Figure 12
Scenarios of outdoor temperature over scheduling horizon.Figure 13
Scenarios of PV power output over scheduling horizon.The parameters of house and HVAC of [24] are used in this paper, which are listed in Table 1.Table 1
Parameter of the house under study.
Parameter
Value
Unit
House size
2000 + 500 basement
ft2
A
floor, Aceiling, Awall, and Awindow (the area of the floor, ceiling, wall, and window)
2000, 2000, 2600, 520
ft2
R
ceiling, Rwall, and Rwindow (the heat resistance of the ceiling, wall, and window)
49, 13, 2
ft2∗°F/(Btu/h)
C
HVAC (capacity of the AC unit)
34,000
Btu/hConsequently, in model (1), Gt=500.82×(TtOutdoor-TtRoom) (Btu/h) where TtOutdoor is the outdoor temperature in time slot t, Δc=3400.08 (Btu/°F), Δt=0.2 h, and the rated power is 2.352 (kW). The user preference parameters about HVAC Tmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, and ΔTURoom are 72, 80, 76, 3, and 2 (°F), respectively.The parameters of EWH are as follows. The volume of EWH tank is 50 gallons,GEWH is 1.0 (Btu/(h∗°F)), C is 419.88 (Btu/°F), the rated power is 4.5 (kW), TtEWH,env is equal to TtRoom, and TtEWH,in is 60 (°F). The user preference parameters Tmin⁡EWH, Tmax⁡EWH, TsetEWH, ΔTLEWH, and ΔTUEWH are 108, 122, 115, 3, and 3 (°F), respectively.As for the PHEV,CsizePHEV is 16 (kW·h), SOC0PHEV is 0.5, PPHEV is 3.3 (kW), and SOCmin⁡PHEV, SOCmax⁡PHEV, and SOCfinalPHEV are 0.2, 0.95, and 0.85, respectively. It is assumed that the PHEV is plugged in the grid in time slot 91; that is, tplug=91. tcharge is 9, tdelay is 3, and tend=Nslot=120.The parameters of WM, CD, and DW are listed in Table2.Table 2
Parameter setting of CW, CD, and DW.
Parameter
CW
CD
DW
t
min
⁡
a (time slot)
46
96
46
t
max
⁡
a (time slot)
95
120
105
t
ideal
a (time slot)
60
100
70
t
work
a (time slots)
5
10
5
t
delay
a (time slots)
5
5
5
Rated power (kW)
0.5
4
1As for the home energy storage battery, the rated battery capacityCsizeBat is 13.44 (kW·h), E0Bat is 6.72 (kW·h), SOCmin⁡Bat is 0.2, SOCmax⁡Bat is 1. Pmax⁡Bat,ch=Pmax⁡Bat,disch=2.0 (kW), and ηchBat=ηdischBat=0.9. It is assumed that the battery is lead-acid battery; the capital cost is 2176 ($). The degradation cost function coefficients in [44] are used.As described in Section4.4, βsell and βbuy are two important parameters that affect the power distributions between the grid and home energy storage battery. In the simulations, they are 0.6 and 0.8, respectively.The parameters of PSO are as follows. The population sizeNpop is 30 and the maximum iteration number kmax⁡ is 3000. wmin⁡, wmax⁡, Cth, and Nc are 0.2, 0.9, 20, and 5, respectively. According to the values of Nslot and tplug, the dimension of position vector and velocity vector of each particle is 273.


### 5.2. Case Description

For comparison, different cases were studied, and the input data and parameter setting in all cases are the same as those presented in Section5.1. These cases are summarized as follows.Case 1.
It is the multiobjective optimization algorithm for HEMS proposed in this paper, and the scheduling objects are PHEV, EWH, PHEV, WM, CD, DW, and home energy storage battery. In this case, the user has the ability to sell electricity to the grid for revenue. The power distributions among grid, loads, PV, and battery are demonstrated in Figure2.Case 2.
It is a single objective optimization algorithm that minimizes the electricity cost. Other aspects of Case2 are the same as those in Case 1.Case 3.
It is a single objective optimization algorithm that minimizes the electricity cost too. However, the user does not have the ability to sell electricity to the grid for revenue. The home energy storage battery is used to store the excessive energy generated by the PV. In this case, if the power output from PV is greater than the sum of load demand and the charging power of home energy storage battery, the excessive energy will be discarded.Case 4.
This case is similar to Case3 except that, in this case, the operations of home appliances are not optimally scheduled by any algorithm and the user uses these appliances without considering the electricity price, PV power output, and forecasted outdoor temperature.


### 5.3. Cost and Comfort Level

The simulation results of these four cases are listed in Table3.Table 3
Simulation results of different cases.
Case
Purchase cost (cents)
Battery cost (cents)
Sales revenue (cents)
Net cost (cents)
Comfort level
Case1
84.67
108.89
57.29
136.27
24.87
Case2
77.90
107.41
58.67
126.35
36.77
Case3
68.82
80.79
—
149.61
34.13
Case4
102.35
80.70
—
183.05
0.0For Cases1, 2, and 3, the algorithms were run independently 30 times with different initializations. The results presented in Table 2 are the average values of different runs. For Case 1, the user preference factor α is 0.5.From Table3, we can see that the user is most comfortable in Case 4. However, in this case, the user’s net electricity cost is the highest because of not considering the electricity price and PV power output. During the operations of the PHEV and CD, the electricity price is high and the PV power output is low, which increases the electricity cost. The power from PV is supplied to the loads and the home energy storage battery. When the PV power output is high (e.g., time slots 60–90), the excessive power is discarded due to the inability to sell electricity to the utility grid for revenue. Therefore, the PV utilization efficiency is very low.In Case3, the schedulable home appliances and the home energy storage battery are optimally scheduled according to electricity price, PV power output, forecasted outdoor temperature, and user preferences. The power consumption on peak hours is shifted to off-peak hours or hours when the PV power output is high, more demand of loads is met by the PV, and the PV utilization efficiency is improved significantly. As a result, the amount of electricity purchased from the grid and the overall net cost are reduced. Compared with Case 4, the electricity purchase cost and net cost of Case 3 are reduced by 32.76% and 18.27%, respectively, at the cost of user comfort level.In Cases1 and 2, the user has the ability to sell electricity to grid for revenue. Therefore, the excessive power of PV can be sold to the utility grid, and there is no power wasted. In addition, the home energy storage battery can absorb electricity from the grid when the electricity price is low and supply the stored energy to loads or sell back to the utility grid for profit when the electricity price is high. These two factors contribute to overall net cost reduction. On the other hand, because the home energy storage battery absorbs electricity from the grid, the costs of purchasing electricity from the grid in Cases 2 and 1 are higher than that of Case 3. Meanwhile, more energy is charged to or discharged from the home energy storage battery; therefore, the battery degradation costs in the two cases are higher than those in Cases 3 and 4. However, due to the gain of selling electricity to the utility grid, compared with Case 3, the net costs of Cases 2 and 1 are reduced by 15.55% and 8.92%, respectively. Consequently, we can say that the framework of HEMS proposed in this paper is better than other frameworks that only include parts of these components or without the ability to sell electricity to the utility grid.Compared with Case2, the net cost of Case 1 is increased by 7.85%. However, the comfort level of Case 1 is improved by 32.36%. Besides this improvement, in Case 1, the user can take a tradeoff between the electricity cost and comfort level through the preference factor α conveniently, and the user’s comfort level is quantified. Based on these results, we can conclude that the multiobjective optimization algorithm proposed in this paper is superior to the single objective algorithms in Cases 2, 3, and 4.


### 5.4. Operation States of Schedulable Home Appliances

When the forecasted outdoor temperature scenario iss6 and PV power output scenario is s8, the operation states of schedulable home appliances under the control of the algorithm proposed in this paper are shown in Figure 14.Figure 14
Operation states of schedulable home appliances.
(a)
Room temperature
(b)
Water temperature in tank of EWH
(c)
Charging power of PHEV
(d)
PHEV battery SOC
(e)
CW power
(f)
CD power
(g)
DW powerAs shown in Figure14, the temperatures of room and water in the tank of EWH are within their prespecified ranges. Most charge power for PHEV is shifted from high price hours to low price hours, and the final SOC of the PHEV battery has reached the specified value. WM, CD, and DW finish their tasks before their deadlines.


### 5.5. Power Distributions among Grid, Load, PV, and Battery

When the operation states of schedulable home appliances are as shown in Figure14, the corresponding power distributions among grid, load, PV, and battery are demonstrated as follows.The power distributions between the grid and the home energy storage battery are shown in Figure15.Figure 15
Power distributions between the grid and the home energy storage battery.
(a)
Power transmitted from grid to battery
(b)
Power transmitted from battery to gridFrom Figure15 we can find that when the electricity price is low, that is, between time slot 1 and time slot 62, the home energy storage battery absorbs electricity from the grid; when the price is high, that is, between time slot 63 and time slot 110, it sells the stored electricity to the grid for profit.The SOC, charging power, and discharging power of the home energy storage battery are shown in Figure16.Figure 16
SOC, charging power, and discharging power of the home energy storage battery.
(a)
Battery SOC
(b)
Charging power of battery
(c)
Discharging power of batteryFigure16 shows that the SOC of the home energy storage battery is within the specified range during the scheduling horizon. Between time slot 1 and time slot 62, most charging power is from grid; between time slot 63 and time slot 95, most charging power is from PV. Before time slot 50, the power discharged from the home energy storage battery is supplied to loads; between time slots 51 and 120 and the discharged power is supplied to loads and sold to the grid.Figure17 displays the power distributions from PV to loads, battery, and grid.Figure 17
Power distributions from PV to loads, battery, and grid.
(a)
Power output of PV
(b)
Power transmitted from PV to loads
(c)
Power transmitted from PV to battery
(d)
Power transmitted from PV to gridFigure18 depicts the power distribution that is transmitted from the grid to HEMS, that is, the power that is purchased by the user in each time slot.Figure 18
Purchased power from grid.As shown in Figure18, HEMS purchases electricity from the utility grid when the electricity price is low. When the price is high, the amount of electricity purchased from the utility grid is reduced or even does not buy electricity any more. For example, from time slot 61 to time slot 90, HEMS does not buy electricity from the grid because of the high electricity price.


### 5.6. Parameter Analysis

To demonstrate the effect of preference factor to optimization results, the input data and other parameters are kept the same as those in Case1, and the multiobjective optimization algorithm was run with different preference factors. The optimization results are shown in Figure 19.Figure 19
Relationship between optimization results and preference factor.As shown in Figure19, when the user preference factor increases from 0 to 1, the electricity cost decreases from 169.18 cents to 126.34 cents and the comfort level indicator increases from 13.55 to 36.77. In other words, with the increase of preference factor, the electricity cost increases and the user feels less comfortable.The optimization algorithm runs with differentβsell while the other parameters and input data are kept the same as those in Case 1. Figure 20 shows the relationship between the total energy that is transmitted from battery to the grid and βsell.Figure 20
Relationship between total energy transmitted from the home energy storage battery to grid andβsell.As shown in Figure20, with the increase of βsell, the total amount of energy that is transmitted from the home energy storage battery to grid decreases. The reason is that the greater βsell decreases the possibility of selling the stored energy to the grid for revenue.Figure21 depicts the relationship between the total energy that is transmitted from the grid to the home energy storage battery and βbuy.Figure 21
Relationship between total energy transmitted from the grid to the home energy storage battery andβbuy.As shown in Figure21, with the increase of βbuy, the total amount energy that is transmitted from the grid to the home energy storage battery increases. The reason is that greater βbuy means more chances of buying electricity from the grid to charge the home energy storage battery when the electricity price is low.


### 5.7. Runtime and Robustness of Algorithm

The parameters and input data were kept as described in Section5.1, and the maximum iteration number was set to 3000. The algorithms in Cases 1, 2, and 3 were run 30 times, respectively, and the statistics of runtime and final fitness value were obtained. The results are displayed in Table 4.Table 4
Statistics of runtime and fitness value.
Case
Parameter
Minimum
Maximum
Mean
Standard deviation
Case1
Runtime (s)
81.9630
83.1010
82.4493
0.3515
Fitness value
78.4738
82.1968
80.5712
1.2511
Case2
Runtime (s)
81.0580
81.9160
81.5070
0.3689
Fitness value
121.7943
129.1096
126.3472
2.3401
Case3
Runtime (s)
28.1420
28.9380
28.3093
0.2702
Fitness value
147.4412
153.5338
149.6107
2.1340As presented in Table4, the runtimes in Cases 1 and 2 are longer than that in Case 3. The reason is that the former two cases need to determine the power distribution among loads, PV, battery, and grid through the method described in Section 4.4. Because the proposed multiobjective optimization algorithm for HEMS is an offline optimization algorithm, the runtime is acceptable for practical applications. In fact, compared to the algorithm in [1], it is very fast. In addition, from the standard deviations of runtime and fitness value in Table 4, we can say that the proposed algorithm is robust enough for application.


## 5.1. Input Data and Parameter Setting

The scheduling horizon is 24 hours, and it is divided evenly into 120 time slots with each time slot being 12 minutes; that is,Nslot=120, Δt=0.2 h.The data of real-time electricity price and outdoor temperature from [41], hot water usage from [42], and critical load from [43] are utilized. The electricity price, outdoor temperature, hot water usage, and critical load are shown in Figures 7, 8, 9, and 10, respectively.Figure 7
Electricity price.Figure 8
Forecasted outdoor temperature.Figure 9
Hot water usage profile.Figure 10
Critical load profile.In this paper, it is assumed that the capacity of the PV system in Figure1 is 5.75 kW and the PV power output during scheduling horizon is as shown in Figure 11. In each time slot, the price of selling electricity to the power grid by a user, ctsell, is assumed to be equal to the price that he/she pays for buying electricity from the grid, ctgrid.Figure 11
Forecasted PV power output.Based on the forecasted outdoor temperature and PV power output, two sets of stochastic scenarios were generated which are shown in Figures12 and 13, respectively.Figure 12
Scenarios of outdoor temperature over scheduling horizon.Figure 13
Scenarios of PV power output over scheduling horizon.The parameters of house and HVAC of [24] are used in this paper, which are listed in Table 1.Table 1
Parameter of the house under study.
Parameter
Value
Unit
House size
2000 + 500 basement
ft2
A
floor, Aceiling, Awall, and Awindow (the area of the floor, ceiling, wall, and window)
2000, 2000, 2600, 520
ft2
R
ceiling, Rwall, and Rwindow (the heat resistance of the ceiling, wall, and window)
49, 13, 2
ft2∗°F/(Btu/h)
C
HVAC (capacity of the AC unit)
34,000
Btu/hConsequently, in model (1), Gt=500.82×(TtOutdoor-TtRoom) (Btu/h) where TtOutdoor is the outdoor temperature in time slot t, Δc=3400.08 (Btu/°F), Δt=0.2 h, and the rated power is 2.352 (kW). The user preference parameters about HVAC Tmin⁡Room, Tmax⁡Room, TsetRoom, ΔTLRoom, and ΔTURoom are 72, 80, 76, 3, and 2 (°F), respectively.The parameters of EWH are as follows. The volume of EWH tank is 50 gallons,GEWH is 1.0 (Btu/(h∗°F)), C is 419.88 (Btu/°F), the rated power is 4.5 (kW), TtEWH,env is equal to TtRoom, and TtEWH,in is 60 (°F). The user preference parameters Tmin⁡EWH, Tmax⁡EWH, TsetEWH, ΔTLEWH, and ΔTUEWH are 108, 122, 115, 3, and 3 (°F), respectively.As for the PHEV,CsizePHEV is 16 (kW·h), SOC0PHEV is 0.5, PPHEV is 3.3 (kW), and SOCmin⁡PHEV, SOCmax⁡PHEV, and SOCfinalPHEV are 0.2, 0.95, and 0.85, respectively. It is assumed that the PHEV is plugged in the grid in time slot 91; that is, tplug=91. tcharge is 9, tdelay is 3, and tend=Nslot=120.The parameters of WM, CD, and DW are listed in Table2.Table 2
Parameter setting of CW, CD, and DW.
Parameter
CW
CD
DW
t
min
⁡
a (time slot)
46
96
46
t
max
⁡
a (time slot)
95
120
105
t
ideal
a (time slot)
60
100
70
t
work
a (time slots)
5
10
5
t
delay
a (time slots)
5
5
5
Rated power (kW)
0.5
4
1As for the home energy storage battery, the rated battery capacityCsizeBat is 13.44 (kW·h), E0Bat is 6.72 (kW·h), SOCmin⁡Bat is 0.2, SOCmax⁡Bat is 1. Pmax⁡Bat,ch=Pmax⁡Bat,disch=2.0 (kW), and ηchBat=ηdischBat=0.9. It is assumed that the battery is lead-acid battery; the capital cost is 2176 ($). The degradation cost function coefficients in [44] are used.As described in Section4.4, βsell and βbuy are two important parameters that affect the power distributions between the grid and home energy storage battery. In the simulations, they are 0.6 and 0.8, respectively.The parameters of PSO are as follows. The population sizeNpop is 30 and the maximum iteration number kmax⁡ is 3000. wmin⁡, wmax⁡, Cth, and Nc are 0.2, 0.9, 20, and 5, respectively. According to the values of Nslot and tplug, the dimension of position vector and velocity vector of each particle is 273.


## 5.2. Case Description

For comparison, different cases were studied, and the input data and parameter setting in all cases are the same as those presented in Section5.1. These cases are summarized as follows.Case 1.
It is the multiobjective optimization algorithm for HEMS proposed in this paper, and the scheduling objects are PHEV, EWH, PHEV, WM, CD, DW, and home energy storage battery. In this case, the user has the ability to sell electricity to the grid for revenue. The power distributions among grid, loads, PV, and battery are demonstrated in Figure2.Case 2.
It is a single objective optimization algorithm that minimizes the electricity cost. Other aspects of Case2 are the same as those in Case 1.Case 3.
It is a single objective optimization algorithm that minimizes the electricity cost too. However, the user does not have the ability to sell electricity to the grid for revenue. The home energy storage battery is used to store the excessive energy generated by the PV. In this case, if the power output from PV is greater than the sum of load demand and the charging power of home energy storage battery, the excessive energy will be discarded.Case 4.
This case is similar to Case3 except that, in this case, the operations of home appliances are not optimally scheduled by any algorithm and the user uses these appliances without considering the electricity price, PV power output, and forecasted outdoor temperature.


## 5.3. Cost and Comfort Level

The simulation results of these four cases are listed in Table3.Table 3
Simulation results of different cases.
Case
Purchase cost (cents)
Battery cost (cents)
Sales revenue (cents)
Net cost (cents)
Comfort level
Case1
84.67
108.89
57.29
136.27
24.87
Case2
77.90
107.41
58.67
126.35
36.77
Case3
68.82
80.79
—
149.61
34.13
Case4
102.35
80.70
—
183.05
0.0For Cases1, 2, and 3, the algorithms were run independently 30 times with different initializations. The results presented in Table 2 are the average values of different runs. For Case 1, the user preference factor α is 0.5.From Table3, we can see that the user is most comfortable in Case 4. However, in this case, the user’s net electricity cost is the highest because of not considering the electricity price and PV power output. During the operations of the PHEV and CD, the electricity price is high and the PV power output is low, which increases the electricity cost. The power from PV is supplied to the loads and the home energy storage battery. When the PV power output is high (e.g., time slots 60–90), the excessive power is discarded due to the inability to sell electricity to the utility grid for revenue. Therefore, the PV utilization efficiency is very low.In Case3, the schedulable home appliances and the home energy storage battery are optimally scheduled according to electricity price, PV power output, forecasted outdoor temperature, and user preferences. The power consumption on peak hours is shifted to off-peak hours or hours when the PV power output is high, more demand of loads is met by the PV, and the PV utilization efficiency is improved significantly. As a result, the amount of electricity purchased from the grid and the overall net cost are reduced. Compared with Case 4, the electricity purchase cost and net cost of Case 3 are reduced by 32.76% and 18.27%, respectively, at the cost of user comfort level.In Cases1 and 2, the user has the ability to sell electricity to grid for revenue. Therefore, the excessive power of PV can be sold to the utility grid, and there is no power wasted. In addition, the home energy storage battery can absorb electricity from the grid when the electricity price is low and supply the stored energy to loads or sell back to the utility grid for profit when the electricity price is high. These two factors contribute to overall net cost reduction. On the other hand, because the home energy storage battery absorbs electricity from the grid, the costs of purchasing electricity from the grid in Cases 2 and 1 are higher than that of Case 3. Meanwhile, more energy is charged to or discharged from the home energy storage battery; therefore, the battery degradation costs in the two cases are higher than those in Cases 3 and 4. However, due to the gain of selling electricity to the utility grid, compared with Case 3, the net costs of Cases 2 and 1 are reduced by 15.55% and 8.92%, respectively. Consequently, we can say that the framework of HEMS proposed in this paper is better than other frameworks that only include parts of these components or without the ability to sell electricity to the utility grid.Compared with Case2, the net cost of Case 1 is increased by 7.85%. However, the comfort level of Case 1 is improved by 32.36%. Besides this improvement, in Case 1, the user can take a tradeoff between the electricity cost and comfort level through the preference factor α conveniently, and the user’s comfort level is quantified. Based on these results, we can conclude that the multiobjective optimization algorithm proposed in this paper is superior to the single objective algorithms in Cases 2, 3, and 4.


## 5.4. Operation States of Schedulable Home Appliances

When the forecasted outdoor temperature scenario iss6 and PV power output scenario is s8, the operation states of schedulable home appliances under the control of the algorithm proposed in this paper are shown in Figure 14.Figure 14
Operation states of schedulable home appliances.
(a)
Room temperature
(b)
Water temperature in tank of EWH
(c)
Charging power of PHEV
(d)
PHEV battery SOC
(e)
CW power
(f)
CD power
(g)
DW powerAs shown in Figure14, the temperatures of room and water in the tank of EWH are within their prespecified ranges. Most charge power for PHEV is shifted from high price hours to low price hours, and the final SOC of the PHEV battery has reached the specified value. WM, CD, and DW finish their tasks before their deadlines.


## 5.5. Power Distributions among Grid, Load, PV, and Battery

When the operation states of schedulable home appliances are as shown in Figure14, the corresponding power distributions among grid, load, PV, and battery are demonstrated as follows.The power distributions between the grid and the home energy storage battery are shown in Figure15.Figure 15
Power distributions between the grid and the home energy storage battery.
(a)
Power transmitted from grid to battery
(b)
Power transmitted from battery to gridFrom Figure15 we can find that when the electricity price is low, that is, between time slot 1 and time slot 62, the home energy storage battery absorbs electricity from the grid; when the price is high, that is, between time slot 63 and time slot 110, it sells the stored electricity to the grid for profit.The SOC, charging power, and discharging power of the home energy storage battery are shown in Figure16.Figure 16
SOC, charging power, and discharging power of the home energy storage battery.
(a)
Battery SOC
(b)
Charging power of battery
(c)
Discharging power of batteryFigure16 shows that the SOC of the home energy storage battery is within the specified range during the scheduling horizon. Between time slot 1 and time slot 62, most charging power is from grid; between time slot 63 and time slot 95, most charging power is from PV. Before time slot 50, the power discharged from the home energy storage battery is supplied to loads; between time slots 51 and 120 and the discharged power is supplied to loads and sold to the grid.Figure17 displays the power distributions from PV to loads, battery, and grid.Figure 17
Power distributions from PV to loads, battery, and grid.
(a)
Power output of PV
(b)
Power transmitted from PV to loads
(c)
Power transmitted from PV to battery
(d)
Power transmitted from PV to gridFigure18 depicts the power distribution that is transmitted from the grid to HEMS, that is, the power that is purchased by the user in each time slot.Figure 18
Purchased power from grid.As shown in Figure18, HEMS purchases electricity from the utility grid when the electricity price is low. When the price is high, the amount of electricity purchased from the utility grid is reduced or even does not buy electricity any more. For example, from time slot 61 to time slot 90, HEMS does not buy electricity from the grid because of the high electricity price.


## 5.6. Parameter Analysis

To demonstrate the effect of preference factor to optimization results, the input data and other parameters are kept the same as those in Case1, and the multiobjective optimization algorithm was run with different preference factors. The optimization results are shown in Figure 19.Figure 19
Relationship between optimization results and preference factor.As shown in Figure19, when the user preference factor increases from 0 to 1, the electricity cost decreases from 169.18 cents to 126.34 cents and the comfort level indicator increases from 13.55 to 36.77. In other words, with the increase of preference factor, the electricity cost increases and the user feels less comfortable.The optimization algorithm runs with differentβsell while the other parameters and input data are kept the same as those in Case 1. Figure 20 shows the relationship between the total energy that is transmitted from battery to the grid and βsell.Figure 20
Relationship between total energy transmitted from the home energy storage battery to grid andβsell.As shown in Figure20, with the increase of βsell, the total amount of energy that is transmitted from the home energy storage battery to grid decreases. The reason is that the greater βsell decreases the possibility of selling the stored energy to the grid for revenue.Figure21 depicts the relationship between the total energy that is transmitted from the grid to the home energy storage battery and βbuy.Figure 21
Relationship between total energy transmitted from the grid to the home energy storage battery andβbuy.As shown in Figure21, with the increase of βbuy, the total amount energy that is transmitted from the grid to the home energy storage battery increases. The reason is that greater βbuy means more chances of buying electricity from the grid to charge the home energy storage battery when the electricity price is low.


## 5.7. Runtime and Robustness of Algorithm

The parameters and input data were kept as described in Section5.1, and the maximum iteration number was set to 3000. The algorithms in Cases 1, 2, and 3 were run 30 times, respectively, and the statistics of runtime and final fitness value were obtained. The results are displayed in Table 4.Table 4
Statistics of runtime and fitness value.
Case
Parameter
Minimum
Maximum
Mean
Standard deviation
Case1
Runtime (s)
81.9630
83.1010
82.4493
0.3515
Fitness value
78.4738
82.1968
80.5712
1.2511
Case2
Runtime (s)
81.0580
81.9160
81.5070
0.3689
Fitness value
121.7943
129.1096
126.3472
2.3401
Case3
Runtime (s)
28.1420
28.9380
28.3093
0.2702
Fitness value
147.4412
153.5338
149.6107
2.1340As presented in Table4, the runtimes in Cases 1 and 2 are longer than that in Case 3. The reason is that the former two cases need to determine the power distribution among loads, PV, battery, and grid through the method described in Section 4.4. Because the proposed multiobjective optimization algorithm for HEMS is an offline optimization algorithm, the runtime is acceptable for practical applications. In fact, compared to the algorithm in [1], it is very fast. In addition, from the standard deviations of runtime and fitness value in Table 4, we can say that the proposed algorithm is robust enough for application.


## 6. Conclusion

In smart grid, implementing DR in residential sector through HEMS has attracted much interest of both academic researchers and industrial engineers. This paper first proposes a framework of HEMS including grid, load, PV, and home energy storage battery. In this framework, a user has the ability to sell electricity to utility grid for revenue. In order to quantify user’s comfort level during the operation of home appliances, a set of comfort level indicators are proposed based on home appliance’s characteristics and user’s preferences. A novel multiobjective optimization algorithm for HEMS is proposed, which minimizes the electricity cost and maximizes the comfort level of the user simultaneously. The algorithm optimally controls the operations of schedulable home appliances, such as PEHV, EWH, WM, CD and DW, and the power distributions among grid, load, PV, and battery according to the electricity price, power output of PV, forecasted outdoor temperature, and user preferences. The stochastic natures of PV generation and outdoor temperature are considered and modeled by scenario method. The control of both home appliances and power distributions among different components of HEMS is investigated in depth by simulations. The computation time and robustness of the proposed algorithm are acceptable for practical applications. The results demonstrate that, compared with other framework of HEMS and algorithms, the framework of HEMS and algorithm proposed in this paper can reduce electricity cost and improve a user’s comfort level significantly, provides the user with an efficient method of taking a tradeoff between the electricity cost and the comfort level, and facilitates the implementation of DR in residential sector in smart grid.In this paper, the PHEV is considered as a pure load, which absorbs electricity for transportation. However, in smart grid, when the grid electricity price is high, it can also supply the stored electricity to other home appliances or critical loads through the V2H function to reduce the amount of electricity purchased from grid and home owner’s electricity cost. In the future, we will integrate this function into the model proposed in this paper. In this case, determining the power distribution among loads, PV, battery, PHEV, and grid will become more challenging.



---

*Source: 807527-2015-04-30.xml*