Abstract
To promote the effective utilization of distributed power sources after grid connection and achieve the goal of maximizing energy transmission efficiency and minimizing cost, this paper proposes a scheme based on the integration of the improved particle swarm optimization algorithm and the improved ant colony optimization algorithm (IPSOACO). This scheme first adopts the reactive power correction method to process various types of nodes. Secondly, the traditional particle swarm optimization (PSO) and ant colony optimization (ACO) algorithms are improved to solve problems such as slow optimization speed in the early and late stages of optimization, premature convergence, and being prone to fall into local optimum. The optimal solution of the improved PSO algorithm is combined with the initial value of the ant colony algorithm and deployed in the IEEE33 node system for site selection. Compared with the traditional particle swarm optimization algorithm fused with Ant colony optimization algorithm (PSOACO), the improved algorithm is more prominent in reducing power loss and improving voltage quality. It solves problems such as poor voltage quality, high network loss and limitations of the optimization algorithm in the IEEE 33-node system, and improves the computational efficiency and stability of the system to a certain extent. It provides a better solution for the research on the location and capacity of distributed power sources in the distribution network.
Keywords: Ant colony optimization algorithm, Penalty function, Particle swarm algorithm, Reactive power correction, Siting and capacity
Subject terms: Energy science and technology, Renewable energy, Photovoltaics
Introduction
Against the growing global energy demand, distributed generation (DG) has been steadily developing. DG refers to power generation equipment with capacities ranging from tens of kilowatts to tens of megawatts. It is compatible with the surrounding environment, installed at the user or load end, and serves as a way to utilize renewable energy efficiently1. With the promotion of distributed power generation technology, a large number of distributed power sources with unreasonable location and capacity have been integrated into the distribution network, resulting in irrational currents, increased network losses, degraded voltage quality, affecting security and stability, and causing a waste of funds. Therefore, the optimal siting and capacity planning of distributed power supply has become critical research topics.
The processing of nodes in the siting and capacity planning of distributed power supply is a crucial component. Traditional trend calculation (It is a prediction method based on historical data or existing trends, used to estimate future changing trends. In the site selection and capacity planning of distributed power generation (DG), trend calculation may be used to predict the changing trends of power demand, load variations, DG output, etc.) can only be calculated for general nodes. However, for nodes such as PI-type and PQ(V)-type, when the voltage or reactive power exceeds the limit without processing, resulting in the dispersion of the trend, it is not possible to do the optimal calculation in a limited number of iterations2. Zhou3 proposed a power system framework based on the IEEE standard 14 nodes and the Newton–Raphson method of power flow calculation, which results in the power flow of the power system, and concludes that the reactive power has a strong correlation with the voltage. Correlation between reactive power and voltage. However, the mathematical model of this article is relatively simple, does not consider the dynamic process of the system, and the algorithm is simple. The Newton–Laffson method has the advantages of fast convergence speed, but its convergence is greatly affected by the selection of initial values. Moreover, for sick systems or some special operating conditions, there may be difficulties in convergence or no convergence at all. Song4 proposed in this paper a probabilistic tidal current calculation method based on Nataf transform and improved LHS. In this paper, a probabilistic tidal current calculation method based on Nataf transform and improved LHS is proposed to obtain a more accurate solution with less computational effort. In this paper, the reactive power correction method is used to process the PI-type, PQ(V)-type and PV-type nodes into PQ-type nodes that can be used for power flow calculation, and thus the forward back generation method is improved, so that the distribution network in the tidal current calculation, more relevant to the real-world situation.
Classical mathematical optimization algorithms, heuristic algorithms can be applied to the optimization algorithm for site selection and capacity determination. Since the optimal allocation problem of distributed power supply in the distribution network is subject to multiple constraints, it is essentially a multi-objective optimization problem, which cannot be solved by pure mathematical optimization methods. Intelligent optimization algorithms have the advantages of global optimality, adaptivity, parallelism, robustness, adaptability, and wide applicability, and can be used efficiently for complex nonlinear optimization problems5. Kumar et al.6 cited the use of a hybrid of particle swarm optimization (PSO) algorithm and gray wolf optimization (GWO) algorithm for optimizing the allocation of class 1 and 2 renewable energy generators and sizing. It was also applied and tested on IEEE 33 and IEEE 69 buses for power loss minimization. However, the computational complexity of the hybrid PSO–GWO algorithm is relatively high. For large-scale power systems, the computing time may be long, affecting the efficiency of practical applications. Apari et al.7 gave an overview of heuristic evolutionary optimization methods for microgrids (AC, DC, and hybrid AC–DC), focusing on promising techniques such as crow search algorithms, modified crow search algorithms, particle swarm optimization, and genetic algorithms. Comparative analysis shows that Modified Raven Search Algorithm performs best in various evaluation criteria and has the potential to optimize microgrids effectively. Sun et al.8 used a hybrid approach combining simulated annealing with particle swarm optimization. The model constraints are handled by merging the penalty function into the objective function computation. The method produces a set of multi-objective Pareto solutions and also determines the best optimization result through adaptive evaluation of local optima and weighted multi-objective analysis. The simulated annealing algorithm jumps out of the local optimum by randomly searching and accepting inferior solutions, but it requires a large amount of iteration and calculation. Although the particle swarm optimization algorithm has a fast convergence speed, it may also fall into local optimum when dealing with complex optimization problems and requires multiple runs to verify the results. After the combination of the two, the computational complexity further increases. For problems with large-scale or high real-time requirements, the computing time may be too long, affecting the efficiency of practical applications. And it depends on the characteristics of the specific problem. For some problems with special structures or complex constraints, this method may not be able to fully exert its advantages. The effectiveness of the proposed algorithm in determining the location and capacity of distributed power sources is demonstrated using the IEEE 69 node system. In this paper, first, adaptive weight updating and asymmetric learning factors are used to improve the global and local search capabilities of the PSO algorithm to increase convergence accuracy. Second, a nonlinear adjustment of the pheromone volatility factor ρ and the introduction of the A* algorithm evaluation idea (While ensuring the optimality and integrity of the algorithm, it can effectively reduce the search space and improve the search efficiency) are used to improve the accuracy and speed of the ACO algorithm and avoid the problem of the algorithm falling into a local optimum. Finally, the optimal solution of the improved particle swarm optimization algorithm is taken as the initial value of the improved ant colony algorithm for the fusion of the two algorithms.
Regarding optimization for siting and capacity determination. Wu et al.1 A method was designed considering the multiple interferences of new energy sources, constructing an effective optimization model for the location and capacity of energy storage in the distribution network by combining the various interferences of new energy sources. The design optimization method is proved to have the characteristics of large energy storage capacity, good siting and capacity fixing through the analysis of arithmetic examples. However, the experimental data may have certain limitations and may mainly rely on simulated data or partially idealized data. However, the data in the actual distribution network often have uncertainties, incompleteness and complexity, which may lead to a certain gap between the performance of this method in practical applications and the experimental results. Megantoro et al.9 In this study, by implementing this method of ORPD in the IEEE bus system, the power loss is reduced, the voltage deviation is minimized, and the voltage stability index is improved. It was also found that each meta-heuristic algorithm shows unique advantages in ORPD for renewable energy systems: GA excels in broad search capability, FOA balances exploration and exploitation, PFA achieves fast convergence, and AOA provides high accuracy, making these techniques valuable in managing uncertainty in renewable energy sources. Gao et al.10 proposed a method based on a holomorphic embedded load flow method (HELM) as a new approach to compute voltage stability indices for various types of nodes in distribution networks. The resulting criteria for evaluating voltage stability are used as constraints for optimizing DG location and capacity. The validity of the proposed method is verified on IEEE 33-node and IEEE 69-node distribution network models. This paper takes power loss and voltage quality as the main optimization objectives. By using the analytic hierarchy process, the weights of the optimization objective function are determined hierarchically, and multiple objectives are transformed into a single one. Then, power balance, node voltage, DG capacity and the number of nodes accessed by DG are taken as constraint conditions. To simplify the solution process, the constrained optimization problem is transformed into an unconstrained optimization problem. Finally, the method of introducing the penalty function (a method used to handle problems with constraint conditions) is used to combine the constraint conditions into a unified objective function. This method enables the algorithm to handle complex optimization tasks more efficiently and flexibly, while meeting the constraint conditions.
Based on the above analysis, this paper proposes an improved particle swarm optimization algorithm combined with an improved ant colony optimization algorithm to optimize the location selection and capacity setting of distributed power sources. Key contributions include: (1) Determining the minimum power loss and the highest voltage quality as the objective function, and setting the power balance, node voltage, DG capacity and the number of nodes as the constraints, the total normalized objective function is constructed. (2) Analyzing three distributed power generation methods, establishing mathematical models and refining forward–backward power generation method. (3) In order to overcome the limitations of traditional algorithms, the study fuses and improves the particle swarm algorithm and ant colony algorithm, and optimizes the inertia weight, learning factor, pheromone volatility factor and heuristic function. Test results show that the improved hybrid algorithm outperforms traditional algorithm in terms of iteration speed and accuracy. Case studies confirm its superior performance in minimizing power loss and maximizing voltage quality, which significantly improves the effectiveness of siting and capacity allocation.
Mathematical modeling and node processing for distributed power
DG connected to the grid changes the structure of the distribution network from a single network to a multi-source network, and the magnitude of the tidal current will be changed, and its flow direction will also be changed. And different types of DG access lead to different types of nodes in the distribution network, so it is necessary to establish a mathematical model of distributed power sources to analyze the types of distributed power sources, and finally to make it integrated into the existing methods of tidal current calculation.
PV generation model
In photovoltaic power generation the solar cell is regarded as a PN junction, which generates electricity under the action of solar energy. Considering the PN junction as an ideal state, the PV cell can be viewed as a constant current source and a diode in parallel with the circuit, but there are two other losses inside the PV cell, which need to be equated: (1) the electrodes on the front side and the back side of the solar cell are in contact with each other, and the solar cell itself has a resistance, so when the current passes through, there will be a loss, so this part is replaced with a series connection of a resistor Rx instead, Rx generally has a low resistance value. (2) Due to internal rupture damage of the PV panel, battery leakage, or short circuit caused by external debris media, there is a current flow causing losses11, replace this part with a parallel resistor Rsh, which is generally of very high resistance value. The equivalent circuit of PV power generation is shown in Fig. 1.
Fig. 1.

