**Power Command Optimal Allocation Model of Distributed Energy System Based on Improved Firefly Algorithm**

Xiao Xue^{1}, Yangbing Zheng^{2, 3,}* and Chao Lu^{4}

^{1}School of Information Engineering, Nanyang Institute of Technology, Nanyang 473004, Henan, China^{2}College of Mechanical and Electronic Engineering, Nanyang Normal University, Nanyang 473061, Henan, China^{3}Qinghai Wandong Ecological Environment Development Co.LTD, Geermu 816000, Qinghai, China^{4}Nanyang Zehui Technology Co., LTD, Nanyang, 473000, Henan, China*E-mail: zhengyb505@163.com***Corresponding Author*

Received 26 November 2021; Accepted 19 December 2021; Publication 19 February 2022

In order to enhance the power command allocation effect of distributed energy system, the modified firefly algorithm is established to deal with the optimal model of the proposed power command allocation. Firstly, the basic function and physical structure of power grid system distributed energy system are analyzed. Secondly, theoretical model of power command allocation model distributed energy system is constructed. Thirdly, the improved firefly algorithm is established. Finally, a power grid system distributed energy system with eight units is selected to carry out simulation analysis, results illustrate that the model has quickest convergence efficiency, and can obtain optimal power command allocation effect distributed energy system.

**Keywords:** Distributed energy system, power command allocation, improved firefly algorithm.

Automatic generation control (automatic generation control) is a critical part of distributed energy system, which can ensure that the frequency and tie line exchange power of interconnected power grid are maintained at the rated value. Generally, automatic generation control of distributed energy system concludes two stages, the first stage is tracking of total power command, the dispatching centre of real power grid uses PI controller, in recent years, some intelligent controlling methods are established, such as fuzzy control, reinforcement learning algorithm. The second stage is allocation of total power command, for practical system, the power allocation distributed energy system is often carried out according to engineering experience or fixed allocation according to the same adjustable capacity ratio. In order to decrease cost and enhance controlling performance level, a number of reinforcement learning algorithms are constructed for conducting power allocation distributed energy system, such as traditional Q learning algorithm, multiple step reverting Q learning algorithm, modified tier Q learning, the existing algorithms are classified as the centralized optimization algorithm. When automatic generation control unit scale increases, the optimal effect declines, and the convergence time also increases, it is difficult to meet the 4–16 s time scale requirement of automatic generation control. In addition, the centralized optimization algorithm should collect operation data of every automatic generation control unit, therefore the communication congestion may exist.

In order to embolden faster response automatic generation control frequency modulation units to involve in secondary frequency modulation. Federal Energy Regulatory Commission put forward a more fair and reasonable frequency modulation auxiliary service market (hereinafter referred to as “frequency modulation market”) mechanism. According to this mechanism, the compensation cost of each automatic generation control frequency modulation unit consists of two parts, including automatic generation control capacity compensation cost and frequency modulation mileage compensation cost. The two parts mentioned above are directly influenced by the quotation of frequency modulation mileage, that is, automatic generation control frequency modulation units with high quotation of frequency modulation mileage will participate in automatic generation control frequency modulation more, for getting optimal dynamic capacity. The participation of all automatic generation control frequency modulation units is directly proportional to their frequency modulation mileage capacity. A real-time automatic generation control scheduling method is designed to make the fast response automatic generation control frequency modulation unit bearing a large automatic generation control power command under the requirement of high frequency modulation mileage. Although these methods are simple and applicable, they lack specific optimization and can not meet the requirements of ISO for the optimal comprehensive benefits of dynamic performance and frequency modulation mileage compensation cost. In fact, the goal of ISO is not only to quickly balance the load disturbance, but also to minimize the cost of frequency modulation mileage compensation. However, these two goals conflict with each other, because in the frequency modulation market, the automatic generation control frequency modulation unit with fast climbing speed will pay higher frequency modulation mileage compensation cost under the same automatic generation control generation power command.

Because automatic generation control frequency modulation process has high nonlinear characteristic, the traditional optimal allocation method is easy to fall into local optimum, and the load disturbance of system has a certain randomness, at the same time the power grid require that the automatic generation control has high real time, therefore the reinforcement learning algorithm with real time and self adaption can be suitable for automatic generation control frequency regulating. The improved hierarchy reinforcement learning algorithm is established to construct the multiple objective optimization method considering power controlling error, hydropower adjustable capacity margin and automatic generation control regulating cost. The reinforcement learning can achieve automatic generation control with continuous state and discrete action. So far there has been no comprehensive optimal continuous control of dynamic performance and frequency modulation mileage in the field of load frequency control of multiple area automatic generation control. Therefore this research select the intelligent algorithm, to improve the training efficiency and accuracy of searching optimal solution.

