Integrated Reactive Power Optimisation for Power Grids Containing Large-Scale Wind Power Based on Improved HHO Algorithm

: Large-scale wind power grid integration will greatly change the system current distribution, making it difﬁcult for the reactive power regulator to adjust to the optimal state. In this paper, an integrated reactive power optimisation method based on the improved Harris Hawk (HHO) algorithm is proposed. Firstly, a reactive power regulation model is constructed to solve the reactive power regulation interval of wind turbines, and the reactive power margin of wind turbines is used to participate in the system’s reactive power optimisation. Finally, a reactive power compensation capacity allocation optimisation model considering nodal voltage deviation, line loss and equipment investment cost, is established, and a reactive power optimisation scheme is obtained using the Harris Hawk optimisation algorithm on the basis of considering the constraints of the wind turbine reactive power output interval. The improved HHO algorithm is used to solve the reactive power optimisation scheme considering the constraints of tidal power, machine end voltage, a conventional generator and wind farm reactive power. In the simulation, the effects of the improved Harris Hawk optimisation algorithm and the particle swarm optimisation algorithm are compared, and the experimental results prove that compared to the particle swarm algorithm, the optimisation result of the improved Harris Hawk optimisation algorithm reduces the average loss of the system by 42.6% and reduces the average voltage deviation by 30.3%, which conﬁrms that the improved Harris Hawk intelligent optimisation algorithm is effective in proving its superiority and solving the multi-objective model for reactive power optimisation.


Introduction
In the context of international energy transition and global fossil energy depletion, China is vigorously promoting the development of new energy sources.Though wind power is a typical clean energy source and has been vigorously promoted [1], the power fluctuations caused by the uncertainty and uncontrollability of wind power output significantly change the system network tide distribution, making it difficult for the reactive regulator to achieve optimal operation, resulting in higher additional losses and voltage overrunning in the system.
The basic research idea for reactive power optimisation problems is to select multiple control variables, construct a reactive power optimisation model, set the objective function, constraints, and, finally, select different algorithms for iterative solutions [2][3][4][5].The algorithms used to find the reactive power optimisation model are divided into two main categories: one category the traditional reactive power optimisation algorithm [6][7][8], and the other category is the heuristic intelligent optimisation algorithm [9][10][11][12][13].
In terms of traditional optimisation algorithms used to solve reactive power optimisation problems, the literature [14] uses a linear programming method to solve the model by coordinating the control of SVGs in MV distribution networks with distributed PV inverters in LV distribution networks.The literature [15] proposed a two-stage algorithm for dynamic reactive power optimisation based on the decoupled interior point method and mixed integer programming.In the literature [16], a two-stage dynamic reactive power optimisation model is proposed for the reactive power optimisation problem of mixed integer non-linear programming.A mixed integer programming model with the number of reactive power control device actions being a constraint is constructed in the literature [17] to decide the solution.The above traditional optimisation algorithms also have certain problems when solving reactive power optimisation problems, such as sensitivity to initial conditions, high computational complexity and the need for large amounts of data.To address the shortcomings of the above traditional optimisation algorithms in solving reactive power optimisation problems in power systems, heuristic intelligent optimisation algorithms are increasingly used in reactive power optimisation problems due to their strong convergence and global and local optimisation capabilities.In [18], a reactive power optimisation model for a distribution network with wind turbines was constructed and solved using particle swarm algorithms.In [19], the authors constructed an objective function based on the operating cost of the system to validate the grey wolf algorithm, and the improved grey wolf algorithm improved the convergence of the algorithm and the ability of local optimisation.In [20], a two-layer optimisation model of distribution network with DG was constructed, with DG investment and the operation cost being the upper-level objective and distribution network line loss and voltage deviation being the lower-level objectives, and the sparrow optimisation algorithm was improved and solved.In [21], the authors construct the objective functions of maximum active power, total voltage harmonic distortion rate and minimum voltage deviation for PV grid connection, solving them using an ant colony algorithm improved through adaptive weighting.
In conclusion, most of the literature on reactive power optimisation of new energy wind power grids fails to analyse the voltage weaknesses of the grid and ignores the reactive power regulation capability of the wind farm itself.The identification of voltage weak nodes can target the installation of reactive power compensation equipment, which, in turn, reduces the dimensionality of the optimisation variables and the difficulty of solving reactive power optimisation problems.The reactive power margin of the wind turbine can replace part of the reactive power compensation device to ensure reactive power regulation and improve the overall economy of the system.
To solve the above problems, this paper proposes an integrated reactive power optimisation method for large-scale wind power grids based on the improved HHO algorithm.The method, firstly, identifies the voltage weak points of wind farms after grid connection using the continuation power flow method and places reactive power compensation devices at the weak points to reduce the dimensions of optimisation variables.Secondly, the reactive power margins of doubly fed wind turbines are analysed and used for reactive power optimisation to improve the economy of the system.The HHO algorithm is then improved using various strategies to improve its convergence, as well as global and local optimisation capabilities, and, finally, an integrated reactive power optimisation strategy is obtained by solving the objective function, with node voltage deviation, line losses and equipment investment cost used as indicators.The superiority of the improved Harris Hawk intelligent optimisation algorithm in solving the multi-objective model for reactive power optimisation is verified by comparing the results of the Harris Hawk optimisation algorithm before and after the improvement to those of the particle swarm optimisation algorithm.

Integrated Reactive Power Optimisation Model Construction and Solution
The main process of establishing and solving the integrated reactive power optimisation model for a large-scale wind power grid based on the improved HHO algorithm proposed in this paper is as follows: 1.
Determine the voltage weak nodes of the system based on the continuous flow method and use the identified voltage weak nodes as the access points of reactive power compensation equipment.2.
Analyse the reactive power regulation margin of the doubly fed turbine and use it as one of the optimisation variables to perform reactive power optimisation.

