# Beetle Swarm Optimization Algorithm-Based Load Control with Electricity Storage

Authors: Hengjing He; Shangli Zhou; Leping Zhang; Junhong Lin; Weile Chen; Di Wu
Journal: Journal of Control Science and Engineering
 (2020)

---

## Abstract

Based on the intelligent bidirectional interactive technology, this paper studies the flexible working mode and optimal power consumption strategy of several typical power consumption loads including energy storage equipment. Based on the real-time price scheme, the objective function and constraints are obtained, and the adaptive algorithm for beetle swarm optimization with variable whisker length is used to optimize so that the electric equipment can automatically change its power load through the intelligent terminal and even work in the way of reverse power transmission. The proposed optimal scheduling algorithm can not only maximize the interests of users but also ensure the minimum peak to average ratio so as to realize peak shaving and valley filling. Simulation results verify the effectiveness of the algorithm.


---

## Body

## 1. Introduction

With the continuous increase in power demand and the deepening of power market reform, the demand side management (DSM) based on orderly power consumption is more and more adopted by power grid enterprises [1]. However, the traditional orderly power consumption management, no matter what kind of technology, or by imposing restrictions on the user’s power load in a certain period of time, or through the electricity price incentive policy to let the user limit the power consumption load in a certain period of time, for a single power consumption equipment, is rigid to participate in the peak shaving and valley filling of the power grid in the way of work or outage. This traditional and mandatory DSM model often leads to the lack of flexibility in the electricity market, which deepens the interest conflict between the supply side and the demand side.In order to solve the shortage of power supply and reduce the load peak valley difference, an effective way is used to increase the elasticity of power demand and introduce a competition mechanism on the power demand side. The demand side is no longer the traditional and passive receiver but can respond according to the price signal or incentive mechanism, actively change the demand of electricity, participate in the power management, and obtain corresponding benefits, namely, demand response (DR) [2]. Different from the traditional and passive DSM mode, intelligent DSM adopts intelligent bidirectional interaction technology. With the access of intelligent terminal equipment, the development of power communication technology, and the increase in the proportion of intelligent controllable load in the family, the intelligent two-way interactive technology of power consumption becomes possible [3]. The two-way interaction technology provides a technical basis for residents to participate in automatic demand response and realize intelligent power consumption. It can not only effectively improve the utilization rate of electric energy and the operation efficiency of the power grid but also achieve the purpose of maintaining the stability and reliability of the power system and market.The theory of demand-side management (DSM) has been developed for decades in the world [4]. However, it was not until the blackout in California in 2001 that many countries paid attention to and developed DSM based on the market. Compared with developed countries in Europe and America, the development of intelligent electricity technology and theory in China is relatively slow. Song [5] first introduces the concept and implementation principles of demand-side response and the implementation plan of demand response in the United States. Then, Zhang et al. [6] give a comprehensive introduction to the demand side response in combination with the actual situation in China and give relevant suggestions and assumptions.In order to solve the specific automation demand response technology, various software and hardware design schemes have been proposed, such as the software and hardware design and implementation scheme of the user side energy management prototype system [7], the management and control scheme of smart appliances based on user comfort [3], the massive data storage problem of smart grid based on Hadoop cloud computing platform [8], and the designer of smart grid two-way interactive platform system case [9]. In addition, how to optimize the load regulation and control algorithm has been proposed constantly, such as the residential user power dispatching strategy based on the price forecasting scheme [10], the user power dispatching strategy based on the noncooperative game method [11], simulated annealing-based krill herd algorithm [12], multiobjective optimization method based on adaptive parameter harmony search algorithm [13], and improved quantum-behaved particle swarm optimization with elitist breeding [14]. In the work [15], the particle swarm optimization (PSO) algorithm is employed to handle the PSP and to obtain an optimal smart home appliances schedule. The work in [16] presents two bio-inspired energy optimization techniques, i.e., the grasshopper optimization algorithm (GOA) and bacterial foraging algorithm (BFA), for power scheduling in a single office. In order to solve the problem of instability and high-cost of photovoltaic power generation, the optimal scheduling model of a photovoltaic power system was established by minimizing power generation scheduling cost. The model increases the ability of load controlling by virtue of the demand response of price to reduce the influence of the instability of photovoltaic generation on optimal scheduling results. For solving the model, the classical genetic algorithm was improved [17]. In a deregulated electricity market, the power system operator should systematically identify the optimal schedule of renewable distributed generation (DG) units to not only optimize the market profits but also to improve the network conditions. The work in [18] proposes a parallel computation-based methodology using fuzzy logic designed in the structure of a genetic algorithm (GA). A large number of electric vehicles (EV) connected to the grid will affect the planning and operation of the power system. Hence, it is of great significance to guide the charging behavior of electric vehicles in an orderly manner. Regarding this kind of problem, an electric vehicle intelligent charging navigation strategy based on real-time electricity price is proposed, where the PSOGA algorithm is used to solve the optimal scheme. The motivation is to guide the EV charging towards an orderly way by virtue of the real-time electricity price mechanism [19].The work in [20] compares the effects of different optimization algorithms for different reference functions. However, the energy storage equipment is not considered in these scheduling strategies, and the scheduling scheme is only given from the distribution side or the user side.In this paper, based on the intelligent electricity bidirectional interaction technology, the flexible working mode and power consumption strategy of several typical electrical loads including energy storage equipment are studied. Based on the real-time price scheme, the optimal scheduling algorithm is given so that the power consumption equipment can automatically change its power load through the intelligent terminal and even work in the way of reverse power transmission. By using the adaptive algorithm for beetle swarm optimization with variable whisker length,i can not only maximize the interests of users but also ensure the minimum peak to average ratio, so as to realize peak shaving and valley filling. Firstly, the mathematical modeling of several typical loads is carried out; then, based on the real-time price scheme, the optimization objective function is given, which includes two parts: one is the user’s electricity cost, and the other is the peak to average ratio. Finally, the optimal control algorithm is given, and an example is analyzed.


