# Research on Economic Optimization of Microgrid Cluster Based on Chaos Sparrow Search Algorithm

Authors: Peng Wang; Yu Zhang; Hongwan Yang
Journal: Computational Intelligence and Neuroscience
 (2021)

---

## Abstract

With the deepening of the power market reform on the retail side, it is of great significance to study the economic optimization of the microgrid cluster system. Aiming at the economics of the microgrid cluster, comprehensively considering the degradation cost of energy storage battery, the compensation cost of demand-side controllable loads dispatch, the electricity transaction cost between the microgrids, and the electricity transaction cost between the microgrid and the power distribution network of the microgrid cluster, we establish an optimal dispatch model for the microgrid cluster including wind turbines, photovoltaics, and energy storage batteries. At the same time, in view of the problem that the population diversity of the basic sparrow search algorithm decreases and it is easy to fall into local extremes in the later iterations of the basic sparrow search algorithm, a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning is proposed, and different types of test functions are used to analyze the convergence effect of the algorithm, and the calculation effects of the sparrow algorithm, the particle swarm algorithm, the chaotic particle swarm, and the genetic algorithm are compared. The algorithm has higher convergence speed, higher accuracy, and better global optimization ability. Finally, through the calculation example, it is concluded that the benefit of the microgrid cluster is increased by nearly 20%, which verifies the effectiveness of the improvement.


---

## Body

## 1. Introduction

With the current energy shortage and environmental problems in power supply becoming more and more serious, the microgrid composed of renewable energy sources has been widely used [1–3], which can not only improve the energy efficiency but also protect the environment, reduce costs, and meet the requirements of economy, environmental protection, and stability [4–10]. However, due to the poor antidisturbance capacity of a single microgrid, multiple microgrids in a local area are interconnected to form a microgrid cluster system. By coordinating the energy output of each microgrid in the cluster, the dynamic balance of supply and demand within the cluster is achieved, and the reliability and economy of the system is effectively improved. However, due to differences in the capacity configuration and load characteristics of each microgrid, when electric energy is exchanged between microgrids, it will affect the operation of microgrids [11]. Therefore, considering the exchange of electricity between microgrids, how to coordinate and optimize the microgrid cluster according to the supply and demand characteristics of each microgrid is very important.At present, research on coordination and optimization of a microgrid cluster has achieved certain results. Literature [12] proposed a multi-microgrid coordinated and optimized dispatching model based on double auction to optimize the sum of interactive power between each microgrid and other microgrids and power distribution network. Although this model optimized the electricity transaction volume between microgrids, it did not take into account the influence of demand-side controllable loads on the electrical energy interaction between microgrids. Literature [13] established a market transaction model based on cooperative game theory and carried out research on the benefit distribution and settlement rules of the microgrid cluster cooperative alliance. Although the electricity transaction price between microgrids was optimized, the influence of the demand-side controllable loads on the microgrids was not considered. Literature [14] studied the optimal dispatching problem of photovoltaic microgrid based on the consideration of time-of-use electricity price, with the goal of minimizing the exchange volume of the grid. Although the time-of-use electricity prices and optimized transaction volumes were considered, only the optimal dispatch of a single microgrid was considered, and the optimization of the microgrid cluster system was not considered. Literature [15] considered the installation cost, operating cost, and environmental benefits of the multi-microgrid system to establish an economic dispatch model and used a particle swarm optimization algorithm combined with Monte Carlo simulation to solve it. Although a centralized optimization algorithm was adopted, each microgrid needed to fully share internal privacy information, which requires higher communication and makes it difficult to optimize dispatch. Literature [16] achieved minimum operation cost through a few iterations by combining the Newton-type second-order algorithm and a consensus-based information exchange. Literature [17] took the adjustment cost of each microgrid as the consensus variables and used the consensus algorithm to solve the power distribution problem of island microgrid clusters. Although literature [16] and [17] had realized the economic operation of microgrid clusters, they only considered peak shaving and valley filling from the power generation side, without considering the response effect of electricity load. Literature [18] was based on the particle swarm algorithm to study the economic optimization dispatch of the microgrid. Although the optimal solution of the microgrid operating cost was obtained, the particle swarm algorithm had limited global optimization capability and is easy to fall into the local optimal solution. Literature [19] proposed a chaotic starling particle swarm optimization algorithm. The additions of the inertial weights and the chaotic logistic mapping strategy improved the algorithm to have better convergence and stronger global search capabilities. However, when applied to multiple local optima, it may fall into local optima and cause stagnation. Literature [20] proposed a new type of swarm intelligence optimization algorithm, the sparrow search algorithm. Compared with other algorithms, its solution efficiency was better; however, it was also easy to fall into the problem of local extremum in the later iteration.Based on the abovementioned problems, this paper improves the optimization model of the microgrid cluster and comprehensively considers the degradation cost of energy storage battery, the compensation cost of demand-side controllable loads dispatch, the electricity transaction cost between the microgrids, and the electricity transaction between the microgrid and the power distribution network of the microgrid cluster, establishes a dynamic energy trading model for the microgrid cluster, promotes the balance of supply and demand within the cluster by continuously coordinating the electricity transaction volume between microgrids, and reduces system operating costs. At the same time, taking into account the Bernoulli chaotic map, dynamic adaptive weights can effectively avoid the algorithm from falling into the local optimum and improve the algorithm's global optimization ability, and the Cauchy mutation and reverse learning can effectively jump out of the local optimum. This paper proposes a chaotic sparrow search algorithm (ISSA). We use different types of test functions to analyze the convergence effect of the algorithm and compare them with sparrow algorithm (SSA), particle swarm algorithm (PSO), chaotic particle swarm algorithm (CPSO), and genetic algorithm (GA). The effectiveness of the improvement of the proposed ISSA algorithm is verified, and the algorithm is applied to solve the operating cost of the microgrid cluster system. Finally, a calculation example is used to verify the operating economy of the microgrid cluster with demand-side controllable loads participating in the dispatch.The organization structure of this paper is as follows. Section2 introduces the basic structure of the microgrid cluster and demand-side response model. In Section 3, the optimal dispatch model of the microgrid cluster is introduced. In Section 4, the improved sparrow algorithm is introduced. Section 5 uses the test function analysis to verify the effectiveness of the algorithm improvements. In Section 6, the microgrid cluster composed of three microgrids is taken as an example, and the ISSA algorithm is used to conduct simulation experiments. Section 7 gives the conclusion and describes the future of the proposed algorithm.


## 2. Microgrid Cluster Structure and Demand-Side Response Model

### 2.1. Electric Energy Trading Structure of the Microgrid Cluster

The microgrid cluster electric energy transaction structure is shown in Figure1; n microgrids are interconnected to form a microgrid cluster system, and each microgrid in the community contains different types of distributed power generation units and loads. The energy flow in Figure 1 represents the power interaction between the microgrid and the power distribution network, and the information flow represents the two-way interaction of information between the microgrid and the cluster adjustment/cluster control system. It can be seen from Figure 1 that, in the process of optimal dispatch of the microgrid cluster, the cluster adjustment/cluster control system conducts two-way information interaction with the microgrid and continuously optimizes the electric energy transaction volume by adding controllable loads to realize the optimal dispatch of the microgrid cluster.Figure 1
Electricity transaction of the microgrid cluster.


### 2.2. Demand-Side Response Model

There are many different forms of loads in the microgrid. The classification of loads is helpful for energy management and dispatch. The demand-side management model of this paper mainly takes controllable loads as the research object. Based on the reliability of power supply, it is divided into three types: shiftable load, transferable load, and interruptible load.


#### 2.2.1. Shiftable Load

The microgrid can flexibly change the operating period of the shiftable load, so that it can choose to use electricity in the appropriate electricity price time period. The microgrid can control the shiftable load from the peak period of power consumption to the general period, thereby reducing the pressure of dispatching and reducing the operating cost. The mathematical model is as follows [21]:(1)Ci,k,tshift=CiPshiftPi,kshiftdi,k,t,where CiPshift represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,kshift represents the power of the k-th translatable load in MGi, di,k,tshift represents the state of the k-th translatable load of MGi in period t, if t∈ti,kshift,ti,kshift+Di,kshift, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kshift represents the original power consumption period of the k-th shiftable load in MGi, and Di,kshift represents the continuous power consumption period of the k-th shiftable load in MGi.


#### 2.2.2. Transferable Load

The transferable load has a certain degree of flexibility in the way of power supplies, its controllability is very strong, and the power supply time can be changed as planned. The power sector estimates the transferable load capacity and signs contracts with users to increase the economy of the microgrid. The mathematical model is as follows:(2)Ci,k,ttrans=CiPtransPi,ktransui,k,t,where CiPtrans represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,ktrans represents the power of the k-th transferable load in MG I, ui,k,t represents the state of the k-th transferable load of the MGi in the period t, if t∈ti,ktrans,ti,ktrans+Di,ktrans, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kPtrans represents the original power consumption period of the k-th shiftable load in MGi, and Di,ktrans represents the total power consumption period of the k-th shiftable load in MGi.


#### 2.2.3. Interruptible Load

The microgrid can cut off the interruptible load at any time without any negative impact on its operation, thus making the microgrid’s energy management system more flexible. Cutting off the interruptible load requires consideration of the user’s wishes and carries on certain compensation to the user. When the compensation cost for removing the interruptible load is lower than the cost of dispatching other units, it can choose to remove the interruptible load. The mathematical model is as follows:(3)Ci,k,tinter=1−fi,k,tCiPinterPi,kinter,where fi,k,t represents the state of the k-th interruptible load of the MGi in the t period, when the value is 1, it means it is in the running state, when the value is 0, it means it is in the interrupt state, and CiPinter and Pi,kinter, respectively, represent the dispatch compensation cost of unit power of the interrupted load in MGi and the power of the k-th interruptible load.When the user side participates in demand management, the power department should provide economic compensation to the user. This article comprehensively considers the dispatch compensation cost of the three controllable loads: shiftable load, transferable load, and interruptible load. The specific mathematical model is as follows:(4)Ci,tCL=∑i∈NishiftCi,k,tshift+∑i∈NitransCi,k,ttrans+∑i∈NiinterCi,k,tinter,where Ci,k,tshift represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,ttrans represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,tinter represents the dispatch compensation cost of the k-th interruptible load of MGi in period t, Nishift represents the set of translatable load of MGi, Nitrans represents the set of transferable load of MGi, and Niinter represents the set of interruptible load of MGi.


## 2.1. Electric Energy Trading Structure of the Microgrid Cluster

The microgrid cluster electric energy transaction structure is shown in Figure1; n microgrids are interconnected to form a microgrid cluster system, and each microgrid in the community contains different types of distributed power generation units and loads. The energy flow in Figure 1 represents the power interaction between the microgrid and the power distribution network, and the information flow represents the two-way interaction of information between the microgrid and the cluster adjustment/cluster control system. It can be seen from Figure 1 that, in the process of optimal dispatch of the microgrid cluster, the cluster adjustment/cluster control system conducts two-way information interaction with the microgrid and continuously optimizes the electric energy transaction volume by adding controllable loads to realize the optimal dispatch of the microgrid cluster.Figure 1
Electricity transaction of the microgrid cluster.


## 2.2. Demand-Side Response Model

There are many different forms of loads in the microgrid. The classification of loads is helpful for energy management and dispatch. The demand-side management model of this paper mainly takes controllable loads as the research object. Based on the reliability of power supply, it is divided into three types: shiftable load, transferable load, and interruptible load.