3.
For actual wind farms, the comprehensive reactive power optimisation solution model is constructed by considering the current constraints and the inequality constraints on the constraint control variables, with the node voltage deviation, line loss and equipment investment cost being the objective functions.

4.
Use the multi-strategy improved HHO algorithm to solve the comprehensive reactive power optimisation model and analyse the results.
The overall flow of the example analysis is shown in Figure 1.
Sustainability 2023, 15, x FOR PEER REVIEW 3 of 21 reactive power optimisation is verified by comparing the results of the Harris Hawk optimisation algorithm before and after the improvement to those of the particle swarm optimisation algorithm.

Integrated Reactive Power Optimisation Model Construction and Solution
The main process of establishing and solving the integrated reactive power optimisation model for a large-scale wind power grid based on the improved HHO algorithm proposed in this paper is as follows: 1. Determine the voltage weak nodes of the system based on the continuous flow method and use the identified voltage weak nodes as the access points of reactive power compensation equipment.2. Analyse the reactive power regulation margin of the doubly fed turbine and use it as one of the optimisation variables to perform reactive power optimisation.3.For actual wind farms, the comprehensive reactive power optimisation solution model is constructed by considering the current constraints and the inequality constraints on the constraint control variables, with the node voltage deviation, line loss and equipment investment cost being the objective functions.4. Use the multi-strategy improved HHO algorithm to solve the comprehensive reactive power optimisation model and analyse the results.
The overall flow of the example analysis is shown in Figure 1.

Start
Enter data from the original IEEE-

Identification of System Voltage Weak Points Based on the Continuation Power Flow Method
When large-scale new energy wind farms are connected to the grid, the power fluctuations caused by the uncertainty and uncontrollability of their power output will significantly affect the tidal wave distribution of the system, and the voltage at each node will fluctuate, while voltage instability in the grid often starts from one or a few weak nodes with stable voltages, which then spreads to other nodes [22].By identifying voltage weak points through research, reactive power can be optimised for these weak points, thereby

Identification of System Voltage Weak Points Based on the Continuation Power Flow Method
When large-scale new energy wind farms are connected to the grid, the power fluctuations caused by the uncertainty and uncontrollability of their power output will significantly affect the tidal wave distribution of the system, and the voltage at each node will fluctuate, while voltage instability in the grid often starts from one or a few weak nodes with stable voltages, which then spreads to other nodes [22].By identifying voltage weak points through research, reactive power can be optimised for these weak points, thereby reducing the dimensionality of the variables in the reactive power optimisation model and improving the efficiency of the optimisation.
The basic model of the continuation power flow method is the extended tide equation, which determines whether the current state is stable by analysing the various state indicators of the system in the critical operating state, as the operating state when the transmission power of a branch reaches the maximum transmission power is the critical operating state.
Let the tidal equation for the system in n dimensions with parameters be where x is the node voltage amplitude and the phase angle in the system, and λ is the load growth factor.The continuation power flow method is used to overcome the singularity of the Jacobi matrix by incorporating a load growth factor to obtain a complete PV curve for the node, where the continuation power flow method consists of four parts: parameterisation, prediction, step and correction [23,24].
The PV curve visualises the voltage variation at each node in the power transfer critical point state for the access of doubly fed wind turbines.
Let the voltage variation indicator for node i be where V i0 is the initial voltage of node i after the doubly fed turbine is connected to the system, and V cri is the voltage corresponding to node i in the critical state.
The greater the node voltage variation indicator, the more vulnerable the node voltage and the greater the need for some reactive power compensation for voltage optimisation at the node.

Analysis of Reactive Power Regulation Margins for Doubly Fed Wind Turbines
In this paper, doubly fed asynchronous wind turbines are used as the wind turbine type in wind farms and analysed.In normal operation, doubly fed asynchronous wind turbines have a certain adjustment range of reactive power, which can be used as a new type of reactive power source to support the reactive power optimisation of the power grid in order to improve the efficiency of the reactive power optimisation of the power system [25][26][27].
The relationship between the active power P g absorbed by the converter on the grid side, the active power P r absorbed on the rotor side and the active power P s emitted on the stator side during normal operation of a doubly fed fan is satisfied by where s is the rate of rotation of the rotor side of the doubly fed fan.
The power transfer and conversion model of a doubly fed fan is shown in Figure 2.For a conventional doubly fed fan, the stator-side reactive power range is as follows: where Q s is the reactive power emitted from the stator side of the doubly fed fan, Q smin is the maximum reactive power absorbed by the stator side of the doubly fed fan, and Q smax is the maximum reactive power emitted from the stator side of the doubly fed fan.During normal operation, the voltage at the machine end of a doubly fed fan is approximately constant, but as the active power output to the grid side increases, the reactive power available for regulation within the doubly fed fan decreases.The reactive power output range is directly related to the reactive power regulation capability of the During normal operation, the voltage at the machine end of a doubly fed fan is approximately constant, but as the active power output to the grid side increases, the reactive power available for regulation within the doubly fed fan decreases.The reactive power output range is directly related to the reactive power regulation capability of the stator-side and grid-side converters, being formatted as follows: where Q g.max and Q g.min are the maximum and minimum values of the reactive power injected into the grid side of the doubly fed wind turbine, respectively; Q c.max and Q c.min are the maximum and minimum values of the reactive power of the converter on the grid side of the doubly fed wind turbine, respectively; and Q s.max and Q s.min are the maximum and minimum values of the reactive power output on the stator side of the doubly fed wind turbine, respectively.
where L s is the stator-side inductance of the doubly fed fan; L m is the excitation inductance of the doubly fed fan; U s is the rms value of the stator voltage of the doubly fed fan; s is the turndown rate on the rotor side of the doubly fed fan; and I s.max and I r.max are the maximum current values on the stator and rotor sides of the doubly fed fan, respectively; and P m is the input mechanical power of the doubly fed fan to the grid.The main factor affecting the reactive power regulation range of the grid-side converter is the size of the grid-side converter capacity, as shown in the following equation: where S c.max is the rated capacity of the converter on the grid side of the doubly fed wind turbine, P m is the input mechanical power of the doubly fed turbine to the grid, and s is the turndown rate on the rotor side of the doubly fed turbine.In summary, once the current wind speed and wind power of the wind farm are known, the reactive power regulation range of the entire wind farm can be calculated based on the reactive power regulation model of the doubly fed asynchronous wind turbine in the wind farm.The reactive power margin of the wind farm can then be applied to the reactive power optimisation problem of the power grid to give full play to the reactive power regulation characteristics of the wind farm and ensure the safe and stable operation of the power grid.