## 2. Intelligent Bidirectional Interactive Operation of the Smart Grid

### 2.1. System Description

In the traditional orderly power consumption management, for residential users, either through the peak load regulation strategy of forced switching off or through the price incentive policy, users can limit their power consumption load in a certain period of time. For users, it is basically in a passive state of power consumption. In order to mobilize users to change their electricity demand actively and participate in power consumption management, intelligent two-way interactive technology is more and more adopted. Its interaction model is shown in Figure1. According to the total load, the power supply side issues the price signal in real time, and the user side makes demand response according to the real-time price signal, so as to achieve the purpose of maximizing the interests of users and smoothing the load curve of the grid. Due to the lack of professional knowledge of residents, it is inconvenient to participate in demand response. In order to not affect the normal life of residents and let more users participate in the demand response, the development of intelligent terminal equipment, the realization of intelligent management of household appliances, and the automatic control of demand response are the important contents of realizing intelligent power consumption. In order to realize intelligent power consumption, it is very important to design the optimal dispatching algorithm of power load based on the characteristics of the typical load.Figure 1
Intelligent bidirectional interactive operation model.


### 2.2. Classification of Household Electricity Load

In order to facilitate the analysis and calculation, the user power load is divided into three categories:(i)
α-type dynamic load: the controllable load that can be completely scheduled in the dispatching time. The total load in the dispatching time is unchanged and has the function of reverse power transmission, such as energy storage equipment and electric vehicle; the set of such electrical equipment is marked as Uα.(ii)
β-type dynamic load: the controllable load that can be completely scheduled within the dispatching time is the same as the total load within the dispatching time, but it does not have the function of reverse power transmission, such as temperature control equipment and water heater; the set of such electrical equipment is marked as Uβ.(iii)
γ-type dynamic load: for the load fixed in the dispatching time, such as lighting equipment and television, the set of such electrical equipment is marked as Uγ; all consumers are marked as U.


### 2.3. Real-Time Electricity Price

