# An Optimization Model and Modified Harmony Search Algorithm for Microgrid Planning with ESS

Authors: Yang Jiao; Jing Wu; Qing-kun Tan; Zhong-fu Tan; Guan Wang
Journal: Discrete Dynamics in Nature and Society
 (2017)

---

## Abstract

To solve problems such as the high cost of microgrids (MGs), balance between supply and demand, stability of system operation, and optimizing the MG planning model, the energy storage system (ESS) and harmony search algorithm (HSA) are proposed. First, the conventional MG planning optimization model is constructed and the constraint conditions are defined: the supply and demand balance and reserve requirements. Second, an ESS is integrated into the optimal model of MG planning. The model with an ESS can solve and identify parameters such as the optimal power, optimal capacity, and optimal installation year. Third, the convergence speed and robustness of the ESS are optimized and improved. A case study comprising three different cases concludes the paper. The results show that the modified HSA (MHSA) can effectively improve the stability and economy of MG operation with an ESS.


---

## Body

## 1. Introduction

Distributed powers, loads, energy storage systems (ESS), and control devices are combined using microgrids (MGs) to form a single controllable power generation and distribution system, supplying electricity and heat to users simultaneously. With operational control, energy management, and other key technologies, MGs can be connected to the grid or run separately. These approaches reduce the adverse effects of an intermittent distributed power supply to the distribution network and maximize the use of distributed power output to improve reliability and power quality. In recent years, MGs have been joined by smart-energy comprehensive-utilization LAN networks, which offer superior performance when using wind power, solar photovoltaic (PV), and other sources of renewable clean energy power generation with a high development rate. Due to the reverse distribution of renewable energy power generation and customer power demand, the balance between supply and demand is challenging to meet, and an auxiliary power source for renewable energy power generation is necessary. Based on the peak-valley conditions of the load curve, ESS can effectively flatten the peak-valley difference by optimizing the charge-discharge behavior. Therefore, ESS are widely used in MGs. The operating characteristics of MGs can be affected, however, in the case of a large-scale ESS with its high initial investment cost. The study of how to optimize MG planning with ESS has both important theoretical value and practical significance.MG demonstration projects have been conducted in many countries [1]. More than 400 MGs have been constructed, are under construction, or are awaiting construction. The US Distributed Energy Technology Laboratory (DETL) analyzes the efficiency of distributed generation (DG), monitors the changes in output, and searches the impact on MGs caused by load variation [2]. MG Manheim in Germany is located in a residential area, containing six PV units [3]. This MG tests the decentralized controls with controls based on agents. The MG demonstration project in Kyotango, Japan, is aimed at MG energy management and power quality control [4]. Relative to those of developed countries, studies of MG technology in China started late. The current demonstration projects can be divided into remote MGs, island MGs and urban MGs [5]. The new energy MG demonstration area in Turpan, Xinjiang, is currently the largest and most comprehensive application in China and is an integral project examining the use of solar energy in buildings [6]. The MG at Dangan Island is the first independent renewable power station in China. This MG can use wave energy to desalinate 60 t/day of seawater [7]. The MG ESS at the Nanjing Power Supply Company can smooth output fluctuations of wind and light energy and switch the grid-connected system to off-grid mode freely in the system [8].At present, the optimization method of MGs with ESS considers primarily economic characteristics, response characteristics, and environmental protections. Reference [9] considers the environmental costs and reliability constrictions from the angle of minimizing investment and optimizes the power supply capacity for MGs to operate an entire year in islands. Reference [10] describes the reliability of MGs. Based on economic dispatching and considering system reliability, the energy storage optimization model is established in this literature. Reference [11] aims at developing a wind storage system and considers the influence of the wind power penetration rate, energy storage efficiency, and diesel generator operation strategy from the perspective of minimizing power supply costs. A stochastic optimization method is used to obtain the optimal energy storage capacity, and the corresponding sensitivity analysis is conducted. Considering economy and reliability, [10] establishes the objective function and can obtain the optimal capacity disposition of the ESS for different types of MGs. The objective of [12] is to maximize net profit over a maximized lifetime. A power generation planning model, including a low-carbon economy MG system, is established. In [13], a stochastic model is proposed for the coordinated scheduling of combined heat and power units in MGs. This model also considers wind turbine and PV units. Based on the cost formula, [14] identifies the optimal size of battery energy storage in operational management. Reference [15] proposes a multiobjective energy management system in the short term with the presence of renewable energy. This system can optimize the performance of MGs. Reference [16] seeks to optimize the random behaviors of wind and solar energy in MGs in the short term and with the presence of renewable energy sources. The response loads involved in the operating costs and pollutant emissions are also considered. An MG optimizing model is proposed in [17]. The model integrates microhydropower and renewable-energy-driven power plants with PV systems connected to the grid system. References [18, 19] establish an MG with electric vehicles and distributed power generation, optimize its constraints, and propose an improved general type 2 fuzzy logic set (GT2FLS) and harmony search algorithm (HSA) to minimize the frequency deviation of the MG on the load disturbance. In [20], a robust control strategy for an MG with electric vehicles and DG is introduced. This strategy guarantees the stability and robustness of the system and can be applied to different MG configurations. With the development of smart grid technology, user demand response [21], real-time price [22], and other factors are also considered in MG optimal scheduling models.Existing studies, however, have the following two deficiencies: the balance between supply and demand is usually considered in constraints, but the system reserve problem is not [23]. Based on the reliability of the system, the total reserve capacity determined is typically 25%–30% of the maximum load in the MG system [24]. As a smart comprehensive multienergy utilization LAN network, the reserve system should be fully met. Regarding the selection of an appropriate algorithm, existing studies use analytical methods [25], numerical algorithms [26], and other traditional optimization algorithms in general. These algorithms require improvement with regard to their convergence speed and calculation results. The limitations of traditional optimization methods have appeared, and the scale and complexity of optimization problems are increasing gradually. Additional advanced planning studies on MGs have used heuristic intelligent optimization algorithms [27] such as the genetic algorithm [28], particle swarm optimization (PSO) [29], enhanced gravity search algorithm (EGSA) [30], and HSA [31], to solve the problems; however, these algorithms still have room to improve in terms of convergence time, optimal problem searching, and results. Thus, the contributions of this study are as follows:(i)
An optimization model for MG planning is established with the objective function of the minimum operating cost in the scheduling period. The operational costs consist of the fuel cost, unit operation cost, and power purchase cost. In addition, the model considers the supply and demand balance constraint and the system reserve constraint.(ii)
An optimization model for MG planning with ESS is proposed to enhance the stability and economy of MG operation. The model takes the scale constraint and operational constraint of ESS operation as the new constraint conditions.(iii)
A modified harmony search algorithm (MHSA) is proposed. To apply the coordination search ability and overcome the limitations of the harmony search range, a subharmony memory is constructed to improve the algorithm’s adaptability. The algorithm could increase the convergence speed and reduce the total cost.The remainder of this paper is organized as follows: Section2 constructs an optimization model for MG planning with the objective function of minimum operation cost. In Section 3, an optimization model of MG planning with ESS is established, including the objective function and constraints. Section 4 uses the MHSA to enhance the adaptability and expand the search range. Three simulation cases are established to demonstrate the validity of the MHSA in Section 5. Section 6 highlights the main conclusions of this study.


## 2. Basic MG Planning Optimization Model

Reasonable MG planning optimization can enhance economic benefits, optimize the overall power flow, and improve power quality. In this section, an optimization model of MG planning is established.


### 2.1. Objective Function

The model takes the minimum MG operation cost as the objective function, which can be calculated as shown in(1)CMO=∑n=1N∑h=124∑j=1J365×CF,jPn,h,j+CPV,j·Pn,h,j+CW,j·Pn,h,j+ϑCbuy,j-ζCsell,j×1+r-n,where n is the indexed year; N is the planning cycle; Cmo represents MG operational costs including the unit commitment cost, fuel cost, and unit operation cost; h is the indexed hour; j is the index for DG units; J is the number of DG units; CF,j is the fuel cost of unit j; Pn,h,j is the output power of DG unit j at hour h in year n; CPV,j is the operational cost of PV power generating j; CW,j is the operational cost of wind turbine j; Cbuy,j is the power purchasing cost of MG from the main network; ϑ is a binary variable; Csell,j is the revenue of MG power sales for the main network; ζ is a binary variable; r is the discount rate; and n is the index for the years of interest.