Objective Function
The construction is designed to minimise system voltage deviations, line losses and the total investment cost of reactive equipment (capacitor banks) at the nodes to be compensated, which can be expressed as follows: where M is the number of nodes in the system; v is the node number; U v is the actual voltage value of the node at the moment; U N is the rated voltage value of the node; U i , U j and θ ij are the voltage magnitudes of nodes i and j, respectively, and the phase angle difference between the two nodes; N L is the set of all branches in the system; w is the reactive compensation node number, m is the cost of each capacitor bank and C is the number of capacitor banks connected to the reactive compensation node; and f 1 (x) is a function of voltage deviation and optimisation variables, f 2 (x) is a function of line losses and optimisation variables, and f 3 (x) is a function of the investment cost of reactive power compensation equipment and optimisation variables.

Flow Constraints
The Flow Constraints are that the injected power is equal to the outgoing power at each node of the power system during operation.
where P i and Q i are the active and reactive power at node i; U i , U j and θ ij are the voltage amplitudes at nodes i and j and the phase angle difference between the two nodes, respectively; and G ij and B ij are the conductance and conductance before nodes i and j.

Inequality Constraints
Power system in the operation process to ensure stable operation of the system, voltage fluctuations need to meet certain requirements, at the same time as a means of voltage regulation, transformer taps and capacitor access capacity also exists in a certain range of limitations.
where the inequality constraint contains the voltage U Gi at node i of the generator, and U Gimin and U Gimax are the minimum and maximum values of the voltage at the generator, respectively; T i , T imin and T imax are the highest and lowest tap positions of the on-load regulator transformer, respectively; and Q Ci , Q Cimin and Q Cimax are the maximum and minimum compensation capacities of the capacitor bank and the compensation capacity of the reactive power compensation capacitor throw, respectively.
The reactive power output Q Gi of the generator and the reactive power Q Fi of the doubly fed wind turbine are also subject to the same maximum and minimum value constraints as the following equation:

Conventional HHO Algorithm
Harris Hawks Optimisation (HHO) is a novel bionic intelligent optimisation algorithm proposed by Ali Asghar Heidari and Seyedali Mirjalili in 2019 [28].The algorithm mimics the Harris Hawk predation characteristics and combines Levy flight functions to achieve solutions to complex multidimensional problems [29,30].

Harris Hawk Population Initialisation Settings
In the simulation experiment, a virtual population of Harris Hawks is required to hunt prey, and we assume a population of Harris Hawks of size N of Eagle = (X 1 , X 2 , . . ., X N ) T .The initial position of its population can be represented by the following matrix: where, N is the total number of eagles in the Harris Hawk population, d is the number of variables included in each Harris Hawk population, the dimensionality of the optimisation problem and X i,j is the value of the jth dimension for the ith Harris Hawk.
Based on the practical aspects of the above optimisation problem, the eagle can be defined as follows: where U G is the terminal voltage of a conventional generator set, N1 is the number of conventional generator sets, T is the tap position of the load-ratio voltage transformer, N2 is the number of load-ratio voltage transformer, C is the number of capacitors used to perform reactive power compensation, N3 is the number of capacitor banks used to perform reactive power compensation, Q is the reactive power margin used by the wind farm used to perform reactive power regulation and N4 is the number of wind farms.
To evaluate the fitness value of each Harris Hawk, a target matrix was used to store the fitness value of each Harris Hawk during the search for excellence, as shown in Equation ( 15): where N is the total number of eagles in the Harris eagle population, and d is the number of variables included in each Harris eagle population, i.e., the dimensionality of the optimisation problem.

Prey Search Phase
Harris Hawks choose different predatory behaviour depending on the escape energy of their prey, which is represented as E, as shown in Equation ( 16): where E is the escape energy of the prey at the current number of iterations, E 0 is a random number between −1 and 1, t is the current number of iterations, and T is the set maximum number of iterations for the Harris Hawk population.
Assuming that the two random prey species are random prey 1 and random prey 2, while setting the maximum number of iterations for the Harris Hawk population at 300, the adaptive decay phenomenon of the escape energy of the two random prey species with increasing number of iterations is shown in Figure 3.
where N is the total number of eagles in the Harris eagle population, and d is the numb of variables included in each Harris eagle population, i.e., the dimensionality of the op misation problem.