Equivalent circuit diagram of photovoltaic power generation.
By analyzing the equivalent circuit diagram of photovoltaic power generation, the expression of current versus voltage relationship is obtained as:
| 1 |
is the light-generated current;
is the reverse saturation current of the diode; n denotes the diode parameter, which takes the range of 1–5; k is the Boltzmann constant, which is 1.38 × 10−23 J/K; q is the charge constant;
and
are the series and parallel resistors, respectively; and T is the cell temperature.
The open circuit voltage
expression can be obtained by making
so that the equivalent circuit is open at both ends:
| 2 |
![]() |
3 |
From the expression, it can be seen that the volt-ampere characteristics and PV curves of PV power generation will be different under different light intensity and different temperature conditions.
Wind turbine models
Wind power generation refers to the conversion of wind energy into mechanical energy of a power transmission device, and then the generator converts the mechanical energy into electricity, then according to the type of generator wind power generation can be divided into wind power generation with asynchronous motors and wind power generation with synchronous motors. Therefore, these two types of motors are mathematically modeled:
(1) The control system of asynchronous motors tends to use constant speed and frequency control strategy, the work will consume reactive power in the grid, so generally in the motor-generator end port to the reactive power compensation, the internal composition of the rotor and stator and the air gap12. The equivalent circuit of wind power generation for an asynchronous motor is shown in Fig. 2.
Fig. 2.