### 2.2. Constriction Conditions

The MG planning model is constrained by many factors. In this section, the supply and demand balance constraints and system reserve constraints are considered.


#### 2.2.1. Supply and Demand Balance Constraint

When the DG generation capacity cannot meet the energy demand at specific hours, the MG requires the power to be transported from the main network:(2)∑j=1JPn,h,j+PB,n,h+PV,h+PW,h+ψPMain,h=1+θn-1PD,h,where PV,h is the prediction value of PV output power at hour h; PW,h is the prediction value of WPP power output at hour h; Pmain,h is a binary variable; θ is the load growth rate; and PD,h is the demand forecast value at hour h.


#### 2.2.2. MG Reserve Constraint

The distributed power supply is a mutual reserve of the power grid, which has the advantages of high reliability and energy efficiency. The MG reserve should satisfy no less than 15% of the load demand per hour. The following conditions should also be met:(3)Rn,h+RB,n,h=μD1+θn-1PD,h+μVPV,h+μWPW,h,Rn,h≤∑j=1JPj,max-Pn,h,j,RB,n,h≤-PB,n,h+min⁡SB,n,h-0.15×EBR,nQBPBR,n,where Rn,h is the reserve of the DG unit at hour h in year n; RB,n,h is the reserve of ESS at hour h in year n; μD is the prediction error of the load demand; μV and μW are the prediction errors of PV and WPP, respectively; Pj,max is the maximum output power of unit j;SB,n,h is the ESS charging state at hour h in year n; EB,n is the ESS capacity in year n; and QB is the ESS charging and discharging efficiency.


## 2.1. Objective Function

The model takes the minimum MG operation cost as the objective function, which can be calculated as shown in(1)CMO=∑n=1N∑h=124∑j=1J365×CF,jPn,h,j+CPV,j·Pn,h,j+CW,j·Pn,h,j+ϑCbuy,j-ζCsell,j×1+r-n,where n is the indexed year; N is the planning cycle; Cmo represents MG operational costs including the unit commitment cost, fuel cost, and unit operation cost; h is the indexed hour; j is the index for DG units; J is the number of DG units; CF,j is the fuel cost of unit j; Pn,h,j is the output power of DG unit j at hour h in year n; CPV,j is the operational cost of PV power generating j; CW,j is the operational cost of wind turbine j; Cbuy,j is the power purchasing cost of MG from the main network; ϑ is a binary variable; Csell,j is the revenue of MG power sales for the main network; ζ is a binary variable; r is the discount rate; and n is the index for the years of interest.


## 2.2. Constriction Conditions

The MG planning model is constrained by many factors. In this section, the supply and demand balance constraints and system reserve constraints are considered.


### 2.2.1. Supply and Demand Balance Constraint

When the DG generation capacity cannot meet the energy demand at specific hours, the MG requires the power to be transported from the main network:(2)∑j=1JPn,h,j+PB,n,h+PV,h+PW,h+ψPMain,h=1+θn-1PD,h,where PV,h is the prediction value of PV output power at hour h; PW,h is the prediction value of WPP power output at hour h; Pmain,h is a binary variable; θ is the load growth rate; and PD,h is the demand forecast value at hour h.


### 2.2.2. MG Reserve Constraint

The distributed power supply is a mutual reserve of the power grid, which has the advantages of high reliability and energy efficiency. The MG reserve should satisfy no less than 15% of the load demand per hour. The following conditions should also be met:(3)Rn,h+RB,n,h=μD1+θn-1PD,h+μVPV,h+μWPW,h,Rn,h≤∑j=1JPj,max-Pn,h,j,RB,n,h≤-PB,n,h+min⁡SB,n,h-0.15×EBR,nQBPBR,n,where Rn,h is the reserve of the DG unit at hour h in year n; RB,n,h is the reserve of ESS at hour h in year n; μD is the prediction error of the load demand; μV and μW are the prediction errors of PV and WPP, respectively; Pj,max is the maximum output power of unit j;SB,n,h is the ESS charging state at hour h in year n; EB,n is the ESS capacity in year n; and QB is the ESS charging and discharging efficiency.


## 2.2.1. Supply and Demand Balance Constraint

When the DG generation capacity cannot meet the energy demand at specific hours, the MG requires the power to be transported from the main network:(2)∑j=1JPn,h,j+PB,n,h+PV,h+PW,h+ψPMain,h=1+θn-1PD,h,where PV,h is the prediction value of PV output power at hour h; PW,h is the prediction value of WPP power output at hour h; Pmain,h is a binary variable; θ is the load growth rate; and PD,h is the demand forecast value at hour h.


## 2.2.2. MG Reserve Constraint

The distributed power supply is a mutual reserve of the power grid, which has the advantages of high reliability and energy efficiency. The MG reserve should satisfy no less than 15% of the load demand per hour. The following conditions should also be met:(3)Rn,h+RB,n,h=μD1+θn-1PD,h+μVPV,h+μWPW,h,Rn,h≤∑j=1JPj,max-Pn,h,j,RB,n,h≤-PB,n,h+min⁡SB,n,h-0.15×EBR,nQBPBR,n,where Rn,h is the reserve of the DG unit at hour h in year n; RB,n,h is the reserve of ESS at hour h in year n; μD is the prediction error of the load demand; μV and μW are the prediction errors of PV and WPP, respectively; Pj,max is the maximum output power of unit j;SB,n,h is the ESS charging state at hour h in year n; EB,n is the ESS capacity in year n; and QB is the ESS charging and discharging efficiency.


## 3. MG Planning Optimization Model with ESS

In this section, the optimization model for MG planning with ESS is established based on the basic model. The model can be used to solve the problems of the optimal power, optimal capacity, and the optimal installation year for MGs with ESS.


### 3.1. Objective Function

The operating cost of MGs and the investment cost of the ESS are considered in this planning model for MGs with ESS. The objective of this study is to address the ESS installation planning problem in existing MGs; thus, the investment cost of MGs is not included. The total cost in the planning cycle is taken as the objective function. The total cost includes the operation cost of MGs and the investment cost of the ESS:(4)min⁡C=CMO+CB,where C is the objective function of the investment cost; CMO is the MG operating cost; and CB is the ESS installation and operational costs.The ESS cost includes the installation cost and the operational cost. The installation cost is calculated as follows:(5)CBI=∑n=1NCBVIPPB,n+CBVIEEB,n+CBFI×PF,r,n,where CBI is the ESS installation cost; CBVIP is the variable installation cost associated with the rated power; PB,n is the power output of the ESS in installation year n; CBVIE is the variable installation cost related to the capacity size; EB,n is the capacity of the ESS in installation year n; EB,n=0 represents ESS not installed in year n; and CBFI is the fixed installation cost. The operation cost of ESS is predominantly the system operation cost and fixed operation cost, which can be calculated as follows:(6)CBO=∑n=1NCBFOPBR,n1+r-n+∑n=1N∑h=124365×CBVOPB,n,h1+r-n,where CBO is the ESS operation cost; CBFO is the fixed operation cost; PBR,n is the rated power in year n; CBVO is the variable operation cost; and PB,n,h is the ESS power output at hour h in year n.


### 3.2. Constriction Conditions

The supply and demand balance constraint and reserve constraint must still be considered in the optimization model for MG planning with ESS. In addition, the ESS scale constraints and operational constraints should also be considered in the model.


#### 3.2.1. Scale Constraints

The scale constraints, including installation power constraints, capacity scale constraints, and energy-scale constraints at a specific power size, can be calculated by (7) as follows: (7)PBR,n=PB,n,n=1PB,n+PBR,n-1,n≠1,EBR,n=EB,n,n=1EB,n+EBR,n-1,n≠1,βEP,minPBR,n≤EBR,n≤βEP,maxPBR,n,where PBR,n is the ESS rated power; EBR,n is the ESS rated capacity; and βEP,max and βEP,min are the ESS maximum and minimum efficiency, respectively.