Prey Search Phase
Harris Hawks choose different predatory behaviour depending on the escape ener of their prey, which is represented as E, as shown in Equation ( 16): where E is the escape energy of the prey at the current number of iterations, 0 E is a ra dom number between −1 and 1, t is the current number of iterations, and T is the set ma imum number of iterations for the Harris Hawk population.
Assuming that the two random prey species are random prey 1 and random prey while setting the maximum number of iterations for the Harris Hawk population at 30 the adaptive decay phenomenon of the escape energy of the two random prey speci with increasing number of iterations is shown in Figure 3.The absolute value of prey escape energy decreases with the number of iterations, well as when the absolute value of prey escape energy is greater than 1, indicating th the prey is physically abundant and the Harris Hawk is far away from the prey; the Har Hawk population will use individuals within the population to disperse their flight an search for prey in a larger area.A random number is used to define whether Harris Haw find prey during the search phase and select the next iteration of the location update str egy, as shown in Equations ( 17) and ( 18):  The absolute value of prey escape energy decreases with the number of iterations, as well as when the absolute value of prey escape energy is greater than 1, indicating that the prey is physically abundant and the Harris Hawk is far away from the prey; the Harris Hawk population will use individuals within the population to disperse their flight and search for prey in a larger area.A random number is used to define whether Harris Hawks find prey during the search phase and select the next iteration of the location update strategy, as shown in Equations ( 17) and ( 18): where X m (t) is the average position of the Harris Hawk population at the time of the tth iteration, N is the total number of hawks in the Harris Hawk population and X i (t) is the position of the ith Harris Hawk at the time of the tth iteration.
where X(t + 1) is the position vector of a Harris Hawk at the next iteration; X rabbit (t) is the position vector of the prey in the current iteration; X m (t) is the average position of the Harris Hawk population at the time of the tth iteration; X rand (t) is the position of a random individual in the Harris Hawk population at the time of the tth iteration; UB and LB are the maximum and minimum values of the dimensional variables, respectively; X(t) is the position vector of the Harris Hawk at the current iteration; and r 1 , r 2 , r 3 , r 4 and p are random numbers in the range 0-1.
In summary, during the prey search phase, Harris Hawks update their position for the next iteration based on the magnitude of the value.If p ≥ 0.5, it means that none of the Harris Hawks in the population have found a prey position, so one of the other hawks in the population will be randomly selected for the position update.If p < 0.5, it means that one Harris Hawk in the population has found prey, meaning that the next iteration position will be updated with the prey position for roundup hovering.

Prey Hunting Phase
When the prey is found and circled by the Harris Hawk population, the hawk population will conduct a prey siege when the absolute value of the prey's escape energy E is less than 1.Depending on the prey's escape energy, the colony will choose a different strategy for rounding up the prey, which will include circling roundup, strong assault, circling roundup with progressive dive assault and strong assault with progressive dive assault.
When the prey escape energy E satisfies 0.5 < |E| < 1, the prey still has some energy to escape, meaning that the Harris Hawk flock roundup strategy will be a circling roundup, as shown in Equations ( 19) and ( 20): where X(t + 1) is the position vector of the Harris Hawk at the next iteration; ∆X(t) is the position distance between the prey and the Harris Hawk at the current iteration; J is a random number in the range 0-2 representing the random jump strength of the prey, which varies randomly at each iteration to restore the chance of the moment when the capture occurs; and E is the escape energy of the prey at the current iteration.
When the prey escape energy E satisfies |E| < 0.5, the prey escape energy is about to be depleted, meaning that the Harris Hawk flock roundup strategy is a strong surprise attack, as shown in Equation ( 21): where X(t + 1) is the position vector of the Harris Hawk at the next iteration, ∆X(t) is the position distance between the prey and the Harris Hawk at the current iteration, E is the escape energy of the prey at the current iteration, and X rabbit (t) is the position vector of the prey at the current iteration.
When the prey escape energy E satisfies 0.5 < |E| < 1 and successfully breaks through the flock's siege, in order to simulate the behaviour of the prey during the escape phase, levy flight is introduced into the HHO algorithm to simulate the irregular behaviour of the prey during the escape phase, meaning that the Harris Hawk flock's siege strategy at this time is a circling siege with a gradual swooping assault, in which the hawks will evaluate the next siege strategy based on Equation (22): The Harris Hawk will check the prey's position against its own to see if the last hawk siege was a valid act, and if it was not a valid act, it will perform an irregular progressive swoop based on levy flight and update its position, as shown in Equation ( 23): where Z is the Harris Hawk's position vector for the next iteration based on the levy flight update, S is a random position increment of dimension 1 × d, and LF is the levy flight function.
In summary, the positional fitness values of Z and Y need to be compared to determine the position of the Harris Hawk population after the next iteration of the update, as shown in Equation (24): When the prey escape energy E satisfies |E| < 0.5 and the flock has successfully broken through the hawk roundup, the hawks move using a similar strategy and circling roundup and gradual swoop assault, but at this point, the prey's escape energy is considered to be small, and a strong assault with a gradual swoop assault is adopted.The strategy needs to be updated to reduce the average distance between the hawks and the prey, as shown in Equation (25): The position of the Harris Hawk flock after the next iteration of the update is structured as shown in Equation ( 24).

Improved HHO Algorithm
The main parameters that affect the ability of the conventional HHO algorithm are the prey jump strength and the prey escape energy.When the jump strength is small, the algorithm may fall into the local optimum and vice versa, but too large a jump strength directly reduces the search accuracy of the global optimum, while the change in prey escape energy directly affects the search efficiency of the algorithm.In response to the search efficiency and local optimum problems that still exist in the conventional HHO algorithm, this paper makes algorithmic improvements to it from multiple perspectives.The improved HHO algorithm has a stronger search capability and is faster than the conventional HHO and previous algorithms used in power system reactive power optimisation, and the strategy used to improve the conventional HHO algorithm in this paper is described below.

Corsi Variation in the Harris Hawk Population
To address the problem of easily falling into local optima in the conventional HHO algorithm, a Cauchy Distribution is used to diversify the Harris Hawk population to increase the search space of the Harris Hawk population and improve the global optimal search capability of the HHO algorithm, where the standard Cauchy distribution function is structured as shown in Equation (26): When the HHO algorithm finishes updating the global optimal solution X best after each iteration, the global optimal solution X best is subjected to a Corsi variation, as shown in Equation ( 27): where X best (t + 1) is the global optimal solution when the next iteration is performed, X best (t) is the global optimal solution generated in this iteration, and Cauchay(0, 1) is the number of dimensions of the corresponding variable, i.e., d.Corsi variance factors were generated to update the range of each dimension in the original global optimal solution.

