An improved backward/forward sweep power flow method based on network tree depth for radial distribution systems

Introduction Load flow analysis is a crucial task in power systems control as it helps in the computation of voltages at each node and currents at each branch [1]. The load flow method results carry important information about the power system; many analysis would not be possible without it. Applications of load flow methods reduce the needs for additional investments in sensors and communication infrastructure in power systems. Load flow results are included in various tools which monitor, analyze and control the power system. Load flow analysis is directly or indirectly used in various power system applications such as distributed generator and capacitor placements [2–4], economic dispatch [5, 6], power quality improvements, network reconfiguration and service restorations [7, 8], power systems optimization and other applications. Different load flow methods have been devised for power flow analysis in both distribution networks and transmission network. The power flow analysis commonly used in distribution networks includes Abstract


Introduction
Load flow analysis is a crucial task in power systems control as it helps in the computation of voltages at each node and currents at each branch [1]. The load flow method results carry important information about the power system; many analysis would not be possible without it. Applications of load flow methods reduce the needs for additional investments in sensors and communication infrastructure in power systems. Load flow results are included in various tools which monitor, analyze and control the power system. Load flow analysis is directly or indirectly used in various power system applications such as distributed generator and capacitor placements [2][3][4], economic dispatch [5,6], power quality improvements, network reconfiguration and service restorations [7,8], power systems optimization and other applications. Different load flow methods have been devised for power flow analysis in both distribution networks and transmission network. The power flow analysis commonly used in distribution networks includes cases and compares the proposed load flow method with other existing methods. "Conclusion" section concludes this paper and highlights the areas for future works.

Study justification
Tanzania Electric Supply Company (TANESCO) Limited is the only company that deals with the generation, transmission and distribution of electricity in Tanzania. TANESCO owns the interconnection power grid made up of generation, transmission and distribution system [19]. According to [20], the TANESCO's transmission system comprises fifty-seven (57) substations interconnected by transmission lines and 11,124 distribution transformers with 17,021 km of 33 kV lines, 5,375 km of 11kv lines and over 34,513 km of low-voltage (LV) lines. This information justifies how vast is the distribution network as compared to the transmission network. The distribution network supplies electricity at two voltage levels, the medium voltage (MV) with 33 kV or 11 kV and LV with 380V for three phases and 230V for single phase. The MV is used at the primary distribution network, and LV is used at the secondary distribution network. Both primary and secondary distribution networks are operated radially. In Tanzania power system, the primary distribution network is automated but there is no automation in secondary distribution network [21][22][23][24].
The single-line diagram for the Tanzania secondary distribution network is shown in Fig. 1. The secondary distribution network comprises a three or a single-phase network with a neutral conductor. Single distribution transformers save loads in the secondary distribution networks; thus, a radial power flow analysis is used for identifying power system parameters. The secondary distribution network is not static as it grows as new customers are connected to the network. The data collected from the utility company in Tanzania  from January 2015 to September 2019 has revealed the customers' growth rate of 32% per year, as shown in Fig. 2. This growth rate is significant for the distribution network and has impacts on the load flow methods. The network growth cause changes in the topology due to network reconfiguration during service restoration and when new customers are added. Also, in such network, nodes are numbered arbitrarily. Most of the available load flow methods, such as conventional BFS, DLF and CIM, depend on node numbering schemes. Other available methods involve partitioning the network and the use of matrices multiplications. Considering the distribution network dynamicity caused by network expansion and network growth, most of these available load flow methods may not be efficient. Also, considering the nature of primary and secondary distribution networks characterized by multiple connections with a large number of nodes, methods that involve matrices multiplications may be computationally ineffective. Power flow methods that can accommodate network reconfiguration without requiring node renumbering are essential for efficient power flow analysis in both primary and secondary distribution networks. Therefore, the improved power flow method in this paper forms the baseline for automating the power distribution networks.

Conventional backward/forward sweep method
The electric power distribution system is characterized by heavy loading conditions at some buses and a high R/X ratio, unbalanced load and mostly radial topology. Many power flow methods have been designed and proved to work efficiently for transmission systems [9][10][11]. However, the design assumptions considered for power flow methods in transmission networks are not suitable for power flow analysis in radial distribution networks due to their convergence, memory requirements and computational efficiency.
Load flow solution that fits the requirements for a radial distribution network has been proposed [25][26][27][28]. The backward/forward sweep (BFS) is among the most successful power flow methods for radial networks [29,30]. The variants of BFS methods have been reported, such as the current summation method, power summation method and admittance summation method [13]. The basic operation principle of BFS involves two computation processes at each iteration. The backward process involves the power or current flow solutions starting from the branch of the end nodes moving toward the branch connected to the reference node. The forward sweep calculates the voltage at each node starting from the reference node to the end nodes. During the backward sweep, the voltage is held constant, and during the forward sweep, the current or power value is held constant [31,32]. After each iteration, the power flow convergence is tested. The first step of BFS is a calculation of node/bus injection current which can be calculated using Eq. (1).
where I (k) i is the injection current at node i on iteration k, S i is the power injection at node i and V i−1,i is the current of branch connecting node i to its immediate upstream node and Z i−1,i is the impedance of branch connecting node i to its immediate upstream node.
The most common stopping criteria for BFS are the convergence of voltage magnitudes obtained by tracking the differences of voltage magnitude between two successive iterations. The algorithm stops when the conditions in Eq. (4) are met.
where α is the tolerance limits which, in this work, was set as α = 0.0001.