#### 3.2.2. Operational Constraints

The ESS operational constraints include limits on power charging and discharging levels, initial charging state constraints, and power limitations and capacity constraints. They can be described as follows:(8)Bdis,n,h+Bch,n,h≤1,-PBR,n·Bch,n,h≤PB,n,h≤k·PBR,n·Bdis,n,h,SB,n,h=k·EBR,n,-PBR,n≤PB,n,h≤PBR,n,0.15EBR,n≤SB,n,h≤EBR,n,where Bdis,n,h is the discharging binary variable. When Bdis,n,h=1, the ESS is discharging at hour h in year n. When Bdis,n,h=0, the ESS is not discharging. Bch,n,h is the charging binary variable. When Bch,n,h=1, the ESS is charging at hour h in year n, and when Bch,n,h=0, the ESS is not charging. k is the index of discharging depth.


## 3.1. Objective Function

The operating cost of MGs and the investment cost of the ESS are considered in this planning model for MGs with ESS. The objective of this study is to address the ESS installation planning problem in existing MGs; thus, the investment cost of MGs is not included. The total cost in the planning cycle is taken as the objective function. The total cost includes the operation cost of MGs and the investment cost of the ESS:(4)min⁡C=CMO+CB,where C is the objective function of the investment cost; CMO is the MG operating cost; and CB is the ESS installation and operational costs.The ESS cost includes the installation cost and the operational cost. The installation cost is calculated as follows:(5)CBI=∑n=1NCBVIPPB,n+CBVIEEB,n+CBFI×PF,r,n,where CBI is the ESS installation cost; CBVIP is the variable installation cost associated with the rated power; PB,n is the power output of the ESS in installation year n; CBVIE is the variable installation cost related to the capacity size; EB,n is the capacity of the ESS in installation year n; EB,n=0 represents ESS not installed in year n; and CBFI is the fixed installation cost. The operation cost of ESS is predominantly the system operation cost and fixed operation cost, which can be calculated as follows:(6)CBO=∑n=1NCBFOPBR,n1+r-n+∑n=1N∑h=124365×CBVOPB,n,h1+r-n,where CBO is the ESS operation cost; CBFO is the fixed operation cost; PBR,n is the rated power in year n; CBVO is the variable operation cost; and PB,n,h is the ESS power output at hour h in year n.


## 3.2. Constriction Conditions

The supply and demand balance constraint and reserve constraint must still be considered in the optimization model for MG planning with ESS. In addition, the ESS scale constraints and operational constraints should also be considered in the model.


### 3.2.1. Scale Constraints

The scale constraints, including installation power constraints, capacity scale constraints, and energy-scale constraints at a specific power size, can be calculated by (7) as follows: (7)PBR,n=PB,n,n=1PB,n+PBR,n-1,n≠1,EBR,n=EB,n,n=1EB,n+EBR,n-1,n≠1,βEP,minPBR,n≤EBR,n≤βEP,maxPBR,n,where PBR,n is the ESS rated power; EBR,n is the ESS rated capacity; and βEP,max and βEP,min are the ESS maximum and minimum efficiency, respectively.


### 3.2.2. Operational Constraints

The ESS operational constraints include limits on power charging and discharging levels, initial charging state constraints, and power limitations and capacity constraints. They can be described as follows:(8)Bdis,n,h+Bch,n,h≤1,-PBR,n·Bch,n,h≤PB,n,h≤k·PBR,n·Bdis,n,h,SB,n,h=k·EBR,n,-PBR,n≤PB,n,h≤PBR,n,0.15EBR,n≤SB,n,h≤EBR,n,where Bdis,n,h is the discharging binary variable. When Bdis,n,h=1, the ESS is discharging at hour h in year n. When Bdis,n,h=0, the ESS is not discharging. Bch,n,h is the charging binary variable. When Bch,n,h=1, the ESS is charging at hour h in year n, and when Bch,n,h=0, the ESS is not charging. k is the index of discharging depth.


## 3.2.1. Scale Constraints

The scale constraints, including installation power constraints, capacity scale constraints, and energy-scale constraints at a specific power size, can be calculated by (7) as follows: (7)PBR,n=PB,n,n=1PB,n+PBR,n-1,n≠1,EBR,n=EB,n,n=1EB,n+EBR,n-1,n≠1,βEP,minPBR,n≤EBR,n≤βEP,maxPBR,n,where PBR,n is the ESS rated power; EBR,n is the ESS rated capacity; and βEP,max and βEP,min are the ESS maximum and minimum efficiency, respectively.


## 3.2.2. Operational Constraints

The ESS operational constraints include limits on power charging and discharging levels, initial charging state constraints, and power limitations and capacity constraints. They can be described as follows:(8)Bdis,n,h+Bch,n,h≤1,-PBR,n·Bch,n,h≤PB,n,h≤k·PBR,n·Bdis,n,h,SB,n,h=k·EBR,n,-PBR,n≤PB,n,h≤PBR,n,0.15EBR,n≤SB,n,h≤EBR,n,where Bdis,n,h is the discharging binary variable. When Bdis,n,h=1, the ESS is discharging at hour h in year n. When Bdis,n,h=0, the ESS is not discharging. Bch,n,h is the charging binary variable. When Bch,n,h=1, the ESS is charging at hour h in year n, and when Bch,n,h=0, the ESS is not charging. k is the index of discharging depth.


## 4. Improved Harmony Search Algorithm

The HSA is a new type of intelligent optimization algorithm that can find optimal solutions more easily. A simple searching process and strong global searching ability are the advantages of the HSA [32]. This paper will introduce the HSA, expand the search range, and improve the coordination of local and global search to solve the proposed model [33].


### 4.1. Harmony Search Algorithm

Z. W. Geem et al. proposed a heuristic intelligent optimization algorithm called the HSA [34]. The specific calculation steps are introduced as follows.Step 1.
The objective function, constraints, and basic parameters of harmony search are determined. ①H is the number that could be saved by harmony memory (HM). The number should be less than the number of feasible solutions. ②  Prob is the preserving probability of harmonic memory, specifically the probability of preserving the solution xij from HM when a new solution emerges. ③  Part is the probability of fine-tuning the disturbance in a portion of the solution. ④  I is the number of improvised operations, specifically the number of cycles.Step 2.
HM is initialized.H is the number of initial solutions generated randomly in the optimization problems.Q0 is an HM gathered by H initial solutions when iterative algebra t=0. This parameter can be expressed as follows:(9)Q0=x11⋯xN1f11f21x12⋯xN2f12f22⋮⋯⋮⋮⋮x1H-1⋯xNH-1f1H-1f2H-1x1N⋯xNHf1Hf2H,where Xj is the jth solution vector; xij is the ith subvector of the jth solution vector; and fXj is the function value of the jth solution vector, with i=1,2,…,H and j=1,2,…,N.Step 3.
New solutions are generated. New harmonic vectorsXnew=x1new,x2new,…,xinew,…,xnnew are generated in the following three ways: ① Some of the solutions in HM are preserved with a probability of Prob. In other words, the new solution xinew comes from the collection of the ith solution component in the memory Xi=xi1,xi2,…,xiH. ② A new solution xinew is generated randomly with a probability of 1-Prob. ③ Part of Part in xinew is disturbed by the above method. The disturbance principle can be calculated as(10)x′inew=xinew+2·η·rand⁡-η,where η is the bandwidth; rand is the random number between 0 and 1; and x′inew is the ith new solutions after disturbance: (11)xinew⟵xinew∈xi1,xi2,…,xiH,rand⁡<Probxinew∈Xinew,otherwise:i=1,2,…,N,where N is the number of solutions and rand is a random number between 0 and 1. The new harmony xinew requires tonal tuning if its value comes from HM.Step 4.
The memory is updated. The worst solution is replaced by the new one if the new solution is better than the worst in HM, and then the new HM is obtained. Otherwise, the original solution is kept unchanged.Step 5.
The algorithm ends if the program reaches the predetermined number of iterationsI. If not, the algorithm returns to Step 3.
Figure1 shows the algorithm flow chart.Figure 1
Flow chart of HSAS.