Prey Jump Strength Optimisation
The prey jump strength J in the conventional HHO algorithm is a random number in the range 0-2, but in reality, the prey jump strength should be related to the prey's real-time escape energy E. Therefore, the prey jump strength in the conventional HHO algorithm needs to be optimised by replacing the upper limit of the prey jump strength in each iteration with a dynamic upper limit that combines the real-time escape energy, thus restoring the actual situation when the prey escapes and helping to enhance the global optimisation capability of the algorithm.
The prey jump intensity is optimised as shown in Equation ( 28): where J is the initial prey jump strength value in the range 0-1, E is a random number between −1 and 1, t is the current number of iterations, T is the set maximum number of iterations for the Harris Hawk population, and J is the jump strength that has been optimised in real time using the prey escape energy.
After the prey jump strength has been realised in real time by combining the escape energy, the jump strength changes in real time with the increase in the number of iterations, following the change in the prey's own escape energy, as shown in Figure 4.In the early iterations of the HHO algorithm, the jump range is large, but as the number of iterations increases, the prey's escape energy adaptively decays, meaning that the jump intensity decreases in the later iterations.Therefore, the optimisation of the jump strength helps to enhance the global search capability of the algorithm in the early iterations and the local search capability in the late iterations.
in the range 0-2, but in reality, the prey jump strength should be related to the prey's rea time escape energy E. Therefore, the prey jump strength in the conventional HHO alg rithm needs to be optimised by replacing the upper limit of the prey jump strength in ea iteration with a dynamic upper limit that combines the real-time escape energy, thus r storing the actual situation when the prey escapes and helping to enhance the global o timisation capability of the algorithm.
The prey jump intensity is optimised as shown in Equation ( 28): where J is the initial prey jump strength value in the range 0-1, E is a random numb between −1 and 1, t is the current number of iterations, T is the set maximum number iterations for the Harris Hawk population, and J is the jump strength that has been op mised in real time using the prey escape energy.
After the prey jump strength has been realised in real time by combining the escap energy, the jump strength changes in real time with the increase in the number of iter tions, following the change in the prey's own escape energy, as shown in Figure 4.In t early iterations of the HHO algorithm, the jump range is large, but as the number of ite ations increases, the prey's escape energy adaptively decays, meaning that the jump i tensity decreases in the later iterations.Therefore, the optimisation of the jump streng helps to enhance the global search capability of the algorithm in the early iterations an the local search capability in the late iterations.

Prey Position Adaptive Weighting Update
The conventional HHO algorithm is divided into four predation strategies based o the different ranges of values of the prey's escape energy E. The use of adaptive weig

Prey Position Adaptive Weighting Update
The conventional HHO algorithm is divided into four predation strategies based on the different ranges of values of the prey's escape energy E. The use of adaptive weight coefficients to update the position of the prey X rabbit (t) is proposed during the iteration of the algorithm, and the processing can improve the algorithm's local search capability.The adaptive weight coefficients and prey position updates are given in Equations ( 29) and (30): where ω t is the adaptive weighting factor for the prey position updated in this iteration, X rabbit (t + 1) is the prey position in the next iteration updated based on the adaptive weighting factor, and X rabbit (t) is the prey position in this iteration not processed based on the adaptive weighting factor.

Integrated Reactive Power Strategy Solving Process Based on Improved HHO Algorithm
In this paper, the generator end voltage, on-load adjustable transformer taps, reactive power compensation equipment at voltage weak points and wind farm reactive power regulation margin are taken as variables that need to be optimised, i.e., X in the improved HHO optimisation algorithm, as well as the objective function, which takes into account the node voltage deviation, line loss and equipment investment cost, is taken as the value of the optimisation algorithm's fitness function in order to enact the solution of the algorithm.In summary, the solution flow of the improved integrated reactive power optimisation strategy based on the HHO algorithm proposed in this section is shown in Figure 5.  (1) Population initialisation and parameter setting: The population size of Harris Hawk is set as N, the dimension of the variables contained in Harris Hawk individuals is set as d, and the maximum number of iterations is set as T. We then initialize the prey escape energy E and jump strength J , initialize the location of Harris Hawk population individuals, define the integrated reactive optimisation objective as the fitness function and calculate the fitness value of the initialised solution.
(2) The locations of individuals in the population are tested for dimensional variable crossing limits, individual fitness values are calculated and adjusted, the optimal individual is selected as prey, and the prey escape energy at the current number of iterations is updated based on Equation ( 16).(3) The next location update strategy for the Harris Hawk population is decided based on the prey escape energy size, and if the absolute value of prey escape energy is greater than 1, the prey search phase is carried out, and the Harris Hawk population's location Corsi variation is processed based on Equation ( 27). ( 4) If the absolute value of prey escape energy is less than 1, the prey roundup phase is carried out, and different location update strategies are then selected according to (1) Population initialisation and parameter setting: The population size of Harris Hawk is set as N, the dimension of the variables contained in Harris Hawk individuals is set as d, and the maximum number of iterations is set as T. We then initialize the prey escape energy E and jump strength J, initialize the location of Harris Hawk population individuals, define the integrated reactive optimisation objective as the fitness function and calculate the fitness value of the initialised solution.
(2) The locations of individuals in the population are tested for dimensional variable crossing limits, individual fitness values are calculated and adjusted, the optimal individual is selected as prey, and the prey escape energy at the current number of iterations is updated based on Equation ( 16).(3) The next location update strategy for the Harris Hawk population is decided based on the prey escape energy size, and if the absolute value of prey escape energy is greater than 1, the prey search phase is carried out, and the Harris Hawk population's location Corsi variation is processed based on Equation ( 27). ( 4) If the absolute value of prey escape energy is less than 1, the prey roundup phase is carried out, and different location update strategies are then selected according to whether the absolute value of prey escape energy is greater than 0.5 and whether the prey breaks through the last roundup of the Harris Hawk population, allowing us to carry out local optimisation of the algorithm.( 5) Adaptive weighting of the prey position is determined based on Equation (30), the jump strength of the prey for this iteration is determined based on Equation (28), and the position of the next iteration of the Harris Hawk population is updated based on the processed prey position.The fitness value of the new population individuals is calculated, and the global optimal solution is updated.( 6) We determine whether the number of iterations satisfies the maximum number of iterations, and if so, we output the global optimal solution and the best fitness value for the Harris Hawk population; if not, the maximum number of is transferred to step (2).