### 2.2.1. Shiftable Load

The microgrid can flexibly change the operating period of the shiftable load, so that it can choose to use electricity in the appropriate electricity price time period. The microgrid can control the shiftable load from the peak period of power consumption to the general period, thereby reducing the pressure of dispatching and reducing the operating cost. The mathematical model is as follows [21]:(1)Ci,k,tshift=CiPshiftPi,kshiftdi,k,t,where CiPshift represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,kshift represents the power of the k-th translatable load in MGi, di,k,tshift represents the state of the k-th translatable load of MGi in period t, if t∈ti,kshift,ti,kshift+Di,kshift, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kshift represents the original power consumption period of the k-th shiftable load in MGi, and Di,kshift represents the continuous power consumption period of the k-th shiftable load in MGi.


### 2.2.2. Transferable Load

The transferable load has a certain degree of flexibility in the way of power supplies, its controllability is very strong, and the power supply time can be changed as planned. The power sector estimates the transferable load capacity and signs contracts with users to increase the economy of the microgrid. The mathematical model is as follows:(2)Ci,k,ttrans=CiPtransPi,ktransui,k,t,where CiPtrans represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,ktrans represents the power of the k-th transferable load in MG I, ui,k,t represents the state of the k-th transferable load of the MGi in the period t, if t∈ti,ktrans,ti,ktrans+Di,ktrans, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kPtrans represents the original power consumption period of the k-th shiftable load in MGi, and Di,ktrans represents the total power consumption period of the k-th shiftable load in MGi.


### 2.2.3. Interruptible Load

The microgrid can cut off the interruptible load at any time without any negative impact on its operation, thus making the microgrid’s energy management system more flexible. Cutting off the interruptible load requires consideration of the user’s wishes and carries on certain compensation to the user. When the compensation cost for removing the interruptible load is lower than the cost of dispatching other units, it can choose to remove the interruptible load. The mathematical model is as follows:(3)Ci,k,tinter=1−fi,k,tCiPinterPi,kinter,where fi,k,t represents the state of the k-th interruptible load of the MGi in the t period, when the value is 1, it means it is in the running state, when the value is 0, it means it is in the interrupt state, and CiPinter and Pi,kinter, respectively, represent the dispatch compensation cost of unit power of the interrupted load in MGi and the power of the k-th interruptible load.When the user side participates in demand management, the power department should provide economic compensation to the user. This article comprehensively considers the dispatch compensation cost of the three controllable loads: shiftable load, transferable load, and interruptible load. The specific mathematical model is as follows:(4)Ci,tCL=∑i∈NishiftCi,k,tshift+∑i∈NitransCi,k,ttrans+∑i∈NiinterCi,k,tinter,where Ci,k,tshift represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,ttrans represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,tinter represents the dispatch compensation cost of the k-th interruptible load of MGi in period t, Nishift represents the set of translatable load of MGi, Nitrans represents the set of transferable load of MGi, and Niinter represents the set of interruptible load of MGi.


## 2.2.1. Shiftable Load

The microgrid can flexibly change the operating period of the shiftable load, so that it can choose to use electricity in the appropriate electricity price time period. The microgrid can control the shiftable load from the peak period of power consumption to the general period, thereby reducing the pressure of dispatching and reducing the operating cost. The mathematical model is as follows [21]:(1)Ci,k,tshift=CiPshiftPi,kshiftdi,k,t,where CiPshift represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,kshift represents the power of the k-th translatable load in MGi, di,k,tshift represents the state of the k-th translatable load of MGi in period t, if t∈ti,kshift,ti,kshift+Di,kshift, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kshift represents the original power consumption period of the k-th shiftable load in MGi, and Di,kshift represents the continuous power consumption period of the k-th shiftable load in MGi.


## 2.2.2. Transferable Load

The transferable load has a certain degree of flexibility in the way of power supplies, its controllability is very strong, and the power supply time can be changed as planned. The power sector estimates the transferable load capacity and signs contracts with users to increase the economy of the microgrid. The mathematical model is as follows:(2)Ci,k,ttrans=CiPtransPi,ktransui,k,t,where CiPtrans represents the dispatch compensation cost of unit power of the shiftable load in MGi, Pi,ktrans represents the power of the k-th transferable load in MG I, ui,k,t represents the state of the k-th transferable load of the MGi in the period t, if t∈ti,ktrans,ti,ktrans+Di,ktrans, then when the value is 1, it means it is in the running state; when the value is 0, it means it is in the interrupt state, ti,kPtrans represents the original power consumption period of the k-th shiftable load in MGi, and Di,ktrans represents the total power consumption period of the k-th shiftable load in MGi.


## 2.2.3. Interruptible Load

The microgrid can cut off the interruptible load at any time without any negative impact on its operation, thus making the microgrid’s energy management system more flexible. Cutting off the interruptible load requires consideration of the user’s wishes and carries on certain compensation to the user. When the compensation cost for removing the interruptible load is lower than the cost of dispatching other units, it can choose to remove the interruptible load. The mathematical model is as follows:(3)Ci,k,tinter=1−fi,k,tCiPinterPi,kinter,where fi,k,t represents the state of the k-th interruptible load of the MGi in the t period, when the value is 1, it means it is in the running state, when the value is 0, it means it is in the interrupt state, and CiPinter and Pi,kinter, respectively, represent the dispatch compensation cost of unit power of the interrupted load in MGi and the power of the k-th interruptible load.When the user side participates in demand management, the power department should provide economic compensation to the user. This article comprehensively considers the dispatch compensation cost of the three controllable loads: shiftable load, transferable load, and interruptible load. The specific mathematical model is as follows:(4)Ci,tCL=∑i∈NishiftCi,k,tshift+∑i∈NitransCi,k,ttrans+∑i∈NiinterCi,k,tinter,where Ci,k,tshift represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,ttrans represents the dispatch compensation cost of the k-th shiftable load of MGi in period t, Ci,k,tinter represents the dispatch compensation cost of the k-th interruptible load of MGi in period t, Nishift represents the set of translatable load of MGi, Nitrans represents the set of transferable load of MGi, and Niinter represents the set of interruptible load of MGi.


## 3. Optimal Dispatch Model of the Microgrid Cluster

### 3.1. Operating Cost Model

#### 3.1.1. Degraduation Cost of the Energy Storage Battery

The degradation cost of the energy storage battery is the cost of life reduction caused by the battery being recycled due to discharge, which is determined by the depth of discharge and the price of the battery. When the energy storage battery is deeply discharged, its recycling will lead to a reduction in life and an increase in degradation costs. In this paper, the battery discharge depth function [22] is used to express the degradation cost of the energy storage battery. The specific function can be expressed as(5)Ci,tBD=10−Simax−Si,t−10−Simax−Si,t−1Ci,bat,Si,t=Si,t−1+Pi,tchΔtηi,tchNiESS−Pi,tdisΔtNiESSηi,tdis,where Simax represents the maximum state of charge of the energy storage battery of MGi, Si,t represents the state of charge of the energy storage battery of MGi in the period t, Ci,bat represents the initial investment cost of the energy storage battery of MGi, Pi,tch represents the charging power of the energy storage battery of the MGi in the period t, Pi,tdis represents the discharge power of the energy storage battery of the MGi in the period t, NiESS represents the rated capacity of the energy storage battery of the MGi, ηi,tch represents the charging efficiency of the energy storage battery of the MGi in the period t, ηi,tdis represents the discharge efficiency of the energy storage battery of the MGi in the period t, and Δt is the time interval.From equation (5), it can be seen that the initial investment cost of the energy storage battery is constant. Therefore, as long as the charge and discharge power of the energy storage battery are optimized to obtain the battery state of charge, the degradation cost of the energy storage battery can be obtained.


#### 3.1.2. Electricity Transaction Cost between Microgrids

The electricity transaction cost between microgrids refers to the cost incurred when multiple microgrids exchange electricity, which is generally expressed as(6)Ct,kMN=Pi,tMNλi,tMNΔt,where Pi,tMN represents the power of MGi interacting with other microgrids in period t, the purchase of electricity is a positive value, the sale of electricity is a negative value, and λi,tMN represents the electricity price of MGi in period t.


#### 3.1.3. Electricity Transaction Cost between the Microgrid and Power Distribution Network

The electricity transaction cost between the microgrid and the distribution network refers to the cost generated when the microgrid and the power distribution network interact with electricity, which is generally expressed as(7)Ci,tDN=−Pi,tDNλtDNΔt,where Pi,tDN is the interactive power between the MGi and the power distribution network in t period, the purchase of electricity is a negative value, the sale of electricity is a positive value, and λi,tDN is the electricity price of the power distribution network in t period.


### 3.2. Optimal Dispatch Objective Function of the Microgrid Cluster

This paper takes the lowest operating cost of the microgrid cluster as the optimization goal and establishes the optimal dispatch model of the microgrid cluster. During the operation of the microgrid cluster, the costs are mainly composed of the compensation cost of the demand-side controllable load dispatch, the degradation cost of the energy storage battery, the electricity transaction cost between the microgrids, and the electricity transaction cost between the microgrid and power distribution network. The optimization objective function can be expressed as(8)minfx=∑t∈TCi,tCL+∑t∈TCi,tBD+∑t∈TCi,tMN+∑t∈TCi,tDN,where Ci,tCL represents the dispatch compensation cost of the controllable loads of the MGi in period t, Ci,tBD represents the degradation cost of the energy storage battery of the MGi in period t, Ci,tMN represents the electricity transaction cost between the microgrids of the MGi in period t, Ci,tDN represents the electricity transaction cost between the microgrid and the power distribution network of MGi in period t, and T is the dispatch period.


### 3.3. Constraints

#### 3.3.1. Constraints of Power Balance

The power balance constraint of the microgrid clusters system is generally expressed as(9)Pi,tDN+Pi,tIL+Pi,tch+∑k∈NishiftPi,kshiftdi,k,t+∑k∈NiransPi,ktransui,k,t+∑k∈NiinterPi,kinterfi,k,t=Pi,tRE+Pi,tdis+Pi,tMN,where Pi,tIL is the electric power of the key load of MGi in t period and Pi,tRE is the renewable energy output of MGi in t period.The interactive power balance constraint between microgrids is expressed as(10)∑i∈IPi,tMN=0.


#### 3.3.2. Constraints of Energy Storage Battery Operation

Since the energy storage battery cannot be charged and discharged at the same time, the energy storage battery charge and discharge power constraint is expressed as(11)0≤Pi,tch≤Pimax,0≤Pi,tdis≤Pimax,Pi,tch⋅Pi,tdis=0,where Pimax represents the maximum charge and discharge power of the energy storage battery of the MGi.For energy storage battery, their initial and final capacities should be consistent (excluding charge and discharge power constraints) and the energy storage capacity of each period needs to be controlled within a reasonable range. The following is the specific expression:(12)Simin≤Si,t≤Simax,Si,0=Si,24,where Simin is the minimum state of charge of the energy storage battery of MGi.


#### 3.3.3. Transaction Constraints of the Microgrid Cluster