### 4.2. Algorithm Improvement

HSA has the advantages of a simple search process, strong global searching ability, and finding optimal solutions easily, but the convergence speed is slow. The adaptability is poor, and the search range is limited. In this section, the MHSA is proposed to improve the convergence speed and robustness of the HSA [35].


#### 4.2.1. The Improvement of Self-Adaptability

MHSA adds the optimal solution weightω (0.4–0.6) in Step 3, and the remaining weight is divided equally by other solutions. As the number of iterations decreases, the fixed bandwidth η also decreases. The decreasing of the fixed bandwidth η can be described as follows:(12)η=Z·LIImax,whereZ is the maximum range of the function;LI is the current number of remaining iterations; and Imax is the maximum number of iterations. By introducing this adaptive strategy, the local and global searching ability of the HSA can be improved to achieve optimization.


#### 4.2.2. The Establishment of Sub-HM

The process of creating the sub-HM is as follows [36]: ① The main HM is established as a sub-HM searched by the standard iterative. ② An auxiliary harmony searching iteratively from the opposite direction of the main HM is established. The algorithm divides all solutions of HM into two mutually independent sublibraries after being randomly initialized, rather than updating the entire solutions. According to the standard HSA, one of the sublibraries of HM searches iteratively. The other one searches from the opposite end, fully exploring the search range and identifying useful information within the search field.The process of MHSA in MG planning with ESS is described as follows:(1) MG planning with the ESS and its algorithm parameters are initialized.(2) HM is initialized, and the harmony matrix is generated. After random initialization, HM is divided into the main HM and auxiliary HM. The value of each harmony is calculated.(3) Based on the main HM and the auxiliary HM, a new HM can be generated through the methods of harmony preservation, pitch adjustment, and random selection. In the process of generating the new harmonic vector, three principles will be used: harmony reservation, tone control, and random selection.(4) The next-generation HM is updated according to the algorithmic principle. The optimal solution weight ω is added; η is self-adaptive in this step.(5) The criterion of terminating the proofreading algorithm: Take the convergence principle as reference, and judge whether the algorithm satisfies the convergence condition. If not, Steps 3 and 4 will be repeated until the algorithm satisfies the convergence condition or reaches the maximum value.


## 4.1. Harmony Search Algorithm

Z. W. Geem et al. proposed a heuristic intelligent optimization algorithm called the HSA [34]. The specific calculation steps are introduced as follows.Step 1.
The objective function, constraints, and basic parameters of harmony search are determined. ①H is the number that could be saved by harmony memory (HM). The number should be less than the number of feasible solutions. ②  Prob is the preserving probability of harmonic memory, specifically the probability of preserving the solution xij from HM when a new solution emerges. ③  Part is the probability of fine-tuning the disturbance in a portion of the solution. ④  I is the number of improvised operations, specifically the number of cycles.Step 2.
HM is initialized.H is the number of initial solutions generated randomly in the optimization problems.Q0 is an HM gathered by H initial solutions when iterative algebra t=0. This parameter can be expressed as follows:(9)Q0=x11⋯xN1f11f21x12⋯xN2f12f22⋮⋯⋮⋮⋮x1H-1⋯xNH-1f1H-1f2H-1x1N⋯xNHf1Hf2H,where Xj is the jth solution vector; xij is the ith subvector of the jth solution vector; and fXj is the function value of the jth solution vector, with i=1,2,…,H and j=1,2,…,N.Step 3.
New solutions are generated. New harmonic vectorsXnew=x1new,x2new,…,xinew,…,xnnew are generated in the following three ways: ① Some of the solutions in HM are preserved with a probability of Prob. In other words, the new solution xinew comes from the collection of the ith solution component in the memory Xi=xi1,xi2,…,xiH. ② A new solution xinew is generated randomly with a probability of 1-Prob. ③ Part of Part in xinew is disturbed by the above method. The disturbance principle can be calculated as(10)x′inew=xinew+2·η·rand⁡-η,where η is the bandwidth; rand is the random number between 0 and 1; and x′inew is the ith new solutions after disturbance: (11)xinew⟵xinew∈xi1,xi2,…,xiH,rand⁡<Probxinew∈Xinew,otherwise:i=1,2,…,N,where N is the number of solutions and rand is a random number between 0 and 1. The new harmony xinew requires tonal tuning if its value comes from HM.Step 4.
The memory is updated. The worst solution is replaced by the new one if the new solution is better than the worst in HM, and then the new HM is obtained. Otherwise, the original solution is kept unchanged.Step 5.
The algorithm ends if the program reaches the predetermined number of iterationsI. If not, the algorithm returns to Step 3.
Figure1 shows the algorithm flow chart.Figure 1
Flow chart of HSAS.


## 4.2. Algorithm Improvement

HSA has the advantages of a simple search process, strong global searching ability, and finding optimal solutions easily, but the convergence speed is slow. The adaptability is poor, and the search range is limited. In this section, the MHSA is proposed to improve the convergence speed and robustness of the HSA [35].


### 4.2.1. The Improvement of Self-Adaptability

MHSA adds the optimal solution weightω (0.4–0.6) in Step 3, and the remaining weight is divided equally by other solutions. As the number of iterations decreases, the fixed bandwidth η also decreases. The decreasing of the fixed bandwidth η can be described as follows:(12)η=Z·LIImax,whereZ is the maximum range of the function;LI is the current number of remaining iterations; and Imax is the maximum number of iterations. By introducing this adaptive strategy, the local and global searching ability of the HSA can be improved to achieve optimization.


### 4.2.2. The Establishment of Sub-HM

The process of creating the sub-HM is as follows [36]: ① The main HM is established as a sub-HM searched by the standard iterative. ② An auxiliary harmony searching iteratively from the opposite direction of the main HM is established. The algorithm divides all solutions of HM into two mutually independent sublibraries after being randomly initialized, rather than updating the entire solutions. According to the standard HSA, one of the sublibraries of HM searches iteratively. The other one searches from the opposite end, fully exploring the search range and identifying useful information within the search field.The process of MHSA in MG planning with ESS is described as follows:(1) MG planning with the ESS and its algorithm parameters are initialized.(2) HM is initialized, and the harmony matrix is generated. After random initialization, HM is divided into the main HM and auxiliary HM. The value of each harmony is calculated.(3) Based on the main HM and the auxiliary HM, a new HM can be generated through the methods of harmony preservation, pitch adjustment, and random selection. In the process of generating the new harmonic vector, three principles will be used: harmony reservation, tone control, and random selection.(4) The next-generation HM is updated according to the algorithmic principle. The optimal solution weight ω is added; η is self-adaptive in this step.(5) The criterion of terminating the proofreading algorithm: Take the convergence principle as reference, and judge whether the algorithm satisfies the convergence condition. If not, Steps 3 and 4 will be repeated until the algorithm satisfies the convergence condition or reaches the maximum value.


## 4.2.1. The Improvement of Self-Adaptability

MHSA adds the optimal solution weightω (0.4–0.6) in Step 3, and the remaining weight is divided equally by other solutions. As the number of iterations decreases, the fixed bandwidth η also decreases. The decreasing of the fixed bandwidth η can be described as follows:(12)η=Z·LIImax,whereZ is the maximum range of the function;LI is the current number of remaining iterations; and Imax is the maximum number of iterations. By introducing this adaptive strategy, the local and global searching ability of the HSA can be improved to achieve optimization.


## 4.2.2. The Establishment of Sub-HM