Wind power equivalent circuit diagram for asynchronous generators.
P and Q are the active and reactive power of the generator, respectively; U is the machine end voltage;
is the stator leakage reactance,
is the rotor leakage reactance,
is the reactance of the capacitor, and
is the excitation reactance;
is the rotor resistance; and s is the slew rate of the motor.
It can be introduced from the equivalent circuit:
![]() |
4 |
| 5 |
Included among these
+
,
.
The medium output power of wind power technology depends on the wind speed, which can be regarded as a constant value when steady state tidal current calculations are performed to calculate the tidal current at a given moment in time. Therefore when the wind speed is constant, the active power will also remain constant. From Eq. (5), it can be seen that the reactive power of the asynchronous motor is related to the voltage and the rate of rotation s. Therefore, the change of Eq. (4) is brought to (5) by eliminating s, so as to obtain the equation of the reactive power and voltage:
| 6 |
From Eq. (6), it can be seen that the reactive power of the asynchronous motor changes with the voltage, and in summary, this type of wind generation can be viewed as a PQ(V) node in the tidal current calculation.
(2) For synchronous generators, it is also necessary to consider whether the synchronous motor has excitation regulation capability. For synchronous generators without excitation regulation capability, the equivalent circuit can be drawn as shown in Fig. 3.
Fig. 3.

Wind power equivalent circuit diagram of a synchronous motor.
P and Q represent the active and reactive power of the generator respectively;
represents the armature leakage reactance,
represents the armature winding reactance,
;
is the resistance of the armature winding; U is the machine voltage; E is the generator no-load electromotive force, and E is kept unchanged when there is no excitation regulation. Analyzing the equivalent circuit, we can get the expressions of P and Q:
| 7 |
| 8 |
is the power angle, and according to the above, when the active power is constant, associating (7) and (8) and eliminating the power angle yields the equation for active and reactive power:
![]() |
9 |
According to the relation equation, it can be seen that the synchronous generator at this time can be regarded as a PQ(V)-type node in the current calculation. When the motor has the ability of excitation regulation, the voltage is known, and the reactive power magnitude can be changed by adjusting the excitation, and this type of situation is equated to a PQ or PV node, which correspond to the power factor control type and the voltage control type, respectively.
Micro gas turbine model
Micro gas turbines are now mainly current controlled PWM alternators for AC and then connected to the distribution grid14. The equivalent circuit of the micro gas turbine generating electricity with a current source inverter connected to the grid is shown in Fig. 4.
Fig. 4.