(1) Trading electricity price constraints between microgrids: when directly trading electrical energy between microgrids, the price should be above the purchase price of the power distribution network and remain below the sale price of the power distribution network, so it is expressed as(13)λtEB≤λi,tMN≤λtES,where λtEB and λtES are the electricity purchase and sale prices of the power distribution network.(2) Constraints on the balance of electricity transaction costs between microgrids: the balance constraint of electricity transaction cost between microgrids is expressed as(14)∑i∈IPi,tMNλi,tMNΔt=0.(3) Interactive power constraints between microgrids: the interactive power constraint between microgrids is expressed as(15)−PmaxMN≤Pi,tMN≤PmaxMN,where PmaxMN is the maximum value of interactive power between microgrids.(4) Interactive power constraints between the microgrid and power distribution network: the interactive power constraint between the microgrid and the power distribution network is expressed as(16)−PmaxDN≤Pi,tDN≤PmaxDN,where PmaxDN is the maximum value of the interactive power between the MGi and the power distribution network.


#### 3.3.4. Constraints of Demand-Side Controllable Loads

The shiftable load needs to be translated as a whole to maintain the continuity of its electricity consumption, so the shiftable load constraint is expressed as(17)∑t=ti,kSshiftti,kEshiftdi,k,t=Di,kshift,di,k,t+∑p=1Di,kshift−1di,k,t+p=Di,kshift,where ti,kSshift represents the initial dispatch period of the k-th shiftable load in MGi and ti,kEshift represents the end dispatch period of the k-th shiftable load in MGi.The dispatch period of the transferable load is within the acceptable range, indicating that its operation has high flexibility, so the transferable load constraint is expressed as(18)∑t=ti,kStransti,kEtransui,k,t=Di,ktrans,where ti,kStrans and ti,kEtrans, respectively, are the beginning and end dispatch periods of the k-th transferable load of MGi.According to different degrees of importance, the maximum interruptible duration constraint of the interruptible load is implemented. In addition, the maximum and minimum duration constraints are also included in the interruptible load [23], and the constraints are expressed as(19)∑t=ti,kSinterti,kEinter1−fi,k,t≤Di,kinter,where ti,kSinter represents the initial operating period of the k-th interruptible load in MGi, ti,kEinter represents the end operating period of the k-th interruptible load in MGi, and Di,kinter represents the k-th maximum interruptible duration in MGi in a day.


## 3.1. Operating Cost Model

### 3.1.1. Degraduation Cost of the Energy Storage Battery

The degradation cost of the energy storage battery is the cost of life reduction caused by the battery being recycled due to discharge, which is determined by the depth of discharge and the price of the battery. When the energy storage battery is deeply discharged, its recycling will lead to a reduction in life and an increase in degradation costs. In this paper, the battery discharge depth function [22] is used to express the degradation cost of the energy storage battery. The specific function can be expressed as(5)Ci,tBD=10−Simax−Si,t−10−Simax−Si,t−1Ci,bat,Si,t=Si,t−1+Pi,tchΔtηi,tchNiESS−Pi,tdisΔtNiESSηi,tdis,where Simax represents the maximum state of charge of the energy storage battery of MGi, Si,t represents the state of charge of the energy storage battery of MGi in the period t, Ci,bat represents the initial investment cost of the energy storage battery of MGi, Pi,tch represents the charging power of the energy storage battery of the MGi in the period t, Pi,tdis represents the discharge power of the energy storage battery of the MGi in the period t, NiESS represents the rated capacity of the energy storage battery of the MGi, ηi,tch represents the charging efficiency of the energy storage battery of the MGi in the period t, ηi,tdis represents the discharge efficiency of the energy storage battery of the MGi in the period t, and Δt is the time interval.From equation (5), it can be seen that the initial investment cost of the energy storage battery is constant. Therefore, as long as the charge and discharge power of the energy storage battery are optimized to obtain the battery state of charge, the degradation cost of the energy storage battery can be obtained.


### 3.1.2. Electricity Transaction Cost between Microgrids

The electricity transaction cost between microgrids refers to the cost incurred when multiple microgrids exchange electricity, which is generally expressed as(6)Ct,kMN=Pi,tMNλi,tMNΔt,where Pi,tMN represents the power of MGi interacting with other microgrids in period t, the purchase of electricity is a positive value, the sale of electricity is a negative value, and λi,tMN represents the electricity price of MGi in period t.


### 3.1.3. Electricity Transaction Cost between the Microgrid and Power Distribution Network

The electricity transaction cost between the microgrid and the distribution network refers to the cost generated when the microgrid and the power distribution network interact with electricity, which is generally expressed as(7)Ci,tDN=−Pi,tDNλtDNΔt,where Pi,tDN is the interactive power between the MGi and the power distribution network in t period, the purchase of electricity is a negative value, the sale of electricity is a positive value, and λi,tDN is the electricity price of the power distribution network in t period.


## 3.1.1. Degraduation Cost of the Energy Storage Battery

The degradation cost of the energy storage battery is the cost of life reduction caused by the battery being recycled due to discharge, which is determined by the depth of discharge and the price of the battery. When the energy storage battery is deeply discharged, its recycling will lead to a reduction in life and an increase in degradation costs. In this paper, the battery discharge depth function [22] is used to express the degradation cost of the energy storage battery. The specific function can be expressed as(5)Ci,tBD=10−Simax−Si,t−10−Simax−Si,t−1Ci,bat,Si,t=Si,t−1+Pi,tchΔtηi,tchNiESS−Pi,tdisΔtNiESSηi,tdis,where Simax represents the maximum state of charge of the energy storage battery of MGi, Si,t represents the state of charge of the energy storage battery of MGi in the period t, Ci,bat represents the initial investment cost of the energy storage battery of MGi, Pi,tch represents the charging power of the energy storage battery of the MGi in the period t, Pi,tdis represents the discharge power of the energy storage battery of the MGi in the period t, NiESS represents the rated capacity of the energy storage battery of the MGi, ηi,tch represents the charging efficiency of the energy storage battery of the MGi in the period t, ηi,tdis represents the discharge efficiency of the energy storage battery of the MGi in the period t, and Δt is the time interval.From equation (5), it can be seen that the initial investment cost of the energy storage battery is constant. Therefore, as long as the charge and discharge power of the energy storage battery are optimized to obtain the battery state of charge, the degradation cost of the energy storage battery can be obtained.


## 3.1.2. Electricity Transaction Cost between Microgrids

The electricity transaction cost between microgrids refers to the cost incurred when multiple microgrids exchange electricity, which is generally expressed as(6)Ct,kMN=Pi,tMNλi,tMNΔt,where Pi,tMN represents the power of MGi interacting with other microgrids in period t, the purchase of electricity is a positive value, the sale of electricity is a negative value, and λi,tMN represents the electricity price of MGi in period t.


## 3.1.3. Electricity Transaction Cost between the Microgrid and Power Distribution Network

The electricity transaction cost between the microgrid and the distribution network refers to the cost generated when the microgrid and the power distribution network interact with electricity, which is generally expressed as(7)Ci,tDN=−Pi,tDNλtDNΔt,where Pi,tDN is the interactive power between the MGi and the power distribution network in t period, the purchase of electricity is a negative value, the sale of electricity is a positive value, and λi,tDN is the electricity price of the power distribution network in t period.


## 3.2. Optimal Dispatch Objective Function of the Microgrid Cluster

This paper takes the lowest operating cost of the microgrid cluster as the optimization goal and establishes the optimal dispatch model of the microgrid cluster. During the operation of the microgrid cluster, the costs are mainly composed of the compensation cost of the demand-side controllable load dispatch, the degradation cost of the energy storage battery, the electricity transaction cost between the microgrids, and the electricity transaction cost between the microgrid and power distribution network. The optimization objective function can be expressed as(8)minfx=∑t∈TCi,tCL+∑t∈TCi,tBD+∑t∈TCi,tMN+∑t∈TCi,tDN,where Ci,tCL represents the dispatch compensation cost of the controllable loads of the MGi in period t, Ci,tBD represents the degradation cost of the energy storage battery of the MGi in period t, Ci,tMN represents the electricity transaction cost between the microgrids of the MGi in period t, Ci,tDN represents the electricity transaction cost between the microgrid and the power distribution network of MGi in period t, and T is the dispatch period.


## 3.3. Constraints

### 3.3.1. Constraints of Power Balance

The power balance constraint of the microgrid clusters system is generally expressed as(9)Pi,tDN+Pi,tIL+Pi,tch+∑k∈NishiftPi,kshiftdi,k,t+∑k∈NiransPi,ktransui,k,t+∑k∈NiinterPi,kinterfi,k,t=Pi,tRE+Pi,tdis+Pi,tMN,where Pi,tIL is the electric power of the key load of MGi in t period and Pi,tRE is the renewable energy output of MGi in t period.The interactive power balance constraint between microgrids is expressed as(10)∑i∈IPi,tMN=0.


### 3.3.2. Constraints of Energy Storage Battery Operation

Since the energy storage battery cannot be charged and discharged at the same time, the energy storage battery charge and discharge power constraint is expressed as(11)0≤Pi,tch≤Pimax,0≤Pi,tdis≤Pimax,Pi,tch⋅Pi,tdis=0,where Pimax represents the maximum charge and discharge power of the energy storage battery of the MGi.For energy storage battery, their initial and final capacities should be consistent (excluding charge and discharge power constraints) and the energy storage capacity of each period needs to be controlled within a reasonable range. The following is the specific expression:(12)Simin≤Si,t≤Simax,Si,0=Si,24,where Simin is the minimum state of charge of the energy storage battery of MGi.


### 3.3.3. Transaction Constraints of the Microgrid Cluster

(1) Trading electricity price constraints between microgrids: when directly trading electrical energy between microgrids, the price should be above the purchase price of the power distribution network and remain below the sale price of the power distribution network, so it is expressed as(13)λtEB≤λi,tMN≤λtES,where λtEB and λtES are the electricity purchase and sale prices of the power distribution network.(2) Constraints on the balance of electricity transaction costs between microgrids: the balance constraint of electricity transaction cost between microgrids is expressed as(14)∑i∈IPi,tMNλi,tMNΔt=0.(3) Interactive power constraints between microgrids: the interactive power constraint between microgrids is expressed as(15)−PmaxMN≤Pi,tMN≤PmaxMN,where PmaxMN is the maximum value of interactive power between microgrids.(4) Interactive power constraints between the microgrid and power distribution network: the interactive power constraint between the microgrid and the power distribution network is expressed as(16)−PmaxDN≤Pi,tDN≤PmaxDN,where PmaxDN is the maximum value of the interactive power between the MGi and the power distribution network.


### 3.3.4. Constraints of Demand-Side Controllable Loads

The shiftable load needs to be translated as a whole to maintain the continuity of its electricity consumption, so the shiftable load constraint is expressed as(17)∑t=ti,kSshiftti,kEshiftdi,k,t=Di,kshift,di,k,t+∑p=1Di,kshift−1di,k,t+p=Di,kshift,where ti,kSshift represents the initial dispatch period of the k-th shiftable load in MGi and ti,kEshift represents the end dispatch period of the k-th shiftable load in MGi.The dispatch period of the transferable load is within the acceptable range, indicating that its operation has high flexibility, so the transferable load constraint is expressed as(18)∑t=ti,kStransti,kEtransui,k,t=Di,ktrans,where ti,kStrans and ti,kEtrans, respectively, are the beginning and end dispatch periods of the k-th transferable load of MGi.According to different degrees of importance, the maximum interruptible duration constraint of the interruptible load is implemented. In addition, the maximum and minimum duration constraints are also included in the interruptible load [23], and the constraints are expressed as(19)∑t=ti,kSinterti,kEinter1−fi,k,t≤Di,kinter,where ti,kSinter represents the initial operating period of the k-th interruptible load in MGi, ti,kEinter represents the end operating period of the k-th interruptible load in MGi, and Di,kinter represents the k-th maximum interruptible duration in MGi in a day.