Network depth in radial electrical distribution system
The nominal radial distribution system consists of nodes/buses which are connected by branches. The structure of such a system can be described as a tree [33]. There are three types of nodes in distribution systems: terminal nodes, intermediate nodes and common nodes. The common node refers to a junction node that connects more than three network segments, for example, node 2 and node 4 in Fig. 3. The terminal nodes are the endpoints of a network segment, for example, nodes 1, 6, 9 and 10 in Fig. 3. The intermediate nodes are the nodes between common nodes and end nodes, for example, node 3 and 7. The end node that connects the network to the power system is called the root/reference node. Loads and distributed generators can be connected to the nodes. However, there are nodes with no power consumption and no power injections; they are called zero injection nodes. A distribution network can be modeled as a radial tree G = {V , E} with N nodes, where V is a set of vertices, or nodes/buses and E is a set of branches or edges [34]. In a radial distribution network, power flow is unidirectional, flowing from upstream to downstream buses. In that regard, power can flow from node i to node j via a branch which can be represented as branch/edge (i, j). The immediate upstream node for node i is a parent of node i, and the immediate downstream node of node i is a child of node i. Therefore, P i is a set of all parents of node i, and C i is a set of all children of node i. However, each node, except the root node, has just one parent for the radial distribution network. For example, from Fig. 3, the parent of node 4 is node 2 and children of node 4 are nodes 7, 8 and 9. The edge set that connects a node to its parent is called a parent edge, and a set of edges that connect a node to its children is called a children edge. Consider node 4 in Fig. 3, the parent edge is edge (2,4), and children edges are edge (4, 7), (4,8) and (4,9). For every node i, the degree of node d i is a total number of branches that directly connect to node i. The distance between any two nodes can be measured by the number of edges between the two nodes. For example, the distance between nodes 1 and 12 is 4 since there are four edges between them. Therefore, at this point, important variables in the proposed algorithm called a node depth (D n ) and network depth (T) can be defined.

Definition 1 A node depth is the distance between a node and the root node
Definition 2 A depth of a network is the distance between the root node and the furthest node from the root node, i.e., T = Max n∈V (D n ) Consider Fig. 3 and Definition 1, node 6 and node 11 both are terminal nodes, but the depth of node 6 is 3, and the depth of node 11 is 4. Similarly, nodes 4 and 5 are of different types and belong to different network segments, but both have a depth of 2. The depth of the root node is 0. From definition 2, the depth of the network in Fig. 3 is 4. In the forward sweep, each node calculates and updates voltage solution set H n by accessing the voltage of its parent node, stored current and line data of its parent branch to get its new voltage value. The process of storing the currents and voltages performed at the nodes on each iteration is equivalent to memorization in dynamic programming. On each directional move, backward and forward, each node solves the same problem repeatedly, i.e., current summation and voltage subtraction, respectively, which signifies sub-problem overlapping in dynamic programming. Since a solution for a large problem (power system network) is obtained by solving similar small problems on each node, it signifies that the substructure is optimal. Therefore, it is possible to solve the power flow problem using dynamic programming concepts. The algorithm starts by setting the voltages for all nodes equal to nominal network voltage. In the backward sweep, the algorithm starts at depth D i = T and traverses up the network to depth D i = 1 by decreasing the depth by 1 after each iteration, i.e., traverses through all depths except depth 0. At each iteration k, the algorithm is at search depth D k = T − k . At each depth, all nodes belong to that depth are listed. Let that list at each depth be represented as Q k = {n ∈ V |D k = 0} . At each depth and for each node q ∈ Q k , the Kirchhoff 's current law is solved and update the solution set I b . In the forward sweep, the algorithm starts at a depth D i = 1 and traverses down the network to depth D i = T , by increasing the depth by 1 after each iteration. At each iteration k, the algorithm is at search depth D k = k . At each depth and for each node q ∈ Q k , the voltage drop due to the parent branch of node q is found and subtracted from the voltage of its parent node and the solution set H n is updated. This backward and forward sweep processes repeat until convergence criteria are met. The flowchart of the proposed algorithm is presented in Fig. 4.
It should be noted that unlike many other proposed solutions in the literature, in the implementation of the proposed algorithm, there is no need to classify or partition the network into main and derivation lines or any use of matrices multiplication. The solutions are obtained by simply adding and subtracting voltages and currents. Also, the proposed method is independent of the numbering and naming of the nodes since the nodes interact by parent-children relationship. Once the node knows its parent or children, it can also automatically get their names and addresses in the solution set S = {H n , I b }.