Equivalent circuit diagram of power generation in a micro gas turbine.
The active and reactive power can be introduced from the equivalent circuit diagram:
| 10 |
The equation for active and reactive power can be obtained by transforming Eq. (10) by Euler’s formula:
| 11 |
I is the output current; e and f are the real and imaginary parts, respectively; P is the active power injected into the grid; it can be seen from Eq. (11) that the reactive power Q is a function of P and I, and both P and I are kept constant, so that the micro-gas turbine power generation can be regarded as a PI-type node in the calculation of the current.
Node processing for distributed power
Traditional tidal current calculation can only be done for general nodes. However, leaving some special nodes unprocessed will lead to trend dispersion, and the optimal calculation cannot be made in a limited number of iterations. Therefore, it is necessary to process the equivalent nodes to transform them into the types of nodes that can be processed by the traditional tidal current calculation.
PQ-type
This type of node is similar to the traditional node and does not need to do additional processing, its active and reactive power is fixed and does not change, it has a model for the calculation of the tidal currents, which allows the inverse power to be brought in:
| 12 |
It injects an equivalent current into the grid of:
| 13 |
PI-type
The active power and output current of this type of node remain constant:
| 14 |
and
are the active and reactive power of the connected DG respectively. The branch current calculation in the trend is more complicated, so the current can be converted into active power representation, which can reduce the calculation complexity. From Eq. (10), active power, reactive power, output current and node voltage satisfy the following relationship:
| 15 |
From Eqs. (13) and (14), the reactive power for the k + 1th time in the current calculation can be introduced:
| 16 |
is the magnitude of the node voltage for k iterations, so that a PI-type node can be transformed into a PQ-type node. However, in practical applications, PI-type nodes usually use the current control method, which makes
in Eq. (10), and can directly regulate the active power of the input grid since the current is regulated, and Eq. (10) can be simplified as:
![]() |
17 |
In the tidal current calculation, the active power of the k + 1st iteration can be calculated by iterating the voltage of the kth iteration:
| 18 |
PQ(V)-type
The active power of this type of node is constant and the reactive power changes with the node voltage, it is treated similar to a PI node, which is converted to a PQ node at each iteration, and it is modeled as a tidal current calculation:
![]() |
19 |
is the reactive power of the k + 1st iteration and
is the voltage magnitude of the kth iteration.
PV-type
This type of DG is modeled in the tidal current calculation:
| 20 |
and
are the active and voltage magnitudes injected into the grid, respectively. For the forward back generation method, the reactive power correction method is utilized for the PV-type nodes15.
By connecting n PV-type DGs to the grid and assuming that the current injected into the grid by the DG is positive, the variation relationship between the node voltage vector and the injected current vector is:
| 21 |
, denotes the impedance matrix of the PV-type node. Since the voltages at each node in the grid are near their rated values and the phase angle is small:
![]() |
22 |
, denotes the conjugate of the injected power at the node. Bringing Eq. (21) into Eq. (20):
| 23 |
Since
, one can expand Eq. (20):
| 24 |
Also, since the active power at the PV node is constant,
, so:
| 25 |
The following corrections are made to the reactive power of the PV node for each forward back generation in the tidal current calculation:
| 26 |
denotes the reactive power of the kth iteration of the trend calculation, and
is the same. In this way, the reactive power of the PV-type node can be corrected gradually starting from
type DG reactive power is usually limited by a range, in case the corrected reactive power is out of the limitation range, Eq. (26) is to be modified:
| 27 |
and
are the upper and lower limits of real reactive power.
When analyzing different types of distributed power sources, node types can be classified according to their regulation methods and operational characteristics, as shown in Table 1.
Table 1.
Node types of different distributed generators.
| Node type | Distributed power types |
|---|---|
| PQ-type | Synchronous motors with power-controlled excitation regulation |
| PQ(V)-type | Asynchronous motors, synchronous motors without excitation regulation |
| PI-type | Photovoltaic power generation, micro gas turbines |
| PV-type | Synchronous motors whose excitation regulation is voltage-controlled |
Improved PSOACO algorithm
The ACO algorithm relies on the accumulation of pheromone concentration to optimize the search process, which is initially slow due to pheromone insufficiency, but later demonstrates a strong global search capability through a positive feedback mechanism. However, in the face of complex problems, ACO is prone to premature convergence, which makes it difficult to ensure that the optimal solution is found. On the contrary, PSO algorithm has fast search speed at the beginning, but it is easy to fall into local optimization at the later stage, with weak local search ability and redundancy in the iterative process. The PSOACO hybrid algorithm, on the other hand, utilizes the PSO algorithm to quickly locate potentially high-quality regions in the search space, and subsequently uses these results as the initial values of the ACO algorithm, which utilizes the ACO algorithm’s global search capability at a later stage to perform a refined search. This serial hybrid strategy avoids the inefficient redundancy of the PSO algorithm at the later stage and overcomes the defect of the ACO algorithm’s slow solution speed at the initial stage, which significantly improves the overall accuracy and speed of the algorithm.
However, by directly combining the ordinary PSO algorithm with the ACO algorithm, the algorithm’s optimization search speed and accuracy are still insufficient, and it may still fall into local extremes. In order to ensure that the hybrid algorithm can effectively converge to the optimal solution. From the literature,14, it is known that the four perspectives of inertia weight, learning factor, volatility function and heuristic function to optimize the hybrid algorithm can not only improve the performance of the algorithm but also ensure that each of the PSO and ACO algorithms can effectively play the optimization ability.
The planning problem of DG grid-connection is a nonlinear, multi-objective and multi-constraint problem, its access will lead to the change of the whole system trend, and the different location, capacity and type of DG access will have different impacts, so it is necessary to plan the DG reasonably, and the combination of particle swarm algorithm and ant colony optimization algorithm can be very good solution to this problem.
Improved PSO algorithm
Improvement of inertia weights ω
For the shortcomings of the PSO algorithm, an adaptive weight updating method is used to adaptively adjust the inertia weights according to the size of the particle adaptation. The smaller the adaptation value of the particle indicates that it is close to the optimal solution, and local search is needed at this time, and the larger the adaptation value of the particle indicates that it is far from the optimal solution, and global search is needed at this time. When
, the expression of inertia weight ω is as follows:
| 28 |
is taken as 0.9 and
is taken as 0.4; f is the value of particle adaptation,
is the average of all particle adaptations, and
is the minimum value of particle adaptation.
Improvements in learning factor c
An asymmetric learning factor is used to increase the diversity of particles by adopting a larger
and a smaller
at the beginning of the computation so that the particles can diverge in the search space to reduce the influence of other particles. As the number of selected generations increases, so that
linearly decreases,
linearly increases, thus promoting the convergence of particles to the global optimal solution.
| 29 |
is the initial value of the individual learning factor, which is taken as 2.5;
the final value of the individual learning factor, which is taken as 0.5;
is the initial value of the social learning factor, which is taken as 1; and
is the final value of the social learning factor, which is taken as 2.25. k is the current number of iterations and
is the maximum number of iterations.
Substituting the above two formulas into the velocity update formula of the particle swarm algorithm yields a new velocity update expression:
| 30 |
Improved ACO algorithm
Improvement of pheromone volatilization factor
A nonlinear adjustment of the pheromone volatility factor
is used to improve the accuracy and speed of the ACO optimization algorithm. The expression of pheromone volatilization factor
is shown below:
| 31 |
k is the current number of iterations and
is the maximum number of iterations.
Improvement of the heuristic function
In order to prevent the algorithm from falling into local optimum, the idea of A* algorithm evaluation is introduced into the algorithm, and the evaluation function is constructed by calculating the interrelationships among the nodes in order to improve the performance of the heuristic algorithm. The improved expression of the heuristic function
is:
| 32 |
is the distance from the start node to the target node;
denotes the heuristic value from the start node to the target node calculated by the A* algorithm, which can be calculated by its valuation function f(n) = g(n) + h(n);
is the weight parameter, which balances the importance of the heuristic value and the actual distance of the A* algorithm. By synthesizing the actual distance and the heuristic value, the ants are more effectively guided towards the optimal solution.
IPSOACO algorithm calculation process
Set the parameters of the PSO algorithm, such as population size, learning factor, inertia weights, etc., as well as the initial position
and the initial velocity
of the particles.Calculate the fitness value of the particles, by comparing the optimal value of the individual and the population, so as to realize the update of the optimal value of the individual and the population.
Dynamic tuning of the inertia function
and the learning factor 
Calculate the velocity and position of each particle, compare the individual optimum and the population optimum again, and update.
Determine the current number of iterations, if the maximum number of iterations is not reached 6, then return to the second step and the number of iterations plus one, if reached then the optimal solution of PSO is output as the initial value of ACO.
Setting various parameters of the ACO, such as pheromone concentration, volatilization factor, information heuristic factor, expectation heuristic factor, and so on.
Calculate the likelihood of an ant choosing a particular path and update the pheromone concentration on the path, function.
Optimization and computation to update the globally optimal path and pheromone.
Determine whether the maximum number of iterations has been reached, if not, return to the seventh step and the number of iterations plus one, otherwise, output the optimal solution.
Distributed power siting and capacity
The above optimization algorithm is selected for siting and sizing the distributed power supply. Since the type of distributed power supply is not the conventional type, it is necessary to perform the tidal current calculation and determine the objective function and constraints, and finally site and capacitate the distributed power supply with the improved intelligent algorithm in the IEEE33 node system.
Distribution network trend calculation
The forward push back generation method is a traditional algorithm for distribution network trend calculation, which is most suitable for tree-like distribution network trend calculation, and it is simpler and faster convergence in trend calculation compared to the Newton-like method which does not need differential calculation and construction of Jacobi matrix. The forward and back generation method is divided into two processes: (1) the forward process: according to the voltage of the parent node and the power derived in the back generation, the voltage drop on the line is calculated to determine the voltage at the ends of the child nodes; (2) the back generation process: according to the power of the load, as well as the voltage drop and losses of the individual components, to calculate the starting power of the previous node, and to correct the voltage of the parent node15. As Fig. 5 a simple trending wiring as an example.
Fig. 5.