The process of creating the sub-HM is as follows [36]: ① The main HM is established as a sub-HM searched by the standard iterative. ② An auxiliary harmony searching iteratively from the opposite direction of the main HM is established. The algorithm divides all solutions of HM into two mutually independent sublibraries after being randomly initialized, rather than updating the entire solutions. According to the standard HSA, one of the sublibraries of HM searches iteratively. The other one searches from the opposite end, fully exploring the search range and identifying useful information within the search field.The process of MHSA in MG planning with ESS is described as follows:(1) MG planning with the ESS and its algorithm parameters are initialized.(2) HM is initialized, and the harmony matrix is generated. After random initialization, HM is divided into the main HM and auxiliary HM. The value of each harmony is calculated.(3) Based on the main HM and the auxiliary HM, a new HM can be generated through the methods of harmony preservation, pitch adjustment, and random selection. In the process of generating the new harmonic vector, three principles will be used: harmony reservation, tone control, and random selection.(4) The next-generation HM is updated according to the algorithmic principle. The optimal solution weight ω is added; η is self-adaptive in this step.(5) The criterion of terminating the proofreading algorithm: Take the convergence principle as reference, and judge whether the algorithm satisfies the convergence condition. If not, Steps 3 and 4 will be repeated until the algorithm satisfies the convergence condition or reaches the maximum value.


## 5. Case Simulation

Three simulation cases are established to verify the applicability of the proposed model and algorithm. The DG net power generation and reserve in different cases are assumed. The model is calculated by MHSA and compared with HSA and PSO.


### 5.1. Basic Data

A small MG in China is chosen as the analytical object. This MG system is a small commercial and industrial MG. The load characteristics are sensitive and require a relatively high level of power supply reliability and quality. The MG consists of two diesel generators (namely, DG1 and DG2) with 250 kW installed capacity, a PV generator DG3 with a capacity of 100 kW, and a wind generator DG4 with a capacity of 150 kW. The upper climbing power and lower climbing power of DG1 and DG2 are not more than 50 kW, the start-shut time of DG1 and DG2 is not less than 30 minutes, and the start-shut cost of DG1 and DG2 is ¥120. PSO is a type of bionic optimization algorithm [37] based on the swarm intelligence theory with the advantages of simplicity, high precision, and fast convergence. PSO is widely used in neural network construction, power system planning, and fuzzy controls [38]. Table 1 illustrates the parameter values of the DG units in the MG.Table 1
Parameter values of the DG units in the MG.
Unit
Parameter
C
F
,
j
C
P
V
,
j
C
W
,
j
DG1
0.35 yuan/kWh
—
—
DG2
0.35 yuan/kWh
—
—
DG3
—
0.95 yuan/kWh
—
DG4
—
—
0.55 yuan/kWhLead-acid batteries [39] are used in the MG. The users are predominantly residents, public utilities, and small business users. Table 2 shows the values of the model parameters. The data in the table are based on the general standard of [40].Table 2
Parameter values of the model.
Parameter
Value
N
8
r
5%
Q
B
90%
C
B
F
I
16000 yuan
C
B
V
I
P
2035 yuan/kW
C
B
V
I
E
675 yuan/kWh
C
B
F
O
60 yuan/kW/year
C
B
V
O
0.01 yuan/kWh
C
b
u
y
,
j
0.8 yuan/kWh
C
s
e
l
l
,
j
0.4 yuan/kWh
β
E
P
2–4
P
j
,
m
a
x
300 kW
μ
D
3%
μ
V
6%
μ
W
15%
θ
1%Data from a typical summer day are selected to calculate the three scenarios and ensure the load distribution, size, and standby requirements are consistent. The load demand of the MG system on a typical summer day is as follows: the power consumption is low from 22:00 to 7:00 because the users are predominantly residential users, enterprise users, and small business users. The power consumption is high during the daytime and peaks at noon and in the evening. Figure2 shows the distribution of the MG’s load demand and reserve demand.Figure 2
Distribution of load demand in the MG under three cases.The parameters for MHSA are set as follows:H=50, Prob=0.9, Part=0.1, ω=0.5, and Imax=200. The parameters for HSA are set as follows:H = 50, Prob=0.9, Part=0.1, Imax=200, and η=100. The parameters for PSO are as follows: the population size is 50; the learning factors are c1=c2=2; the number of initial iterations is 1; the maximum number of iterations is 200; the inertia weight is 0.9; and the random number is r1=r2=0.1.


### 5.2. Simulation Case Setting

To analyze the ESS model in the MG and improve the effectiveness of the HSA, this paper establishes three simulation scenarios and makes assumptions regarding the DG net power generation and reserve condition based on different scenarios.Case 1 (reference scenario).
The power generation of MG is sufficient to meet the reserve requirements. The reference scenario is used to verify the effectiveness of the proposed algorithm and is used primarily as a reference. Case1 provides a comparison for the effects that the ESS has on MG construction optimization.Case 2 (reserve scenario).
The power generation of the MG is normally sufficient but cannot meet the reserve requirements. The MG would be unstable under this scenario. At this point, the ESS may be an alternative reserve DG to optimize the operation of the MG and meet reserve requirements.Case 3 (extreme scenario).
The power generation of MG is insufficient and cannot meet the reserve requirements. In this scenario, the ESS may discharge to meet the demand load in the peak, replacing the DG reserves to optimize system operation. The system reserve can be satisfied by ESS discharge.


### 5.3. Simulation Results

#### 5.3.1. Results in Case1

Case1 is the reference used to both verify the validity of the proposed algorithm and provide an object of comparison to analyze the effect of the ESS on MG construction optimization. In this section, three methods, MHSA, HSA, and PSO, are chosen to solve the model. The generation capacity and reserve requirement are satisfied in this case. The methods can analyze the optimization effect of the ESS on the MG. Figure 3 shows the comparison of the convergence conditions of the MHSA, HSA, and PSO for Case 1.Figure 3
Comparison of the convergence condition of MHSA, HSA, and PSO for Case1.The convergence rate of MHSA in scenario 1 is higher than that of the HSA and PSO. Table3 shows the comparison of the computation time of the MHSA, HSA and PSO in Case 1.Table 3
Comparison of the computation time of the MHSA, HSA, and PSO in Case1.
Algorithm
Calculating time (s)
Maximum value
Minimum value
Average value
MHSA
1.20
1.05
1.12
HSA
1.96
1.71
1.82
PSO
1.53
1.34
1.48In the calculation of the speed of the comparison, MHSA is also faster than HSA and PSO in Case1. Table 4 comparatively analyzes the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 1.Table 4
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case1.
Algorithm
Output value
Case1
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
34060016
2
71
93
min
⁡
C
34053188
2
69
92
a
v
g
C
34056764
2
70
92
HSA
max
⁡
C
34063974
2
70
92
min
⁡
C
34056976
2
71
94
a
v
g
C
34058811
2
70
93
PSO
max
⁡
C
34062774
2
71
92
min
⁡
C
34055396
2
69
89
a
v
g
C
34057871
2
71
91In Case1, because MG can satisfy both the load and reserve demand, the ESS total cost is lowest in the second year and is ¥340,318,800. Relative to the latter two types of algorithms, the MHSA saves ¥3788 and ¥2208. The corresponding rated power and capacity are 69 kW and 92 kW. Figure 4 shows the supply and demand condition in Case 1.Figure 4
Supply and demand condition in Case1.The net power generation equals the load demand of MG without ESS, which means that the MG power generation is sufficient to meet the load demand. The ESS will charge when the load demand is low at hour3 and hour4. The MG power generation can meet the load demand when the load demand is high, but to optimize system operation, the ESS will discharge instead of beginning to reserve DG to optimize the DG units’ operation and extend their service life. When h=12, 18, and 19 and the demand load is high, the ESS will discharge instead of running DG units to optimize system operation. Figure 5 shows the reserve condition in Case 1.Figure 5
Reserve condition in Case1.The DG reserve is equal to the MG system reserve requirements when the ESS are not considered, implying that the DG reserve is sufficient to meet reserve requirements. At this point, the MG system can also meet the requirements without ESS. When an ESS is installed, however, the operation of the DG reserve can be replaced by the ESS to optimize system operation. The use of ESS supports replacing the operation of the DG reserve with the system reserve whenh=9, 11–13, 17–20.


#### 5.3.2. Results in Case2

