Optimal Power Flow in Direct Current Networks Using the Antlion Optimizer

This document presents a solution method for optimal power flow (OPF) problem in direct current (DC) networks by implementing a master-slave optimization methodology that combines an antlion optimizer (ALO) and a power flow approach based on successive approximation (SA ). In the master stage, the ALO determines the optimal amount of power to be delivered by all the distributed generators (DGs) in order to minimize the total power losses in the distribution lines of the DC network. In slave stage, the power flow problem is solved considering constant power loads and power outputs of DGs as constants. To validate the effectiveness and robustness of the proposed model, two additional comparative methods were implemented: particle swarm optimization (PSO) and black hole optimization (BHO). Two distribution test feeders (21 and 69 nodes) were simulated under different scenarios of distributed power generation. The simulations, conducted in MATLAB 2018b, show that the proposed method (ALO) presents a better balance between power loss minimization and computational time required to find the optimal solution regardless of the size of the DC network.


Introduction
Micro Grids (MGs) are defined as small-scale electrical systems that can operate with Alternating Current (AC) orDirect Current (DC) and in isolation or connected to the electrical grid [1]. MGs can integrate different distributed energy resources, such as energy storage (batteries, supercondensers, or fuel cells) and distributed generation systems based on renewable energy sources (sun, wind, and thermal energy, among others) or their non-renewable counterparts (coal, gas, and oil, among others). Since most devices used in the industry and households work with DC, implementing a DC Micro Grid (DC MG) offers a reduction in implementation costs and energy losses because AC/DC converters are not necessary [2]. Thus, the energy they used to operate is better exploited [3]. Additionally, integrating and operating devices in DC MGs is simpler than in AC MGs. Likewise, the mathematical models that represent DC networks are less complex because important variables (such as frequency and reactive power) are 847 inherent to AC networks and nonexistent in DC networks [4]. For those reasons, this document focuses on direct current networks.
Despite of the advantages of DC MGs, they also present different problems to integrate and operate the different devices that compose them [5]; the most noticeable are high network power losses, voltage profiles outside allowable limits, overloaded lines, high investment and operation costs associated with bad design strategies, and energy management. As a result, researchers in this field have been interested in taking the opportunity to formulate strategies, techniques, and methods that can be used to model the network and improve its performance. In previous years, some of the most common topics in the field of DC MGs have been the Optimal Power Flow (OPF) and the Power Flow (PF) problems [6], whose solution can be used to find the power configuration to be injected into different distributed energy resources in the MG (mainly distributed generators) to obtain different technicaloperating benefits (e.g., power loss reduction and voltage profile improvement) [4]. These two problems are closely related because they depend on each other to determine the viability of the network (the OPF depends on the PF).
To solve the power flow problem in DC MGs more effectively, the specialized literature reports multiple methods. Some of the most outstanding are the Gauss-Seidel iterative method [7], Newton-Raphson method [8], and a linear approximation based on Taylor series [9]. Additionally, an iterative version of the method in [9] is proposed in [10], along with an iterative method based on successive approximation. This document compares the efficiency reported for the methods mentioned above and concluded that, for mesh and radial networks, the most efficient option is an iterative method based on successive approximation (SA). For that reason, in this study, SA was selected to solve the power flow problem in DC MGs.
Regarding the OPF, Distributed Generators (DGs) are the devices most commonly studied in order to improve some aspect of the network operation. In those cases, the main functions are the minimization of power losses and the improvement of the voltage levels, always considering the set of constraints that represents this type of systems [11]. In that sense, different methodologies have been proposed in the specialized literature to solve said problem. For example, some authors [12] proposed a second-order cone programming formulation to solve and analyze this problem, while some others [13] have explored a convex model as a method to solve OPF problems in DC networks with a greater penetration of distributed resources. Another work [14] presented a solution method for OPF by a convex quadratic approximation. Additionally, in recent years, multiple hybrid techniques have been proposed to solve the OPF problem, obtaining excellent results in terms of power loss reduction and computational efficiency. That is the case in [6], where the authors proposed a hybrid (master-slave) methodology that combines a continuous genetic algorithm and the Gauss-Seidel numerical method to solve the OPF problem. It is important to highlight that such methodology was validated in a 10-node test feeder, which is considered small and little informative; therefore, based on the results obtained, the method cannot be said to be replicable in larger systems. Among hybrid algorithms that offer excellent results, BHO [15] and PSO [16,18] (recently proposed) stand out. Said optimization methods achieve significant power loss reductions. However, only PSO offers the processing times required to solve the OPF problem. Importantly, the OPF problem in DC MGs is currently under development ; as a result, the number of works in that regard in the literature is limited.
Based on the review of the state of the art presented above, we can observe that most works in the field focus their objective function on reducing power losses; furthermore, few works report computation times, which are essential to identify the effectiveness of the proposed methodologies in terms of required processing times. Hybrid methodologies that use metaheuristic techniques and numerical methods are highly efficient; based on low-complexity iterative methods [19], they can solve the OPF problem in DC networks.
Efficient methods (in terms of solution and required processing times) are needed to solve the OPF problem in DC networks; for solving the objective functions proposed by users and operators of the electrical network. As a result, this document proposes an Antlion Optimization (ALO) technique combined with Successive Approximation (SA) to solve the OPF problem in DC MGs with the main objective of reducing the power losses in the network. Notice that, there is no evidence in the literature of the application of the ALO for solving the problem here addressed, which is identified in this work as a contribution to the state-of-the-art. The DC MG in this work only considers distributed generators, whose location in the test feeders was established based on optimal locations reported in the literature. This step was taken to provide the same scenario for all the techniques and perform a fair validation of the proposed method. ALO was selected in this work due to its excellent results reported in 848 OPTIMAL POWER FLOW IN DIRECT CURRENT NETWORKS USING THE ANTLION OPTIMIZER [20] to solve the location and sizing problem of DGs in AC networks. In the review of the specialized literature, we did not find any work about the application of said method in DC networks, more specifically, to address the problem under study. Finally, to compare and validate the effectiveness and robustness of our methodology, two other methods were used: PSO and BHO. In all the cases, the SA was in charge of solving the power flow problem. For the validation, we used two test feeders, with 21 and 69 nodes, widely reported in the specialized literature.
This paper is organized as follows: Section 2 presents the mathematical formulation of the OPF problem considering distributed generators in the DC MG. Section 3 presents the master-slave ALO-SA methodology proposed in this paper to solve OPF problems in DC networks. Section 4 describes the test feeders, comparison techniques, and parameters used to analyze the results. Section 5 presents the numerical results. Finally, Section 6 discusses the conclusions of this study and possible future work.