A simple flow wiring.
The loads of nodes i, j are, respectively,
and
. The power of node i can be expressed as:
| 33 |
Forward calculation
It can be had from Fig. 5:
| 34 |
is the current in branch j,
;
is the conjugate of
.
The node power can be obtained by organizing Eqs. (33) and (34):
| 35 |
| 36 |
,
,
is the voltage at branch j, and the impedance on the line is
=
.
Back calculation
According to Ohm’s law,
, the collation can be obtained:
| 37 |
| 38 |
According to
,
, the voltage of the node can be obtained.
However, the forward back generation method is only applicable to the current calculation for traditional PQ-type nodes, so the traditional forward back generation method can be improved according to the treatment of several distributed power node types described in “Node processing for distributed power” section. For PI-type nodes, the reactive power is derived using the node voltage magnitude, input current and active power at the last iteration of the PI node; the same is true for PQ(V)-type nodes; for PV-type nodes, when the reactive power does not cross the boundary, it is processed according to the reactive power correction method; when the reactive power crosses the boundary, the reactive power is fixed at the upper and lower limits, and it is processed according to PQ-type nodes. The steps of the improved forward back generation method is shown below:
Initialize the parameters of the system and select the reference node of the system.
Find the current of each type of distributed power injection node.
Perform the forward calculation to calculate the current of each node in the whole system.
Perform back calculation to calculate the voltage of each node in the whole system.
Process reactive power of PI-type, PQ(V)-type, and PV-type nodes into PQ-type nodes.
Judge whether the accuracy of the trend calculation meets the requirements of the system, if so, output the voltage of each node; otherwise, return to the third step and add one to the number of iterations.
DG grid connection analysis
Four different node types of DGs are connected to node 14 of IEEE33 and MATLAB is used as a simulation tool for verification and analysis. Where for the four types of DGs, their parameters are shown below:
PQ type node: active power is 300 kW and reactive power is 150 kvar.
PI type node: active power is 300 kW and injected grid current is 15 A.
PQ(V) type node: active power is 300 kW, node voltage is 0.5 pu, node reactance is 0.3 pu.
PV-type node: active power is 300 kW, injected grid voltage is 0.96 pu.
Comparison is made with the time when the DG is not connected, respectively, and the node voltage variation graph for each node is obtained as shown below.
Observe that no matter what type of DG is connected to the distribution network from Figs. 6 and 7 there is an enhancement in the node voltage and the enhancement in voltage is different for different types of DG, in general the enhancement in the node voltage after connecting to different DGs from node No. 9 to node No. 18 is greater. Therefore, the mathematical modeling approach described in “Mathematical modeling of site selection and capacity determination” section is effective after the DGs are connected to the distribution grid and all the node voltages are boosted.
Fig. 6.
Access to PQ-type nodes and PI-type nodes.
Fig. 7.
Access to PQ(V)-type nodes and PV-type nodes.
Mathematical modeling of site selection and capacity determination
Objective function
Optimized power loss
When electricity is transmitted from the power plant to the consumer, heat energy will be generated due to losses in the transmission line. Reasonable DG configuration can reduce such active losses and improve the efficiency of power generation to achieve the purpose of energy saving and consumption reduction. For the active power loss objective function the optimal expression is:
| 39 |
n is the total number of lines;
is the current on the ith branch, which can be calculated from the current; and
is the resistance on the ith branch.
Optimization of voltage quality
After a power system has been subjected to a disturbance, certain bus voltages may drop dramatically for a short period of time, lasting up to a few seconds or minutes, resulting in a voltage collapse that compromises the integrity of the power system and prevents it from supplying power to customers properly. Static voltage stability metrics are commonly used to measure the voltage stability of a system. Voltage quality in distribution network is affected by its voltage stability, so the variance of distribution network node voltages based on the desired voltage is used to describe the voltage quality. The expression of this objective function is:
![]() |
40 |
N is the total number of nodes in the system;
is the voltage of the ith node; and
is the desired steady state voltage.
Multi-objective normalization
In this paper, the weight coefficients of each objective function are calculated based on the analytic hierarchy process (AHP), and the weight coefficients are obtained using AHP. The specific steps are shown below:
Construct the pairwise comparison matrix, according to the scale of 1–9, respectively,
and
(i, j = 1, 2…. n; i ≠ j) for two-by-two comparisons, the importance degree of the assignment, the scale criteria as shown in Table 2.- Since both voltage quality and active network loss are parameters that reflect the transmission efficiency of the distribution network from different perspectives, and their importance is very important for distribution network planning, the importance of voltage quality and active network loss are viewed as equally important. After grading the importance, the weights of both are calculated using the following weighting formula.

41 -
The normalized objective function is obtained:

42 Z is the normalized total objective function,
is the weight coefficient of power loss and
is the weight coefficient of voltage quality. After AHP the original optimization problem with multi-objective function is transformed into an optimization problem based on single objective function.
Table 2.
Test results of the IPSO algorithm.
| Scale | Significance |
|---|---|
| 1 | Both factors are of equal importance compared to each other |
| 3 | The former is slightly more important than the latter |
| 5 | The former is clearly more important than the latter |
| 7 | The former is more strongly important than the latter |
| 9 | The former is more important than the latter |
| 2, 4, 6, 8 | Denotes the intermediate value of the above neighboring judgments |
| Reciprocal | If the ratio of importance of factors i and j is then the ratio of importance of j to i is 1/
|
Constraint function
Power balance constraint
In the tidal flow calculation, the active and reactive power at the injection node should be consistent with the active and reactive power at the outflow node, i.e., the active and reactive power equations need to be balanced.
| 43 |
and
denote the original active and reactive power of the ith node, respectively;
and
denote the active and reactive power after connecting the DG at the ith node, respectively;
and
denote the active and reactive power required for the load on the ith node, respectively;
and
denote the voltages at the ith and jth nodes, respectively; and
and
denote the conductance and conductivity between node i and node j.
Node voltage constraints
Constraints are needed in the tidal current calculation in case the voltage exceeds the limits:
| 44 |
is the voltage of node i,
and
and are the upper and lower limits of this voltage respectively.
DG capacity constraints
Excessive capacity of DGs connected to the grid will have an impact on the steady state of the grid, so the DGs connected to the distribution grid have to meet the node capacity limits.
| 45 |
| 46 |
denotes as the DG capacity value of the ith node,
denotes the minimum DG capacity that can be accessed by the ith node, and
denotes the maximum DG capacity that can be accessed by the ith node.
Number of nodes constraint
For the security planning of the grid and other factors, it is not advisable to access the DG at too many nodes, and the constraints on the number of nodes are as follows:
| 47 |
D is the maximum value of the number of DG nodes planned to be installed,
is the number of nodes on which DGs are installed, and
.
Finally, the final objective function is obtained by adding each inequality to
in the form of a penalty function, as follows:
| 48 |
K denotes the penalty for deviation from the limit,
is the penalty factor for the node voltage,
is the penalty factor for the installed capacity of the DG, and
is the penalty factor for the maximum number of nodes installed by the DG.
Results
IPSOACO algorithm performance test
Test functions
In this paper, the intelligent algorithm is tested for its convergence accuracy and convergence speed by test functions, and the following four classical test functions are used: the Rastrigin function is used as the algorithm’s optimization accuracy, the Ackley function is used to check whether the algorithm can get rid of the local extremes, the Griewank function is used to test the global convergence speed of the algorithm, and the Sphere function is used to test the algorithm in the practicality of the algorithm when solving regular cases.
The IPSOACO algorithm is tested using the test function as a fitness function.
Algorithm performance testing and comparison
The MATLAB simulation tool is used to compare the performance of PSOACO algorithm with IPSOACO algorithm, and the convergence curves are obtained by testing in the four test functions mentioned above, and the convergence effect is observed.
For the PSOACO algorithm parameter settings: the population size is set to 100, where the number of PSO algorithm iterations is set to 50, the initial inertia weight is 0.9, the final inertia weight is 0.5, and the learning factors are all set to 1.5, and the number of ACO algorithm iterations is set to 50, the information heuristic factor α is set to 0.9, the expectation heuristic factor β is set to 1, and the total amount of pheromone is set to 200.
For the IPSOACO algorithm settings: the population size is set to 100, the inertia weights and learning factors are set according to Eqs. (28) and (29), the volatility factors and heuristic functions are set according to (31) and (32), and the rest of the parameters are the same as those of PSOACO.
The test results of the PSOACO algorithm are shown in Fig. 8, and the result plots of the test functions are (a), (b), (c), (d).
The test results of the IPSOACO algorithm are shown in Fig. 9. The result plots of the test functions are (a), (b), (c), (d).
Fig. 8.
Test results of PSOACO algorithm.
Fig. 9.
Test results of IPSOACO algorithm.
Comparing the test results of the two optimization algorithms in the four test functions, the results of each optimization algorithm were tallied in the following tables to compare the number of iterations that started converging and the convergence results of each algorithm. The test results of PSOACO algorithm and IPSOACO algorithm are shown in Tables 3 and 4 respectively.
Table 3.
Test results of PSOACO algorithm.
| Test functions | Test results |
|---|---|
| Sphere | 39 iterations begin to converge to 0.03008 |
| Griewank | 35 iterations begin to converge to 0.00362 |
| Ackley | 23 iterations begin to converge to 1.47142 |
| Rastrigin | 34 iterations begin to converge to 1.45113 |
Table 4.
Test results of IPSOACO algorithm.
| Test functions | Test results |
|---|---|
| Sphere | 12 iterations begin to converge to 0.01506 |
| Griewank | 18 iterations begin to converge to 0.0004861 |
| Ackley | 11 iterations begin to converge to 1.3056 |
| Rastrigin | 20 iterations begin to converge to 0.24228 |
Observing Tables 3 and 4, the IPSOACO algorithm shows the fastest convergence speed in all the tested functions. Its convergence accuracy is excellent in the Sphere function, which proves the high accuracy of optimization search; it converges significantly in the Griewank function, which shows the strong ability of global optimal search; and it also maintains high accuracy in complex functions such as Rastrigin, which proves its ability to solve complex problems.
Compared with the PSOACO algorithm, the IPSOACO algorithm is effective in improving the inertia weights and learning factors, as well as the pheromone volatilization factors and heuristic functions, which improves the overall speed of the algorithm and avoids the algorithm falling into the local optimum.
Algorithm for siting and sizing
The IPSOACO algorithm is used for siting and capacity determination to plan the IEEE33 node system and the PSOACO algorithm is used for siting and capacity determination as a control group. Where the objective functions are: power loss optimization and voltage quality optimization and the constraints are: power balance, node voltage, DG capacity and DG location.
Calculus analysis
The IEEE33 node system has 33 nodes and 32 branches, all nodes except node 1 are load nodes, i.e., all have access to the DG, and node 1 is a power point, i.e., a balancing node; the system has a system voltage of UN = 12.66 kV, a base power of SB = 10 MW, an active load of P∑ = 3715 kW, a reactive load of Q∑ = 2300 kvar, convergence accuracy ε = 10−4.The structural topology of the IEEE33 system is shown in Fig. 10.
Fig. 10.
Structural topology diagram of the IEEE33 system.
Calculate the results of site selection and capacity determination
First of all, the parameter selection is carried out, the fuel cell industry is still in the early stage of testing, so the planning model parameters: three types of DGs are selected for planning: photovoltaic power generation, wind power generation and micro gas turbine, and the DGs are equated into nodes of type PI, type PQ, type PQ(V) and type PV as described in “Node processing for distributed power” section, and in the test system, the total number of DG access nodes is 6, and the maximum number of access nodes of each type of DGs is 4. Each node accesses only one type of DG, and, the capacity of DG should be within a certain limit, the total capacity of DG access is not more than 1886 kW, and the access capacity of each DG is not more than 350 kW.
The IPSOACO algorithm is then applied to the IEEE33 node system for site selection, i.e., the node numbers of the DGs that can be accessed in the test system and the types of DGs that can be accessed are derived from the total objective function constructed by Eq. (43) for a certain DG capacity. With the results derived from the above siting, the IPSOACO algorithm is continued to determine the optimal capacity of each node to access the DG. The results of the site selection and capacity determination are shown in the following table.
The trend graphs of node voltage and branch power loss variation of IEEE33 nodes after siting and capacitance determination by IPSOACO algorithm are shown in Figs. 11 and 12.
Fig. 11.