In order to realize fair power consumption and peak load shifting, it is an effective means to adopt the real-time electricity price strategy by citing the competition mechanism. Without losing generality, it is assumed that there aren users participating in intelligent power consumption, and all users’ electrical equipment is recorded as a set Γ=1,2,…,N. Considering that many electric loads do not work in a complete small period of time ΔT, each hour can be divided into several equal time periods, so each hour period can be divided into L=1/ΔT. Without losing generality, let L be an integer. Then, the whole day from 0:00 to 24:00 can be divided into H=24L segments, denoted as M=1,2,…,H. The time period i∈M represents the time period area i−1,i⋅ΔT.For any devicej∈Γ, it is assumed that the load over the time period i∈M is a constant lji and written as a vector; lj=lj1,…,ljH,j∈Γ, indicates the load j in the whole day. Let Li=∑j∈Γlji be the sum of all user loads above the time period i∈M.For a substation transformer, the total electricity charge can be determined in sections according to the current total load. When the power consumption does not exceed the basic load, the electricity price is relatively low. When the power consumption exceeds the basic load, the high price is adopted, such as the simple piecewise linear function as follows:(1)EiLi=aiLi,0≤Li≤Li∗,aiLi∗+biLi−Li∗,Li≥Li∗,0<ai≤bi,where is the corresponding constant of ai,bi,Li∗ and can be adjusted according to the time calculation. As mentioned in [11], the parameters adopted by a Canadian power company are as follows:(2)ai=5.9c/kWh,bi=8.3c/kWh,Li∗=24kWh.According to the total electricity charge, the station transformer charges the equipmentj the electricity fee according to the proportion: eji=lji/LiEiLi, where lji is the electrical load of ith period of load j. From the point of view of a single user, it is hoped that the single consumption will be the lowest; that is, it is hoped that eji will be the smallest, while from the point of view of the whole station change, it is hoped that EiLi will be kept the smallest.In addition, as the power supplier, we hope that the peak valley difference is the minimum. The peak load is defined asLpeak=maxi∈MLi; the average load is Lavg=1/H∑i=1HLi, and the peak to average ratio is,(3)PAR=LpeakLavg.For a whole day’s electric load, the average value of the load is usually constant. Therefore, as the power supply side, it is necessary to ensure that the peak to average ratio reaches the minimum value.


### 2.4. Participation of Energy Storage Equipment in Generation Subsidy Price

In order to solve the problem of insufficient power supply, an effective way is to encourage users to use energy storage equipment (such as energy storage battery and electric vehicle) to discharge during peak load. Therefore, the electricity price subsidy policy is adopted, and the traditional electricity price subsidy policy adopts the unified subsidy price, which is a lack of flexibility. Therefore, the subsidy tariff can be formulated according to the load at the current moment. For example, the following subsidy function can be simply used:(4)SiLi,Qi=ciLiQi,Li≥Li∗∗,0,where ci is a constant, Li∗∗ is the corresponding constant, Li is the total load at the current time, and Qi is the total discharge load at the current time, which is recorded as a negative value. Obviously, if the current total load is large and higher than the set critical value Li∗∗, the energy storage equipment is encouraged to participate in power generation and subsidize the electricity charge; on the contrary, if the current total load is small and lower than the set threshold Li∗∗, the power supply is sufficient and the users are not encouraged to participate in power generation. For the convenience of mathematical description, the total discharge load Qi can be expressed as Qi=∑j∈Γglji:(5)glji=lji,lji<0,0,lji≥0.


## 2.1. System Description

In the traditional orderly power consumption management, for residential users, either through the peak load regulation strategy of forced switching off or through the price incentive policy, users can limit their power consumption load in a certain period of time. For users, it is basically in a passive state of power consumption. In order to mobilize users to change their electricity demand actively and participate in power consumption management, intelligent two-way interactive technology is more and more adopted. Its interaction model is shown in Figure1. According to the total load, the power supply side issues the price signal in real time, and the user side makes demand response according to the real-time price signal, so as to achieve the purpose of maximizing the interests of users and smoothing the load curve of the grid. Due to the lack of professional knowledge of residents, it is inconvenient to participate in demand response. In order to not affect the normal life of residents and let more users participate in the demand response, the development of intelligent terminal equipment, the realization of intelligent management of household appliances, and the automatic control of demand response are the important contents of realizing intelligent power consumption. In order to realize intelligent power consumption, it is very important to design the optimal dispatching algorithm of power load based on the characteristics of the typical load.Figure 1
Intelligent bidirectional interactive operation model.