In recent years, there are many intelligent algorithm, which concludes particle swarm algorithm [1], genetic algorithm [2], simulated anneal algorithm [3]. The existing intelligent algorithms are good optimal methods, which concludes low convergence speed, poor computing efficiency, and premature. In this research, firefly algorithm is selected to carry out automatic generation control generation power command allocation. In recent years, the firefly algorithms have been successfully applied in optimal analysis of many fields. Hao Zhang et al. proposed a novel support vector machine, the parameters of it can be optimized by firefly algorithm, the new model can be used assess the chain finance considering different indexes. Simulation analysis results showed that the proposed model could improve classification prediction precision and reduce the error rate of falseness recognize credible enterprise [4]. Janmenjoy Nayak et al. used modified firefly algorithm and gradient boosting method that can obtain optimal hyper parameters of Lightboost. A perturbation factor was used to improved firefly algorithm, which could avoid the local optimal solution [5]. Jie Shan et al. presented a novel parallel firefly algorithm using four communication strategies, this algorithm was distributed and could not permit poor precision and low velocity. The original fireflies were divided into several subgroups based on distributed parallel method [6]. Manousos Rigakis et al. carry out optimal analysis based on the firefly algorithm, which could improve coordinates-related encoding or decoding process. The presented method could handle discrete optimization problems with effect [7]. Hussam S. Alhadawi et al. optimized configuration for substitution boxes based on firefly algorithm, this theoretical model could have faster searching optimal solutions. To effectively cope with premature problem, the firefly algorithm is improved by using chaotic theory, which can obtain best effect [8]. Hana Gharrad et al. used the firefly algorithm to enable drones jointly neutralize ongoing events [9]. Junfei Zhang et al. combined machine learning and firefly algorithm to construct the hybrid model that can effectively solve a multiple objective optimization model [10]. Therefore the firefly algorithm is an effect tool for automatic generation control Power Command Allocation.

In the smooth working process of power system, the main aims of automatic generation control of distributed energy system have the following aspects: the generation active power and power system load should be controlled effectively and quickly; the grid frequency should be controlled in permitting scope through tracking the load change; the tie line should be controlled in the permissible scope through specifying the generation power; every unit should be allocated based on the allocation project when the load changes regularly. The on-line economical allocation should be carried out based on the rules of optimizing the economy management; The spare unit volume should be controlled and regulated for ensuring safety of the power grid [11].

Modern interconnected power grids are composed of multiple regional power grids, which are connected through tie lies connected each region has independent automatic generation control of distributed energy system. Generators in each area can be adjusted according to whether they participate in commissioning frequency tasks, which can be divided into automatic generation control unit and non automatic generation control unit, the non automatic generation control unit only generates electricity according to the daily power demand of the dispatching centre. It is planned to operate at the established stable power, and the power generation power of the plant control system or artificial fixed unit shall operate dispatching centre automatic generation control, the unit control command is only sent to automatic generation control unit power plant, real time update and adjust until power generation power operating value [12].

The power grid dispatching cent in every controlling area establishes power arrangement of all units next day according to supplying load prediction, contract planned value of exchange power of interconnection line, and available output of unit, and the arrangement plant can be distributed to each power plant. In addition, the economical dispatching of dispatching centre can carry out real time economical load allocation for automatic generation control unit in real-time run time according to ultra short term load forecasting and real operation conditions of every electric plant, and calculates operating power point and automatic generation control participation factor for the next time period, and the calculated parameters can be sent to load frequency control software [13].

The automatic generation control software of power grid dispatching centre can obtain the real time information, measured value of tie line exchange power, clock error, and the calculate the controlling error of computation area, and the value of controlling error can be obtained through signal processing. The final power regulation command of automatic generation control unit can be calculated according to power of power generation unit, operating power point of unit, and reference ratio.

When a very serious fault occurs in the power grid, it is often necessary to suspend the automatic generation control system for fault treatment. Moreover, when the automatic load frequency control program detects that the system frequency and the region control deviation change greatly, the program enters an emergency state and stops sending automatic generation control system control instructions to prevent faults in automatic generation control system. The physical framework of the automatic generation control system is shown in Figure 1.

The commands sent through the master station monitoring system of power grid dispatching institution are transmitted by the network communication or remote terminal communication operating station. It is sent to the power plant control system or unit controller through the communication channel to regulate and control the power of the generator unit. The master station control system receives the real time frequency, load information and automatic generation control of the power grid through the special communication channel, and carry out relevant analysis and calculation on these data. In addition, the power exchange information of inter area tie line related to the power control of system real time tie line is also uploaded to the master station control system through the station automation system of RTU where the substation is located [14].