Node voltage comparison curve.
Fig. 12.

Comparison curve of power loss.
In order to form a comparison, the PSOACO algorithm is used for siting and capacity determination as a control group, where the planning model parameters are consistent with IPSOACO. The final results of siting and capacity determination are shown in Tables 5 and 6, and then the node voltages and branch power losses before and after planning the IEEE33 system with the PSOACO algorithm and the IPSOACO algorithm are compared, and the results are shown in Figs. 13 and 14.
Table 5.
IPSOACO algorithm site selection and capacity determination results.
| Types of DG | Access location | DG capacity (kW) |
|---|---|---|
| Wind power | 3 | 100 |
| Photovoltaic | 14 | 90 |
| Photovoltaic | 18 | 60 |
| Micro gas turbine | 25 | 200 |
| Micro gas turbine | 32 | 220 |
| Wind power | 33 | 120 |
Table 6.
PSOACO algorithm site selection and capacity determination results.
| Types of DG | Access location | DG capacity (kW) |
|---|---|---|
| Wind power | 3 | 110 |
| Photovoltaic | 7 | 140 |
| Micro gas turbine | 14 | 220 |
| Micro gas turbine | 19 | 210 |
| Micro gas turbine | 25 | 220 |
| Wind power | 31 | 100 |
Fig. 13.

Node voltage comparison curve.
Fig. 14.

Comparison curve of power loss.
Observing Figs. 11, 12, 13 and 14, it can be concluded that the IPSOACO algorithm is more capable than the traditional PSOACO algorithm in improving the voltage quality, especially at nodes 6–18 and 27–33; and in reducing the branch power loss, the IPSOACO algorithm is more capable, especially at nodes 2–5 and 26–28 Nodes. In Fig. 14, the lowest node, node 18, the node voltage is 0.88331 pu without DG access, 0.92012 pu after optimization of PSOACO algorithm, and 0.93559 pu after optimization of IPSOACO algorithm, although both of them can improve the voltage quality but IPSOACO algorithm is more effective and IPSOACO algorithm increases 1.75% than PSOACO algorithm; in Fig. 15, node 15 is the lowest node and node 17 is the lowest node, node 17 is the lowest node and node 17 is the highest node. 1.75%; on node 27, the highest node at the end of Fig. 15, the power loss without access to DG is 16.531 kW, 13.516 kW after optimization of PSOACO algorithm, and 10.225 kW after optimization of IPSOACO algorithm, and IPSOACO algorithm reduces the power loss by about 32.24% compared with PSOACO algorithm.
Fig. 15.

