On the Matricial Formulation of Iterative Sweep Power Flow for Radial and Meshed Distribution Networks with Guarantee of Convergence

This paper presents a general formulation of the classical iterative-sweep power flow, which is widely known as the backward–forward method. This formulation is performed by a branch-to-node incidence matrix with the main advantage that this approach can be used with radial and meshed configurations. The convergence test is performed using the Banach fixed-point theorem while considering the dominant diagonal structure of the demand-to-demand admittance matrix. A numerical example is presented in tutorial form using the MATLAB interface, which aids beginners in understanding the basic concepts of power-flow programming in distribution system analysis. Two classical test feeders comprising 33 and 69 nodes are used to validate the proposed formulation in comparison with conventional methods such as the Gauss–Seidel and Newton–Raphson power-flow formulations.


General Context
Electrical distribution networks represent the most significant portion of the power system and are entrusted with providing electricity to end-users at medium-and low-voltage levels by connecting the transmission/sub-transmission system with consumers [1,2]. Typical voltages in these electrical networks oscillate between 4.16 kV and 33 kV [3], and these networks are typically operated with a radial structure to minimize installation, operation, and maintenance costs, including protective devices coordination simplifications [4][5][6]. To determine the behavior of electrical networks under well-defined voltage conditions, power flow methodologies are used, which facilitate the calculation of the voltage profiles at all the nodes of the network for a particular load condition [7,8]. The main challenge in the power-flow analysis of distribution networks is the constant power loads that produce nonlinear relationships between the voltages and powers [9,10], which makes the use of numerical methods for solving the power-flow problem necessary [11]. A typical tendency in the power-flow analysis of electrical distribution networks is the use of graph-based methods to address the power-flow problem based on the radial structure of the grid [12,13]. However, these methodologies are not useful in the case of weakly or strongly meshed distribution networks [14], which can cause major issues in modern power systems where meshed structures can help with grid performance in terms of realizing lower power losses and improvement voltage profiles [15]. In the case of commercial solutions for a distribution system analysis such as the DigSILENT and ETAP software, the Newton-Raphson (NR) method is the most-used approach [16] as it can be used with radial and meshed structures as well as multiple slack and voltage-controlled nodes [17]. In this research, we tackle the power-flow problem in electrical distribution networks while considering a unique slack node and radial and meshed configurations by reformulating the conventional backward-forward power flow using the branch-to-nodal admittance matrix [18].

Motivation
The power-flow analysis in electrical distribution networks is one of the most classical and largely studied problems in power-system analysis [14] as the power-flow is a necessary calculation in the determination of grid performance [10]. A power-flow method is a tool that is used to determine, via an iterative procedure, the final values of all the voltages in an electrical network with a certain tolerance acceptance in order to determine the complete operative state [14], i.e., currents through lines, voltage regulation in all the nodes, active and reactive power losses, and voltage stability. To solve the power-flow problem, the most classical methods used are the NR and Gauss-Seidel (GS) approaches, which guarantee convergence based on the Kantarovich and Banach fixed-point theorems [19]. In addition, some graph-based methods such as triangular formulation and quasi-symmetric matrices have also been reported for handling radial grid configurations [12,20]. However, this research is motivated by the fact that the classical backward-forward power-flow method is commonly formulated via sequential steps that require that the grid is ordered in layers [21]. It has a radial structure as, all the currents are calculated in the backward stage, while all the voltages are defined in the forward stage [13]. As this operation can be efficient, these stages exclude meshed configurations, which implies that it is not applicable to weakly or strongly meshed distribution networks. Therefore, herein, a reformulation of the backward-forward power flow in distribution networks is presented based on the branch-to-nodal incidence matrix [13], which permits the handling of radial and meshed distribution networks that include voltage-controlled nodes. Furthermore, the convergence of the proposed method is demonstrated by applying the Banach fixed-point theorem [22].