## 3.3.1. Constraints of Power Balance

The power balance constraint of the microgrid clusters system is generally expressed as(9)Pi,tDN+Pi,tIL+Pi,tch+∑k∈NishiftPi,kshiftdi,k,t+∑k∈NiransPi,ktransui,k,t+∑k∈NiinterPi,kinterfi,k,t=Pi,tRE+Pi,tdis+Pi,tMN,where Pi,tIL is the electric power of the key load of MGi in t period and Pi,tRE is the renewable energy output of MGi in t period.The interactive power balance constraint between microgrids is expressed as(10)∑i∈IPi,tMN=0.


## 3.3.2. Constraints of Energy Storage Battery Operation

Since the energy storage battery cannot be charged and discharged at the same time, the energy storage battery charge and discharge power constraint is expressed as(11)0≤Pi,tch≤Pimax,0≤Pi,tdis≤Pimax,Pi,tch⋅Pi,tdis=0,where Pimax represents the maximum charge and discharge power of the energy storage battery of the MGi.For energy storage battery, their initial and final capacities should be consistent (excluding charge and discharge power constraints) and the energy storage capacity of each period needs to be controlled within a reasonable range. The following is the specific expression:(12)Simin≤Si,t≤Simax,Si,0=Si,24,where Simin is the minimum state of charge of the energy storage battery of MGi.


## 3.3.3. Transaction Constraints of the Microgrid Cluster

(1) Trading electricity price constraints between microgrids: when directly trading electrical energy between microgrids, the price should be above the purchase price of the power distribution network and remain below the sale price of the power distribution network, so it is expressed as(13)λtEB≤λi,tMN≤λtES,where λtEB and λtES are the electricity purchase and sale prices of the power distribution network.(2) Constraints on the balance of electricity transaction costs between microgrids: the balance constraint of electricity transaction cost between microgrids is expressed as(14)∑i∈IPi,tMNλi,tMNΔt=0.(3) Interactive power constraints between microgrids: the interactive power constraint between microgrids is expressed as(15)−PmaxMN≤Pi,tMN≤PmaxMN,where PmaxMN is the maximum value of interactive power between microgrids.(4) Interactive power constraints between the microgrid and power distribution network: the interactive power constraint between the microgrid and the power distribution network is expressed as(16)−PmaxDN≤Pi,tDN≤PmaxDN,where PmaxDN is the maximum value of the interactive power between the MGi and the power distribution network.


## 3.3.4. Constraints of Demand-Side Controllable Loads

The shiftable load needs to be translated as a whole to maintain the continuity of its electricity consumption, so the shiftable load constraint is expressed as(17)∑t=ti,kSshiftti,kEshiftdi,k,t=Di,kshift,di,k,t+∑p=1Di,kshift−1di,k,t+p=Di,kshift,where ti,kSshift represents the initial dispatch period of the k-th shiftable load in MGi and ti,kEshift represents the end dispatch period of the k-th shiftable load in MGi.The dispatch period of the transferable load is within the acceptable range, indicating that its operation has high flexibility, so the transferable load constraint is expressed as(18)∑t=ti,kStransti,kEtransui,k,t=Di,ktrans,where ti,kStrans and ti,kEtrans, respectively, are the beginning and end dispatch periods of the k-th transferable load of MGi.According to different degrees of importance, the maximum interruptible duration constraint of the interruptible load is implemented. In addition, the maximum and minimum duration constraints are also included in the interruptible load [23], and the constraints are expressed as(19)∑t=ti,kSinterti,kEinter1−fi,k,t≤Di,kinter,where ti,kSinter represents the initial operating period of the k-th interruptible load in MGi, ti,kEinter represents the end operating period of the k-th interruptible load in MGi, and Di,kinter represents the k-th maximum interruptible duration in MGi in a day.


## 4. Improved Sparrow Algorithm

### 4.1. Basic Sparrow Search Algorithm

The sparrow search algorithm is a swarm intelligence optimization algorithm that simulates the foraging behavior of sparrows. It contains three types of individuals, discoverer, follower, and alerter, and updates their locations according to their own rules.The location of the discoverer is updated as follows:(20)Xi,jt+1=Xi,jt⋅exp−iξ⋅MaxIter,R2<ST,Xi,jt+Q⋅L,R2≥ST,where t represents the current iteration number, j=1,2,…,d, and Xi,jt+1 represents the position of the i-th sparrow of the t + 1 generation in the j-th dimension, MaxIter represents the maximum number of iterations, ξ is a random number in the range of 0,1, R2∈0,1 represents the warning value, ST∈0.5,1 represents the safety value, Q is a random number and obeys 0,1 normal distribution, and L is a row of multidimensional matrix where all elements are 1. If R2<ST, it means that there are no natural enemies nearby, the search environment is safe, and the discoverer implements an extensive search mode; if R2≥ST, it means that sparrows detect natural enemies, and the entire population adjusts its search strategy and quickly moves to a safe area.The follower’s location update formula is as follows:(21)Xi,jt+1=Q⋅expXw,jt−Xi,jti2,i>N2,Xb,jt+1+Xi,jt−Xb,jt+1⋅A+⋅L,i≤N2,where Xw,jt represents the worst position of the sparrow in the j-th dimension at the t-th iteration, Xb,jt+1 represents the best position of the sparrow in the j-th dimension at the t + 1 iteration, and A is a 1×d matrix with randomly assigned values of 1 or −1 for each element. If i>N/2, it means that the i-th follower did not get food and has low adaptability and needs to fly to other areas to find food to obtain energy. If i≤N/2, it means that the i-th follower will randomly select a location nearby Xb,jt+1 for foraging.The position update formula of the alerter is as follows:(22)Xi,jt+1=Xb,jt+β⋅Xi,jt−Xb.jt,fi>fg,Xi,jt+k⋅Xi,jt−Xw,jtfi−fw+ε,fi=fg,where Xb,jt represents the optimal position of the sparrow in the j-th dimension at the t-th iteration, β is the step size control parameter, k is a random number within −1,1, fi is the fitness value of the current sparrow, fg represents the current global optimal fitness value, fw represents the current global worst fitness value, and ε is a very small constant to avoid denominator becoming 0. If fi>fg, it means that the sparrow is on the edge of the population and is easily attacked by natural enemies; if fi=fg, it means that the sparrow is in the center of the population and, due to being aware of the threat of being attacked by natural enemies, approaches other sparrows in time to avoid danger.


### 4.2. Improved Sparrow Algorithm

#### 4.2.1. Initial Population of the Bernoulli Chaotic Map

Chaotic variables are ergodic, which can effectively improve the algorithm's global optimization capability. The chaotic map used in this paper is the Bernoulli equation [24].(23)Xn+1=Xn1−λ,Xn∈0,1−λ,Xn−1+λλ,Xn∈1−λ,1,where λ=0.3.


#### 4.2.2. Improved Finder Update Formula

Introducing the global optimal solution of the previous generation and the dynamic weight factorω into the discoverer update formula can avoid the algorithm falling into local optimal and improve the convergence speed [25]. The improved formula is as follows:(24)ω=ωmin+ωmax2+ωmax−ωmincostπMaxIter,(25)Xi,jt+1=Xi,jt+ωfj,gt−Xi,jt⋅rand,R2<ST,Xi,jt+Q,R2≥ST.In formula (24), ωmax and ωmin are the inertia weights at the beginning and end of the iteration, respectively, t is the current iteration number, MaxIter is the maximum number of iterations, and when ωmax=0.95 and ωmin=0.4, the algorithm optimization performance is the best. As the number of iterations increases, the inertia weight will gradually decrease nonlinearly because at the beginning of the iteration, using a larger inertia weight can improve the search ability of the algorithm and at the end of the iteration, using a smaller inertia weight can enhance the development ability of the algorithm.In formula (25), fj,gt is the optimal solution of the sparrow in the j-th dimension at the t-th iteration.


#### 4.2.3. Improved Alerter Update Formula

The improved alerter update formula is shown in equation (26), which means that if the sparrow is in the optimal position, it will randomly fly to any position between the optimal position and the worst position. If the sparrow is not in the optimal position, then it will randomly fly to any position between the current position and the optimal position.(26)Xi,jt+1=Xb,jt+βXi,jt−Xb,jt,fi≠fg,Xb,jt+βXw,jt−Xb,jt,fi=fg.


#### 4.2.4. Combining the Cauchy Mutation and Reverse Learning Strategy

Gaussian mutation has a weak ability to guide individuals out of better local solutions, which is not conducive to global convergence; therefore, this paper uses the Cauchy mutation [26–28]. The Cauchy mutation comes from the Cauchy distribution, and the standard Cauchy distribution function formula is as follows:(27)fx=1π1x2+1.Introducing the Cauchy mutation into the target position update method and exerting the perturbation ability of the Cauchy operator can improve the global optimization ability of the algorithm.(28)Xi,jt+1=Xb,jt+cauchy0,1⊕Xb,jt,where cauchy0,1 is the standard Cauchy distribution. The Cauchy distribution random variable generating function is η=tanξ−0.5π.Reverse learning can effectively improve the efficiency of the algorithm in solving the global optimum. The solution idea is: in the search process, based on the current solution, the reverse learning strategy is used to calculate the reverse solution relative to the center, and then, a better solution is selected after the corresponding comparative evaluation, thereby improving the global optimization capability of the algorithm, and the calculation formula is as follows:(29)Xb,j′t=ub+r⊕lb−Xb,jt,(30)Xi,jt+1=Xb,j′t+k1⊕Xb,jt−Xb,j′t,where Xb,j′t is the reverse solution of the optimal solution of the t-th generation, ub,lb are the upper and lower bounds, r is a 1∗d random number matrix, which obeys the (0, 1) standard uniform distribution, and k1 represents the information exchange control parameters. The formula is as follows:(31)k1=MaxIter−tMaxItert.The reverse learning strategy can expand the global optimization ability of the algorithm, and the Cauchy mutation strategy can improve the algorithm to avoid falling into the local optimal solution. Therefore, in order to further improve the algorithm optimization performance, the Cauchy mutation strategy and the reverse learning strategy are exchanged under the condition of selection probabilityPs, and the target position is dynamically updated. The calculation formula is as follows:(32)Ps=−exp1−tMaxIter20+θ,where θ is the adjustment parameter, and its value can be 0.05.The process of selecting strategy 1 is as follows:(1)
Ifrand<Ps(2)
Select the reverse learning strategy of formulas (29)–(31) to update the position(3)
Ifrand≥Ps(4)
Select the Cauchy mutation strategy of formula (28) to update the target positionThe Cauchy perturbation strategy and reverse learning strategy can improve the ability of the algorithm to jump out of local space; however, it is impossible to compare whether the fitness value of the new position obtained after these two disturbance strategies is better than the fitness value of the previous position. Therefore, the greedy rule is added to compare the fitness value of the new position after the disturbance mutation with the fitness value of the previous position. If the fitness value of the new location is better than the fitness value of the old location, the location is updated; otherwise, it is not updated.The process of selecting strategy 2 is as follows:(1)
IffXi,jt+1<fXb,j(2)
Xb,j=Xi,jt+1(3)
IffXi,jt+1≥fXb,j(4)
Xb,j=Xb,j


#### 4.2.5. The Steps of the Algorithm