Case2 is the reserve case and is used to verify the effects of ESS on system reserves and MG optimization when the system is underutilized. Figure 6 shows the supply and demand conditions in Case 2.Figure 6
Supply and demand conditions in Case2.The net power generation without ESS is equal to the MG’s load demand, implying that the MG generation capacity is sufficient to meet the load demand. At this time, the ESS charge during valley hours, namely,h=3,4, and discharge at the times of peak load, namely, h=12,13, and 17–19. After continuous discharging, it is necessary to charge when the load is slightly lower; that is, h=15. In this case, the ESS discharge in the peak load periods to replace the DG reserve and optimize MG operation. Figure 7 shows the reserve condition in Case 2.Figure 7
Reserve condition in Case2.Figure6 shows that the reserve system cannot meet the requirements. The DG reserve is lower than reserve requirement without ESS ath = 12–14 and 17–20, indicating that the DG reserve cannot meet the reserve requirement. In this case, ESS play a crucial role in supporting the reserve to replace the operation of the DG reserve, and ESS can completely replace the DG reserve unit whenh = 9, 13, and 19. Whenh = 8–20 and 23, the installation of ESS enables MG operation to meet the reserve demand and to replace the DG reserve to optimize MG operation.


#### 5.3.3. Results in Case3

Case3 is the extreme case for verifying ESS’ effectiveness in optimizing MG operation. In this case, the power generation capacity is insufficient to meet the reserve requirement. Figure 8 shows the supply and demand condition in Case 3.Figure 8
Supply and demand condition of Case3.Whenh = 12 and 18–20, the net power generation is less than the load demand without ESS. In this scenario, the MG generation cannot meet the load demand. At this point, the ESS charge at the real and relative valley hours,h = 3, 4, 15, 16, and 22. At peak hours, namely,h = 11–13 and 17–20, the ESS discharge to meet the demand load and replace the DG reserve to optimize system operation. Figure 9 shows the reserve condition in Case 3.Figure 9
Reserve condition in Case3.The DG reserve cannot meet the reserve requirements without the installation of ESS whenh = 8–11 and 20, indicating that the DG reserve in the MG system cannot meet the reserve requirements. The reserve even drops to a negative value whenh = 10 and 11. All DG reserve units should be started to supply the demand load, and the reserve requirement cannot be met. The system reserve is satisfied whenh = 4, 5, and 8–23 after installing ESS. The MG system can meet system reserve requirements through ESS completely whenh = 4, 5, 12, 13, and 17–20.


#### 5.3.4. Comparative Analysis

To analyze the application of this model in three scenarios, this section selects data from a typical summer day to apply to the processing model (the load distribution, size, and reserve requirements are the same in all three cases). This section also compares the optimal installation decisions and the related cost results of the MHSA, HSA, and PSO. The reserve demand curve and the load demand curve of the MG system are essentially the same because the system reserve capacity increases along with the increase in users’ load demand. This phenomenon provides sufficient reserves for high load demand. Table5 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 2.Table 5
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case2.
Algorithm
Output value
Case2
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
37877418
1
129
198
min
⁡
C
37870166
1
128
197
a
v
g
C
37873329
1
129
198
HSA
max
⁡
C
37880195
1
129
199
min
⁡
C
37872733
1
128
198
a
v
g
C
37875991
1
129
199
PSO
max
⁡
C
37878457
1
131
200
min
⁡
C
37872965
1
128
199
a
v
g
C
37875229
1
130
200In Case2, the MG system cannot meet reserve requirements; thus, the total cost of ESS must be lowest in the first year, ¥37,870,166, and the total cost calculated by the MHSA is ¥2567 and ¥2799 less than the costs in the other two algorithms. The corresponding rated power and capacity are 128 kW and 197 kWh. Table 6 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 3.Table 6
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case3.
Algorithm
Output value
Case3
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
43974937
1
246
391
min
⁡
C
43967861
1
249
387
a
v
g
C
43972974
1
248
390
HSA
max
⁡
C
43978955
1
250
393
min
⁡
C
43970328
1
247
392
a
v
g
C
43974018
1
248
392
PSO
max
⁡
C
43977421
1
247
394
min
⁡
C
43972795
1
250
392
a
v
g
C
43974933
1
248
395In Case3, the MG system cannot meet the most basic load demand; thus, the total cost of ESS installation must also be lowest in the first year, ¥43,967,861 as calculated by MHSA. Compared with the costs of the latter two algorithms, MHSA could save ¥2467 and ¥4934. The rated power and capacity of ESS are 249 kW and 387 kWh.


## 5.1. Basic Data

A small MG in China is chosen as the analytical object. This MG system is a small commercial and industrial MG. The load characteristics are sensitive and require a relatively high level of power supply reliability and quality. The MG consists of two diesel generators (namely, DG1 and DG2) with 250 kW installed capacity, a PV generator DG3 with a capacity of 100 kW, and a wind generator DG4 with a capacity of 150 kW. The upper climbing power and lower climbing power of DG1 and DG2 are not more than 50 kW, the start-shut time of DG1 and DG2 is not less than 30 minutes, and the start-shut cost of DG1 and DG2 is ¥120. PSO is a type of bionic optimization algorithm [37] based on the swarm intelligence theory with the advantages of simplicity, high precision, and fast convergence. PSO is widely used in neural network construction, power system planning, and fuzzy controls [38]. Table 1 illustrates the parameter values of the DG units in the MG.Table 1
Parameter values of the DG units in the MG.
Unit
Parameter
C
F
,
j
C
P
V
,
j
C
W
,
j
DG1
0.35 yuan/kWh
—
—
DG2
0.35 yuan/kWh
—
—
DG3
—
0.95 yuan/kWh
—
DG4
—
—
0.55 yuan/kWhLead-acid batteries [39] are used in the MG. The users are predominantly residents, public utilities, and small business users. Table 2 shows the values of the model parameters. The data in the table are based on the general standard of [40].Table 2
Parameter values of the model.
Parameter
Value
N
8
r
5%
Q
B
90%
C
B
F
I
16000 yuan
C
B
V
I
P
2035 yuan/kW
C
B
V
I
E
675 yuan/kWh
C
B
F
O
60 yuan/kW/year
C
B
V
O
0.01 yuan/kWh
C
b
u
y
,
j
0.8 yuan/kWh
C
s
e
l
l
,
j
0.4 yuan/kWh
β
E
P
2–4
P
j
,
m
a
x
300 kW
μ
D
3%
μ
V
6%
μ
W
15%
θ
1%Data from a typical summer day are selected to calculate the three scenarios and ensure the load distribution, size, and standby requirements are consistent. The load demand of the MG system on a typical summer day is as follows: the power consumption is low from 22:00 to 7:00 because the users are predominantly residential users, enterprise users, and small business users. The power consumption is high during the daytime and peaks at noon and in the evening. Figure2 shows the distribution of the MG’s load demand and reserve demand.Figure 2
Distribution of load demand in the MG under three cases.The parameters for MHSA are set as follows:H=50, Prob=0.9, Part=0.1, ω=0.5, and Imax=200. The parameters for HSA are set as follows:H = 50, Prob=0.9, Part=0.1, Imax=200, and η=100. The parameters for PSO are as follows: the population size is 50; the learning factors are c1=c2=2; the number of initial iterations is 1; the maximum number of iterations is 200; the inertia weight is 0.9; and the random number is r1=r2=0.1.


## 5.2. Simulation Case Setting

To analyze the ESS model in the MG and improve the effectiveness of the HSA, this paper establishes three simulation scenarios and makes assumptions regarding the DG net power generation and reserve condition based on different scenarios.Case 1 (reference scenario).
The power generation of MG is sufficient to meet the reserve requirements. The reference scenario is used to verify the effectiveness of the proposed algorithm and is used primarily as a reference. Case1 provides a comparison for the effects that the ESS has on MG construction optimization.Case 2 (reserve scenario).
The power generation of the MG is normally sufficient but cannot meet the reserve requirements. The MG would be unstable under this scenario. At this point, the ESS may be an alternative reserve DG to optimize the operation of the MG and meet reserve requirements.Case 3 (extreme scenario).
The power generation of MG is insufficient and cannot meet the reserve requirements. In this scenario, the ESS may discharge to meet the demand load in the peak, replacing the DG reserves to optimize system operation. The system reserve can be satisfied by ESS discharge.