Literature Review
Power-flow solutions in the literature present a vast universe of possibilities based on iterative procedures, linearization methods, and convex reformulations. Some of these approaches are presented below.
The most classical power-flow methods in power-systems analysis correspond to the Gauss-Seidel (GS) and NR approaches [14]. The GS approach can be easily implemented using any programming language with its main advantage being that it can be used with complex numbers. However, it exhibits the worse performance in terms of processing time and number of iterations. With the purpose of improving the efficiency of the GS method, an accelerating factor α that reduces the total number of iterations and the required overall processing time is used [17]. In the case of the NR approach, it is a methodology that is more commonly used in commercial software and is widely adopted by utilities [23]. The main advantage of the NR approach is that it converges in a few iterations, has low processing times, and can possibly be used with radial and meshed networks comprising multiple voltage-controlled nodes. The main problem with using the NR approach in distribution networks is the high dispersion of the Jacobian matrix, which may cause convergence problems when the matrix is inverted for updating the voltage magnitude and angle variables [19]. The authors of [24] proposed the use of the Levenberg-Marquardt (LM) algorithm for solving power-flow problems in electrical networks; this approach essentially comprises an alternative manner of presenting the NR formulation with the main advantage that a factor is added to the Jacobian in order to reduce the possible singularities in this matrix.
For distribution networks, some of the most recognized approaches for addressing the power-flow problem are graph-based methodologies known as backward-forward and triangular methods [12,20]. The backward-forward method is typically designed with an algorithmic structure using an iterative sweep based on currents in the backward stage to update the voltages in the forward stage [21]. An important improvement in the backward-forward approach was presented by [13], wherein radial and meshed structures were included in a matricial formulation. The triangular approach works for radial and meshed structures [12]; however, the related convergence analysis is not provided. It should be noted that in these methods, the authors do not present an analysis of the inclusion of voltage-controlled nodes, which we proposed in our matricial reformulation. A new approach based on successive approximations was recently reported in [25]. This approach demonstrates the convergence of the recursive formulation for radial and meshed networks using the Banach fixed-point theorem. However, voltage-controlled sources were not considered in this formulation, and the behavior of the θ-coefficient was not determined to confirm the convergence at well-defined voltage conditions. Two additional important power flow contributions have been reported in specialized literature by [26,27] regarding secondary distribution networks to study the problem of the harmonic penetration caused by higher penetration of photovoltaic sources. The authors in these approaches have proposed a harmonic power flow analysis using affine arithmetic which allows reaching better results regarding harmonic distortion estimations with low-computational effort when compared with classical Monte-Carlo simulations; in addition, these methods were validate in real secondary distribution networks with promissory results for utilities.
Other approaches have also been presented in specialized literature in relation to linear and convex approximations for power-flow solutions in distribution networks. In [11], a convex approximation for a power-flow analysis of radial and meshed distribution networks was presented while considering a semidefinite programming approximation by using a rectangular representation of the power-balance equations. In [8], a second-order cone programming approximation was described while considering branch variables related to currents and powers in all the lines. It is essential to mention that the main disadvantage of these approaches is the low rate of convergence when the number of nodes (n) increases as these formulations create n 2 variables related to voltages, which increase the required processing times to reach the optimal solution in the iterative procedure [28]. In the case of linear methodologies, the authors of [7] proposed a Taylor's series expansion of the hyperbolic relation between the voltage and powers to reach a linear formulation that can be used to solve directly without the use of iterative procedures. In [10], an improvement of this linear approximation was presented using the straight equation to include the minimum expected voltage in the approximation and improve the final result of the power-loss calculation. The authors of [29] described a linear approximation based on a logarithmic transformation of the voltage magnitudes added to the Taylor's series expansion for applications in power systems. It should be noted that these linear approximations have speed responses; however, the final result of the power-loss estimation varies in the range of 1% and 10%.

Contributions and Scope
The main contributions of this research can be summarized as follows: • The reformulation of the classical backward-forward power-flow method for application to distribution networks with the ability to handle radial and meshed configurations by rewriting the branch variables into nodal variables using the branch-to-node incidence matrix.

•
The parametric independence of the power-flow formulation, as no assumptions about relations reactance/resistance, are required in the proposed matricial formulation.

•
The possibility of guaranteeing convergence under well-defined voltage conditions by applying the Banach fixed-point theorem to the recursive solution, which only requires that the short-circuit current be more significant to the load current in all the nodes to ensure the convergence of the algorithm.