Automatic generation control of distributed energy system master station control system, also known as energy management system (EMS), is generally set in provincial power grid and dispatching institutions above it in modern interconnected power grid. In order to realize the automatic generation control function, the main station control system generally includes the main station computer system, energy management software system and automatic generation control application software [15].

Information transmission system is the channel for automatic generation control system to realize information transmission. It mainly consists of master station communication workstation, communication network, data network, RTU and plant station automation system. At present, the information transmission of automatic generation control system is through telecontrol communication technology and point-to-point transmission through special communication channel. The networking of integrated information transmission network using public data communication network technology, automatic generation control system is still in the stage of experimental research.

This research adds regulating cost and lifting time when constructing the allocation mathematical model of automatic generation control of distributed energy system, and the corresponding formula is listed as follows

The objective functions can be formulated by [16]

$\mathrm{min}{F}_{1}$ | $={\displaystyle \sum _{m=1}^{{M}_{i}}}{\lambda}_{m}\mathrm{\Delta}{P}_{m}$ | (1) |

$\mathrm{min}{F}_{2}$ | $={\displaystyle \sum _{m=1}^{{M}_{i}}}{\displaystyle \frac{\mathrm{\Delta}{P}_{m}}{\mathrm{\Delta}{P}_{m}^{r}}}$ | (2) |

The constraint conditions are listed as follows [17]:

$$\mathrm{\Delta}{P}_{t}=\sum _{m=1}^{{M}_{i}}\mathrm{\Delta}{P}_{m}$$ | (3) |

$$\mathrm{\Delta}{P}_{t}\cdot \mathrm{\Delta}{P}_{m}>0$$ | (4) |

$$\mathrm{\Delta}{P}_{m}^{\mathrm{min}}\le \mathrm{\Delta}{P}_{m}\le \mathrm{\Delta}{P}_{m}^{\mathrm{max}}$$ | (5) |

where $\mathrm{\Delta}{P}_{t}$ denotes total power command obtained through calculation of PI controller, $\mathrm{\Delta}{P}_{i,m}$ denotes the automatic generation control generation power command of $m$th unit, ${\lambda}_{m}$ denotes the adjustment cost coefficient of the $m$th unit, $\mathrm{\Delta}{P}_{m}^{r}$ represents the adjusting velocity of $m$th unit. $\mathrm{\Delta}{P}_{m}^{\mathrm{min}}$ and $\mathrm{\Delta}{P}_{m}^{\mathrm{max}}$ are maximum power and minimum standby capacity of the $m$th unit.

The automatic generation control regulation unit of distributed energy system includes coal-fired power units, gas-fired units, hydropower units, wind turbines, photovoltaic units, Renewable energy power generation unit, etc. it is a large-scale comprehensive energy automatic generation control system. Firstly, through the controller such as PI controller, the regional control deviation (ACE) is used as the input of the controller to track the real-time load disturbance and output the total automatic generation control generation power command. Then, the power grid dispatching centre will distribute the automatic generation control total generation power command to all automatic generation control frequency modulation units according to the dynamic allocation algorithm of generation power command. This research mainly discusses the second process – the dynamic allocation process of total automatic generation control generation power command, so as to realize the optimal dynamic performance and economic comprehensive benefits of automatic generation control generation power command allocation [18].

In the frequency modulation market, frequency modulation mileage is a new quantitative index to determine the actual regulation amount of each automatic generation control frequency modulation unit according to the automatic generation control power generation instructions distributed in real time by the power dispatching centre. According to the market rules of China Southern Power Grid, the total frequency modulation mileage in a certain period of time is the sum of the adjusted mileage of automatic generation control frequency modulation unit in response to automatic generation control power generation command in that period. Among them, the frequency modulation mileage of automatic generation control frequency modulation unit in response to automatic generation control generation power command each time refers to the absolute value of the difference between the actual output at the end of response to automatic generation control generation power command and the output in response to command, as follows:

The formula for calculating frequency modulation mileage of the $i$th frequency modulation unit is listed as follows [19]:

$${Q}_{i}(k)=|\mathrm{\Delta}{P}_{i}^{o}(k+1)-\mathrm{\Delta}{P}_{i}^{o}(k)|$$ | (6) |

where ${Q}_{i}(k)$ denotes the frequency modulation mileage of the $i$th automatic generation control frequency modulation unit at the $k$th control interval, $\mathrm{\Delta}{P}_{i}^{o}(k)$ denotes the actual regulated power output of the $i$th automatic generation control frequency modulation unit at the $k$th control start time interval, $\mathrm{\Delta}{P}_{i}^{o}(k+1)$ denotes the actual regulated power output of the $i$th automatic generation control frequency modulation unit at $k+1$th control start time interval.

The frequency modulation mileage compensation cost of each automatic generation control frequency modulation unit can be calculated according to the following method [20]