## 5.3. Simulation Results

### 5.3.1. Results in Case1

Case1 is the reference used to both verify the validity of the proposed algorithm and provide an object of comparison to analyze the effect of the ESS on MG construction optimization. In this section, three methods, MHSA, HSA, and PSO, are chosen to solve the model. The generation capacity and reserve requirement are satisfied in this case. The methods can analyze the optimization effect of the ESS on the MG. Figure 3 shows the comparison of the convergence conditions of the MHSA, HSA, and PSO for Case 1.Figure 3
Comparison of the convergence condition of MHSA, HSA, and PSO for Case1.The convergence rate of MHSA in scenario 1 is higher than that of the HSA and PSO. Table3 shows the comparison of the computation time of the MHSA, HSA and PSO in Case 1.Table 3
Comparison of the computation time of the MHSA, HSA, and PSO in Case1.
Algorithm
Calculating time (s)
Maximum value
Minimum value
Average value
MHSA
1.20
1.05
1.12
HSA
1.96
1.71
1.82
PSO
1.53
1.34
1.48In the calculation of the speed of the comparison, MHSA is also faster than HSA and PSO in Case1. Table 4 comparatively analyzes the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 1.Table 4
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case1.
Algorithm
Output value
Case1
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
34060016
2
71
93
min
⁡
C
34053188
2
69
92
a
v
g
C
34056764
2
70
92
HSA
max
⁡
C
34063974
2
70
92
min
⁡
C
34056976
2
71
94
a
v
g
C
34058811
2
70
93
PSO
max
⁡
C
34062774
2
71
92
min
⁡
C
34055396
2
69
89
a
v
g
C
34057871
2
71
91In Case1, because MG can satisfy both the load and reserve demand, the ESS total cost is lowest in the second year and is ¥340,318,800. Relative to the latter two types of algorithms, the MHSA saves ¥3788 and ¥2208. The corresponding rated power and capacity are 69 kW and 92 kW. Figure 4 shows the supply and demand condition in Case 1.Figure 4
Supply and demand condition in Case1.The net power generation equals the load demand of MG without ESS, which means that the MG power generation is sufficient to meet the load demand. The ESS will charge when the load demand is low at hour3 and hour4. The MG power generation can meet the load demand when the load demand is high, but to optimize system operation, the ESS will discharge instead of beginning to reserve DG to optimize the DG units’ operation and extend their service life. When h=12, 18, and 19 and the demand load is high, the ESS will discharge instead of running DG units to optimize system operation. Figure 5 shows the reserve condition in Case 1.Figure 5
Reserve condition in Case1.The DG reserve is equal to the MG system reserve requirements when the ESS are not considered, implying that the DG reserve is sufficient to meet reserve requirements. At this point, the MG system can also meet the requirements without ESS. When an ESS is installed, however, the operation of the DG reserve can be replaced by the ESS to optimize system operation. The use of ESS supports replacing the operation of the DG reserve with the system reserve whenh=9, 11–13, 17–20.


### 5.3.2. Results in Case2

Case2 is the reserve case and is used to verify the effects of ESS on system reserves and MG optimization when the system is underutilized. Figure 6 shows the supply and demand conditions in Case 2.Figure 6
Supply and demand conditions in Case2.The net power generation without ESS is equal to the MG’s load demand, implying that the MG generation capacity is sufficient to meet the load demand. At this time, the ESS charge during valley hours, namely,h=3,4, and discharge at the times of peak load, namely, h=12,13, and 17–19. After continuous discharging, it is necessary to charge when the load is slightly lower; that is, h=15. In this case, the ESS discharge in the peak load periods to replace the DG reserve and optimize MG operation. Figure 7 shows the reserve condition in Case 2.Figure 7
Reserve condition in Case2.Figure6 shows that the reserve system cannot meet the requirements. The DG reserve is lower than reserve requirement without ESS ath = 12–14 and 17–20, indicating that the DG reserve cannot meet the reserve requirement. In this case, ESS play a crucial role in supporting the reserve to replace the operation of the DG reserve, and ESS can completely replace the DG reserve unit whenh = 9, 13, and 19. Whenh = 8–20 and 23, the installation of ESS enables MG operation to meet the reserve demand and to replace the DG reserve to optimize MG operation.


### 5.3.3. Results in Case3

Case3 is the extreme case for verifying ESS’ effectiveness in optimizing MG operation. In this case, the power generation capacity is insufficient to meet the reserve requirement. Figure 8 shows the supply and demand condition in Case 3.Figure 8
Supply and demand condition of Case3.Whenh = 12 and 18–20, the net power generation is less than the load demand without ESS. In this scenario, the MG generation cannot meet the load demand. At this point, the ESS charge at the real and relative valley hours,h = 3, 4, 15, 16, and 22. At peak hours, namely,h = 11–13 and 17–20, the ESS discharge to meet the demand load and replace the DG reserve to optimize system operation. Figure 9 shows the reserve condition in Case 3.Figure 9
Reserve condition in Case3.The DG reserve cannot meet the reserve requirements without the installation of ESS whenh = 8–11 and 20, indicating that the DG reserve in the MG system cannot meet the reserve requirements. The reserve even drops to a negative value whenh = 10 and 11. All DG reserve units should be started to supply the demand load, and the reserve requirement cannot be met. The system reserve is satisfied whenh = 4, 5, and 8–23 after installing ESS. The MG system can meet system reserve requirements through ESS completely whenh = 4, 5, 12, 13, and 17–20.


### 5.3.4. Comparative Analysis

To analyze the application of this model in three scenarios, this section selects data from a typical summer day to apply to the processing model (the load distribution, size, and reserve requirements are the same in all three cases). This section also compares the optimal installation decisions and the related cost results of the MHSA, HSA, and PSO. The reserve demand curve and the load demand curve of the MG system are essentially the same because the system reserve capacity increases along with the increase in users’ load demand. This phenomenon provides sufficient reserves for high load demand. Table5 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 2.Table 5
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case2.
Algorithm
Output value
Case2
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
37877418
1
129
198
min
⁡
C
37870166
1
128
197
a
v
g
C
37873329
1
129
198
HSA
max
⁡
C
37880195
1
129
199
min
⁡
C
37872733
1
128
198
a
v
g
C
37875991
1
129
199
PSO
max
⁡
C
37878457
1
131
200
min
⁡
C
37872965
1
128
199
a
v
g
C
37875229
1
130
200In Case2, the MG system cannot meet reserve requirements; thus, the total cost of ESS must be lowest in the first year, ¥37,870,166, and the total cost calculated by the MHSA is ¥2567 and ¥2799 less than the costs in the other two algorithms. The corresponding rated power and capacity are 128 kW and 197 kWh. Table 6 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 3.Table 6
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case3.
Algorithm
Output value
Case3
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
43974937
1
246
391
min
⁡
C
43967861
1
249
387
a
v
g
C
43972974
1
248
390
HSA
max
⁡
C
43978955
1
250
393
min
⁡
C
43970328
1
247
392
a
v
g
C
43974018
1
248
392
PSO
max
⁡
C
43977421
1
247
394
min
⁡
C
43972795
1
250
392
a
v
g
C
43974933
1
248
395In Case3, the MG system cannot meet the most basic load demand; thus, the total cost of ESS installation must also be lowest in the first year, ¥43,967,861 as calculated by MHSA. Compared with the costs of the latter two algorithms, MHSA could save ¥2467 and ¥4934. The rated power and capacity of ESS are 249 kW and 387 kWh.


## 5.3.1. Results in Case1