Mathematical Formulation
The OPF problem is related to a set of constraints associated with the power flow in DC networks [9]. Said constraints can be used to determine the power losses, that is, the variable that was selected as the objective function to be minimized in this work. The following is the complete mathematical formulation for the problem addressed in this work.

Objective Function
The objective function is defined as a specific problem to be solved or minimized applying optimal flow; in this particular case, the minimization of power losses in a DC MG. To represent that function, we use the following equation: where P loss represents the power losses (the variable to minimize), which is a function of v, that is, the vector that contains all the voltage profiles calculated using the power flow and G L , i.e., the matrix that represents the conductivity effects of each line.

Constraints
Constraints refer to limits and parameters of the OPF and PF problems. They are represented by the following equations: This is the mathematical interpretation of Equations (2) to (6): In Equation (2), we find P g , P DG and P d , which refer to the power generated by the slack node, the power supplied to the network by the DGs, and the power demanded at the network nodes, respectively. This equation expresses the power balance of the network. Additionally, D(v) is defined as a positive symmetric matrix whose diagonal contains the nodal voltages of the system; G L and G N represent the conductance of the lines and resistive loads connected to the MG, respectively . Equations (3) and (4) are composed of P min g and P max g , which denote the minimum and maximum power the slack node can deliver to the network. Likewise, P min DG and P max DG define the minimum and maximum power the DGs can supply. These equations are used to determine the generation capacity of the slack node and the DGs. Equation (5) includes v min and v max , which define the maximum and minimum allowable voltage. The voltage regulation limits are thus represented. Finally, Equation (6) defines the maximum penetration of DGs, where α represents the allowable penetration percentage with respect to the power generated by the slack node.