System Description
The computer used was an 11th Gen Intel(R) Core(TM) i5-11400H @2.70 GHz model with Windows 10 Home Edition, and the simulation modelling software used was MAT-LAB 2021a.In order to verify the correctness and effectiveness of the integrated reactive power optimisation strategy for grids containing large-scale wind power based on the improved HHO algorithm proposed in this chapter, daily simulations were carried out on the improved IEEE-30 node system.The IEEE-30 node system has a reference power of 100 MVA, a voltage level of 132 kV, 30 nodes, 41 branches, 6 conventional generating units, 4 load-ratio voltage transformers, and 1 balancing node.The IEEE-30 node system now replaces conventional generators at nodes 2, 5, 11 and 13 with wind farms, nodes 1, 22 and 8 are replaced with conventional generators and nodes 23 and 24 are replaced with new energy wind farms, as well as updates the corresponding real-time loads at the above wind farm nodes.The modified IEEE-30 node system contains three conventional generators and six new energy wind farms, with wind farms at nodes 2, 5, 11, 13, 23 and 24.The IEEE-30 node system modified by the new energy wind load is shown in Figure 6.
Sustainability 2023, 15, x FOR PEER REVIEW 14 (5) Adaptive weighting of the prey position is determined based on Equation (30) jump strength of the prey for this iteration is determined based on Equation ( 28) the position of the next iteration of the Harris Hawk population is updated base the processed prey position.The fitness value of the new population individua calculated, and the global optimal solution is updated.( 6) We determine whether the number of iterations satisfies the maximum numb iterations, and if so, we output the global optimal solution and the best fitness v for the Harris Hawk population; if not, the maximum number of iterations is tr ferred to step (2).

System Description
The computer used was an 11th Gen Intel(R) Core(TM) i5-11400H @2.70 GHz m with Windows 10 Home Edition, and the simulation modelling software used MATLAB 2021a.In order to verify the correctness and effectiveness of the integrate active power optimisation strategy for grids containing large-scale wind power base the improved HHO algorithm proposed in this chapter, daily simulations were ca out on the improved IEEE-30 node system.The IEEE-30 node system has a refer power of 100 MVA, a voltage level of 132 kV, 30 nodes, 41 branches, 6 conventional erating units, 4 load-ratio voltage transformers, and 1 balancing node.The IEEE-30 n system now replaces conventional generators at nodes 2, 5, 11 and 13 with wind fa nodes 1, 22 and 8 are replaced with conventional generators and nodes 23 and 24 ar placed with new energy wind farms, as well as updates the corresponding real-time l at the above wind farm nodes.The modified IEEE-30 node system contains three con tional generators and six new energy wind farms, with wind farms at nodes 2, 5, 11 23 and 24.The IEEE-30 node system modified by the new energy wind load is show Figure 6.Daily simulation analysis is carried out using a modified IEEE-30 node sys Firstly, the voltage values of the critical state at each node at 24 moments of the day calculated via the continuation power flow method, which further determines the vo weak nodes in the system to be access points for the reactive power compensation eq Daily simulation analysis is carried out using a modified IEEE-30 node system.Firstly, the voltage values of the critical state at each node at 24 moments of the day are calculated via the continuation power flow method, which further determines the voltage weak nodes in the system to be access points for the reactive power compensation equipment.Secondly, the reactive power regulation range at each moment is calculated based on the daily output data of the wind farm.Finally, a multi-strategy improved HHO optimisation algorithm is used to solve the integrated reactive power optimisation model and obtain an integrated reactive power optimisation strategy.

Identification of Voltage Weaknesses in New Energy Wind Farms after Connection to the System
A typical wind power output scenario is selected to access the system, and the weak nodes of each node in the system are evaluated at each moment of the day, and the results of the average node voltage change index are obtained as shown in Figures 7 and 8

Identification of Voltage Weaknesses in New Energy Wind Farms after Connection to the System
A typical wind power output scenario is selected to access the system, and the we nodes of each node in the system are evaluated at each moment of the day, and the resu of the average node voltage change index are obtained as shown in Figures 7 and 8, a the orange bars in Figure 7 are the four voltage nodes with the largest voltage chan index.As can be seen in Figures 7 and 8, after a typical wind power scenario is connected the system, except for balancing node 1, the voltages of the remaining nodes in the criti state have different degrees of change to those of the original voltages after the wind fa is connected to the system, with the most significant changes occurring at nodes 5, 18, and 30. Figure 8 shows the complete PV curves of the four nodes, with the most obvio changes mentioned above for 12 h within one day's simulation sample.When the lo growth factor reaches the critical state, the corresponding node voltage amplitude d creases by a large amount, and the node voltage fluctuation brings hidden danger to t stability of the system.

Node Sorting Average node voltage variation indicator
Therefore, using the average node voltage change index, it can be concluded that t voltage weak nodes of the typical wind power scenario after accessing the system a