$${C}_{i}=\sum _{k=1}^{N}\eta \cdot {V}_{i}^{p}\cdot {Q}_{i}(k)$$ | (7) |

where ${C}_{i}$ denotes the total frequency modulation mileage compensation cost of the $i$th automatic generation control frequency modulation unit in n control intervals, $\eta $ denotes price for frequency modulation mileage, ${V}_{i}^{p}$ denotes the comprehensive frequency modulation performance index score of the $i$th automatic generation control frequency modulation unit, $N$ denotes the number of control intervals per period during frequency modulation service, ${V}_{i}^{p}$ is made up of the following three values:

Adjust rate value: It illustrates the rate at which automatic generation control frequency modulation unit responds to automatic generation control generation power command, and it can be computed by the following formulation:

$${V}_{i}^{r}=\frac{\mathrm{\Delta}{P}_{i}^{r}}{\mathrm{\Delta}{P}_{a}^{r}}$$ | (8) |

where ${V}_{i}^{r}$ denotes the adjustment rate score of the $i$th automatic generation control frequency modulation unit; $\mathrm{\Delta}{P}_{i}^{r}$ denotes the maximum regulation rate of the $i$th automatic generation control frequency modulation unit, $\mathrm{\Delta}{P}_{a}^{r}$ represents the average regulation rate of all automatic generation control frequency modulation units in the control area.

Response time value: It illustrates the time delay of automatic generation control frequency modulation unit when automatic generation control generated power command responses, its formulation is listed as follows

$${V}_{i}^{d}=1-\frac{{D}_{i}^{d}}{5\mathrm{min}}$$ | (9) |

where ${V}_{i}^{d}$ represents the response time value of the $i$th automatic generation control frequency modulation unit, ${D}_{i}^{d}$ illustrates the regulating time of the $i$th automatic generation control frequency modulation unit.

1. Adjust precision value

The adjustment precision is assessed through evaluating the the offset between the allocated automatic generation control generation power command input and the real unit output, it is calculated by

$${V}_{i}^{q}=1-\frac{1}{K}\sum _{k=1}^{K}\left|\frac{\mathrm{\Delta}{P}_{i,i}(k)-\mathrm{\Delta}{P}_{i,o}(k+1)}{\mathrm{\Delta}{P}_{i,a}}\right|$$ | (10) |

where ${V}_{i}^{q}$ denotes the adjustment accuracy score of the $i$th automatic generation control frequency modulation unit, $\mathrm{\Delta}{P}_{i,i}(k)$ is the automatic generation control generation power command input of the ith automatic generation control frequency modulation unit at the beginning of the $k$th control interval, $\mathrm{\Delta}{P}_{i,a}$ denotes the allowable adjustment error of the $i$th automatic generation control frequency modulation unit in each cycle is 1.5% of the rated output of the $i$th automatic generation control frequency modulation unit.

The value of comprehensive frequency modulation property index is equal to the sum of the product of the three adjustment scores and the weight, and the result is

$${V}_{i}^{p}={\omega}_{1}{V}_{i}^{r}+{\omega}_{2}{V}_{i}^{d}+{\omega}_{3}{V}_{i}^{q}$$ | (11) |

where ${\omega}_{1}$, ${\omega}_{2}$ and ${\omega}_{3}$ are weight ratios of each adjustment value.

Fireflies can decide the existence and attraction of other fireflies by grasping luminous intensity and frequency of other fireflies within the permissible scope, so as to attract the opposite sex and prey. Xin She Yang of the Engineering Department of Cambridge University, country-regionplaceUK, proposed the firefly algorithm based on this behaviour of fireflies in 2009, the implementation of the algorithm is based on the following three principles:

(1) All fireflies have no sex.

(2) Attraction is proportional to their brightness. In this way, for any two flashing fireflies, the weaker one will fly to the brighter one. In addition, the attraction is also related to the distance between fireflies and the light absorption rate of air. The increase of distance or light absorption rate will reduce the attraction. If there is no firefly brighter than the current firefly, the current firefly will move randomly [21].

(3) The brightness of fireflies is determined by fitness.

The Cartesian distance is used to describe the distance between two fireflies $i$ and $j$ at locations ${X}_{i}$ and ${X}_{j}$ respectively, which is calculated by

$${d}_{ij}=\sqrt{\sum _{k=1}^{K}{({l}_{i,k}-{l}_{j,k})}^{2}}$$ | (12) |

where $K$ denotes the coordination dimension, ${l}_{i,k}$ denotes $k$th dimensional component in space coordination ${X}_{i}$, ${l}_{j,k}$ denotes $k$th dimensional component in space coordination ${X}_{j}$.

The attraction of firefly is defined by [22]