Proposed Methodology
The set of equations introduced in the previous section represent the problem addressed in this work. As a result, nonlinear methods should be applied to find a solution to this problem (see Equation (2)). In that sense, this study proposes to divide the optimal power flow problem in DC networks into two stages: The first stage (master) uses ALO to control the optimal power injection of the DGs. The second stage (slave) employs SA to evaluate the objective function in each one of the possible solutions proposed by the master stage. The following is a description of the master-slave methodology adopted in this work:

Master Stage: Antlion Optimization Algorithm
ALO imitates the interaction between ants and antlions; hence its name. The algorithm is characterized by the hunting technique of antlions, which create cone-shaped traps of different sizes on the ground. After creating a pit, the antlion hides at the bottom and waits until insects fall and are trapped. This way, antlions hunt for their favorite pray, ants [20]. In turn, ants move in a stochastic way when looking for food sources; their movements can be represented using random walks [21]. The following subsection presents the steps of the algorithm to obtain a solution to OPF problems in DC networks through ALO.

Generation of the Initial Population
To generate the initial population of ants (M Ant ), this work proposes a population with a size of n rows (the number of ants) as possible solutions to the problem and d columns, which represent the number of variables of the problem to solve (see Figure 7). Where A n is the n th ant inside the M Ant . In the case of the optimal power flow in DC MGs, the number of columns is associated with the number of nodes (DGs in the network, except the slack node) that will be allowed to generate power. The variables of each row (Ant) represent the power values assigned to the DGs for a particular solution. The values for every Ant are calculated randomly, respecting the maximum and minimum limits imposed on each variable considered in the problem; in this particular case, the maximum and minimum power limits of DGs.
Ants are similar to the particles in PSO [16]. The values assigned to the ants in each row refer to a possible solution to the problem.

Calculation of the Objective Function and Antlion Selection:
To evaluate the impact of all the possible solutions contained in M Ant , we assess the objective function for each ant (aptitude function), storing the values obtained for each one in a matrix of a size nx1 (M OA ). In the case of the OPF problem, we evaluate the power levels assigned in each Ant to the different DGs in the MG; thus, we can calculate the power loss level associated with each possible solution.
. . . Additionally, we select, as antlion, the incumbent solution to the problem, which is the Ant with the best solution in the M Ant , storing the value of the objective function F A Antlion and the configuration of the variables that compose it [22]. The antlion will affect the movements of all the Ants during the iterative process [23].

Evolution of the Ants Based on the Random Walk
A simple random walk was employed for the evolution of the Ants; it can be used to generate new populations and improve the incumbent (antlion) in the iterative process. This type of walk employs a dynamic process that consists in taking consecutive random steps from a starting point (M Ant ) based on the information contained in the antlion [21]. To generate the population of Ants at each iteration, we should take into account the information associated with the M Ant at the previous iteration and the displacement matrix ω t (see Equation (9)).
where ω t presents the same size of M Ant (nxd), assigning positive or negative values to each one of the variables that compose it in order to have the ants move over the solution space. ω t is presented in Equation (10), where ω n denotes the movement of the n th ant.
To calculate ω n , we employ Equation (11). From this equation, we can observe that the particle moves as a function of the information contained in the antlion and the ant's own information. Parameters α and β are used to regulate the approach to the best local and global solution, along with a random number random that can take a positive or negative value, as described in (12).
Once the M Antt has been calculated, we should verify that all the ants meet the technical constraints established for the problem under study, in this particular case, the power limits of the DGs. Afterward, the M OA , the antlion, and the F A Antlion of that population are updated. This process is repeated until the previously established stopping criteria are met. Importantly, the optimal solution to the problem is provided by the antlion and the F A Antlion , which are obtained when the iterative process is complete.

Stopping Criterion
For the master stage, we use two different stopping criteria: • After t consecutive iterations, the process is complete and the objective function is not updated anymore. That is, the iterative process ends when the objective function reaches a significant number of iterations without finding a better solution to the OPF problem. • The optimization algorithm ends the iterative process when it reaches the maximum allowable number of iterations, which are controlled by a counter.

