{'fraction_non_alphanumeric': 0.04065157160599981, 'fraction_numerical': 0.015429444922136238, 'mean_word_length': 4.579690831556503, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Rapid Scalable Distributed Power Flow with Open-Source Implementation

This paper introduces a new method for solving the distributed AC power flow (PF) problem by further exploiting the problem formulation. We propose a new variant of the ALADIN algorithm devised specifically for this type of problem. This new variant is characterized by using a reduced modelling method of the distributed AC PF problem, which is reformulated as a zero-residual least-squares problem with consensus constraints. This PF is then solved by a Gauss-Newton based inexact ALADIN algorithm presented in the paper. An open-source implementation of this algorithm, called rapidPF+, is provided. Simulation results, for which the power system's dimension varies from 53 to 10224 buses, show great potential of this combination in the aspects of both the computing.


I. INTRODUCTION
The ongoing implementation of the energy transition leads to heterogeneous energy networks with numerous energy producers, energy consumers, transport, conversion and storage systems. Due to strongly varying renewable-based energy feed-ins and demands of the power system, new challenges arise in the aspect of power flow analysis, including power flow (PF) problems and optimal power flow (OPF) problems.
The conventional PF problem is modeled as a system of nonlinear equations. Usually, it is solved by centralized methods, i.e., Gauss-Seidel or Newton-Raphson (Grainger, 1999). However, the centralized approach requires one central entity, where all generation information and network topology data are collected. Sharing such data is unsatisfactory for system operators. In contrast to the centralized approach, the distributed approach first solves each decoupled sub-problem in its own local agent respectively, and then deals with a coupled problem in a central coordinator, in which only little information is acquired. As a result, the distributed approach not only preserves the information privacy and decision independence, but also decreases the vulnerability due to singlepoint-of failure (Mühlpfordt et al., 2021).
The most well-known distributed algorithms for power flow analysis are Optimality Condition Decomposition (OCD) proposed by Hug-Glanzmann and Andersson (2009), Auxiliary Problem Principle (APP) by Baldick et al. (1999), and Alternating direction method of multipliers (ADMM) by Erseghe (2014). In this context, OCD follows the idea of Lagrangian Relaxation Decomposition. Under certain assumptions, which cannot be guaranteed in general, it can converge to a solution with slight deviation to the optimizer. Different from OCD, The authors acknowledge funding from the German Federal Ministry of Education and Research within the project MOReNet -Modellierung, Optimierung und Regelung von Netzwerken heterogener Energiesysteme mit volatiler erneuerbarer Energieerzeugung.
APP and ADMM introduce Augmented Lagrangian Relaxation techniques to improve convergence behaviors, while ADMM outperforms APP by reducing the communication effort. Although ADMM has drawn significant attention for power flow analysis (Erseghe, 2014;Kim and Baldick, 2000;Guo et al., 2016), it normally takes quite a few iterates to approach a solution with moderate accuracy. Lately, Sun and Sun (2021) proposed a two-level ADMM for solving distributed AC OPF problem with convergence guarantee. Nonetheless, the power flow model is formulated as a Quadratically Constrained Quadratic Program (QCQP) problem at the expense of accuracy, and the algorithm converges to a modest accuracy slowly.
In addition, Houska et al. (2016) proposed the Augmented Lagrangian based Alternating Direction Inexact Newton method (ALADIN) that is devised for non-convex problems with local convergence guarantee. It has found widespread application for power flow analysis of small-and mediumsized power systems (Engelmann et al., 2018;Meyer-Huebner et al., 2019;Du et al., 2019). ALADIN shares the same idea with ADMM-update primal variables in an alternating fashion. However ALADIN requires sensitivities information of sub-problems to build a second-order approximation in the coordinator. When using suitable Hessian approximation, ALADIN can achieve locally quadratic convergence. In our previous work (Mühlpfordt et al., 2021), an open-source MATLAB code for rapid prototyping for distributed power flow (rapidPF) 1 is provided, in which the AC PF problem is reformulated as a zero-residual least-squares problem tailored for the ALADIN to speed up the convergence-all the example cases can converge within half-dozen iterates. Nevertheless, the total computing time is not acceptable for large-scale problems due to the relative large dimension of the decoupled NLP problem and the problematic code efficiency of ALADINα toolbox (Engelmann et al., 2020).
The contribution of the present paper is two-fold. We propose a Gauss-Newton based ALADIN algorithm for solving the zero-residual least-squares problem and a reduced modelling method for distributed AC PF. Based on them, we upgrade the open-source code of rapidPF. The remainder of this paper is organized as follows: Section II formulates the distributed AC PF as a zero-residual least-squares problem. Section III presents both the standard ALADIN and the Gauss-Newton based ALADIN algorithms. The upgrade of rapidPF, called rapidPF+, is described in Section IV. The simulation results are compared and discussed in Section V.

II. PROBLEM FORMULATION
This section introduces the distributed AC PF problem of polar voltage coordination and its zero-residual least-squares formulation. Before further discussion, we first introduce some nomenclature. For a power system, R represents the set of regions, n reg is the number of regions and n conn is the number of all the connecting tie lines between regions. In a specific region , N is the set of all buses, whereas N core and N copy are the set of core and copy buses in this region , respectively.

A. Distributed Power Flow
The conventional AC PF problem seeks a deterministic solution to the steady-state operation of an AC electrical power system by applying numerical analysis techniques (Frank and Rebennack, 2016). Each bus in the system has four variables, i.e., voltage angle θ, voltage magnitude v, active power injection p, and reactive power injection q. Fact 1 Genetically, there are multiple mathematically valid solutions to a power flow problem, but only one solution has physical meaning (Frank and Rebennack, 2016).This results, e.g., from the periodic voltage angle θ, and the respective trigonometric functions.
In order to apply a distributed algorithm, reformulation of the AC PF problem is necessary. In terms of partitioning the power system, we share the components between neighboring regions to ensure physical consistency. As an example, we take the 6-bus system with 2 regions, shown in Figure 1. The coupled system, shown in Figure 1(a), has been partitioned into 2 local regions. To solve the AC PF problem in region R 1 , besides its own buses {1,2,3} called core buses, the complex voltage of bus {4} from neighboring region R 2 is required. Hence, for the sub-problem of region R 1 , we create an auxiliary bus {4} called copy bus, along with its own core bus, to formulate a self-contained AC PF problem.
Then, affine consensus constraints of the connecting tie line are added to ensure consistency of the copy bus with its original core bus in the neighboring region. The consensus constraints of the example case in Figure 1 can be written as In a specific region , the power flow equations be represented as for all core bus i ∈ N core with the angle difference between buses θ ik = θ i − θ k , complex generation s g = p g + jq g , complex load s l = p l + jq l , complex components of the bus admittance matrix entries Y ik = G ik + jB ik . These equations can also be written as residual function where r : R 2n core +2n copy → R n pf with its components r ,m , i.e., the m-th power flow residual in region . Note that the number of power flow equations n pf = 2n core in all local region.
Hence, the distributed AC PF problem can be represented as a system of nonlinear equations and affinely coupled consensus equations as follows

C. Sensitivities
The derivatives of the objective f (χ ) can be expressed as with J (χ ) = ∇r ,1 , ∇r ,2 , · · · , ∇r ,n pf In practice, the first term J (χ ) J (χ ) of the second order derivative dominates the second one Q (χ ), either because the residuals r ,m are close to affine near the solution, i.e., ∇ 2 r ,m are relatively small, or because of small residuals (Nocedal and Wright, 2006). For solving zero-residual leastsquares problem, we hence chose the so-called Gauss-Newton approximation

III. ALGORITHM
This section presents the standard ALADIN algorithm and its new variant for zero-residual least-squares problems. Houska et al. (2016) introduced a novel algorithm, i.e., AL-ADIN, to handle distributed nonlinear programming. ALADIN for problem (5) is outlined in Algorithm 1. The algorithm has two main steps, i.e., a decoupled step (i) and a consensus step (iii). Pursuing the idea of augmented Lagrangian, the local problem is formulated as (10) in step (i), where ρ is the penalty parameter and Σ is the positive definite scaling matrix for the region . Based on the result from local NLPs (10), the ALADIN algorithm terminates if both the primal and the dual residuals are smaller than tolerance

A. Standard ALADIN
Compared with a simple averaging step of ADMM in the Algorithm 1 ALADIN(standard) Initialization: λ, ρ, µ, z , Σ 0 for all ∈ R, Repeat: (i) Solve decoupled NLPs and compute local sensitivities for all ∈ R g = ∇f (x ) and H ≈ ∇ 2 f (x ) (ii) Check termination condition (9) (iii) Solve coupled QP min ∆x,s where Hessian H = diag{H } ∈R and gradient g with components g (iv) Update primal and dual variables with full-step coordinator, ALADIN based on curvature information (11) builds a coupled QP (12) to coordinate the results of the decoupled step from all regions. Additionally, a slack variable s is introduced in the consensus step to ensure feasibility of the coupled QP. Consequently, ALADIN achieves fast and guaranteed convergence. A detailed proof of local convergence can be found in Houska et al. (2016).

B. Gauss-Newton based inexact ALADIN
Based on the framework of standard ALADIN, we propose a tailored version specific for solving zeros-residual leastsquares problem in the present paper, see Algorithm 2. Since optimal values of Lagrangian multipliers are equal to zero λ * = 0 according to Proposition 1, the Lagrangian terms in (10)(12) can be neglected by fixing dual iterates λ = 0 at the cost of convergence rate. In this way, both coupled and decoupled steps can be viewed as adding a residual to the original problems respectively, and can be solved by equivalent linear systems efficiently.

Algorithm 2 inexact ALADIN(Gauss-Newton)
Initialization: λ, ρ, µ, z , Σ 0 for all ∈ R, Repeat: (i) Solve decoupled linear systems and update primal variables x with Gauss-Newton step p = x − z , as well as compute local sensitivities for all ∈ R (ii) Check termination condition (9) (iii) Solve the linear system of coupled QP where Hessian H = diag{H } ∈R and gradient g with components g (iv) Update primal variables with full step For the decoupled step (i), the objective function (10) can be approximated by a quadratic model by applying the Gauss-Newton method with Gauss-Newton step p = x − z , Jacobian matrix J z = J (z ) and residual vector r z = r (z ) at the initial point z in every iterate. Accordingly, the decoupled NLP (10) is solved by a linear system (14), where x is an inexact solution to this problem. For the coupled step (iii), the objective function can be rewritten as In the corresponding linear system (16), ∆x in coupled step (iii) is locally equivalent to a standard Gauss-Newton step of the original coupled problem (5), where the slack variable s = A (x + ∆x) − b can be viewed as an additional weighted residual.
In the present paper, we focus on the local convergence due to Fact 1 and good initial guess provided by MATPOWER. The local convergence indicates that the starting point and the iterates are all located in a small neighborhood of the optimizer, within which the solution has physical meaning. The convex set Ω concludes all the points in the bounded neighborhood. Besides, the objective f of the original coupled problem (5) is second order continuously differentiable according to Section II-C, and ∇ 2 f (x) is bounded for all x ∈ Ω. Then, there exists a constant L > 0 ∈ Ω for some t ∈ (0, 1). Hence, the function f is twice Lipschitz-continuously differentiable in the neighborhood Ω.
Before discussing further about the convergence property, we introduce a regularity and some nomenclature first: A KKT point is called regular if linear independence constraint qualification (LICQ), strict complementarity conditions (SCC) and second order sufficient condition (SOSC) are satisfied. For the analysis of local decoupled step (i), we introducex as the exact solution andx as the inexact solution of the decoupled NLPs (10), whereas x * = z * is the primal optimizer of the original coupled problem (5).
Next, let's turn to the local convergence property of Algorithm 2.
Theorem 1 Let the minimizer (x * = z * , λ * = 0) be a regular KKT point of problem (5), let the initial guess located in the small neighborhood of the optimizer Ω, and let µ sufficient large such that 1 µ ≤ O( x − z * ), then the iteratesx of Algorithm 2 converge quadratically to a local solution.
Proof of Theorem 1 can be established by three steps, following the analysis in Appendix by Engelmann et al. (2018). First, due to the fact that the local inexact solutionx is obtained by Gauss-Newton method, thex is a linear contraction to the exact solutionx, i.e., there exists a constant η 1 > 0 such that Second, from Lemma 3 of Houska et al. (2016), we have This differs from standard ALADIN by a fixed dual variable λ = 0. Third, because the coupled step of Algorithm 2 is a standard Gauss-Newton step of the original coupled problem (5), as well as the Lipschitz continuity of f and sufficient large µ such that 1 µ ≤ O( x − z * ), we obtain the following inequality according to the convergence analysis of the standard Gauss-Newton method (Nocedal and Wright, 2006, Section 10.3) (5), all the optimal residuals are equal to zero, then we have Q (z * ) = 0 for all ∈ R. As a result, The statement of Theorem 1 follows by combining of(21), (22) and (24).

IV. OPEN-SOURCE IMPLEMENTATION
Based on the Algorithm 2, we improve the existing toolkit rapidPF. To this end, in this section, we introduce a reduced modelling method and describe the structural upgrade of rapidPF+ compared with rapidPF.
A. Reduced modelling method Table I summarizes the known and unknown variables of a AC PF problem according to different bus-types in the power system. In the original distributed AC PF model proposed by Mühlpfordt et al. (2021), the known variables are constrained by bus specification, which is added as residuals in least-squares formulation. This results in the unnecessary growth of the problem dimension and slows down the run time. To overcome the issue, the present paper distinguishes the known and the unknown variables, and uses a so-called reduced modelling method to reduce the dimension of the distributed AC PF problem. For a specific region ∈ N reg , the state consists of variables from both core buses and copy buses. The state of the core bus i is defined according to its own bus-type: whereas the state of the copy bus j contains voltage angle and magnitude ζ copy The state of this specific region χ ∈ R 2n core +2n copy is composed by all the core and the copy buses in the regions.
Typically, n core dominates n copy in a sub-system of a power grid. Therefore, the dimension by using the reduced modelling method, i.e., 2n core + 2n copy , is almost reduced by half, compared with the original model-4n core + 2n copyproposed by Mühlpfordt et al. (2021).

B. rapidPF vs. rapidPF+
As shown in Figure 2, the rapidPF builds a distributed AC PF problem based on MATPOWER case files and solves it by interfacing with an external ALADIN-α toolbox. Nevertheless, due to the problematic code efficiency of the ALADIN-α toolbox, computing for a large-scale problem is not acceptablefor a 4662-Bus system, it takes 90.1 seconds to converge by  Fig. 2. Flow charts for solving distributed AC PF by the rapidPF and the rapidPF+ toolbox using fmincon, whereas the initial time by using CasADi is intolerant.
In contrast, rapidPF+ doesn't rely on the external ALADIN toolbox. The user can switch between two models and two ALADIN algorithms. Comparison of these combinations is carried out in the following section.

V. SIMULATION RESULTS
In this section, we illustrate the performance of several combinations of the two distributed AC PF models and the two variants of ALADIN algorithm. We use the suggested combination by Mühlpfordt et al. (2021) as a benchmark, i.e., the original distributed power flow model with standard AL-ADIN (Algorithm 1). Towards practical implementation, several test cases by Mühlpfordt et al. (2021) are also modifiedmultiple connecting tie lines are added and the graph of regions is transferred from radial to meshed topology. Besides, we introduce a 10224-bus test case to exhibit the performance for a large-scale implementation.
The framework 2 is built on MATLAB-R2021a and the case studies are carried out on a standard desktop computer with Intel ® i5-6600K CPU @ 3.50GHz and 16.0 GB installed RAM. The CasADi toolbox (Andersson et al., 2019) is used in MATLAB, and IPOPT (Wächter and Biegler, 2006) is used as the solver for decoupled NLPs. To solve the linear system, a conjugate-gradient technique (Nocedal and Wright, 2006, Algorithm 7.2) is implemented in order to avoid matrixmatrix multiplications, i.e., J J.
Following Engelmann et al. (2018), the quantities in the following are used to illustrate the convergence behavior 1) The deviation of optimization variables from the optimal value x − x * ∞ .
2) The primal residual, i.e., the violation of consensus is provided by the centralized approach.