## 2.2. Classification of Household Electricity Load

In order to facilitate the analysis and calculation, the user power load is divided into three categories:(i)
α-type dynamic load: the controllable load that can be completely scheduled in the dispatching time. The total load in the dispatching time is unchanged and has the function of reverse power transmission, such as energy storage equipment and electric vehicle; the set of such electrical equipment is marked as Uα.(ii)
β-type dynamic load: the controllable load that can be completely scheduled within the dispatching time is the same as the total load within the dispatching time, but it does not have the function of reverse power transmission, such as temperature control equipment and water heater; the set of such electrical equipment is marked as Uβ.(iii)
γ-type dynamic load: for the load fixed in the dispatching time, such as lighting equipment and television, the set of such electrical equipment is marked as Uγ; all consumers are marked as U.


## 2.3. Real-Time Electricity Price

In order to realize fair power consumption and peak load shifting, it is an effective means to adopt the real-time electricity price strategy by citing the competition mechanism. Without losing generality, it is assumed that there aren users participating in intelligent power consumption, and all users’ electrical equipment is recorded as a set Γ=1,2,…,N. Considering that many electric loads do not work in a complete small period of time ΔT, each hour can be divided into several equal time periods, so each hour period can be divided into L=1/ΔT. Without losing generality, let L be an integer. Then, the whole day from 0:00 to 24:00 can be divided into H=24L segments, denoted as M=1,2,…,H. The time period i∈M represents the time period area i−1,i⋅ΔT.For any devicej∈Γ, it is assumed that the load over the time period i∈M is a constant lji and written as a vector; lj=lj1,…,ljH,j∈Γ, indicates the load j in the whole day. Let Li=∑j∈Γlji be the sum of all user loads above the time period i∈M.For a substation transformer, the total electricity charge can be determined in sections according to the current total load. When the power consumption does not exceed the basic load, the electricity price is relatively low. When the power consumption exceeds the basic load, the high price is adopted, such as the simple piecewise linear function as follows:(1)EiLi=aiLi,0≤Li≤Li∗,aiLi∗+biLi−Li∗,Li≥Li∗,0<ai≤bi,where is the corresponding constant of ai,bi,Li∗ and can be adjusted according to the time calculation. As mentioned in [11], the parameters adopted by a Canadian power company are as follows:(2)ai=5.9c/kWh,bi=8.3c/kWh,Li∗=24kWh.According to the total electricity charge, the station transformer charges the equipmentj the electricity fee according to the proportion: eji=lji/LiEiLi, where lji is the electrical load of ith period of load j. From the point of view of a single user, it is hoped that the single consumption will be the lowest; that is, it is hoped that eji will be the smallest, while from the point of view of the whole station change, it is hoped that EiLi will be kept the smallest.In addition, as the power supplier, we hope that the peak valley difference is the minimum. The peak load is defined asLpeak=maxi∈MLi; the average load is Lavg=1/H∑i=1HLi, and the peak to average ratio is,(3)PAR=LpeakLavg.For a whole day’s electric load, the average value of the load is usually constant. Therefore, as the power supply side, it is necessary to ensure that the peak to average ratio reaches the minimum value.


## 2.4. Participation of Energy Storage Equipment in Generation Subsidy Price