$$\alpha (d)={\alpha}_{0}{e}^{-\xi {d}^{2}}$$ | (13) |

where ${\alpha}_{0}$ denotes the attraction at $d=0$, $\xi $ denotes the light absorption.

The firefly $i$ moves to the more attractive firefly $j$ according to the following formula:

$${l}_{i,k}^{t+1}={l}_{i,k}^{t}+{\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}({l}_{j,k}^{t}-{l}_{i,k}^{t})+\tau (\mathit{rand}-0.5)$$ | (14) |

The solution space of the standard firefly algorithm belongs to the continuous real number domain space, while the solution space of the assembly sequence planning problem belongs to the discrete integer domain space, and the integer values of each dimension are different from each other. In order to make the firefly algorithm for continuous optimization problem suitable for solving assembly sequence planning problem, on the one hand, the assembly sequence planning problem can be improved to adapt to the optimization of firefly algorithm; On the other hand, the firefly algorithm can be changed to adapt to assembly sequence planning. In this paper, the latter method is used to discretize the firefly algorithm to make it suitable for solving the assembly sequence planning problem.

Since the standard firefly algorithm is not suitable for solving the assembly sequence planning problem, a discrete firefly algorithm is proposed to solve the assembly sequence planning problem and reconstruct the firefly position update formula [23]:

$${l}_{i,k}^{t+1}={l}_{i,k}^{t}\oplus {\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}\otimes ({l}_{j,k}^{t}\mathrm{\Theta}{l}_{i,k}^{t})\oplus \tau (\mathit{rand}-0.5)$$ | (15) |

The relevant operations of the discrete firefly algorithm are defined as follows:

Step 1: Initialize the location of firefly $i$: Initialize the location of each firefly as an $n$-dimensional vector. The position of each firefly corresponds to an assembly sequence. Firefly $i$ is encoded with the following sequence:

$${\overrightarrow{L}}_{i}={[{l}_{i,1},{l}_{i,2},\mathrm{\dots},{l}_{i,n}]}^{T}$$ | (16) |

where $n$ denotes the dimensional number of firefly $i$, $l{}_{i,j}$ denotes the $j$th dimensional element of firefly $i$.

Any two elements in vector ${\overrightarrow{L}}_{i}$ are not equal to each other, in order to ensure diversity of population, and improve the global searching ability of algorithm, the initial sequences are generated randomly.

Step 2: Implement subtraction operation between locations ${L}_{j}^{t}\mathrm{\Theta}{L}_{i}^{t}$: this operation can obtain the main moving direction ${M}_{i}^{t+1}$ of $i$th firefly [24]

$${\stackrel{\rightharpoonup}{M}}_{i}^{t+1}={L}_{j}^{t}\mathrm{\Theta}{L}_{i}^{t}$$ | (17) |

During the process of calculation, the dimensional values of sequence ${L}_{j}^{t}$ and ${L}_{i}^{t}$ are compared one by one. For $k$th dimensional element ${m}_{i,k}^{t+1}$ of ${\stackrel{\rightharpoonup}{M}}_{i}^{t+1}$, if ${l}_{i,k}^{t}$ and ${l}_{j,k}^{t}$ is not equal, ${m}_{i,k}^{t+1}={l}_{j,k}^{t}$, that is the vector ${\stackrel{\rightharpoonup}{M}}_{i}^{t+1}$ inherits valid elements from the corresponding dimension of vector ${L}_{j}^{t}$. If ${l}_{i,k}^{t}$ and ${l}_{j,k}^{t}$ is equal, ${m}_{i,k}^{t+1}=0$.

Step 3: Multiple operation of direction: in standard firefly algorithm the step is ${\alpha}_{0}{e}^{-\xi {d}^{2}}$, which can control the distance that firefly $i$ moves in direction ${M}_{i}^{t+1}$ towards firefly $j$. This research uses ${M}_{i,c}^{t+1}$ denotes the product between ${M}_{i}^{t+1}$ and ${\alpha}_{0}{e}^{-\xi {d}^{2}}$.

$${M}_{i,c}^{t+1}={\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}\otimes {M}_{i}^{t+1}$$ | (18) |

where ${\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}$ and $\tau (\mathit{rand}-0.5)$ can be combined to control number of elements in ${M}_{i}^{t+1}$ inheriting from ${M}_{i,c}^{t+1}$. The multiple operation formula is listed by