The steps of the chaos sparrow algorithm are as follows:(1)
Initialize the parameters, and use the Bernoulli chaotic map of equation (23) to initialize the sparrow population(2)
Calculate the fitness value of each sparrow and sort it to find the current optimal and worst fitness value individual(3)
According to equations (25), (21), and (26), the positions of the finder, follower, and alerter are updated, respectively(4)
According to selection strategy 1, the current optimal solution is disturbed and a new solution is generated(5)
According to strategy 2, compare the pros and cons of the fitness values before and after the disturbance to determine whether the location is updated(6)
Iteration termination judgment: if it meets the iteration termination condition, then jump out of the loop and output the optimal result; if not, then jump to step (2) and continue the iteration until it meets the iteration termination condition and output the optimal result.


## 4.1. Basic Sparrow Search Algorithm

The sparrow search algorithm is a swarm intelligence optimization algorithm that simulates the foraging behavior of sparrows. It contains three types of individuals, discoverer, follower, and alerter, and updates their locations according to their own rules.The location of the discoverer is updated as follows:(20)Xi,jt+1=Xi,jt⋅exp−iξ⋅MaxIter,R2<ST,Xi,jt+Q⋅L,R2≥ST,where t represents the current iteration number, j=1,2,…,d, and Xi,jt+1 represents the position of the i-th sparrow of the t + 1 generation in the j-th dimension, MaxIter represents the maximum number of iterations, ξ is a random number in the range of 0,1, R2∈0,1 represents the warning value, ST∈0.5,1 represents the safety value, Q is a random number and obeys 0,1 normal distribution, and L is a row of multidimensional matrix where all elements are 1. If R2<ST, it means that there are no natural enemies nearby, the search environment is safe, and the discoverer implements an extensive search mode; if R2≥ST, it means that sparrows detect natural enemies, and the entire population adjusts its search strategy and quickly moves to a safe area.The follower’s location update formula is as follows:(21)Xi,jt+1=Q⋅expXw,jt−Xi,jti2,i>N2,Xb,jt+1+Xi,jt−Xb,jt+1⋅A+⋅L,i≤N2,where Xw,jt represents the worst position of the sparrow in the j-th dimension at the t-th iteration, Xb,jt+1 represents the best position of the sparrow in the j-th dimension at the t + 1 iteration, and A is a 1×d matrix with randomly assigned values of 1 or −1 for each element. If i>N/2, it means that the i-th follower did not get food and has low adaptability and needs to fly to other areas to find food to obtain energy. If i≤N/2, it means that the i-th follower will randomly select a location nearby Xb,jt+1 for foraging.The position update formula of the alerter is as follows:(22)Xi,jt+1=Xb,jt+β⋅Xi,jt−Xb.jt,fi>fg,Xi,jt+k⋅Xi,jt−Xw,jtfi−fw+ε,fi=fg,where Xb,jt represents the optimal position of the sparrow in the j-th dimension at the t-th iteration, β is the step size control parameter, k is a random number within −1,1, fi is the fitness value of the current sparrow, fg represents the current global optimal fitness value, fw represents the current global worst fitness value, and ε is a very small constant to avoid denominator becoming 0. If fi>fg, it means that the sparrow is on the edge of the population and is easily attacked by natural enemies; if fi=fg, it means that the sparrow is in the center of the population and, due to being aware of the threat of being attacked by natural enemies, approaches other sparrows in time to avoid danger.


## 4.2. Improved Sparrow Algorithm

### 4.2.1. Initial Population of the Bernoulli Chaotic Map

Chaotic variables are ergodic, which can effectively improve the algorithm's global optimization capability. The chaotic map used in this paper is the Bernoulli equation [24].(23)Xn+1=Xn1−λ,Xn∈0,1−λ,Xn−1+λλ,Xn∈1−λ,1,where λ=0.3.


### 4.2.2. Improved Finder Update Formula

Introducing the global optimal solution of the previous generation and the dynamic weight factorω into the discoverer update formula can avoid the algorithm falling into local optimal and improve the convergence speed [25]. The improved formula is as follows:(24)ω=ωmin+ωmax2+ωmax−ωmincostπMaxIter,(25)Xi,jt+1=Xi,jt+ωfj,gt−Xi,jt⋅rand,R2<ST,Xi,jt+Q,R2≥ST.In formula (24), ωmax and ωmin are the inertia weights at the beginning and end of the iteration, respectively, t is the current iteration number, MaxIter is the maximum number of iterations, and when ωmax=0.95 and ωmin=0.4, the algorithm optimization performance is the best. As the number of iterations increases, the inertia weight will gradually decrease nonlinearly because at the beginning of the iteration, using a larger inertia weight can improve the search ability of the algorithm and at the end of the iteration, using a smaller inertia weight can enhance the development ability of the algorithm.In formula (25), fj,gt is the optimal solution of the sparrow in the j-th dimension at the t-th iteration.


### 4.2.3. Improved Alerter Update Formula

The improved alerter update formula is shown in equation (26), which means that if the sparrow is in the optimal position, it will randomly fly to any position between the optimal position and the worst position. If the sparrow is not in the optimal position, then it will randomly fly to any position between the current position and the optimal position.(26)Xi,jt+1=Xb,jt+βXi,jt−Xb,jt,fi≠fg,Xb,jt+βXw,jt−Xb,jt,fi=fg.


### 4.2.4. Combining the Cauchy Mutation and Reverse Learning Strategy

Gaussian mutation has a weak ability to guide individuals out of better local solutions, which is not conducive to global convergence; therefore, this paper uses the Cauchy mutation [26–28]. The Cauchy mutation comes from the Cauchy distribution, and the standard Cauchy distribution function formula is as follows:(27)fx=1π1x2+1.Introducing the Cauchy mutation into the target position update method and exerting the perturbation ability of the Cauchy operator can improve the global optimization ability of the algorithm.(28)Xi,jt+1=Xb,jt+cauchy0,1⊕Xb,jt,where cauchy0,1 is the standard Cauchy distribution. The Cauchy distribution random variable generating function is η=tanξ−0.5π.Reverse learning can effectively improve the efficiency of the algorithm in solving the global optimum. The solution idea is: in the search process, based on the current solution, the reverse learning strategy is used to calculate the reverse solution relative to the center, and then, a better solution is selected after the corresponding comparative evaluation, thereby improving the global optimization capability of the algorithm, and the calculation formula is as follows:(29)Xb,j′t=ub+r⊕lb−Xb,jt,(30)Xi,jt+1=Xb,j′t+k1⊕Xb,jt−Xb,j′t,where Xb,j′t is the reverse solution of the optimal solution of the t-th generation, ub,lb are the upper and lower bounds, r is a 1∗d random number matrix, which obeys the (0, 1) standard uniform distribution, and k1 represents the information exchange control parameters. The formula is as follows:(31)k1=MaxIter−tMaxItert.The reverse learning strategy can expand the global optimization ability of the algorithm, and the Cauchy mutation strategy can improve the algorithm to avoid falling into the local optimal solution. Therefore, in order to further improve the algorithm optimization performance, the Cauchy mutation strategy and the reverse learning strategy are exchanged under the condition of selection probabilityPs, and the target position is dynamically updated. The calculation formula is as follows:(32)Ps=−exp1−tMaxIter20+θ,where θ is the adjustment parameter, and its value can be 0.05.The process of selecting strategy 1 is as follows:(1)
Ifrand<Ps(2)
Select the reverse learning strategy of formulas (29)–(31) to update the position(3)
Ifrand≥Ps(4)
Select the Cauchy mutation strategy of formula (28) to update the target positionThe Cauchy perturbation strategy and reverse learning strategy can improve the ability of the algorithm to jump out of local space; however, it is impossible to compare whether the fitness value of the new position obtained after these two disturbance strategies is better than the fitness value of the previous position. Therefore, the greedy rule is added to compare the fitness value of the new position after the disturbance mutation with the fitness value of the previous position. If the fitness value of the new location is better than the fitness value of the old location, the location is updated; otherwise, it is not updated.The process of selecting strategy 2 is as follows:(1)
IffXi,jt+1<fXb,j(2)
Xb,j=Xi,jt+1(3)
IffXi,jt+1≥fXb,j(4)
Xb,j=Xb,j


### 4.2.5. The Steps of the Algorithm

The steps of the chaos sparrow algorithm are as follows:(1)
Initialize the parameters, and use the Bernoulli chaotic map of equation (23) to initialize the sparrow population(2)
Calculate the fitness value of each sparrow and sort it to find the current optimal and worst fitness value individual(3)
According to equations (25), (21), and (26), the positions of the finder, follower, and alerter are updated, respectively(4)
According to selection strategy 1, the current optimal solution is disturbed and a new solution is generated(5)
According to strategy 2, compare the pros and cons of the fitness values before and after the disturbance to determine whether the location is updated(6)
Iteration termination judgment: if it meets the iteration termination condition, then jump out of the loop and output the optimal result; if not, then jump to step (2) and continue the iteration until it meets the iteration termination condition and output the optimal result.


## 4.2.1. Initial Population of the Bernoulli Chaotic Map

Chaotic variables are ergodic, which can effectively improve the algorithm's global optimization capability. The chaotic map used in this paper is the Bernoulli equation [24].(23)Xn+1=Xn1−λ,Xn∈0,1−λ,Xn−1+λλ,Xn∈1−λ,1,where λ=0.3.


## 4.2.2. Improved Finder Update Formula

Introducing the global optimal solution of the previous generation and the dynamic weight factorω into the discoverer update formula can avoid the algorithm falling into local optimal and improve the convergence speed [25]. The improved formula is as follows:(24)ω=ωmin+ωmax2+ωmax−ωmincostπMaxIter,(25)Xi,jt+1=Xi,jt+ωfj,gt−Xi,jt⋅rand,R2<ST,Xi,jt+Q,R2≥ST.In formula (24), ωmax and ωmin are the inertia weights at the beginning and end of the iteration, respectively, t is the current iteration number, MaxIter is the maximum number of iterations, and when ωmax=0.95 and ωmin=0.4, the algorithm optimization performance is the best. As the number of iterations increases, the inertia weight will gradually decrease nonlinearly because at the beginning of the iteration, using a larger inertia weight can improve the search ability of the algorithm and at the end of the iteration, using a smaller inertia weight can enhance the development ability of the algorithm.In formula (25), fj,gt is the optimal solution of the sparrow in the j-th dimension at the t-th iteration.


## 4.2.3. Improved Alerter Update Formula

The improved alerter update formula is shown in equation (26), which means that if the sparrow is in the optimal position, it will randomly fly to any position between the optimal position and the worst position. If the sparrow is not in the optimal position, then it will randomly fly to any position between the current position and the optimal position.(26)Xi,jt+1=Xb,jt+βXi,jt−Xb,jt,fi≠fg,Xb,jt+βXw,jt−Xb,jt,fi=fg.


## 4.2.4. Combining the Cauchy Mutation and Reverse Learning Strategy