Slave Stage: Successive Approximation (SA)
The slave problem can be used to calculate the objective function associated with the possible solution, (Ant), proposed by the master stage. In other words, the slave stage calculates the electrical variables that enable us to estimate the power losses of the system, which are represented as the objective function selected in this work. For that purpose, we need an iterative method that solves the power flow problem of a DC network in order to determine the impact of the proposed solution and its compliance with the set of constraints that compose the problem. This paper proposes to solve the power flow problem by the iterative method based on Successive Approximation (SA) presented in [10]. This method starts with the following equation: where G dd is a defined symmetric positive matrix, which indicates that its inverse function can be used to obtain a suitable expression to solve nonlinear problems by means of fixed-point theorems. V g and V d denote the voltage profiles of the generators and the demand or consumption nodes, respectively. This set of variables enables us to solve nonlinear problems employing the following mathematical structure: Finally, through an iterative process, we can obtain V d from Equation (14). For that purpose, we should add a counter t, which modifies the equation as follows: Figure 1 presents the flowchart that describes the iterative process of the master-slave methodology proposed here, which combines ALO and SA to efficiently solve the problem of optimal DG sizing. This methodology solves the set of equations that represent the mathematical model of OPF presented in Section 2.

Computational analysis
The next section presents the test feeders used to validate the proposed method, as well as the methods adopted for comparison and the parameters employed to carry out a fair analysis of the results obtained.

Test Systems
In order to validate and prove the robustness of the methodology proposed in this document, we used two test feeders (widely implemented in the specialized literature): (1) A 21-node test feeder, which was employed in [8] and [9]; and (2) a 69-node system adapted to DC, which was used in [16]. To implement the latter, the reactive component had to be eliminated in the branches and nodes. The two test systems are presented below.

21-Bus Test System
The 21-node test system in Fig.2 is composed of 21 nodes and 20 lines, and it presents constant power loads at its nodes.
In this system, the slack node generates power equivalent to 5.8160 p.u., and the power losses are 0.27603 p.u. The base voltage and base power of this system are 1 kV and 100 kW, respectively. The voltage at the slack node (Node 1) is considered to be flat, i.e., 1 p.u. The locations of the generators in the 21-node system are nodes 9, 12, and 16, as reported in [15].

69-Bus Test System
The 69-node system employed in this work is an adaptation of the AC 69-node test feeder in [16] . To adapt the system to DC, we used a base voltage of 12.66kV and a base power of 100kW. Figure  ?? presents the nodal distribution of the system.
Initially, in the 69-node system, the power generation of the slack node is 40.4311 p.u., and the power loss is 1.5385 p.u. The slack node operates with a voltage of 1 p.u. In said system, the generators are located at nodes 26, 61, and 66, as reported in [16].

Methods Used for Comparison
In order to prove the effectiveness of the method proposed here, we compared it to two other methods: the Black Hole Optimization (BHO), recently proposed in [15], and Particle Swarm Optimization (PSO) [17]. Remarkably, 852 OPTIMAL POWER FLOW IN DIRECT CURRENT NETWORKS USING THE ANTLION OPTIMIZER such two methods, as well as the one proposed in this work, adopt a master-slave methodology to solve OPF problems. In that sense, in order to make a fair comparison, we employed Successive Approximation (SA) for all the methods. We selected the methods previously mentioned based on their excellent results reported by different authors in order to demonstrate the effectiveness of the proposed methodology. In order to make a fair comparison between the optimization methods, we considered a population of 30 individuals, maximum 200 iterations, and a non-improvement counter of 50 iterations as the stopping criterion for all the methods employed here. Additionally, we used three different levels of maximum DG penetration in both test systems: 20%, 40%, and 60% of the total power demanded at the slack node. Thus, each distributed generator installed in the electrical network can exploit the maximum allowable penetration, as long as the other generators are not injecting power into the network. For the SA, which is in charge of solving the power flow problem, we determined the maximum number of iterations to be 2000, and the convergence error, equal to 1 × 10 −10 .
Finally, to obtain the average processing times required by the solution methods employed here, each test scenario was executed 10,000 times.