Identification of Voltage Weaknesses in New Energy Wind Farms after Connection to the System
A typical wind power output scenario is selected to access the system, and the weak nodes of each node in the system are evaluated at each moment of the day, and the result of the average node voltage change index are obtained as shown in Figures 7 and 8 As can be seen in Figures 7 and 8, after a typical wind power scenario is connected to the system, except for balancing node 1, the voltages of the remaining nodes in the critica state have different degrees of change to those of the original voltages after the wind farm is connected to the system, with the most significant changes occurring at nodes 5, 18, 29 and 30. Figure 8 shows the complete PV curves of the four nodes, with the most obviou changes mentioned above for 12 h within one day's simulation sample.When the load growth factor reaches the critical state, the corresponding node voltage amplitude de creases by a large amount, and the node voltage fluctuation brings hidden danger to the stability of the system.
Therefore, using the average node voltage change index, it can be concluded that the voltage weak nodes of the typical wind power scenario after accessing the system are nodes 5, 18, 29 and 30, meaning that the voltage weak nodes are used as the access point of the reactive power compensation equipment.This approach avoids the optimisation As can be seen in Figures 7 and 8, after a typical wind power scenario is connected to the system, except for balancing node 1, the voltages of the remaining nodes in the critical state have different degrees of change to those of the original voltages after the wind farm is connected to the system, with the most significant changes occurring at nodes 5, 18, 29 and 30. Figure 8 shows the complete PV curves of the four nodes, with the most obvious changes mentioned above for 12 h within one day's simulation sample.When the load growth factor reaches the critical state, the corresponding node voltage amplitude decreases by a large amount, and the node voltage fluctuation brings hidden danger to the stability of the system.
Therefore, using the average node voltage change index, it can be concluded that the voltage weak nodes of the typical wind power scenario after accessing the system are nodes 5, 18, 29 and 30, meaning that the voltage weak nodes are used as the access points of the reactive power compensation equipment.This approach avoids the optimisation process that involves using the reactive power compensation nodes as the optimisation variables during the modelling process in order to reduce the dimension of the optimisation variables and improve the difficulty of the model solving.

Analysis of Wind Farm Reactive Power Regulation Capability
Based on the reactive power regulation interval analysis of the wind farms shown in Section 1, the reactive power regulation range for each wind farm connected to the IEEE-30 node system was solved for 24 h per day and in 1-hour steps, and the results are shown in Table 1.The solved reactive power regulation range of the wind farm is used as the optimisation variable for each moment of the system reactive power optimisation, meaning that the reactive power regulation margin of the wind farm is involved in the integrated reactive power optimisation of the power system, which fully exploits the reactive power potential of the wind farm and improves the overall economy of the system.

Integrated Reactive Power Optimisation Strategy Solution and Effect Analysis
The variables to be optimised are the voltage at the generator terminals, the on-load adjustable transformer taps, the reactive power compensation equipment at the voltage weak points and the reactive power regulation margin of the wind farm in the modified IEEE-30 node system.Nodes 1, 8 and 22 of the system are conventionally operating generators, while nodes 2, 5, 11, 13, 23 and 24 are connected to new energy wind farms.For the above variables that need to be optimised, the voltage at the conventional generators, except for the balancing node, can vary from 0.9 to 1.1 p.u.; the system voltage is weak at nodes 5, 18, 29 and 30, where the reactive power compensation equipment is connected.Branches 6-10, 6-9, 4-12 and 27-28 are equipped with on-load regulating transformers with a regulation range of ±8 × 1.25%; nodes 5, 18, 29 and 30 each have five capacitors.In summary, the total number of variables that need to be optimised in the system is 16.In this section, a multi-strategy improved HHO optimisation algorithm is used to perform iterative calculations, with the number of iterations being set to 50 and the Harris Hawk population size being 20.At the same time, the conventional HHO and particle swarm optimisation (PSO) algorithms were selected for comparison to verify the global and local optimisation capabilities of the algorithms used in this paper.The objective function values of the three algorithms after the completion of the iterations are shown in Figure 9.  Based on the convergence curves of the corresponding objective fun of the three algorithms in Figure 8, it can be seen that the objective functi three algorithms gradually converge to their respective optimal solution of iterations increases, and the specific convergence occurs as follows: (1) The traditional HHO algorithm often falls into the local optimal loop and middle of the iteration, although it can jump out of the curren solution after several iterations, and it also reduces the efficiency of th (2) The particle swarm optimisation algorithm is prone to fall into local o the beginning and middle of the iteration, and its ability to find the o again after each iteration is poor, resulting in a higher value of th function than that found using the traditional HHO algorithm.(3) Compared to the traditional HHO algorithm and particle swarm op rithm, the multi-strategy improved HHO algorithm does not excessi local optimal loop when it is applied to the reactive power optimisatio tive value decreases faster and has better convergence.The objective is lower after the results are stabilised, which indicates that the algor to the comprehensive reactive power optimisation model solving posed in this paper.
Using the multi-strategy improved HHO algorithm, the traditional and the particle swarm optimisation algorithm, the optimal solution that c the integrated reactive power optimisation model for each of the above Based on the convergence curves of the corresponding objective function fit values of the three algorithms in Figure 8, it can be seen that the objective function values of the three algorithms gradually converge to their respective optimal solutions as the number of iterations increases, and the specific convergence occurs as follows: (1) The traditional HHO algorithm often falls into the local optimal loop at the beginning and middle of the iteration, although it can jump out of the current local optimal solution after several iterations, and it also reduces the efficiency of the global search.(2) The particle swarm optimisation algorithm is prone to fall into local optimal loops at the beginning and middle of the iteration, and its ability to find the optimal solution again after each iteration is poor, resulting in a higher value of the final objective function than that found using the traditional HHO algorithm.(3) Compared to the traditional HHO algorithm and particle swarm optimisation algorithm, the multi-strategy improved HHO algorithm does not excessively fall into the local optimal loop when it is applied to the reactive power optimisation, and its adaptive value decreases faster and has better convergence.The objective function value is lower after the results are stabilised, which indicates that the algorithm is superior to the comprehensive reactive power optimisation model solving calculation proposed in this paper.
Using the multi-strategy improved HHO algorithm, the traditional HHO algorithm and the particle swarm optimisation algorithm, the optimal solution that can be produced the integrated reactive power optimisation model for each of the above variables is obtained, and the integrated reactive power optimisation strategy corresponding to this date is constructed.The corresponding graphs of the overall voltage deviation and line loss reduction rate of the optimised system are shown in Tables 2 and 3.As can be seen from Figures 10 and 11, the system line losses and voltage deviations at each moment before optimisation are large.After applying the conventional HHO algorithm, the multi-strategy improved HHO algorithm and the integrated reactive power optimisation strategy solved via the particle swarm optimisation algorithm, there is a significant reduction in line losses at each moment of the system compared to values recorded before optimisation.The details are as follows: (1) After applying the comprehensive reactive power optimisation strategy derived from the conventional HHO algorithm, the average system loss reduction rate is 9.75%, and the average voltage deviation is 3.311%.
(2) After applying the integrated reactive power optimisation strategy derived from the particle swarm optimisation algorithm, the average system loss reduction rate is 8.16%, and the average voltage deviation is 3.962%.(3) After applying the integrated reactive power optimisation strategy derived from the multi-strategy improved HHO algorithm, the average system loss reduction rate is 13.90%, and the average voltage deviation is 2.308%.
(3) After applying the integrated reactive power optimisation strategy derived from th multi-strategy improved HHO algorithm, the average system loss reduction rate 13.90%, and the average voltage deviation is 2.308%.
By comparing the integrated reactive power strategies derived from the three algo rithms, the overall effect of the unimproved traditional HHO algorithm is shown to b better than the particle swarm optimisation algorithm at reducing the system voltage d viation and line loss, while the voltage deviation and line loss of the system at all momen of the optimised system recorded using the improved HHO algorithm of the multi-stra egy HHO algorithm is significantly better than that of the traditional HHO algorithm which confirms the superiority of the multi-strategy HHO algorithm with regard to solv ing the model of the reactive power optimisation strategy proposed in this paper.