Gaussian mutation has a weak ability to guide individuals out of better local solutions, which is not conducive to global convergence; therefore, this paper uses the Cauchy mutation [26–28]. The Cauchy mutation comes from the Cauchy distribution, and the standard Cauchy distribution function formula is as follows:(27)fx=1π1x2+1.Introducing the Cauchy mutation into the target position update method and exerting the perturbation ability of the Cauchy operator can improve the global optimization ability of the algorithm.(28)Xi,jt+1=Xb,jt+cauchy0,1⊕Xb,jt,where cauchy0,1 is the standard Cauchy distribution. The Cauchy distribution random variable generating function is η=tanξ−0.5π.Reverse learning can effectively improve the efficiency of the algorithm in solving the global optimum. The solution idea is: in the search process, based on the current solution, the reverse learning strategy is used to calculate the reverse solution relative to the center, and then, a better solution is selected after the corresponding comparative evaluation, thereby improving the global optimization capability of the algorithm, and the calculation formula is as follows:(29)Xb,j′t=ub+r⊕lb−Xb,jt,(30)Xi,jt+1=Xb,j′t+k1⊕Xb,jt−Xb,j′t,where Xb,j′t is the reverse solution of the optimal solution of the t-th generation, ub,lb are the upper and lower bounds, r is a 1∗d random number matrix, which obeys the (0, 1) standard uniform distribution, and k1 represents the information exchange control parameters. The formula is as follows:(31)k1=MaxIter−tMaxItert.The reverse learning strategy can expand the global optimization ability of the algorithm, and the Cauchy mutation strategy can improve the algorithm to avoid falling into the local optimal solution. Therefore, in order to further improve the algorithm optimization performance, the Cauchy mutation strategy and the reverse learning strategy are exchanged under the condition of selection probabilityPs, and the target position is dynamically updated. The calculation formula is as follows:(32)Ps=−exp1−tMaxIter20+θ,where θ is the adjustment parameter, and its value can be 0.05.The process of selecting strategy 1 is as follows:(1)
Ifrand<Ps(2)
Select the reverse learning strategy of formulas (29)–(31) to update the position(3)
Ifrand≥Ps(4)
Select the Cauchy mutation strategy of formula (28) to update the target positionThe Cauchy perturbation strategy and reverse learning strategy can improve the ability of the algorithm to jump out of local space; however, it is impossible to compare whether the fitness value of the new position obtained after these two disturbance strategies is better than the fitness value of the previous position. Therefore, the greedy rule is added to compare the fitness value of the new position after the disturbance mutation with the fitness value of the previous position. If the fitness value of the new location is better than the fitness value of the old location, the location is updated; otherwise, it is not updated.The process of selecting strategy 2 is as follows:(1)
IffXi,jt+1<fXb,j(2)
Xb,j=Xi,jt+1(3)
IffXi,jt+1≥fXb,j(4)
Xb,j=Xb,j


## 4.2.5. The Steps of the Algorithm

The steps of the chaos sparrow algorithm are as follows:(1)
Initialize the parameters, and use the Bernoulli chaotic map of equation (23) to initialize the sparrow population(2)
Calculate the fitness value of each sparrow and sort it to find the current optimal and worst fitness value individual(3)
According to equations (25), (21), and (26), the positions of the finder, follower, and alerter are updated, respectively(4)
According to selection strategy 1, the current optimal solution is disturbed and a new solution is generated(5)
According to strategy 2, compare the pros and cons of the fitness values before and after the disturbance to determine whether the location is updated(6)
Iteration termination judgment: if it meets the iteration termination condition, then jump out of the loop and output the optimal result; if not, then jump to step (2) and continue the iteration until it meets the iteration termination condition and output the optimal result.


## 5. Function Test

### 5.1. Parameter Setting

Based on 12 benchmark test functions, we compare the performance of the improved sparrow algorithm, sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. The test function is shown in Table1, and the parameters of each algorithm are shown in Table 2. The parameter selection was based on the parameters used by the original author in the article or the parameters widely used by various researchers. The simulation is written and completed by MATLAB2018a. In the test, the population size of each algorithm is set to 50, the number of iterations is set to 400, and each algorithm runs independently 50 times.Table 1
Test function.
Function expressionDimensionRangeOptimal valueF1x=∑i=1nxi230−100,1000F2x=∑i=1nxi+∏i=1nxi30−10,100F3x=∑i=1n∑j−1ixj230−100,1000F4x=maxixi,1≤i≤n30−100,1000F5x=∑i=1n−1100xi+1−xi22+xi−1230−30,300F6x=∑i=1nxi+0.5230−100,1000F7x=∑i=1nixi4+random0,130−1.28,1.280F8x=∑i=1nxi2−10cos2πxi+1030−5.12,5.120F9x=−20exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+20+e30−32,320F10x=1/4000∑i=1nxi2−∏i=1ncosxi/i+130−600,6000F11x=π/n10sinπy1+∑i=1n−1yi−121+sin2πyi+1+yn−12+∑i=1nuxi,10,100,4yi=1+xi+1/4uxi,a,k,m=kxi−am,xi>a0,−a<xi<ak−xi−am,xi<−a30−50,500F12x=0.1sin23πx1+∑i=1nxi−121+sin23πxi+1+xn−121+sin22πxn+∑i=1nuxi,5,100,430−50,500Table 2
Parameter settings of the algorithm.
AlgorithmParameter settingsGAPX=0.65,PM=0.05PSOc1=c2=1,w=0.6CPSOc1=c2=1,w=0.6SSAPD=20%,R2=0.8,SD=10%ISSAPD=20%,R2=0.8,SD=10%,θ=0.05


### 5.2. Comparison and Analysis of Algorithm Performance Results

The average values and standard deviations obtained by optimizing 12 benchmark test functions by five algorithms are shown in Table3. It can be seen that, for the unimodal function F1–F7, the ISSA algorithm has the best optimization effect, and the average value and standard deviation reach the global optimal solution. For the multimodal function F8–F12, ISSA algorithm and SSA algorithm have the same optimization effect and are better than PSO, CPSO, and GA algorithm. When solving F8 and F10, ISSA and SSA can reach the theoretical optimal solution stably. When solving F9, F11, and F12, although ISSA and SSA cannot converge to the theoretical optimal solution, their convergence effect and convergence accuracy are better than those of PSO, CPSO, and GA.Table 3
Comparison results on test functions.
FStatisticsGAPSOCPSOSSAISSAF1Ave1.5885e + 040.05576.3925e − 406.9803e − 1340Std3.5365e + 030.23231.0020e − 394.9358e − 1330F2Ave50.26617.26392.3988e − 203.5405e − 711.0603e − 219Std8.84565.18731.5270e − 202.5035e − 700F3Ave3.1834e + 041.8163e + 0322.99414.3294e − 1070Std9.0644e + 031.4864e + 0381.98272.3121e − 1060F4Ave53.455411.807211.46274.0192e − 766.4391e − 208Std5.78313.79013.39742.8420e − 750F5Ave2.0631e + 07114.03821.7179e + 0300Std8.4778e + 06202.13851.189100F6Ave1.6195e + 040.02095.7585e − 2200Std4.4542e + 030.11281.6550e − 2100F7Ave8.74270.16119.4820e − 681.4052e − 2580Std4.51830.64405.2353e − 6700F8Ave210.799876.917577.306000Std28.472623.950124.333900F9Ave17.09216.52812.1541e − 108.8818e − 168.8818e − 16Std0.74111.30359.4122e − 2000F10Ave151.26050.09430.004300Std33.97820.09760.006900F11Ave1.4287e + 075.58061.4205e − 311.5705e − 321.5705e − 32Std1.0079e + 073.68881.2059e − 315.5294e − 485.5294e − 48F12Ave5.6904e + 0725.00583.9269e − 311.3498e − 321.3498e − 32Std3.0359e + 0710.70485.9462e − 311.1059e − 471.1059e − 47


### 5.3. Comparison and Analysis of Algorithm Convergence Curves

The convergence curve obtained by optimizing 12 benchmark test functions by five algorithms is shown in Figure2. It can be seen that when solving different test functions, the convergence speed of ISSA is better than SSA, PSO, CPSO, and GA algorithms, and it has better convergence speed and convergence accuracy. The horizontal axis represents update algebra, and the vertical axis represents the logarithm of fitness value log.Figure 2
Convergence curve of algorithm. (a) F1. (b) F2. (c) F3. (d) F4. (e) F5. (f) F6. (g) F7. (h) F8. (i) F9. (j) F10. (k) F11. (m) F12.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)


## 5.1. Parameter Setting

Based on 12 benchmark test functions, we compare the performance of the improved sparrow algorithm, sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. The test function is shown in Table1, and the parameters of each algorithm are shown in Table 2. The parameter selection was based on the parameters used by the original author in the article or the parameters widely used by various researchers. The simulation is written and completed by MATLAB2018a. In the test, the population size of each algorithm is set to 50, the number of iterations is set to 400, and each algorithm runs independently 50 times.Table 1
Test function.
Function expressionDimensionRangeOptimal valueF1x=∑i=1nxi230−100,1000F2x=∑i=1nxi+∏i=1nxi30−10,100F3x=∑i=1n∑j−1ixj230−100,1000F4x=maxixi,1≤i≤n30−100,1000F5x=∑i=1n−1100xi+1−xi22+xi−1230−30,300F6x=∑i=1nxi+0.5230−100,1000F7x=∑i=1nixi4+random0,130−1.28,1.280F8x=∑i=1nxi2−10cos2πxi+1030−5.12,5.120F9x=−20exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+20+e30−32,320F10x=1/4000∑i=1nxi2−∏i=1ncosxi/i+130−600,6000F11x=π/n10sinπy1+∑i=1n−1yi−121+sin2πyi+1+yn−12+∑i=1nuxi,10,100,4yi=1+xi+1/4uxi,a,k,m=kxi−am,xi>a0,−a<xi<ak−xi−am,xi<−a30−50,500F12x=0.1sin23πx1+∑i=1nxi−121+sin23πxi+1+xn−121+sin22πxn+∑i=1nuxi,5,100,430−50,500Table 2
Parameter settings of the algorithm.
AlgorithmParameter settingsGAPX=0.65,PM=0.05PSOc1=c2=1,w=0.6CPSOc1=c2=1,w=0.6SSAPD=20%,R2=0.8,SD=10%ISSAPD=20%,R2=0.8,SD=10%,θ=0.05


## 5.2. Comparison and Analysis of Algorithm Performance Results

The average values and standard deviations obtained by optimizing 12 benchmark test functions by five algorithms are shown in Table3. It can be seen that, for the unimodal function F1–F7, the ISSA algorithm has the best optimization effect, and the average value and standard deviation reach the global optimal solution. For the multimodal function F8–F12, ISSA algorithm and SSA algorithm have the same optimization effect and are better than PSO, CPSO, and GA algorithm. When solving F8 and F10, ISSA and SSA can reach the theoretical optimal solution stably. When solving F9, F11, and F12, although ISSA and SSA cannot converge to the theoretical optimal solution, their convergence effect and convergence accuracy are better than those of PSO, CPSO, and GA.Table 3
Comparison results on test functions.
FStatisticsGAPSOCPSOSSAISSAF1Ave1.5885e + 040.05576.3925e − 406.9803e − 1340Std3.5365e + 030.23231.0020e − 394.9358e − 1330F2Ave50.26617.26392.3988e − 203.5405e − 711.0603e − 219Std8.84565.18731.5270e − 202.5035e − 700F3Ave3.1834e + 041.8163e + 0322.99414.3294e − 1070Std9.0644e + 031.4864e + 0381.98272.3121e − 1060F4Ave53.455411.807211.46274.0192e − 766.4391e − 208Std5.78313.79013.39742.8420e − 750F5Ave2.0631e + 07114.03821.7179e + 0300Std8.4778e + 06202.13851.189100F6Ave1.6195e + 040.02095.7585e − 2200Std4.4542e + 030.11281.6550e − 2100F7Ave8.74270.16119.4820e − 681.4052e − 2580Std4.51830.64405.2353e − 6700F8Ave210.799876.917577.306000Std28.472623.950124.333900F9Ave17.09216.52812.1541e − 108.8818e − 168.8818e − 16Std0.74111.30359.4122e − 2000F10Ave151.26050.09430.004300Std33.97820.09760.006900F11Ave1.4287e + 075.58061.4205e − 311.5705e − 321.5705e − 32Std1.0079e + 073.68881.2059e − 315.5294e − 485.5294e − 48F12Ave5.6904e + 0725.00583.9269e − 311.3498e − 321.3498e − 32Std3.0359e + 0710.70485.9462e − 311.1059e − 471.1059e − 47