•
The presentation of the proposed matricial formulation in an intuitive manner to introduce students of electrical engineering to power-flow analysis by providing the MATLAB/OCTAVE algorithm for solving a small test feeder as a numerical example comprising radial and meshed structures.
It is important to mention that a similar approach was previously proposed in [13] that combined branch-to-nodal matrices with triangular matrices; moreover, its convergences were also proved. However, the authors of [13] did not present the behavior of the θ−coefficient as a function of the load current and the short-circuit current relations per node. In addition, a simulation case is presented herein, where the power system contains a voltage-controlled node (VC node) in a small transmission network, which demonstrates that the proposed matricial approach is extensible to power system applications with multiple meshes and VC nodes.

Organization of the Document
The remainder of this paper is arranged as follows. Section 2 presents the matricial formulation of the classical backward-forward power flow method using a small distribution test feeder with multiple meshes. In Section 3, the convergence analysis is presented based on the Banach fixed-point theorem, which results in the maximum load current divided by the minimum short-circuit current per node. Section 4 presents a small numerical example comprising a 13-node test feeder with mesh and radial topologies and presents the MATLAB/OCTAVE implementation that can be used as a power-flow analysis tutorial for beginners. In Section 4, the configurations of two classical distribution test feeders comprising 33 and 69 nodes are presented. Section 6 presents the numerical results obtained for these test feeders on comparing the proposed matricial formulation with the classical power-flow methods such as the GS, NR, and LM methods; in addition, a small transmission network comprising four nodes that comprise a meshed structure with a voltage-controlled node is presented, which aids in understanding the extension of the proposed formulation to power-system analyses. Section 7 presents the main conclusions derived from this work as well as its possible future improvements.

Matricial Power-Flow Formulation
The classical backward-forward power-flow method was developed using the concept of iterative sweeps, which achieves the following [30]: • Calculates the total current demands at all the loads with assumed known voltages.

•
Determines all the currents that flow in all the branches of the network by applying the first Kirchhoff's law at each node. • Calculates the voltage drops by starting from the source and using an ordering stage that defines the layers at which nodes are located.

•
Updates the voltage profile in all the demand nodes and repeats all the stages until the convergence tolerance is reached.
This structure of the backward-forward method has two main disadvantages: (i) It can only handle radial grid configurations, and (ii) it requires nodal ordering in layers [20]. However, to address these problems, it is possible to reformulate a power-flow problem using branch-to-nodal incidence matrices [18].
Definition 1 (Branch-to-node incidence matrix A). An electrical network that is represented by a connected graph with b links and n vertices can be represented by a rectangular matrix A ∈ R b×n by assuming arbitrary directions in the current flow through the lines as follows: if the line i is connected to the node j and its current leaves from this node. • A i,j = −1 if the line i is connected to the node j and its current arrives at this node.
To exemplify the structure of the branch-to-node incidence matrix A, let us consider the electrical network depicted in Figure 1. This grid comprises six links (branches) and five nodes. The names of the lines are listed in Table 1.  On considering the branch information reported in Table 1 and the electrical-grid configuration depicted in Figure 1, the branch-to-node matrix A can take the following form: It should be noted that this matrix can be split into two sub-matrices that are related to the slack source and the rest of the nodes as follows (This is made possible by assuming the slack node is located at node 1.): where A s is the first column of A (slack node), and A d corresponds to the rest of the columns in A, i.e., the demand nodes. Now, let us define the voltage drop at line i as E i and the voltages at its terminals as V j . Then, from Figure 1, we know that which can be rewritten using (1) and (2) as presented below: where V s = V 1 , E is a vector that comprises all the voltage drops, and V d is a vector that comprises all the voltages in the demand nodes.
To relate the currents J in all the branches with the voltage drops, it is possible to apply Ohm's law as presented below: To determine the relation between the currents injected at the nodes (i.e., I) and all the branch currents, let us apply Kirchhoff's second law at each node while considering the current directions defined in Table 1. We thus obtain It should be noted that I can also be split as where I s and I d are the current of generators and demands, respectively. Using the relation between the branch and nodal currents presented above, it is possible to find that Now if expressions (3), (4), and (7) are combined based on Y = Z −1 , then the following result is obtained: To find the relation between the injected currents and powers, it is possible to apply the Tellegen's theorem, which defines apparent power as follows: where the superscript represents the conjugate operator, S s is the apparent power generation in the slack node, and S d are the apparent power consumption in the demand nodes. Now, if expressions (8) and (10) are combined to obtain V d , the following result is obtained: where Z dd is defined as A T d YA d −1 , and b = +Z dd A T d YA s V s . It should be noted that to solve expression (11), an iterative procedure is required, as this expression has a recursive structure. For this purpose, let us to add an iterative counter t that starts from the initial point t = 0 (i.e., V 0 d is perfectly known), which allows the rewriting of (11) as presented below: Remark 1. The iterative procedure in (12) is performed until the convergence error is reached, i.e.,