Network information re-organization for changing network topology
In some applications which involve network reconfiguration through switching operations due to line failure, phase balancing, system isolation and restoration, nodes or network segment can be added or removed or changed its connection points. In such a dynamic network, the direction of power flow for some branches may change, and the parent-children relationship may also change. Consider Fig. 5, initially Switch A is closed and switch B is opened. Then, node 3 is the parent of node 11 and 11 is a parent of 12. By opening Switch A and closing Switch B, the path of some nodes toward root nodes and the parent-children relationship of some nodes changes such that node 11 becomes a parent of node 3 and node 12 becomes a parent of node 11. Since the proposed algorithm is based on the parent-children relationship, then network data restructuring is required for good performance of the algorithm. Network data restructuring involves updating the network data as a result of reconfiguration.
Steps used to update network data are elaborated in Table 1.
Consider meshed IEEE 15 bus system in Fig. 5; Switch C separates two network segments starting from Substation A and Substation B. When connecting the two networks, one substation is disconnected. Let the network segment connected to the substation be called the source network segment, and the network connected to the source segment called the new network segment. Since each segment consists of different nodes, their connection may result in several possible configurations depending on the type of nodes involved as a connection point from each network segment. Examples of such configurations include connections that involve the end node from the source segment and end node from the new segment, i.e., node 5 and 34, an intermediate node of the source network and the end node of the new network, i.e., node 3 and 33, and so on. The flowchart of the proposed BFS power flow method that can efficiently handle all possible connection scenarios due to network reconfiguration, without renumbering of nodes, is presented in Fig. 6 and the Pseudocode of the same algorithm is presented in Algorithm 1. Table 1 Steps for updating network data Step 1: Identify all nodes and branches in the path from the connection node to the root node of the original network.
Step 2: Reverse the parent-children relationship of the branches identified in step 1 Step for each depth do % Go through each depth of the network starting from d-1 to d=0. 10: Get number of nodes at depth j 11: for each node at depth j do 12: Get parent of the node 13: Get children of the node 14: Calculate injection current at the current node (CurInjection) 15: if current node has children then 16: Get injection currents of all children (ChildInjenction) 17: Calculate current of the branch ending to current node (BranchCurrent) 18 for each depth do 27: Get number of nodes at depth j 28: for each node at depth j do 29: Get parent of the node 30: Get voltage of the parent node (Vp) 31: Calculate the voltage drop of the branch ending to current node (Vd) 32: Calculate Voltage of the current node (Vn) : Vn =Vp-Vd 33: end for 34: end for 35: Check loop termination criteria (maximum number of iteration or tolerance limit) 36: end while

Results and discussion
In this work, simulations were conducted in three parts. In the first part, the simulation was conducted using IEEE standard buses to test the accuracy of the proposed algorithm by comparing it with other studied algorithms. In the second part, simulations were conducted in a meshed IEEE 15 bus to test the capability of the proposed algorithm in handling network reconfiguration cases. The third part is the simulation of the application of the proposed algorithm in a practical electrical secondary distribution network. All simulations were carried out using MATLAB 2017b on 3.80 GHz 4 Cores core i7 computer with 16GB RAM.