## 5.3. Comparison and Analysis of Algorithm Convergence Curves

The convergence curve obtained by optimizing 12 benchmark test functions by five algorithms is shown in Figure2. It can be seen that when solving different test functions, the convergence speed of ISSA is better than SSA, PSO, CPSO, and GA algorithms, and it has better convergence speed and convergence accuracy. The horizontal axis represents update algebra, and the vertical axis represents the logarithm of fitness value log.Figure 2
Convergence curve of algorithm. (a) F1. (b) F2. (c) F3. (d) F4. (e) F5. (f) F6. (g) F7. (h) F8. (i) F9. (j) F10. (k) F11. (m) F12.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)


## 6. Case Analysis

### 6.1. Basic Data

This article takes the microgrid cluster system constructed by the three microgrids shown in Figure1 as an example. The renewable energy output of each microgrid is shown in Figure 3, and the load curve is shown in Figure 4. The power of the controllable loads is 25 kW, and the dispatch compensation prices for the shiftable load, the transferable load, and the interruptible load, respectively, are 0.05 Yuan/kWh, 0.08 Yuan/kWh, and 0.3 Yuan/kWh. The initial operating period and allowable scheduling period of the controllable loads are shown in Table 4. The rated capacity of the microgrid energy storage system is 300 kWh, the maximum allowable charge and discharge power is 100 kW, and the maximum and small states of charge are divided into 0.9 and 0.2. The purchase and sale price of the power distribution network is shown in Table 5. The scheduling period of the calculation example is 24 hours a day, divided into 24 time periods, and the scheduling time is selected as 00 : 00–24 : 00.Figure 3
Renewable energy output.Figure 4
The original load of each microgrid.Table 4
Controllable loads parameters.
Time periodShiftable loadTransferable loadInterruptible loadInitial operating period11 : 00–15 : 0019 : 00–22 : 0010 : 00–21 : 00Scheduleable period11 : 00–22 : 0000 : 00–24 : 0010 : 00–21 : 00Table 5
Time-of-use price.
Transaction formTimetableElectricity price (Yuan/(kwh))Sell electricityPeak time10 : 00∼15 : 0018 : 00∼21 : 001.2Normal time07 : 00∼10 : 0015 : 00∼18 : 0021 : 00∼23 : 000.8Valley time23 : 00∼07 : 000.4Purchase electricity0 : 00∼24 : 000.39


### 6.2. Analysis of the Results of Electricity Trading between Microgrids

The electric energy exchange between microgrids is shown in Table6. It can be seen that when the market is in equilibrium, electricity can be purchased and sold in various periods of time through the trade of electricity between microgrids.Table 6
Transaction electricity between microgrids.
TimeTransaction power (kwh) (controllable load)Transaction power (kwh) (no controllable load)MG1MG2MG3MG1MG2MG3157.0021−49.0573−7.944856.9146−48.9979−7.9167230.5244−33.50492.980530.4912−22.5127−7.9785330.2046−18.1475−12.057130.1978−18.1446−12.0472484.6933−62.3520−22.341384.3783−62.1016−22.2767547.1775−30.4015−16.776047.8766−30.8375−17.0391663.5587−63.77790.219269.7560−63.0511−6.7049770.0852−47.4771−22.608170.3143−42.3144−27.9999816.167612.6786−28.846515.968312.7390−28.7072941.281489.3333−130.614741.072789.6763−130.749010−0.0712−21.258621.3298−57.9441−18.287476.231511−91.11447.756881.3576−65.682913.315952.366912−110.200059.143351.0568−134.731271.275763.455513−6.6502−25.272431.9226−66.10350.929565.174114000000150000001616.9902−43.136826.146717.3261−43.729926.4038170000001826.822114.9465−41.768628.147415.1149−43.26231971.8018−71.1782−0.623697.1128−116.179419.06662060.0222−60.0180−0.004293.7188−131.368237.64942149.2324−6.0715−43.160964.2092−33.1416−31.14162252.5377−43.5587−8.9790104.5194−82.3977−22.12172358.5305−47.8465−10.684058.7109−37.1341−21.57682468.5343−49.9633−18.571069.4401−62.4023−7.0378It can be seen from Table6 that when controllable loads participate in dispatching, at 14 : 00, 15 : 00, and 17 : 00, since the power generation of the microgrid cluster cannot meet the load demand, the power interaction between the microgrids in the cluster cannot be carried out, and electricity needs to be purchased from the power distribution network. From 10 : 00 to 13 : 00, MG1 sells electricity to MG2 that has insufficient power at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus. During the time periods of 08 : 00–09 : 00, 11 : 00–12 : 00, and 18 : 00, MG2 cannot meet its own load demand due to its insufficient output. Therefore, MG2 needs to purchase electricity from MG1 or MG3 that has too much power at the target time. During the time period from 19 : 00 to 24 : 00, MG3 sells electricity to the MG1 whose power is insufficient at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus.


### 6.3. Analysis of the Results of Electric Energy Trading between the Microgrid and Power Distribution Network

The electric energy exchange between the microgrid and the power distribution network is shown in Table7. It can be seen that when MG1, MG2, and MG3 exchange electric energy, the interactive electric energy between each microgrid and the power distribution network can be reduced.Table 7
Transaction electricity between the microgrid and power distribution network.
TimeTransaction power (kwh) (controllable load)Transaction power (kwh) (no controllable load)MG1MG2MG3MG1MG2MG310185.928830.1110−7.1054e − 15185.826030.024420188.249300198.689870.415230207.5529137.89760206.9558137.409040226.273781.07610225.952581.052450247.9922136.84630247.2298136.60606−13.61860−0.0470−7.6627−7.1054e − 1507019.17929.1329023.736815.70698−39.8650−31.26200−40.3733−32.208609−31.2095−67.53770−31.2378−68.203301000−54.92515.78011.82420111.4211e − 14−3.3936−36.46890−23.6277−92.9195120−39.3185−33.94260−53.7049−47.81251300−7.00990.61950014−56.9322−61.8237−47.6179−82.3522−87.8662−73.132215−93.0122−164.1142−118.7230−93.4173−164.3346−118.940116−62.07620−95.5308−62.28670−94.920617−45.9460−174.8343−12.8887−46.5703−173.2011−11.228818−73.2103−40.73620−71.2530−38.2621019067.33000.5899−22.25300−4.333420093.57630.0065−13.17200−5.29152101.583711.2581−33.316100220263.264654.26850248.683566.765223084.832718.9430095.072355.24182400.15390.0572089.963010.1462It can be seen from Table7 that when controllable loads participate in the dispatch, during the time period of 14 : 00–18 : 00, MG1 cannot meet its own needs due to its insufficient output; therefore, it needs to purchase electricity from the power distribution network. During the time period of 01 : 00–05 : 00 and 19 : 00–24 : 00, MG2 has been selling electric energy to the power distribution network due to its overcapacity. During the time period of 10 : 00–17 : 00, MG3 cannot meet its own needs due to its insufficient output, and needs to purchase electricity from the power distribution network to meet its own needs. It can be seen from the abovementioned phenomenon that electricity trading between microgrids can completely eliminate excess renewable energy and balance the supply and demand of the system.


### 6.4. Analysis of the Results before and after Controllable Loads

The controllable load scheduling results are shown in Figure5. It can be seen from Figure (a–c) that the overall loads of MG1 increase from 09 : 00 to 15 : 00, the loads of MG2 decrease from 10 : 00 to 15 : 00, and the loads increase from 18 : 00 to 24 : 00, the loads of MG3 increase during the time period of 00 : 00–08 : 00 and 18 : 00–24 : 00, and the loads decrease from 09 : 00 to 15 : 00. The total loads of the microgrid cluster can be seen from Figure (d), after adding the demand-side controllable loads schedule; the loads in the low period of 23 : 00–07 : 00 increase, and the loads in the peak period of 11 : 00–15 : 00 decreases. The peak-valley difference of the loads is reduced.Figure 5
Before and after load shift. (a) MG1; (b) MG2; (c) MG3; and (d) microgrid cluster.
(a)(b)(c)(d)


### 6.5. Economic Analysis of the Microgrid Cluster

The costs of the microgrid cluster in the two cases where the microgrid cluster has demand-side controllable loads participating in the dispatch and the uncontrollable loads participating in the dispatch are compared, as shown in Table8.Table 8
Operating costs of the microgrid cluster.
TypesControllable loadNo controllable loadMG1MG2MG3MG1MG2MG3ESS2.63022.59273.01543.71205.10493.1601Loadshift2.50002.50002.5000000Loadtrans888000Loadinter3006000MG and MG637.1300−489.1636−147.9664655.6866−609.4750−46.2116MG and DN387.2262−44.5836235.9362495.141150.6059260.5215Total cost1067.4864−520.6545107.48521154.5397−553.7642217.4700654.3171818.2455It can be seen from Table8 that, in the two cases where there are controllable loads participating in the dispatch and the uncontrollable load participating in the dispatch, the cost change of energy storage system is relatively small. When controllable loads are involved in dispatching, the total cost of MG1 is 1067.4864 Yuan, the total revenue of MG2 is 520.6545 Yuan, and the total cost of MG3 is 107.4852 Yuan. Compared with when there is no controllable load involved in dispatching, the economic cost of MG1 is reduced by 87.0533 Yuan, the revenue of MG2 is reduced by 33.1091 Yuan, and the revenue of MG3 is increased by 109.9848 Yuan. Therefore, the economic cost of the entire microgrid cluster is reduced by 163.9284 Yuan. It can be seen that when the controllable loads participate in dispatching, the microgrid cluster can effectively reduce the operating cost of the system.


### 6.6. Analysis of Optimization Algorithm Results

This paper proposes a chaotic sparrow search algorithm. This algorithm is used to optimize the operating cost of the microgrid cluster system, and it compares with sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. The basic parameters of the algorithm are shown in Table2.It can be seen from Figure6 that the objective function values of the five algorithms of GA, PSO, CPSO, SSA, and ISSA decrease continuously and become stable as the number of iterations increases, indicating that these five algorithms are all moving towards the optimal cost. It can be found by comparing GA, PSO, CPSO, SSA, and ISSA that when the demand-side controllable loads participate in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is similar to CPSO algorithm, and its optimal solution is better than the convergence solutions of GA, PSO, CPSO, and SSA algorithms. When there is no demand-side controllable load participating in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is higher than GA, PSO, CPSO, and SSA, and its optimal solution is better than the convergence solution of GA, PSO, and SSA algorithm.Figure 6
Algorithm comparison. (a) Controllable loads; (b) no controllable loads.
(a)(b)


## 6.1. Basic Data