Convergence Analysis
To prove that the recursive formula (12) guarantees the convergence of the power-flow problem in the case of distribution networks comprising radial and mesh structures formulated using branch-to-nodal incidence matrices, let us consider the following. Assumption 1. The amount of power consumed by the loads does produce voltage instabilities in the distribution network, i.e., the system operates under well-defined voltage conditions.

Assumption 2.
There exists a positive lower bound for all the voltage profiles, i.e., V min > 0, which is typically defined by the utility and regulatory policies.
To demonstrate the convergence properties of the recursive power flow approach defined by (12), let us present the general definition of the Banach fixed-point theorem as follows.
Theorem 1 (Banach fixed-point theorem). The iterative formula presented in (12) is stable and corresponds to a contraction map with the form for some V that fulfills Assumption 1 irrespective of the starting point, i.e., V 0 , such that where W is the solution of the power-flow problem, and θ is a real number between 0 and 1.
Proof. The recursive formula for the iterative backward-forward power-flow method presented in (12) can be rewritten as follows: where Ω S is the set that contains all the demand nodes.
In addition, based on the structure of the Banach fixed-point theorem, it is possible to affirm that the solution of the power-flow problem, i.e., W, satisfies W = g (W), and it is unique if and only if g (W) is a contraction mapping on V d . where Now, on considering Assumption 2, which is regarding the positive definiteness of the impedance matrix, the expression (17) can be reduced to It should be noted that, considering the mathematical structure presented in (18) and that Z dd ii is the equivalent impedance at node i, the following relation can be obtained.
where we can ensure that 0 ≤ θ ≤ 1, as the denominator in (19) corresponds to the minimum short-circuit current, and the numerator represents the maximum load current, which is always lower than any short-circuit current during normal operative conditions. This implies that the recursive matricial sweep power flow (12) converges to the power-flow solution, which completes the proof.

Numerical Example
This section presents a small test feeder comprising 13 nodes that can handle radial or mesh configurations. This facilitates the demonstration of the convergence of the proposed matricial reformulation of the classical backward-forward power flow approach. Figure 2 presents the electrical configuration of the 13-node test feeder.  Figure 2. Electrical configuration of a radial/mesh distribution network (adapted from [31]). Table 2 lists the branch and load information for the 13-node test feeder that has a total demand of active and reactive power of 24,200 kW and 7700 kVAr, respectively, and it operates on a line-to-neutral voltage of 23 kV. To solve the power-flow problem in the 13-node test feeder, we consider the following: (i) a radial configuration is reached when all the dashed lines in Figure 2 are open, and a meshed configuration is obtained when one or more dashed lines are connected; (ii) the recursive formula (12) was implemented in MATLAB using scripts in a tutorial style. Figure 3 reports the MATLAB implementation of the proposed matricial backward-forward (MBF) power flow while considering the meshed configuration for the 13-node test feeder depicted in Figure 2.
In the MATLAB implementation presented in Figure 3, we can observe the following: From lines 1 to 36, all the numerical information in the test system is presented and transformed into a per-unit representation. Lines 37 to 48 comprise the branch-to-node incidence matrix, impedance matrix, and all the constant components for evaluating the recursive power-flow formula. From lines 49 to 59, the iterative procedure for solving the power-flow problem while considering a matricial formulation is implemented while considering a convergence tolerance of approximately = 1 × 10 −10 . It should be noted that lines 53 and 54 present the required calculations for determining the total grid power losses using branch variables, i.e., J and E, and the line impedance matrix Z.  It is important to mention that if the last three lines related to the branches are removed in the matrix (see Figure 3), then the radial test system can be evaluated. However, Figure 4 presents the θ−coefficient for the radial and mesh 13-node configurations.
From Figure 4, it can be concluded that expression (19) is fulfilled for all the demand nodes as the θ values are between 0 and 1. For both the simulation cases, the maximum value of θ is reached at node 7 and is 0.016 and 0.009 in the case of the radial and meshed configurations, respectively. It should be noted that, in the case of the meshed configuration, the minimum voltage is 0.983 p.u at node 7, and in the radial configuration, this value is 0.976 p.u at node 9.