Conclusions
In this paper, the method of constructing a comprehensive reactive power optimis tion strategy for power grids containing large-scale wind power based on the improve HHO algorithm was analysed, and the following conclusions were obtained: (1) The system voltage weak nodes were identified as reactive power compensatio nodes based on the continuous tidal current method and the node voltage chang index, which avoided the optimisation process of the access location of the reactiv power compensation equipment, reduced the variable dimensions of the integrate (3) After applying the integrated reactive power optimisation strategy derived from th multi-strategy improved HHO algorithm, the average system loss reduction rate i 13.90%, and the average voltage deviation is 2.308%.
By comparing the integrated reactive power strategies derived from the three algo rithms, the overall effect of the unimproved traditional HHO algorithm is shown to b better than the particle swarm optimisation algorithm at reducing the system voltage de viation and line loss, while the voltage deviation and line loss of the system at all moment of the optimised system recorded using the improved HHO algorithm of the multi-strat egy HHO algorithm is significantly better than that of the traditional HHO algorithm which confirms the superiority of the multi-strategy HHO algorithm with regard to solv ing the model of the reactive power optimisation strategy proposed in this paper.

Conclusions
In this paper, the method of constructing a comprehensive reactive power optimisa tion strategy for power grids containing large-scale wind power based on the improved HHO algorithm was analysed, and the following conclusions were obtained: (1) The system voltage weak nodes were identified as reactive power compensation nodes based on the continuous tidal current method and the node voltage chang index, which avoided the optimisation process of the access location of the reactiv power compensation equipment, reduced the variable dimensions of the integrated By comparing the integrated reactive power strategies derived from the three algorithms, the overall effect of the unimproved traditional HHO algorithm is shown to be better than the particle swarm optimisation algorithm at reducing the system voltage deviation and line loss, while the voltage deviation and line loss of the system at all moments of the optimised system recorded using the improved HHO algorithm of the multi-strategy HHO algorithm is significantly better than that of the traditional HHO algorithm, which confirms the superiority of the multi-strategy HHO algorithm with regard to solving the model of the reactive power optimisation strategy proposed in this paper.

Conclusions
In this paper, the method of constructing a comprehensive reactive power optimisation strategy for power grids containing large-scale wind power based on the improved HHO algorithm was analysed, and the following conclusions were obtained: (1) The system voltage weak nodes were identified as reactive power compensation nodes based on the continuous tidal current method and the node voltage change

Figure 1 .
Figure 1.Flow chart to solve the integrated reactive power optimisation strategy.

Figure 1 .
Figure 1.Flow chart to solve the integrated reactive power optimisation strategy.

Figure 2 .
Figure 2. Doubly fed asynchronous wind turbine power transfer and conversion model.
is the average position of the Harris Hawk population at the time of the t iteration, N is the total number of hawks in the Harris Hawk population and ( ) i X t is t position of the ith Harris Hawk at the time of the tth iteration.

Figure 3 .
Figure 3. Iterative adaptive decay of prey escape energy.

Figure 5 .
Figure 5. Flow chart for solving a comprehensive reactive power optimisation strategy based on the improved HHO algorithm.

Figure 5 .
Figure 5. Flow chart for solving a comprehensive reactive power optimisation strategy based on the improved HHO algorithm.
, and the orange bars in Figure 7 are the four voltage nodes with the largest voltage change index.Sustainability 2023, 15, x FOR PEER REVIEW 15 of

Figure 7 .
Figure 7. Node voltage variation index after wind farm access.

Figure 8 .
Figure 8. PV curves of weak nodes of the simulation sample voltage on the day of optimisation.

ustainability 2023 ,
15,  x FOR PEER REVIEW Hawk population size being 20.At the same time, the conventional HH swarm optimisation (PSO) algorithms were selected for comparison to v and local optimisation capabilities of the algorithms used in this paper.Th tion values of the three algorithms after the completion of the iterations ar ure 9.

Figure 9 .
Figure 9. Convergence curves of the objective function fitness values obtained usi gorithms.

Figure 9 .
Figure 9. Convergence curves of the objective function fitness values obtained using different algorithms.

Figure 10 .
Figure 10.Optimised system line loss reduction rate.

Table 1 .
24-h reactive power regulation range for wind farms.

Table 2 .
Comparison between line loss results obtained using different algorithms.

Table 3 .
Comparison between voltage offset results obtained using different algorithms.
Figure 10.Optimised system line loss reduction rate.
Figure 10.Optimised system line loss reduction rate.