In order to solve the problem of insufficient power supply, an effective way is to encourage users to use energy storage equipment (such as energy storage battery and electric vehicle) to discharge during peak load. Therefore, the electricity price subsidy policy is adopted, and the traditional electricity price subsidy policy adopts the unified subsidy price, which is a lack of flexibility. Therefore, the subsidy tariff can be formulated according to the load at the current moment. For example, the following subsidy function can be simply used:(4)SiLi,Qi=ciLiQi,Li≥Li∗∗,0,where ci is a constant, Li∗∗ is the corresponding constant, Li is the total load at the current time, and Qi is the total discharge load at the current time, which is recorded as a negative value. Obviously, if the current total load is large and higher than the set critical value Li∗∗, the energy storage equipment is encouraged to participate in power generation and subsidize the electricity charge; on the contrary, if the current total load is small and lower than the set threshold Li∗∗, the power supply is sufficient and the users are not encouraged to participate in power generation. For the convenience of mathematical description, the total discharge load Qi can be expressed as Qi=∑j∈Γglji:(5)glji=lji,lji<0,0,lji≥0.


## 3. Optimal Orderly Operation Control Algorithm of Power Load

Based on the above mathematical description, taking the minimum cost and peak to average ratio as the optimization objectives and taking the load of each power consumption equipment and each period as the control object, the optimization objective function is,(6)minflji=∑i=1HEiLi+SiLi,Qi+λ⋅PAR=∑i=1HEi∑j∈Γlji+Si∑j∈Γlji,∑j∈Γglji+λLavg⋅maxi∈M∑j∈Γlji,where λ is the weighting factor, SiLi,Qi is the subsidy function, and PAR is the peak to average ratio.The following statements are to analyze the constraint conditions: for any equipmentj, is,j is used to indicate the start time of load dispatching, ie,j is the end time of load dispatching, and the total load of electric load in the whole dispatching time is fixed, which is recorded as a constant value Pj, i.e., ∑i=is,ji=ie,jlji=Pj. The load device does not work outside the dispatch time, lji=0, 0≤i<is,j,ie,j<i≤H.In addition, for any electrical equipment, its load generally has upper and lower limits, that is,ljmin≤lji≤ljmax. If the load is negative, it indicates the discharge state. Therefore, the general constraint is,(7)Ω1=lji,i∈M,j∈Γ∑i=is,ji=ie,jlji=Pj,lji=0,0≤i<is,j,ie,j<i≤H,ljmin≤lji≤ljmax.From the optimization point of view, the total load in a day should remain unchanged; that is, the optimization functionLavg is constant, and the specific value is,(8)Lavg=∑j∈ΓPjH.In addition, the objective optimization function contains a maximum function, which is not conducive to find the optimal value. The method of adding a variable can be used. For example, if the variableρ is used, then the objective function (6) can be expressed as,(9)minflji=∑i=1HEi∑j∈Γlji+Si∑j∈Γlji,∑j∈Γglji+λH∑j∈ΓPj⋅ρ.By adding the constraint conditions, we get,(10)Ω2=lji,i∈M,j∈Γ∑j∈Γlji≤ρ,which implies that the final constraint is Ω1∩Ω2.


## 4. Adaptive Algorithm for Beetle Swarm Optimization with Variable Whisker Length

We first introduce the beetle antennae search (BAS) algorithm and then beetle swarm optimization (BSO). The main difference is that the former is based on a single individual, and the latter is based on multiple individuals.


### 4.1. Principle of Beetle Antennae Search Algorithm

In the beetle antennae search (BAS) algorithm, we now use the following two rules inspired by the behavior of beetle searching with antennae, which includes searching behavior and detecting behavior. It is noted that the beetle searches randomly to explore an unknown environment. The specific steps are as follows:Step 1: assume that the position of longicorn beetles inn-dimensional solution space is X=x1,x2,…,xn, to model the searching behavior, and we propose describing a random direction of beetle searching as follows:(11)p⟶=randn,1randn,1,whererandn,1 is an n-dimensional vector of random numbers in the range of 0,1.Step 2: we present the searching behaviors of both right-hand and left-hand sides, respectively, to imitate the activities of the beetle’s antennae:(12)xlk=xk−dp⟶,xrk=xk+dp⟶,wherexk is the current position of longicorn beetles, d is the distance from the center of mass to the antennae, xrk denotes a position lying in the searching area of the right-hand side, and xlk denotes that of the left-hand side.Step 3: location update method:(13)xk+1=xk+p⟶δksignfxlk−fxrk,whereδk is the current step size, sign is a symbolic function, and f is the function to be optimized.