Test Systems
This section presents two classical distribution test feeders with radial configurations that are typically used in the optimal location of distributed generators [5], the optimal location of capacitor banks [32][33][34], and optimal battery scheduling approaches [35]. The first system corresponds to the 33-node test feeder, and the second system comprises the 69-node test feeder, which is widely known as the Baran & Wu distribution network.

33-Three-Node Test Feeder
This test system comprises 33 nodes and 32 branches with an operating voltage of 12.66 kV. The slack node is located at node 1, and its configuration is illustrated in Figure 5. This feeder has 3715 kW and 2300 kVAr of total active and reactive power demand, respectively. The initial active power losses of this system are equal to 210.988 kW. Here we considered the voltage and power base values of 12.66 kV and 1000 kW, respectively.
The information of all the branches as well as the load consumption of the 33-node test feeder are listed in Table 3.

69-Node Test Feeder
This test system comprises 69 nodes and 68 branches with an operating voltage of 12.66 kV. The slack node is located at node 1, and its configuration is depicted in Figure 6. This feeder has a total active and reactive power demand of 3890.7 kW and 2693.6 kVAr, respectively. The initial active power losses of this system are equal to 225.072 kW. Here, we assumed that the voltage and power base values were 12.66 kV and 1000 kW , respectively.  The information of all the branches as well as the load consumption of the 69-node test feeder are listed in Table 4.

Computational Validation
To validate the proposed MBF power-flow reformulation, we consider four classical iterative power-flow approaches reported in the specialized literature as comparative methodologies: (i) classical GS [14], (ii) accelerated version of GS (AGS) [14], (iii) NR [17], and iv) LM [24]. To perform a fair comparison, all these methods are evaluated 1000 consecutive times to determine their computational costs (processing times) by considering a maximum of 100 iterations and a tolerance error of 1 × 10 −10 . Table 5 lists the computational efficiency of the proposed MBF method as compared to the classical approaches reported in the literature. These results were reached after performing 1000 consecutive evaluations, which confirms the following:

Results for the 33-and 69-Node Test Feeders
The proposed approach is the most efficient in terms of processing times as compared with the classical approaches as it only takes 1.32 ms for completion in the case of the 33-node test feeder and 5.37 ms for completion in the case of the 69-node test feeder, which implies that it is at least seven times faster than the NR method, which is the most used approach in research and the industry. The classical GS method presents the worse performance in terms of processing times and number of iterations. However, its accelerated version with the α−coefficient presents a significant improvement in its performance. In the case of the 33-node test feeder, this method is approximately ten times faster, and in the case of the 69-node test feeder, it is at least 18 times faster, in terms of the total processing time required to solve the power-flow problem.
The NR and LM methods belong to the same class as both comprise the use of Jacobian matrices. Therefore, their performance with respect to the number of iterations and the processing times is very similar. Even if the proposed approach requires double the number of iterations, in terms of processing times, we can confirm that the MBF is the best numerical method for distribution power-flow analysis as compared with the NR and LM approaches. In terms of the power losses calculation, it is important to mention that all the numerical methods listed in Table 1 arrive at the same solution with negligible errors of estimation (lower than 1 × 10 −10 ). This implies that each of them is suitable for implementation; nevertheless, our proposed method, i.e., the MBF reformulation, is the most desirable approach due to its speediest performance.  Figure 7 presents the voltage profiles for the 33-and 69-node test feeders for the proposed MBF and NR power-flow methods. We can observe that these plots confirm that, numerically speaking, both these methods demonstrate the same performance in terms of voltage determination. However, the main advantage of the MBF when compared to the NR approach (see Table 1) is its faster calculation times as it guarantees convergence on well-defined voltage conditions.
To demonstrate that the proposed MBF approach guarantees convergence in the 33-and 69-node test feeders, Figure 8 presents the behavior of the θ-coefficient. From the results in Figure 8, it is possible to confirm that hypothesis (19) is fulfilled, and the proposed BFM guarantees the convergence of the power-flow problem. In the case of the 33-node test feeder, the maximum coefficient occurs at node 30 with a value of 0.027, while in the case of the 69-node test feeder, this occurs at node 61 with a value of 0.062. These values facilitate the verification that θ is comprehended between 0 and 1 in the case of both the test feeders.