Simulation results
The computational analysis was carried out in a laptop computer with an AMD A9-9420 RADEON R5,5 COMPUTE CORES 2C+3G (3.00GHz) processor, 4 GB of RAM, and 64-bit Windows 10 Home Single Language as operating system. MATLAB 2018b was used as the development environment. Table 1 details the results of each technique employed in this work to solve the OPF problem in the 21-node system. The information in the table is organized as follows: The first column presents the technique; the second, the objective function (power loss reduction (P loss )); the third, the location of the DG and the power it supplies to the electrical network; the fourth, the total sum of power injected by the three DGs; and the fifth, the average computational time required by each technique to find an optimal configuration of power injection.

Results of the 21-Bus Test System
The results in Table 1 show that ALO achieved an average power loss reduction of 73.32%. In the case with 20% penetration, ALO and PSO reached the same level of P loss reduction; however, ALO produced such reduction injecting less power at the DGs than PSO. In turn, BHO offers the worst solution at that level of DG penetration . With a 40% penetration, ALO and PSO produced the same P loss reduction (77.82%); again, BHO exhibited the worst solution, with a reduction 0.07% lower. With the maximum penetration, 60%, ALO and PSO achieved the same P loss reduction (89.91%). Once again, BHO offered the worst solution, with a reduction 1.45% lower.
In order to analyze the processing times required by each method employed here in different power penetration scenarios, we present Figure 4. In the latter, BHO shows the best solution in terms of average processing time (0.2 s), followed by ALO (0.39 s), which represents a 40% reduction compared to PSO (0.66 s). Nevertheless, BHO 854 OPTIMAL POWER FLOW IN DIRECT CURRENT NETWORKS USING THE ANTLION OPTIMIZER provided the worst solution in terms of power loss reduction. Therefore, ALO achieves the best balance between solution and required processing time in the test scenarios applied to the 21-node system.   Table 2 presents the results of the solution methods applied to the 69-node system; it is organized the same as Table  1.

Results in the 69-Bus Test System
In the 20% penetration scenario, the best solution regarding P loss reduction was obtained by ALO and PSO (63.28%). The worst solution was that of BHO, which produced a 62.66% reduction. When 40% DG penetration was allowed, PSO produced the best solution, followed by ALO in second place and HBO. With that DG penetration level, PSO reduces the P loss only 0.076% more than ALO, and it requires a power injection 0.0130% higher than ALO. In the case of the 60% penetration, ALO and PSO obtained the same P loss reduction and offered Figure 5 presents the processing times required by the solution methods in the different proposed scenarios. From the figure, we can observe that BHO presents the best average computation time. BHO was 51.35% faster than ALO; however, the former exhibits the worst P loss reduction in the 69-node system in all the scenarios. In turn, ALO requires 36.51% less processing time than PSO and, in most scenarios, it reaches the same P loss reduction levels. For that reason, in this system, ALO offers the best balance between solution and required processing time.

Conclusions
This paper presented a master-slave methodology that combines antlion optimization with the power flow method based on successive approximation in order to solve the OPF problem in DC networks (ALO-SA). The master stage uses ALO to define the optimal power each DG should inject in order to reduce power losses; in turn, the slave stage employs the power flow based on successive approximation to determine the impact of the solution proposed by the master stage on the objective function. To make a comparison, we used two other methods, two test feeders, and three distributed generation penetration levels as test scenarios. The results show that, as the power injected by the DGs increases, power losses are reduced and processing time is extended.
The power loss reductions produced by the solution methods in both test feeders show that, in most cases, ALO finds the same solution as PSO, which offers the best solution in terms of P loss reduction. However, PSO requires a greater power injection, which does not have a significant impact on power loss reduction. In turn, ALO requires less processing time than PSO to solve the OPF problem. BHO presented the shortest processing times in all the cases under analysis, but also the worst solution in terms of power loss reduction. Based on these results, it can be concluded that the ALO-SA methodology proposed in this work offers the best balance between power loss reduction and required processing time. For that reason, among the approaches analyzed in this study, ALO-SA is considered the most adequate method to solve the optimal power flow problem in direct current networks of any size and DG penetration level. Future work will improve the performance of the ALO considering other methods to develop the slave stage, other positions of the DGs, or the use of the ALO method in parallel processing to reduce the computation time.