A. Comparison of different combinations
For fair comparison, the primal variables x are initialized with the initial guess provided by MATPOWER (Zimmerman et al., 2010), while the dual variable λ is set to zero. The tuning parameters ρ and µ of the ALADIN algorithm are set 2 The code is available on https://github.com/xinliang-dai/rapidPF to 10 2 , whereas the tolerance is set to 10 −8 . RUNPF from MATPOWER is used to represent a centralized approach.
Table III displays the computing time of different combinations. The computing time of both algorithms also benefit from the dimensional reduction-compared with the original distributed AC PF model, the dimension by applying reduced modelling method is decreased almost by half.
What else stands out in this table is the fast computing time of the Gauss-Newton based inexact ALADIN (Algorithm 2). In contrast to solving NLP in a decoupled step of Algorithm 1, Algorithm 2 solves the equivalent linear systems of a quadratic approximation in both decoupled and coupled steps by exploiting the structure of the problem formulation. Consequently, the computation effort has been reduced dramatically. As a result, the computing time of solving the reduced distributed PF model by using Algorithm 2 is in the same order of magnitude with the centralized approach, and can be further improved by implementing parallel computing.

B. Convergence behavior of 10224-Bus system
Next, we study the convergence behavior of the largest test case, i.e., 10224-bus system. The test case is composed of six 1354-bus MATPOWER test cases, and seven 300-bus MATPOWER test cases. Its connection graph of regions are shown in Figure 3. To solve the AC PF problem of the 10224-Bus system, we use the reduced modelling method with the Gauss-Newton based inexact ALADIN algorithm. Figure 4 shows the four quantities in every iterate, i.e., the deviation of current variables from the optimal value, the primal residual, the dual residual and the solution gap. Within half a dozen iterates, the new ALADIN algorithm converges to the optimal solution with high accuracy, as presented in Table II. At the same time, a locally quadratic convergence rate can be observed from  · ∞ 1.7 × 10 −8 7.5 × 10 −9 5.7 × 10 −7 3.2 × 10 −6

VI. CONCLUSIONS
The present paper investigates the application of a new tailored version of ALADIN   Besides, no external NLP solver is needed. In general, this new combination is of great potential for handling large-scale systems, and turns out to be as efficient as a centralized approach. For future work, efforts toward parallel computing will be made to reduce the computing time even further.