Objective function iteration comparison chart.
In addition, on the same simulation device, the average computing time of IPSOACO algorithm is 25.198 s, and the average computing time of PSOACO algorithm is 27.604 s, and from Fig. 15, we can get the optimal solution of IPSOACO algorithm after 39 iterations of the objective function, and the optimal solution of PSOACO algorithm after 44 iterations of the objective function, and the optimal solution of IPSOACO algorithm for siting and capacity determination is more economical. Algorithm saves more time for siting and capacity determination.
It can be concluded from the simulation results that IPSOACO has stronger optimization speed and accuracy, and can effectively reduce the power loss generated by DG grid-connection and improve the node voltage.
Discussion
In this paper, the planning problem of siting and capacity determination is investigated. Firstly, the reactive power correction method is used to process the PI-type, PQ(V)-type and PV-type nodes into PQ-type nodes that can be used for tidal flow calculation and to improve the forward–backward power generation method. Secondly, combining the advantages and disadvantages of PSO and ACO algorithms, the improved and fused algorithm solves the deficiency of single algorithm’s optimization search by adjusting the algorithm’s parameters; lastly, the planning model for siting and capacity determination is established for the IEEE33 node system, and the objective function and constraints are determined. The IPSOACO algorithm and PSOACO algorithm are used for siting and capacity determination respectively, and the results are compared, and it is found that the voltage quality enhancement and network loss reduction of the IPSOACO algorithm are better than that of the PSOACO algorithm, and therefore, the result of siting and capacity determination of the IPSOACO algorithm is more reasonable. Although the IPSOACO algorithm improves the optimization accuracy and search efficiency, there are several limitations. Firstly, the algorithm combines both PSO and ACO methods, resulting in an increase in computing time. Especially when it comes to the update of adaptive weights and the adjustment of pheromone fluctuation factors, more computing is required in each iteration. Particularly in large-scale problems, the computing time and resource requirements increase rapidly. Secondly, the system scale scalability of the algorithm is challenged. When dealing with large-scale problems, computing bottlenecks may occur, the search space increases sharply, resulting in a decrease in efficiency. Finally, the algorithm is relatively sensitive to parameter Settings, especially in aspects such as adaptive weights, pheromone volatilization factors, and the introduction of the A* algorithm. Improper parameter selection may lead to performance fluctuations and increase the complexity of parameter tuning.
When it comes to site selection and capacity determination planning, there are a bunch of factors we need to think about all together. But even so, there’s still room for improvement in the current research. For example, when working with DG nodes, we should treat different DG output modes separately and take a closer look at them. Right now, the objective functions mostly focus on power quality and network losses, but they don’t really bring economic factors into the picture. In real-world site selection and capacity determination, though, economics is just as important. We’ve got to consider things like network loss costs, DG installation costs, environmental protection costs, and DG maintenance costs. And let’s not forget about environmental factors—they’re super important too. Especially in planning, some DGs (like photovoltaic and wind power) are heavily influenced by the environment. Their power output can swing a lot depending on the season or weather. So, figuring out how environmental factors affect things, spotting those patterns, and then turning environmental changes into math problems has become a key area for future research.
Author contributions
M and G wrote the main manuscript text, L analyzed the experiment, and Z provided financial support. All authors have reviewed the manuscript.
Funding
This research was supported by the Collaborative Innovation Project of Universities in Anhui Province: Research on model construction and optimization of county congestion grid under the background of large-scale photovoltaic power generation. (GXXT-2023-030).
Data availability
All data generated or analysed during this study are included in this published article.
Declarations
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Xiaotong Mi and Qinyang Liu contributed equally to this work.
References
- 1.Wu, H., Wu, K., Tang, Y. et al. Optimization method for energy storage location and capacity determination of distribution network considering multiple interference of new energy sources. In 2023 3rd International Conference on Energy, Power and Electrical Engineering (EPEE), 285–288 (IEEE, 2023).
- 2.Wang, J., Sun, Y., Li, Y. et al. Power flow calculation for DC distribution network considering DC–DC converter control mode. In 2020 IEEE/IAS Industrial and Commercial Power System Asia (I&CPS Asia), 385–390 (IEEE, 2020).
- 3.Zhou, Z., Lin, S. & Hu, J. Based on the Newton–Lawson method operating state analysis of power system power flow calculations. In 2022 IEEE 5th International Conference on Automation, Electronics and Electrical Engineering (AUTEEE), 741–746 (IEEE, 2022).
- 4.Song, S. & Su, H. Probabilistic tidal current calculation for wind containing power systems based on Nataf transform and improved LHS. In 2024 4th International Conference on Electrical Engineering and Mechatronics Technology (ICEEMT), 148–151 (IEEE, 2024).
- 5.Tang, J., Liu, G. & Pan, Q. A review on representative swarm intelligence algorithms for solving optimization problems: Applications and trends. IEEE/CAA J. Autom. Sin.8(10), 1627–1643 (2021). [Google Scholar]
- 6.Kumar, K., Ramswaroop, R., Yadav, L. K. et al. Optimal planning of distributed generation using hybrid metaheuristic approach. In 2020 IEEE 9th Power India International Conference (PIICON), 1–6 (IEEE, 2020).
- 7.Papari, B. et al. An advanced meta metrics-based approach to assess an appropriate optimization method for wind/PV/battery based hybrid AC–DC microgrid. e-Prime Adv. Electr. Eng. Electron. Energy9, 100640 (2024). [Google Scholar]
- 8.Sun, H., Wen, C., Shi, C. et al. Improved multi-objective simulated annealing particle swarm algorithm for siting and capacity sizing of distributed power supplies. In 2024 IEEE Cyber Science and Technology Congress (CyberSciTech), 456–460 (IEEE, 2024).
- 9.Megantoro, P. et al. Optimizing reactive power dispatch with metaheuristic algorithms: A review of renewable distributed generation integration with intermittency considerations. Energy Rep.13, 397–423 (2025). [Google Scholar]
- 10.Gao, H. et al. Optimal allocation of distributed generation in active distribution power network considering HELM-based stability index. Int. J. Electr. Power Energy Syst.155, 109508 (2024). [Google Scholar]
- 11.Sardar, R. H. et al. The impact of series (Rs) and shunt resistances (Rsh) on solar cell parameters to enhance the photovoltaic performance of f-PSCs. Opt. Mater.155, 115818 (2024). [Google Scholar]
- 12.Merahi, F. et al. Power control of an autonomous wind energy conversion system based on a permanent magnet synchronous generator with integrated pum** storage. Sci. Rep.14(1), 29776 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Suyanto, S. et al. Power-flow development based on the modified backward–forward for voltage profile improvement of distribution system. Int. J. Electr. Comput. Eng.6(5), 2005 (2016). [Google Scholar]
- 14.Matrenin, P. V. Improvement of ant colony algorithm performance for the job-shop scheduling problem using evolutionary adaptation and software realization heuristics. Algorithms16(1), 15 (2022). [Google Scholar]
- 15.Huang, T. Decision tree algorithm based tidal flow calculation for distribution networks. Acad. J. Comput. Inf. Sci.7(12), 9–15 (2024). [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
All data generated or analysed during this study are included in this published article.