Case1 is the reference used to both verify the validity of the proposed algorithm and provide an object of comparison to analyze the effect of the ESS on MG construction optimization. In this section, three methods, MHSA, HSA, and PSO, are chosen to solve the model. The generation capacity and reserve requirement are satisfied in this case. The methods can analyze the optimization effect of the ESS on the MG. Figure 3 shows the comparison of the convergence conditions of the MHSA, HSA, and PSO for Case 1.Figure 3
Comparison of the convergence condition of MHSA, HSA, and PSO for Case1.The convergence rate of MHSA in scenario 1 is higher than that of the HSA and PSO. Table3 shows the comparison of the computation time of the MHSA, HSA and PSO in Case 1.Table 3
Comparison of the computation time of the MHSA, HSA, and PSO in Case1.
Algorithm
Calculating time (s)
Maximum value
Minimum value
Average value
MHSA
1.20
1.05
1.12
HSA
1.96
1.71
1.82
PSO
1.53
1.34
1.48In the calculation of the speed of the comparison, MHSA is also faster than HSA and PSO in Case1. Table 4 comparatively analyzes the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 1.Table 4
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case1.
Algorithm
Output value
Case1
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
34060016
2
71
93
min
⁡
C
34053188
2
69
92
a
v
g
C
34056764
2
70
92
HSA
max
⁡
C
34063974
2
70
92
min
⁡
C
34056976
2
71
94
a
v
g
C
34058811
2
70
93
PSO
max
⁡
C
34062774
2
71
92
min
⁡
C
34055396
2
69
89
a
v
g
C
34057871
2
71
91In Case1, because MG can satisfy both the load and reserve demand, the ESS total cost is lowest in the second year and is ¥340,318,800. Relative to the latter two types of algorithms, the MHSA saves ¥3788 and ¥2208. The corresponding rated power and capacity are 69 kW and 92 kW. Figure 4 shows the supply and demand condition in Case 1.Figure 4
Supply and demand condition in Case1.The net power generation equals the load demand of MG without ESS, which means that the MG power generation is sufficient to meet the load demand. The ESS will charge when the load demand is low at hour3 and hour4. The MG power generation can meet the load demand when the load demand is high, but to optimize system operation, the ESS will discharge instead of beginning to reserve DG to optimize the DG units’ operation and extend their service life. When h=12, 18, and 19 and the demand load is high, the ESS will discharge instead of running DG units to optimize system operation. Figure 5 shows the reserve condition in Case 1.Figure 5
Reserve condition in Case1.The DG reserve is equal to the MG system reserve requirements when the ESS are not considered, implying that the DG reserve is sufficient to meet reserve requirements. At this point, the MG system can also meet the requirements without ESS. When an ESS is installed, however, the operation of the DG reserve can be replaced by the ESS to optimize system operation. The use of ESS supports replacing the operation of the DG reserve with the system reserve whenh=9, 11–13, 17–20.


## 5.3.2. Results in Case2

Case2 is the reserve case and is used to verify the effects of ESS on system reserves and MG optimization when the system is underutilized. Figure 6 shows the supply and demand conditions in Case 2.Figure 6
Supply and demand conditions in Case2.The net power generation without ESS is equal to the MG’s load demand, implying that the MG generation capacity is sufficient to meet the load demand. At this time, the ESS charge during valley hours, namely,h=3,4, and discharge at the times of peak load, namely, h=12,13, and 17–19. After continuous discharging, it is necessary to charge when the load is slightly lower; that is, h=15. In this case, the ESS discharge in the peak load periods to replace the DG reserve and optimize MG operation. Figure 7 shows the reserve condition in Case 2.Figure 7
Reserve condition in Case2.Figure6 shows that the reserve system cannot meet the requirements. The DG reserve is lower than reserve requirement without ESS ath = 12–14 and 17–20, indicating that the DG reserve cannot meet the reserve requirement. In this case, ESS play a crucial role in supporting the reserve to replace the operation of the DG reserve, and ESS can completely replace the DG reserve unit whenh = 9, 13, and 19. Whenh = 8–20 and 23, the installation of ESS enables MG operation to meet the reserve demand and to replace the DG reserve to optimize MG operation.


## 5.3.3. Results in Case3

Case3 is the extreme case for verifying ESS’ effectiveness in optimizing MG operation. In this case, the power generation capacity is insufficient to meet the reserve requirement. Figure 8 shows the supply and demand condition in Case 3.Figure 8
Supply and demand condition of Case3.Whenh = 12 and 18–20, the net power generation is less than the load demand without ESS. In this scenario, the MG generation cannot meet the load demand. At this point, the ESS charge at the real and relative valley hours,h = 3, 4, 15, 16, and 22. At peak hours, namely,h = 11–13 and 17–20, the ESS discharge to meet the demand load and replace the DG reserve to optimize system operation. Figure 9 shows the reserve condition in Case 3.Figure 9
Reserve condition in Case3.The DG reserve cannot meet the reserve requirements without the installation of ESS whenh = 8–11 and 20, indicating that the DG reserve in the MG system cannot meet the reserve requirements. The reserve even drops to a negative value whenh = 10 and 11. All DG reserve units should be started to supply the demand load, and the reserve requirement cannot be met. The system reserve is satisfied whenh = 4, 5, and 8–23 after installing ESS. The MG system can meet system reserve requirements through ESS completely whenh = 4, 5, 12, 13, and 17–20.


## 5.3.4. Comparative Analysis

To analyze the application of this model in three scenarios, this section selects data from a typical summer day to apply to the processing model (the load distribution, size, and reserve requirements are the same in all three cases). This section also compares the optimal installation decisions and the related cost results of the MHSA, HSA, and PSO. The reserve demand curve and the load demand curve of the MG system are essentially the same because the system reserve capacity increases along with the increase in users’ load demand. This phenomenon provides sufficient reserves for high load demand. Table5 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 2.Table 5
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case2.
Algorithm
Output value
Case2
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
37877418
1
129
198
min
⁡
C
37870166
1
128
197
a
v
g
C
37873329
1
129
198
HSA
max
⁡
C
37880195
1
129
199
min
⁡
C
37872733
1
128
198
a
v
g
C
37875991
1
129
199
PSO
max
⁡
C
37878457
1
131
200
min
⁡
C
37872965
1
128
199
a
v
g
C
37875229
1
130
200In Case2, the MG system cannot meet reserve requirements; thus, the total cost of ESS must be lowest in the first year, ¥37,870,166, and the total cost calculated by the MHSA is ¥2567 and ¥2799 less than the costs in the other two algorithms. The corresponding rated power and capacity are 128 kW and 197 kWh. Table 6 compares the optimal installation decisions and related costs predicted by the MHSA, HSA, and PSO in Case 3.Table 6
Comparison of optimal installation and related costs predicted by the MHSA, HSA, and PSO in Case3.
Algorithm
Output value
Case3
C (¥)
Installation year
BRP (kW)
BRE (kWh)
MHSA
max
⁡
C
43974937
1
246
391
min
⁡
C
43967861
1
249
387
a
v
g
C
43972974
1
248
390
HSA
max
⁡
C
43978955
1
250
393
min
⁡
C
43970328
1
247
392
a
v
g
C
43974018
1
248
392
PSO
max
⁡
C
43977421
1
247
394
min
⁡
C
43972795
1
250
392
a
v
g
C
43974933
1
248
395In Case3, the MG system cannot meet the most basic load demand; thus, the total cost of ESS installation must also be lowest in the first year, ¥43,967,861 as calculated by MHSA. Compared with the costs of the latter two algorithms, MHSA could save ¥2467 and ¥4934. The rated power and capacity of ESS are 249 kW and 387 kWh.


## 6. Conclusions

MG has become a smart-energy comprehensive-utilization and a multienergy complementary system with wide application potential across the world. ESS are an important part of the MG system. Approaches to optimize MG planning with ESS have important theoretical value and practical significance. The paper studies the problem of MG planning with ESS and solves the model using MHSA. The results are as follows:(1) If the operating cost of MG and the investment cost of ESS were considered, the proposed model could find the optimal scheme of MG planning with ESS. Further, ESS could support MG systems in meeting load demand and reserve requirements under three cases by timely adjustment of the charge-discharge power. ESS could also enhance the stability and economy of MG operation.(2) An MHSA is proposed to overcome the slow convergence rate and poor robustness of the HSA. The improvement occurs primarily through the promotion of the self-adaptability and establishment of the sub-HM. By analyzing scenarios, the convergence rate, computation time, and economy of MHSA are found to be significantly higher than those of the traditional HSA and PSO.



---

*Source: 8425458-2017-08-03.xml*