$${M}_{i,c}^{t+1}=\{\begin{array}{cc}{M}_{i}^{t+1},\hfill & \tau (\mathit{rand}-0.5)<{\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}\hfill \\ 0,\hfill & \mathrm{other}\hfill \end{array}$$ | (19) |

Obviously, the bigger the ${\alpha}_{0}{e}^{-\xi {d}_{ij}^{2}}$ is, the more the elements in ${M}_{i}^{t+1}$ inheriting from ${M}_{i,c}^{t+1}$ are.

Step 4: addition operation of location and direction, the main part of position of the discrete firefly algorithm in this research is the sum of location vector of firefly at time $t$ and the direction vector at time $t+1$, the corresponding expression is listed as follows:

$${L}_{i}^{t+1}={L}_{i}^{t+1}\oplus {M}_{i,c}^{t+1}$$ | (20) |

When the position of the firefly is updated, if the element ${m}_{i,c}^{t+1}$ in the direction vector ${M}_{i,c}^{t+1}$ is 0, the value of the $k$th element in the position vector ${L}_{i}^{t+1}$ will not be changed, that is ${l}_{i,k}^{t+1}={l}_{i,k}^{t}$; if ${m}_{i,c}^{t+1}$ is not equal to 0, the $k$th element in the position vector ${L}_{i}^{t+1}$ it the value after ${l}_{i,k}^{t}$ and ${m}_{i,c}^{t+1}$ are exchanged.

In order to verify the effectiveness of the proposed improved firefly algorithm (IFA) on automatic generation control power command allocation, the particle swarm algorithm (PSA), and traditional firefly algorithm (TFA), the simulation analysis is carried out for power grid system with eight units, and the basic parameters are listed in Table 1.

**Table 1** Basic parameters in automatic generation control power grid system

Climbing | Maximum | Minimum | |||

Rate | Regulating | Regulating | |||

Unit | Unit Type | ${T}_{d}(s)$ | /WM/min | Capacity/MW | Capacity/MW |

U1 | Thermal power | 45 | 10.43 | 130 | $-$60 |

U2 | Gas | 15 | 22 | 50 | $-$50 |

U3 | Wind power | 2 | $-$ | 30 | $-$20 |

U4 | Photovoltaic | 2 | $-$ | 20 | $-$10 |

U5 | CHP | 10 | 8 | 30 | $-$25 |

U6 | P2G | 10 | $-$ | 15 | 0 |

U7 | Wind power | 3 | $-$ | 8.65 | $-$12 |

U8 | Gas | 20 | 22 | 25 | $-$15 |

(1) Step disturbance

Because automatic generation control power dynamic allocation belongs to ultra short-term scheduling, the calculation time of the optimization algorithm is relatively high. The simulation analysis of automatic generation control power grid system under step disturbances of 200WM, 300WM, 400WM, 500WM, 600WM, 700WM, 800WM is carried out and the simulation results are shown in Table 2.

**Table 2** Convergence results of automatic generation control power grid system under disturbance based on different algorithm

Iteration Times | |||||||||

Step | Maximum Value | Minimum Value | Average Value | ||||||

Disturbance/MW | PSA | TFA | IFA | PSA | TFA | IFA | PSA | TFA | IFA |

200 | 121 | 102 | 95 | 22 | 19 | 15 | 68.49 | 62.34 | 58.40 |

300 | 139 | 120 | 106 | 32 | 29 | 23 | 72.55 | 69.40 | 65.93 |

400 | 143 | 125 | 110 | 37 | 33 | 29 | 75.30 | 72.31 | 68.04 |

500 | 165 | 143 | 124 | 40 | 36 | 32 | 79.43 | 73.20 | 69.27 |

600 | 183 | 169 | 147 | 43 | 40 | 37 | 82.54 | 79.05 | 75.24 |

700 | 193 | 175 | 156 | 47 | 43 | 40 | 85.42 | 82.95 | 80.21 |

800 | 203 | 195 | 178 | 52 | 48 | 44 | 88.48 | 84.39 | 81.20 |

As seen from Table 1, under different load distribution, the maximum convergence steps of PSA is no more than 202, and the minimum convergence steps of PSA reaches to 22. The maximum convergence steps of TFA is no more than 195, and the minimum convergence steps of TFA reaches to 19. The maximum convergence steps of IFA is no more than 178, and the minimum convergence steps of IFA reaches to 15.

Assuming that the system adopts the global microwave interconnection access wireless communication technology, the time required for each information transmission and iterative calculation is only 1ms at most, and the maximum time of two-layer power distribution is 0.33 s, which can fully meet the control time scale requirements of automatic generation control 4$\sim $16 s.

Taking step disturbance of 300MW to carry out simulation, and the step disturbance results based on different algorithm are listed in Table 3.

**Table 3** Step disturbance results of automatic generation control grid system based on different algorithm

$|$ACE$|$/MW | $|\mathrm{\Delta}f|$/Hz | CPS1/% | |||||

Maximum | Average | Maximum | Average | Maximum | Average | Cost/ | |

Algorithm | Value | Value | Value | Value | Value | Value | 10${}^{4}$Y |

PSA | 69.33 | 5.43 | 0.2984 | 0.0254 | 174.3 | 210.4 | 590.43 |

TFA | 50.43 | 5.19 | 0.2843 | 0.0235 | 164.5 | 196.5 | 567.32 |

IFA | 48.04 | 4.86 | 0.2796 | 0.0227 | 155.6 | 183.6 | 529.06 |

As seen from Table 3, $|$ACE$|$, $|\mathrm{\Delta}f|$ and CPS1 obtained based on IFA are least among that obtained from all algorithms. The cost in the table is the frequency modulation mileage compensation cost. It can be concluded that the dynamic performance of IFA is the best of the four actual algorithms, but its economy is affected by too many fast response automatic generation control frequency modulation units participating in frequency modulation.

The total automatic generation control generation power of system under step disturbance with time is shown in Figure 2. As seen from Figure 2, the total automatic generation control generation power of system based on IFA is least among all algorithms, the main reason for this phenomenon is that the IFA has quickest response performance, therefore it can obtain least power controlling error.

The improved firefly algorithm is put forward for automatic generation control power allocation of distributed energy system. The optimal model of automatic generation control power allocation of distributed energy system is constructed, and the improved firefly algorithm is established for solving the optimal model. A automatic generation control power grid of distributed energy system is selected as research objective to carry out simulation analysis, and simulation results show that the improved firefly algorithm has quickest convergence efficiency, and obtain best power allocation effect of distributed energy system, it can obtain least power controlling error. The data analysis can effectively provide theoretical support for automatic generation control power allocation of distributed energy system.

This work is supported by the Henan Provincial Key Science and Technology Research Projects (NO. 202102210126 and 182102210462).

[1] Abdulhameed Adamu, Mohammed Abdullahia, Sahalu Balarabe Junaidua, Ibrahim Hayatu Hassana, An hybrid particle swarm optimization with crow search algorithm for feature selection, Machine Learning with Applications, 2021, 6(12):100108.

[2] Alba Muñoz, Fernando Rubio, Evaluating genetic algorithms through the approximability hierarchy, Journal of Computational Science, 2021, 53(7):101388.

[3] Kaipu Wang, Xinyu Li, Liang Gao, Peigen Li, Surendra M. Gupta, A genetic simulated annealing algorithm for parallel partial disassembly line balancing problem, Applied Soft Computing, 2021, 107(8):107404.

[4] Hao Zhang, Yuxin Shi, Xueran Yang, Ruiling Zhou, A firefly algorithm modified support vector machine for the credit risk assessment of supply chain finance, Research in International Business and Finance, 2021, 58(12):101482.

[5] Janmenjoy Nayak, Bighnaraj Naik, Pandit Byomakesha Dash, Alireza Souri, Vimal Shanmuganathan, Hyper-parameter tuned light gradient boosting machine using memetic firefly algorithm for hand gesture recognition, Applied Soft Computing, 2021, 107(8):107478.

[6] Jie Shan, Jeng-Shyang Pan, Cheng-Kuo Chang, Shu-Chuan Chu, Shi-Guang Zheng, A distributed parallel firefly algorithm with communication strategies and its application for the control of variable pitch wind turbine, ISA Transactions, 2021, 115(9):79–94.

[7] Manousos Rigakis, Dimitra Trachanatzi, Magdalene Marinaki, Yannis Marinakis, Tourist group itinerary design: When the firefly algorithm meets the n-person Battle of Sexes, Knowledge-Based Systems, 2021, 228(9):107257.

[8] Hussam S. Alhadawi, Dragan Lambić, Mohamad Fadli Zolkipli, Musheer Ahmad, Globalized firefly algorithm and chaos for designing substitution box, Journal of Information Security and Applications, 2020, 55(12):102671.

[9] Hana Gharrad, Nafaa Jabeur, Ansar Ul-Haque Yasar, Stephane Galland, Mohammed Mbarki, A five-step drone collaborative planning approach for the management of distributed spatial events and vehicle notification using multi-agent systems and firefly algorithms, Computer Networks, 2021, 198(10):108282.

[10] Junfei Zhang, Yimiao Huang, Guowei Ma, Yanmei Yuan, Brett Nener, Automating the mixture design of lightweight foamed concrete using multi-objective firefly algorithm and support vector regression, Cement and Concrete Composites, 2021, 121(8):104103.

[11] Shanze Huang, Jin He, Shuo Li, Zhiyuan Cao, Jiankang Li, A 20-Gb/s wideband automatic generation control amplifier with 26-dB dynamic range in 0.18-$\mu $m SiGe BiCMOS, Integration, 2021, 81(11):160–166.

[12] Matouš Glanc, Kasper Van Gelderen, Lukas Hoermayer, Shutang Tan, Satoshi Naramoto, Xixi Zhang, David Domjan, automatic generation control kinases and MAB4/MEL proteins maintain PIN polarity by limiting lateral diffusion in plant cells, Current Biology, 2021, 31(9):1918–1930.

[13] Jiawen Li, Tao Yu, Xiaoshun Zhang, Fusheng Li, Dan Lin, Hanxin Zhu, Efficient experience replay based deep deterministic policy gradient for automatic generation control dispatch in integrated energy system, Applied Energy, 2021, 285(3):116386.

[14] Nizamuddin Hakimuddin, Anita Khosla, Jitendra Kumar Garg, Centralized and decentralized automatic generation control schemes in 2-area interconnected power system considering multi source power plants in each area, Journal of King Saud University - Engineering Sciences, 2020, 32(2):123–132.

[15] I. Saboya, I. Egido, E. Lobato, L. Sigrist, MOPSO-tuning of a threshold-based algorithm to start up and shut-down rapid-start units in automatic generation control, International Journal of Electrical Power & Energy Systems, 2019, 108(6):153–161.

[16] Mita Cokic, Ivan Seskar, FSoftware defined network management for dynamic smart GRID traffic, Future Generation Computer Systems, 2019, 96(7):270–282.

[17] A. Arsenov, G.M. Dimirovski, B. Percinkova, Fast Method for Constrained Load-allocation Strategy in Hydro-thermo-pump Electric Energy Systems, IFAC Proceedings Volumes, 1989, 22(10):409–413.

[18] Feng Zhang, Aihui Fu, Lei Ding, Qiuwei Wu, Bing Zhao, Peng Zi, Optimal sizing of ESS for reducing automatic generation control payment in a power system with high PV penetration, International Journal of Electrical Power & Energy Systems, 2019, 110(9):809–818.

[19] Yi Dong, Zhen Dong, Tianqiao Zhao, Zhengtao Ding, A Strategic Day-ahead bidding strategy and operation for battery energy storage system by reinforcement learning, Electric Power Systems Research, 2021, 196(7):107229.

[20] Anuj Banshwar, Naveen Kumar Sharma, Yog Raj Sood, Rajnish Shrivastava, An international experience of technical and economic aspects of ancillary services in deregulated power industry: Lessons for emerging BRIC electricity markets, Renewable and Sustainable Energy Reviews, 2018, 90(7):774–801.

[21] Jinran Wu, You-Gan Wang, Kevin Burrage, Yu-Chu Tian, Brodie Lawson, Zhe Ding, An improved firefly algorithm for global continuous optimization problems, Expert Systems with Applications, 2020, 149(7):113340.

[22] Tian Mengchu, Bo Yuming, Chen Zhimin, Wu Panlong, Yue Cong, Multi-target tracking method based on improved firefly algorithm optimized particle filter, Neurocomputing, 2019, 359(9):438–448.

[23] Krishna Gopal Dhal, Arunita Das, Swarnajit Ray, Jorge Gálvez, Randomly Attracted Rough Firefly Algorithm for histogram based fuzzy image clustering, Knowledge-Based Systems, 2021, 216(3):106814.

[24] Mahya Mohammadi Golchi, Shideh Saraeian, Mehrnoosh Heydari, A hybrid of firefly and improved particle swarm optimization algorithms for load balancing in cloud environments: Performance evaluation, Computer Networks, 2019, 162(10):106860.

**Xiao Xue**, Associate Professor of School of Electronic and Electrical Engineering in Nanyang Institute of Technology, Nanyang, China. He received his Bachelor of Engineering Science in Electronic Information Engineering from Nanyang Institute of Technology, Henan, China, in 2003; the Doctor Degree of Engineering in detection technology and automatic equipment from China University of Geosciences, Wuhan, China, in 2015. His current research interests include Detection technology, and intelligent control.

**Yangbing Zheng**, Associate Professor of control science and engineering, with Nanyang Normal University, Nanyang, China. She received her Bachelor of Engineering Science in Electronic Information Engineering from Nanyang Institute of Technology, Henan, China, in 2006; and the Doctor Degree of Engineering in detection technology and automatic equipment from China University of Mining and Technology, Beijing, China, in 2013, respectively. Her current research interests include active robot control, and nonlinear control.

**Chao Lu**, Engineer of Nanyang Zehui Technology Co., LTD. He received his Bachelor of Engineering Science in electronic information engineering form Nanyang Institute of Technology, Henan, China, in 2015.

*Distributed Generation & Alternative Energy Journal, Vol. 37_3*, 845–864.

doi: 10.13052/dgaej2156-3306.37321

© 2022 River Publishers