### 4.2. Principle of Particle Swarm Optimization (PSO) Algorithm

The basic concept of the PSO algorithm is that individuals in a group share information, so that the movement of the whole group can change from disorder to order in the process of solving problems, and finally, the best solution to the problem can be obtained. The specific steps are as follows:Step 1: suppose that the population size of particle swarm optimization inn-dimensional solution space is N, and the coordinate position vector of each particle is expressed as Xi=xi1,xi2,…,xin.The velocity vector of each particle is expressed asVi=vi1,vi2,…,vin. The optimal position of an individual is expressed as Pi=pi1,pi2,…,pin, and the optimal position of the population is Pm=pm1,pm2,…,pmn.Step 2: in thek-th iteration, the position and velocity of the d-dimension of the i-th particle are updated as follows:(14)vidk+1=ωvidk+c1randPidk−xidk+c2randpmdk−xidk,xidk+1=xidk+vidk+1,wherew is the inertia weight, c1andc2 are learning factors and rand random numbers in the range of (0, 1).Step 3: the particle optimal position updating method is as follows:(15)Pik+1=Xik+1,fXik+1<fPik,Pik,fXik+1≥fPik,wheref is the function to be optimized.


### 4.3. Principle of Particle Swarm Optimization Algorithm Based on Beetle Antennae Search

There are many unknown parameters in the optimization scheduling system model studied in this paper. In this paper, a particle swarm optimization algorithm (BSO) based on a longicorn whisker search is proposed based on the idea of the BAS algorithm and PSO algorithm. The initial position and velocity process of the beetle antennae algorithm are consistent with that of PSO. However, due to the lack of local information acquisition around the current particle individual in the evolutionary direction strategy of PSO, it is unstable and prone to local optimal solution in the case of multidimensional complexity. The BSO proposed in this paper uses the idea of beetle antennae search and has its own judgment on the environment space in each iteration process; that is, individuals compare the fitness function values of left and right whiskers in each iteration and compare the values of the two. Through this method, the adaptive problems of different groups and iterative stages can be improved, and the instability and local optimal solution problems of the algorithm are solved. The specific steps are as follows:Step 1: suppose that the population size of longicorn beetle population inn-dimensional space and the standardized direction vector generated by each individual are(16)p⟶i=randn,1randn,1.According to the relationship between the optimal position of the group and the optimal position distance of the individual, the distance between the left and right whiskers of thei-th longicorn in the k-th iteration is calculated as follows:(17)dik=βPm−Pi.Step 2: according to the fitness function of the left and right sides of an individual, by comparing the values on both sides, the speed generated by the fitness of each individual in the population is updated as follows:(18)Δvi=p⟶isignfxilk−fxirk.Step 3: in thek-th iteration, the velocity and position of the i-th individual are updated as follows:(19)Vik+1=ωVik+c1rand⋅Pik−Xik+c2rand⋅Pmk−Xik+dikrand⋅p⟶isignfxilk−fxirk,Xik+1=Xik+Vik+1,wherew is the inertia weight and c1andc2 is the learning factor and the matrix dot multiplication represents the multiplication of corresponding elements of the same type matrix.Step 4: after completing the iteration process, the global optimal solution can be obtained.


## 4.1. Principle of Beetle Antennae Search Algorithm

In the beetle antennae search (BAS) algorithm, we now use the following two rules inspired by the behavior of beetle searching with antennae, which includes searching behavior and detecting behavior. It is noted that the beetle searches randomly to explore an unknown environment. The specific steps are as follows:Step 1: assume that the position of longicorn beetles inn-dimensional solution space is X=x1,x2,…,xn, to model the searching behavior, and we propose describing a random direction of beetle searching as follows:(11)p⟶=randn,1randn,1,whererandn,1 is an n-dimensional vector of random numbers in the range of 0,1.Step 2: we present the searching behaviors of both right-hand and left-hand sides, respectively, to imitate the activities of the beetle’s antennae:(12)xlk=xk−dp⟶,xrk=xk+dp⟶,wherexk is the current position of longicorn beetles, d is the distance from the center of mass to the antennae, xrk denotes a position lying in the searching area of the right-hand side, and xlk denotes that of the left-hand side.Step 3: location update method:(13)xk+1=xk+p⟶δksignfxlk−fxrk,whereδk is the current step size, sign is a symbolic function, and f is the function to be optimized.