Results for IEEE Bus Systems
The IEEE 15 bus system has been selected as the test system to test the robustness of the proposed algorithm. The line data and load data for IEEE 15 bus are presented in Tables 2 and 3, respectively. The single-line diagram of IEEE 15 bus system network topology is presented in Fig. 7. In this study, three types of popular load flow methods, namely current injection method (CIM), BFS [1], DLF [17], were used to validate the proposed load flow method. The CIM results were taken from a study conducted by [1], and results for BFS and DLF were obtained from conducted simulations. The load flow results, which show the absolute voltages on the nodes for IEEE 15 bus system, are presented in Table 4. Results in Table 4 show that the proposed load flow method obtained similar voltage profiles to DLF and BFS on all nodes. The results for CIM seem to differ from the rest of the methods. Another test was conducted using the IEEE 33 bus system whose line data and load data were taken from [35,36]. In this study, two types of popular load flow methods, namely BFS and DLF, were used to validate the proposed load flow method. The load flow results, which show the absolute voltages on the IEEE 33 bus system nodes, are  presented graphically in Fig. 8. Results in Fig. 8 show that the proposed load flow method obtained similar voltage profiles to DLF and BFS on all nodes. Another test was conducted using the IEEE 69 bus system whose line data and load data were taken from [37]. In this study, three types of popular load flow methods, namely CIM, BFS and DLF, were used to validate the proposed load flow method. The load flow results that show the absolute voltages on the IEEE 69 bus system nodes are presented graphically in Fig. 9. Results in Fig. 9 show that the proposed load flow method obtained similar voltage profiles to DLF and BFS on all nodes with some deviations from CIM at the far end nodes. Also, the number of iterations for different  bus systems is presented in Table 5, and the average computational time per iteration after 100 runs is presented in Table 6. From presented results for IEEE 15 bus, 33 bus and 69 bus systems, it is evident that the proposed method is efficient in solving power flow problems as it has been able to obtain similar power flow solutions as BFS and DLF with an added advantage of its   efficiency in dynamic radial networks. Also, the number of iterations for the proposed load flow method is equal to DLF and BFS for all considered cases. Table 6 shows that for all tested power systems, the DLF is the fastest, but it involves complex matrices arithmetic which affects its performance in large system applications. For IEEE 33 bus, the proposed method has outperformed the BFS, but for IEEE 69 bus, the BFS performed better than the proposed method. The results show that the speed performance of the proposed algorithm decreases as the network grows relative to BSF, due to additional computational on the proposed algorithm to alleviate algorithms' dependence on node renumbering. For power loss comparison, all algorithms attained loss of around 211.0581 for IEEE 33 bus system and loss of around 238.6734 for IEEE 69 bus system, and no significant difference was observed

Results for network reconfiguration problems
The study to test the efficiency of the proposed load flow method in handling network reconfiguration problems was conducted using meshed IEEE 15 bus system. In this study, two 15 bus systems with different numbering style were combined via tie switch (Switch C) as seen in Fig. 5. The first bus system, called network 1, was the one that was connected to the substation. The numbering of the first bus system (network 1) was retained, and that for the second bus system (network 2) was done randomly to verify that the independence of the proposed algorithm on node numbering. The connection between the two networks was made using a switch. The line segment with an impedance of 1 + 1j was used as a switch between two connecting nodes. Changing network configuration was achieved by changing the position of the switch. Simulations were then conducted for different network topology with different switch positions. Four switch positions were considered for demonstrations, namely when bus 30 of network 2 connected to bus 2 of network 1, bus 14 of network 2 connected to bus 35 of network 1, bus 5 of network 2 connected to bus 23 of network and bus 13 of network 2 connected to bus 28 of network 1. Power flow results for different network configurations are presented in Fig. 10 and Table 7.

Results for Tanzanian secondary distribution network
The proposed algorithm has also been tested in the secondary distribution network segment that comprises 79 nodes. The network has 143 Residential customers. In this network, the active peak load was 190KW, and the reactive peak load was 142.5 KVar. The distribution transformer has a base voltage of 0.4 k and 0.315 MVA. Node numbering was acquired from TANESCO GIS System. To preserve space, only sample load data and line data for Tanzanian secondary distribution network are presented in Tables 8 and  9. The load flow results for this network are presented in Fig. 11. The presented results show that the proposed load flow method can effectively handle power flow problems in dynamic low-voltage power systems.

Conclusion
In a power system, the distribution network is very dynamic in size due to new customers and new nodes added to the network. In such situations, most conventional load flow methods are not efficient in solving load flow problems since they require complex node renumbering. In this paper, a new load flow method based on the backward/forward sweep concept has been used to solve load flow problems in both medium-and lowvoltage distribution systems. Unlike other studied load flow methods like BFS and DLF, the proposed method does not require any complex renumbering of nodes or matrices  calculations; it only uses linear Kirchhoff 's rules and the parent-children relationship between nodes and depth search mechanisms. The proposed algorithms have been compared with popular load flow methods such as CIM, BFS and DLF. The results show that the proposed method has obtained similar power flow solutions as BFS and DLF, which proves its efficiency in solving power flow problems. Also, the proposed algorithm has shown its efficacy in handling network configuration problems without node renumbering. The proposed algorithm has efficiently performed when tested using data from a practical Tanzania electric power system with arbitrary numbering. Therefore, we propose using the proposed load flow method for medium-and low-voltage radial distribution systems.
The proposed load flow method in this paper compliments the traditional BFS method to alleviate the dependence on node numbering and increase the usability of these methods in power system applications. However, further researches are required to improve the computational time of the proposed algorithm. Further studies on the performance of the proposed algorithms in other radial distribution network are also required.