Inclusion of Voltage-Controlled Nodes
One of the main advantages of the proposed MBF power-flow reformulation is the possibility of working with voltage-controlled nodes, i.e., nodes that control active power injection and the magnitude of the voltage profile. These nodes are common in power-system analyses [14], wherein multiple synchronous machines are interconnected via the transmission network. To realize the VC inclusion in the proposed model, we can apply the classical GS method, where the reactive power generation at the VC source nodes is calculated as follows: is the apparent power injected at node k by the VC source, which can be split into its real and imaginary powers, i.e., P VC g k and Q VC,t g k , which are the active power constant and reactive power variable for maintaining a constant magnitude of the voltage output; Y kj is the admittance that relates nodes k and j, respectively.
The voltage-controlled nodes can be easily included in the proposed MBF method by modifying (12) as follows.
Remark 2. Once all the voltages are calculated, in the case of the VC source, the magnitude of the voltage is fixed as a constant, and from (21), only the angle at each iteration is updated, i.e., being V VC g k the specified voltage in the VC source.
To demonstrate the applicability of the proposed MBF power-flow method, we implement a small four-node test feeder with a slack node at bus 1 and a VC source at node 4. This system was initially presented in [14] to introduce the GS and NR methods. The comparison in this section is performed using the widely used power-system software called DigSILENT. Figure 9 presents the configuration of this test feeder and the DigSILENT results obtained after evaluating the AC power flow via the NR method.
The information of the branches and loads for this four-node test feeder are obtained from [14] and are listed in Tables 6 and 7. Once the power-flow problem is solved using the proposed MBF method, the results reported in Table 8 are obtained. It should be noted that these are compared to the DigSILENT solution presented in Figure 9.  The results presented in Table 8 confirm the possibility of using our proposal approach to solve power-flow problems in power systems by using the MBF reformulation with the main advantage that it is comparable with sophisticate software such as DigSILENT. In Appendix A has been illustrated the codification of the proposed MBF method for power systems that comprise voltage-controlled nodes.

Remark 3.
It should be noted that, if the voltage profiles are the same while comparing the NR and MBF methods, as presented in Table 8, then all the active and reactive power flows reported in Figure 9 will demonstrate exactly the same performance, which confirms the possibility of using the proposed approach in radial and meshed networks comprising voltage controlled nodes.

Conclusions and Future Works
A matricial version of the classical backward-forward power-flow method has been presented in this paper with the main advantage that it guarantees convergence under well-defined voltage conditions. In addition, numerical validations were performed using 33-and 69-node test feeders to demonstrate that the MBF proposal requires the minimum processing times as compared with those of classical methods such as GS, NR, and LM.
The proof of convergence was performed by applying the Banach fixed-point theorem. This has permitted the conclusion that the proposed MBF method always converges under well-defined load conditions as the θ-coefficient was defined as the relation between the maximum load current and minimum short-circuit current. This implies that θ is always be comprehended between 0 and 1, thus guaranteeing the numerical convergence of the power-flow problem.
The inclusion of voltage-controlled nodes was also considered by implementing a small four-node test feeder and comparing the numerical results reported using well-known software used for solving power-flow problems called DigSILENT and those of our proposed approach . The voltage profiles obtained using both these methods allowed use to conclude that the proposed MBF method can handle radial and meshed networks comprising VC nodes and will be suitable for multiple power-system applications shortly.
Some additional works that can be derived from this work are listed below: (i) the application of this power-flow method to electrical networks comprising renewable energy sources and battery energy-storage systems in an embedded strategy that facilitates the optimal dispatch of these devices with metaheuristics; (ii) the application of our proposed approach for conducting optimal power-flow analyses in distribution networks via sequential programming approaches based on combinatorial optimization; (iii) the extension of the MBF formulation to electrical systems comprising hybrid structures that contain AC and DC feeders interfaced with power electronic converters.