## 4.2. Principle of Particle Swarm Optimization (PSO) Algorithm

The basic concept of the PSO algorithm is that individuals in a group share information, so that the movement of the whole group can change from disorder to order in the process of solving problems, and finally, the best solution to the problem can be obtained. The specific steps are as follows:Step 1: suppose that the population size of particle swarm optimization inn-dimensional solution space is N, and the coordinate position vector of each particle is expressed as Xi=xi1,xi2,…,xin.The velocity vector of each particle is expressed asVi=vi1,vi2,…,vin. The optimal position of an individual is expressed as Pi=pi1,pi2,…,pin, and the optimal position of the population is Pm=pm1,pm2,…,pmn.Step 2: in thek-th iteration, the position and velocity of the d-dimension of the i-th particle are updated as follows:(14)vidk+1=ωvidk+c1randPidk−xidk+c2randpmdk−xidk,xidk+1=xidk+vidk+1,wherew is the inertia weight, c1andc2 are learning factors and rand random numbers in the range of (0, 1).Step 3: the particle optimal position updating method is as follows:(15)Pik+1=Xik+1,fXik+1<fPik,Pik,fXik+1≥fPik,wheref is the function to be optimized.


## 4.3. Principle of Particle Swarm Optimization Algorithm Based on Beetle Antennae Search

There are many unknown parameters in the optimization scheduling system model studied in this paper. In this paper, a particle swarm optimization algorithm (BSO) based on a longicorn whisker search is proposed based on the idea of the BAS algorithm and PSO algorithm. The initial position and velocity process of the beetle antennae algorithm are consistent with that of PSO. However, due to the lack of local information acquisition around the current particle individual in the evolutionary direction strategy of PSO, it is unstable and prone to local optimal solution in the case of multidimensional complexity. The BSO proposed in this paper uses the idea of beetle antennae search and has its own judgment on the environment space in each iteration process; that is, individuals compare the fitness function values of left and right whiskers in each iteration and compare the values of the two. Through this method, the adaptive problems of different groups and iterative stages can be improved, and the instability and local optimal solution problems of the algorithm are solved. The specific steps are as follows:Step 1: suppose that the population size of longicorn beetle population inn-dimensional space and the standardized direction vector generated by each individual are(16)p⟶i=randn,1randn,1.According to the relationship between the optimal position of the group and the optimal position distance of the individual, the distance between the left and right whiskers of thei-th longicorn in the k-th iteration is calculated as follows:(17)dik=βPm−Pi.Step 2: according to the fitness function of the left and right sides of an individual, by comparing the values on both sides, the speed generated by the fitness of each individual in the population is updated as follows:(18)Δvi=p⟶isignfxilk−fxirk.Step 3: in thek-th iteration, the velocity and position of the i-th individual are updated as follows:(19)Vik+1=ωVik+c1rand⋅Pik−Xik+c2rand⋅Pmk−Xik+dikrand⋅p⟶isignfxilk−fxirk,Xik+1=Xik+Vik+1,wherew is the inertia weight and c1andc2 is the learning factor and the matrix dot multiplication represents the multiplication of corresponding elements of the same type matrix.Step 4: after completing the iteration process, the global optimal solution can be obtained.


## 5. Simulation Results