This article takes the microgrid cluster system constructed by the three microgrids shown in Figure1 as an example. The renewable energy output of each microgrid is shown in Figure 3, and the load curve is shown in Figure 4. The power of the controllable loads is 25 kW, and the dispatch compensation prices for the shiftable load, the transferable load, and the interruptible load, respectively, are 0.05 Yuan/kWh, 0.08 Yuan/kWh, and 0.3 Yuan/kWh. The initial operating period and allowable scheduling period of the controllable loads are shown in Table 4. The rated capacity of the microgrid energy storage system is 300 kWh, the maximum allowable charge and discharge power is 100 kW, and the maximum and small states of charge are divided into 0.9 and 0.2. The purchase and sale price of the power distribution network is shown in Table 5. The scheduling period of the calculation example is 24 hours a day, divided into 24 time periods, and the scheduling time is selected as 00 : 00–24 : 00.Figure 3
Renewable energy output.Figure 4
The original load of each microgrid.Table 4
Controllable loads parameters.
Time periodShiftable loadTransferable loadInterruptible loadInitial operating period11 : 00–15 : 0019 : 00–22 : 0010 : 00–21 : 00Scheduleable period11 : 00–22 : 0000 : 00–24 : 0010 : 00–21 : 00Table 5
Time-of-use price.
Transaction formTimetableElectricity price (Yuan/(kwh))Sell electricityPeak time10 : 00∼15 : 0018 : 00∼21 : 001.2Normal time07 : 00∼10 : 0015 : 00∼18 : 0021 : 00∼23 : 000.8Valley time23 : 00∼07 : 000.4Purchase electricity0 : 00∼24 : 000.39


## 6.2. Analysis of the Results of Electricity Trading between Microgrids

The electric energy exchange between microgrids is shown in Table6. It can be seen that when the market is in equilibrium, electricity can be purchased and sold in various periods of time through the trade of electricity between microgrids.Table 6
Transaction electricity between microgrids.
TimeTransaction power (kwh) (controllable load)Transaction power (kwh) (no controllable load)MG1MG2MG3MG1MG2MG3157.0021−49.0573−7.944856.9146−48.9979−7.9167230.5244−33.50492.980530.4912−22.5127−7.9785330.2046−18.1475−12.057130.1978−18.1446−12.0472484.6933−62.3520−22.341384.3783−62.1016−22.2767547.1775−30.4015−16.776047.8766−30.8375−17.0391663.5587−63.77790.219269.7560−63.0511−6.7049770.0852−47.4771−22.608170.3143−42.3144−27.9999816.167612.6786−28.846515.968312.7390−28.7072941.281489.3333−130.614741.072789.6763−130.749010−0.0712−21.258621.3298−57.9441−18.287476.231511−91.11447.756881.3576−65.682913.315952.366912−110.200059.143351.0568−134.731271.275763.455513−6.6502−25.272431.9226−66.10350.929565.174114000000150000001616.9902−43.136826.146717.3261−43.729926.4038170000001826.822114.9465−41.768628.147415.1149−43.26231971.8018−71.1782−0.623697.1128−116.179419.06662060.0222−60.0180−0.004293.7188−131.368237.64942149.2324−6.0715−43.160964.2092−33.1416−31.14162252.5377−43.5587−8.9790104.5194−82.3977−22.12172358.5305−47.8465−10.684058.7109−37.1341−21.57682468.5343−49.9633−18.571069.4401−62.4023−7.0378It can be seen from Table6 that when controllable loads participate in dispatching, at 14 : 00, 15 : 00, and 17 : 00, since the power generation of the microgrid cluster cannot meet the load demand, the power interaction between the microgrids in the cluster cannot be carried out, and electricity needs to be purchased from the power distribution network. From 10 : 00 to 13 : 00, MG1 sells electricity to MG2 that has insufficient power at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus. During the time periods of 08 : 00–09 : 00, 11 : 00–12 : 00, and 18 : 00, MG2 cannot meet its own load demand due to its insufficient output. Therefore, MG2 needs to purchase electricity from MG1 or MG3 that has too much power at the target time. During the time period from 19 : 00 to 24 : 00, MG3 sells electricity to the MG1 whose power is insufficient at the target time due to its own renewable energy output to meet its own load demand while still having electricity surplus.


## 6.3. Analysis of the Results of Electric Energy Trading between the Microgrid and Power Distribution Network

The electric energy exchange between the microgrid and the power distribution network is shown in Table7. It can be seen that when MG1, MG2, and MG3 exchange electric energy, the interactive electric energy between each microgrid and the power distribution network can be reduced.Table 7
Transaction electricity between the microgrid and power distribution network.
TimeTransaction power (kwh) (controllable load)Transaction power (kwh) (no controllable load)MG1MG2MG3MG1MG2MG310185.928830.1110−7.1054e − 15185.826030.024420188.249300198.689870.415230207.5529137.89760206.9558137.409040226.273781.07610225.952581.052450247.9922136.84630247.2298136.60606−13.61860−0.0470−7.6627−7.1054e − 1507019.17929.1329023.736815.70698−39.8650−31.26200−40.3733−32.208609−31.2095−67.53770−31.2378−68.203301000−54.92515.78011.82420111.4211e − 14−3.3936−36.46890−23.6277−92.9195120−39.3185−33.94260−53.7049−47.81251300−7.00990.61950014−56.9322−61.8237−47.6179−82.3522−87.8662−73.132215−93.0122−164.1142−118.7230−93.4173−164.3346−118.940116−62.07620−95.5308−62.28670−94.920617−45.9460−174.8343−12.8887−46.5703−173.2011−11.228818−73.2103−40.73620−71.2530−38.2621019067.33000.5899−22.25300−4.333420093.57630.0065−13.17200−5.29152101.583711.2581−33.316100220263.264654.26850248.683566.765223084.832718.9430095.072355.24182400.15390.0572089.963010.1462It can be seen from Table7 that when controllable loads participate in the dispatch, during the time period of 14 : 00–18 : 00, MG1 cannot meet its own needs due to its insufficient output; therefore, it needs to purchase electricity from the power distribution network. During the time period of 01 : 00–05 : 00 and 19 : 00–24 : 00, MG2 has been selling electric energy to the power distribution network due to its overcapacity. During the time period of 10 : 00–17 : 00, MG3 cannot meet its own needs due to its insufficient output, and needs to purchase electricity from the power distribution network to meet its own needs. It can be seen from the abovementioned phenomenon that electricity trading between microgrids can completely eliminate excess renewable energy and balance the supply and demand of the system.


## 6.4. Analysis of the Results before and after Controllable Loads

The controllable load scheduling results are shown in Figure5. It can be seen from Figure (a–c) that the overall loads of MG1 increase from 09 : 00 to 15 : 00, the loads of MG2 decrease from 10 : 00 to 15 : 00, and the loads increase from 18 : 00 to 24 : 00, the loads of MG3 increase during the time period of 00 : 00–08 : 00 and 18 : 00–24 : 00, and the loads decrease from 09 : 00 to 15 : 00. The total loads of the microgrid cluster can be seen from Figure (d), after adding the demand-side controllable loads schedule; the loads in the low period of 23 : 00–07 : 00 increase, and the loads in the peak period of 11 : 00–15 : 00 decreases. The peak-valley difference of the loads is reduced.Figure 5
Before and after load shift. (a) MG1; (b) MG2; (c) MG3; and (d) microgrid cluster.
(a)(b)(c)(d)


## 6.5. Economic Analysis of the Microgrid Cluster

The costs of the microgrid cluster in the two cases where the microgrid cluster has demand-side controllable loads participating in the dispatch and the uncontrollable loads participating in the dispatch are compared, as shown in Table8.Table 8
Operating costs of the microgrid cluster.
TypesControllable loadNo controllable loadMG1MG2MG3MG1MG2MG3ESS2.63022.59273.01543.71205.10493.1601Loadshift2.50002.50002.5000000Loadtrans888000Loadinter3006000MG and MG637.1300−489.1636−147.9664655.6866−609.4750−46.2116MG and DN387.2262−44.5836235.9362495.141150.6059260.5215Total cost1067.4864−520.6545107.48521154.5397−553.7642217.4700654.3171818.2455It can be seen from Table8 that, in the two cases where there are controllable loads participating in the dispatch and the uncontrollable load participating in the dispatch, the cost change of energy storage system is relatively small. When controllable loads are involved in dispatching, the total cost of MG1 is 1067.4864 Yuan, the total revenue of MG2 is 520.6545 Yuan, and the total cost of MG3 is 107.4852 Yuan. Compared with when there is no controllable load involved in dispatching, the economic cost of MG1 is reduced by 87.0533 Yuan, the revenue of MG2 is reduced by 33.1091 Yuan, and the revenue of MG3 is increased by 109.9848 Yuan. Therefore, the economic cost of the entire microgrid cluster is reduced by 163.9284 Yuan. It can be seen that when the controllable loads participate in dispatching, the microgrid cluster can effectively reduce the operating cost of the system.


## 6.6. Analysis of Optimization Algorithm Results

This paper proposes a chaotic sparrow search algorithm. This algorithm is used to optimize the operating cost of the microgrid cluster system, and it compares with sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm. The basic parameters of the algorithm are shown in Table2.It can be seen from Figure6 that the objective function values of the five algorithms of GA, PSO, CPSO, SSA, and ISSA decrease continuously and become stable as the number of iterations increases, indicating that these five algorithms are all moving towards the optimal cost. It can be found by comparing GA, PSO, CPSO, SSA, and ISSA that when the demand-side controllable loads participate in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is similar to CPSO algorithm, and its optimal solution is better than the convergence solutions of GA, PSO, CPSO, and SSA algorithms. When there is no demand-side controllable load participating in dispatching, the number of iterations for ISSA algorithm to converge to the optimal solution is higher than GA, PSO, CPSO, and SSA, and its optimal solution is better than the convergence solution of GA, PSO, and SSA algorithm.Figure 6
Algorithm comparison. (a) Controllable loads; (b) no controllable loads.
(a)(b)


## 7. Conclusions

This paper sets the optimization goal as the operating cost of the microgrid cluster system, constructs the microgrid cluster operation optimization model considering demand-side response, and discusses the costs of the microgrid cluster with and without controllable loads dispatch. Then a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning is constructed, which is used to optimize the operating cost of the microgrid cluster system and compare with the optimized results of sparrow algorithm, particle swarm algorithm, chaotic particle swarm algorithm, and genetic algorithm.(1)
Through the proposed strategy, electric energy transactions between microgrids and between microgrids and power distribution networks are realized. On the one hand, the impact caused by the connection between the microgrid cluster and power distribution networks is minimized, and on the other hand, it ensures the safety and stability of system operation.(2)
When there is demand-side controllable loads participating in dispatching, on the one hand, the level of energy mutual benefit between microgrids is improved, and the excess renewable energy can be completely absorbed; on the other hand, due to the controllable loads participating in dispatching, the operating cost of the microgrid cluster dropped from 818.2455 Yuan to 654.3171 Yuan, the cost was reduced by 163.9284 Yuan, and the overall benefit has increased by nearly 20%, which effectively improved the economic benefits of the microgrid cluster.(3)
This paper proposes a chaos sparrow search algorithm based on Bernoulli chaotic mapping, dynamic adaptive weighting, Cauchy mutation, and reverse learning. Based on 12 benchmark test functions, it shows that ISSA algorithm is superior to SSA, PSO, CPSO, and GA algorithms in terms of solution quality, which proves the effectiveness of the algorithm improvement. At the same time, ISSA algorithm has better performance when solving microgrid cluster optimization problems. The global optimization ability is stronger than SSA, PSO, CPSO, and GA algorithms, and the optimization cost is lower than SSA, PSO, CPSO, and GA algorithms. In future works, the ISSA algorithm will be applied to other fields, such as energy storage capacity configuration optimization, and face recognition. It can also be combined with other algorithms to form a hybrid algorithm to improve algorithm performance.



---

*Source: 5556780-2021-03-11.xml*