It is considered that there are three household users participating in intelligent power consumption under a substation transformer, and each user has three different types of power load (see Table1 for details). If a smaller resolution is adopted, different parameter L can be selected to obtain more accurate results, but it will bring a certain computational burden. For simplicity, the day is divided into 24 small periods, i.e., L = 1.Table 1
Electricity load information of all users.
User 1User 2User 3Load sizeγ-type dynamic load0.5 kWh0:00 h–24:00 h1 kWh0:00 h–24:00 h1.5 kWh0:00 h–24:00 h0∼2.5 kWh1 kWh19:00 h–21:00 h1 kWh18:00 h–22:00 h1 kWh18:00 h–23:00 hβ-type dynamic load2 kWh12:00 h–24:00 h4 kWh08:00 h–22:00 h6 kWh10:00 h–22:00 h0∼1 kWhα-type dynamic load0 kWh00:00 h–24:00 h4 kWh00:00 h–08:00 h 19:00 h–24:00 h6 kWh00:00 h–08:00 h 20:00 h–24:00 h-1 kWh∼1 kWhThe electricity charge is collected by piecewise function (1), where the parameter is ai=0.5, bi=0.8, and Li∗=2.5. If reverse generation is used, the subsidy tariff is calculated according to function (4), where the parameter is ci=0.2 and Li∗∗=2.For comparison, first, it is considered that all users do not participate in intelligent power consumption and power generation. Under the premise of no loss of generality, the load is assumed to be uniformly distributed during the scheduling time; forα-type dynamic load, the load is evenly distributed within the dispatching time, while for β-type dynamic load, the load is evenly distributed within the dispatching time and does not participate in power generation. Actually, there is no difference between α-type and β-type dynamic load in this case. By a simple calculation, Figure 2 shows the power load of each time period in this case.Figure 2
Load without smart use of electricity.Through the formula(20)EiLi=aiLi,0≤Li≤Li∗,aiLi∗+biLi−Li∗,Li≥Li∗,0<ai≤bi,PAR=LpeakLavg,the peak to average ratio is 1.9786, and the total electricity charge is 47.7286.If the intelligent dispatching optimization control algorithm proposed in this paper is adopted, whereλ=3, the daily power load is shown in Figure 3.Figure 3
Load under smart use of electricity.If the intelligent dispatching optimization control algorithm proposed in this paper is adopted, the power load of one day is shown in Figure3.By solving the optimal problem,(21)minflji=∑i=1HEi∑j∈Γlji+Si∑j∈Γlji,∑j∈Γglji+λH∑j∈ΓPj⋅ρ,(22)PAR=LpeakLavg.According to the calculation, the peak to average ratio is 1.1670, increased by 41.02%; the total electricity charge is 24.2140, including 15.3871 income from power generation, saving 49.27% in total. Therefore, based on the intelligent power consumption strategy, it not only maximizes the interests of users but also effectively participates in peak shaving and valley filling of the power grid.To have a comparison among different kinds of optimal algorithms for solutions (21) and (22), as shown in Table 2, some popular optimal algorithms are employed: beetle swarm optimization (BSO) algorithm, particle swarm optimization (PSO) algorithm, particle swarm optimization with dynamic adjustment of inertial weights (PSO-w), and beetle antennae search (BAS) algorithm.Table 2
Comparison of the convergence speed and accuracy of the algorithm.
AlgorithmAve.Std.t/sBSO24.21405.6E − 240.51PSO25.24695.7E − 062.09PSO-w25.03001.7E − 031.35BAS27.46041.22E + 003.74In this paper, the mean value of the optimal value, the standard deviation of the optimal value, and the running time of the algorithm to complete 1000 iterations are used as the main comparison data. Clearly, the performance of the BSO algorithm is obviously better than BAS and PSO algorithms.


## 6. Conclusion

Taking residential users participating in intelligent power consumption as an example, this paper considers the optimal scheduling control algorithm of several typical loads including energy storage equipment and proves the superiority of the method based on the adaptive algorithm for beetle swarm optimization with variable whisker length. Based on mathematical modeling, real-time price, and generation subsidy price mechanism, the optimal control model is given. The optimal objective function not only considers the maximization of the user’s income but also takes into account the peak valley difference in power load. The proposed algorithm provides a technical basis for the realization of intelligent power consumption and distributed generation. The next step is to study the influence of various parameters on the optimization objectives.



---

*Source: 8896612-2020-11-25.xml*