163
POLITECNICO DI MILANO School of Industrial and Information Engineering Master of Science in Energy Engineering Newton – Krylov – Schwarz Methods for Distributed Power Flow and Related Applications Supervisor: Prof. M. Merlo (Politecnico di Milano) Supervisor: Prof D. J. P. Lahaye (TU Delft) Thesis work of: Stefano Guido Rinaldo Matr. 836498 Andrea Ceresoli Matr. 841368

POLITECNICO DI MILANO · Traditionally power flows are solved by use of Exact-Newton (EN) methods, that means through a Newton non-linear iter-ation coupled with a direct method

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • POLITECNICO DI MILANO

    School of Industrial and Information Engineering

    Master of Science in Energy Engineering

    Newton – Krylov – Schwarz Methods for Distributed Power Flow and Related Applications

    Supervisor: Prof. M. Merlo (Politecnico di Milano) Supervisor: Prof D. J. P. Lahaye (TU Delft)

    Thesis work of:

    Stefano Guido Rinaldo Matr. 836498 Andrea Ceresoli Matr. 841368

  • Stefano Guido Rinaldo, Andrea Ceresoli: Newton – Krylov – Schwarz methodsfor Distributed Power Flow and Related Applications | Master of Science Thesisin Energy Engineering, Politecnico di Milano.c� Copyright April 2018.

    Politecnico di Milano:www.polimi.it

    School of Industrial and Information Engineering:www.ingindinf.polimi.it

    http://www.polimi.ithttp://www.ingindinf.polimi.it

  • Contents

    Introduction 1

    1 Power System Analysis 51.1 Steady State Approximation . . . . . . . . . . . . . . . . . . . . 51.2 Power System Modelling . . . . . . . . . . . . . . . . . . . . . . 6

    1.2.1 Branch model . . . . . . . . . . . . . . . . . . . . . . . . 61.2.2 Bus Model . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.3 Admittance Matrix . . . . . . . . . . . . . . . . . . . . . 101.2.4 Bus Types . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    1.3 Formulation of Power Flow . . . . . . . . . . . . . . . . . . . . . 141.4 DC Approximation . . . . . . . . . . . . . . . . . . . . . . . . . 16

    2 Newton-Krylov-Schwarz for Power Flow 212.1 Literature Review - Numerical Methods for Power Flow Equations 22

    2.1.1 Newton-Raphson . . . . . . . . . . . . . . . . . . . . . . 232.1.2 Newton Power Flow . . . . . . . . . . . . . . . . . . . . 28

    2.2 Linear Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 322.2.2 Direct and Iterative Solvers . . . . . . . . . . . . . . . . 332.2.3 Basic Theory of Iterative Linear Solvers . . . . . . . . . 352.2.4 Domain Decomposition Methods . . . . . . . . . . . . . 432.2.5 Krylov Subspace Methods . . . . . . . . . . . . . . . . . 51

    2.3 Newton-Krylov-Schwarz . . . . . . . . . . . . . . . . . . . . . . 58

    3 Distributed Power Flow 633.1 Distributed Computing, MPI and PETSc . . . . . . . . . . . . . 63

    3.1.1 Introduction to Distributed Computing . . . . . . . . . . 643.1.2 Introduction to MPI . . . . . . . . . . . . . . . . . . . . 66

    iii

  • iv CONTENTS

    3.1.3 Introduction to PETSc . . . . . . . . . . . . . . . . . . . 673.2 AC Power Flow on PETSc . . . . . . . . . . . . . . . . . . . . . 69

    3.2.1 pf.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.2.2 DMNetwork and DMPlex subclasses . . . . . . . . . . . 713.2.3 Modified pf.c . . . . . . . . . . . . . . . . . . . . . . . . 743.2.4 Solving Power Flow . . . . . . . . . . . . . . . . . . . . . 773.2.5 MATPOWER Test Cases . . . . . . . . . . . . . . . . . 793.2.6 Hardware, Software & Cluster Computing . . . . . . . . 81

    4 Possible Applications 874.1 Cooperation between TSO and DSOs . . . . . . . . . . . . . . . 87

    4.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 874.1.2 TSO-DSO Interaction . . . . . . . . . . . . . . . . . . . 884.1.3 Data Management . . . . . . . . . . . . . . . . . . . . . 90

    4.2 Cooperation between TSOs . . . . . . . . . . . . . . . . . . . . 904.3 Distributed Load Flow for a more efficient grid exploitation . . . 91

    5 Numerical Results 955.1 PETSc vs MATPOWER: case9.m . . . . . . . . . . . . . . . . . 965.2 High Voltage European Transmission Grid: case9241pegase.m . 1005.3 Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

    6 Conclusions 109

    A Linear Algebra 113A.1 Vector Spaces, Inner Products, Norms . . . . . . . . . . . . . . 113A.2 Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 115A.3 Non-Linear Equations . . . . . . . . . . . . . . . . . . . . . . . 116A.4 Symmetric Positive Definite Matrices . . . . . . . . . . . . . . . 116A.5 Hermitian Positive Definite Matrices . . . . . . . . . . . . . . . 117A.6 Relevant Inner Products and Norms . . . . . . . . . . . . . . . . 117A.7 Norm Properties for Orthogonal Matrices . . . . . . . . . . . . . 118A.8 Minimal Polynomial of a Matrix . . . . . . . . . . . . . . . . . . 119

    B Numerical Methods 121B.1 Steepest Descent . . . . . . . . . . . . . . . . . . . . . . . . . . 121B.2 GMRES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

  • CONTENTS v

    C Codes 129C.1 Default Options for pf.c . . . . . . . . . . . . . . . . . . . . . . 129C.2 Function PrintOutput . . . . . . . . . . . . . . . . . . . . . . . 129

    D Isolate zones 135

  • List of Figures

    1.1 Lumped-circuit model (⇡ model) of a transmission line betweennodes f (from) and t (to) . . . . . . . . . . . . . . . . . . . . . . 7

    1.2 Load connected to the bus i . . . . . . . . . . . . . . . . . . . . 91.3 Generator connected to the bus i . . . . . . . . . . . . . . . . . 101.4 Sunt Element connected to the bus i . . . . . . . . . . . . . . . 10

    2.1 Newton-Raphson method for one-dimensional case . . . . . . . . 252.2 Overlapping Block-Preconditioning [5] . . . . . . . . . . . . . . 422.3 Alternating Schwarz procedure on two subdomains [6]. . . . . . 442.4 Alternating Schwarz procedure on partitioning onto 3 subdomains

    [5] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.5 L-domain discretized producing a graph [5] . . . . . . . . . . . . 47

    3.1 (a) shared memory system; (b) distributed memory system . . 643.2 Peer-to-peer system. . . . . . . . . . . . . . . . . . . . . . . . . 653.3 PETSc hierarchy [15] . . . . . . . . . . . . . . . . . . . . . . . . 683.4 Example of a tethraedon and its respective DAG rapresentation [23] 723.5 Example of some basic operations present in DMPlex for data

    management [23] . . . . . . . . . . . . . . . . . . . . . . . . . . 733.6 List of cases from [30] . . . . . . . . . . . . . . . . . . . . . . . . 80

    4.1 Example of a National network, from production to final con-sumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    4.2 case118 IEEE from MATPOWER libraries . . . . . . . . . . . . . . 92

    5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965.2 Output for case9.m obtained in MATPOWER . . . . . . . . . . . . 975.3 case9.m decomposition through 4 processors . . . . . . . . . . . 985.4 Output divided per processor of case9.m solved using PETSc . 99

    vii

  • viii LIST OF FIGURES

    5.5 Pan European Grid representation: case9241pegase.m [31] . . . 1005.6 Jacobian matrices for case9241pegase.m . . . . . . . . . . . . . 1015.7 Computational time trend increasing overlap in ASM precondi-

    tioner (using a shell partitioner) . . . . . . . . . . . . . . . . . . 1035.8 Slow-down due to slow interconnection . . . . . . . . . . . . . . 106

  • List of Tables

    3.1 PETSc solvers used for solving power flow equation . . . . . . . 783.2 Partial list of sparse linear solvers present in PETSc . . . . . . . 78

    5.1 Total number of linear iteration . . . . . . . . . . . . . . . . . . 1025.2 Computational time in [s] . . . . . . . . . . . . . . . . . . . . . 1025.3 Computational time [s] . . . . . . . . . . . . . . . . . . . . . . . 1045.4 Computational time [s] . . . . . . . . . . . . . . . . . . . . . . . 105

    ix

  • 1

    Newton-Krylov-Schwarz for Distributed Power

    Flow Modelling and Related Applications

    Abstract— European Electricity grid is one of the mostcomplex grids in the world. The increasing penetration

    of REnewable Energy Sources (RES) sets new challenges

    in grid management, stressing Transmission System Op-

    erators (TSOs) to increase collaboration so as to ensure

    high quality and reliable transportation of electricity. Cross-

    border flows are nearly fixed and only allow limited flex-

    ibility for grid management. Data privacy among TSOs is

    still an issue. The purpose of this work has been to build a

    Distributed Load Flow solver for better cross-border flow

    management while allowing for data privacy. The model

    exploits an Inexact Newton Method, the Newton-Krylov-

    Schwarz method, available in PETSc libraries.

    Index Terms— Cross-Border Flows, Distributed Comput-ing, Inexact Newton Methods, Load Flow Analysis, PETSc,

    Zonal Partitioning.

    I. INTRODUCTION

    Power grids are one amongst the most complex man-madesystems. National grids are managed by grid operators (TSOs)that have to ensure efficient, reliable and safe operation of thegrid. A steady-state assessment of the grid is done solving theload flow problem over the whole grid. Demand for electricitygrows every year, power production from renewable sourcesis intermittent and new lines are continuously built. Thispushes for development of new scalable load-flow solversthat are able to deal with larger systems to solve. On theother hand, integration of Renewable Energy Sources (RES)in the power grids needs development of new portable-toolsto allow flexible grid management. This issue is particularlyimportant for cross-border flows management. Interface flowsare aligned at countries by pre-arranging capacity upon cross-border branches. Flow management at borders would result ina better economic arrangement [1]. A concrete example couldbe the German case: excess infra-day power from wind powerhappen to take place; a cross border-flow market couplingwould lower hourly prices of electricity in that time-framefor the importing country. In the current configuration, eachnational TSO runs their own power flow algorithm with agoal to align the interface flows with pre-defined values. Thisis not efficient in terms of flow management, even thoughprotects TSOs from information sharing. This work focuses onthe development of a first distributed power flow (DPF) trial-tool, thereby testing its perfomances and providing a simplecase-study.Traditionally power flows are solved by use of Exact-Newton(EN) methods, that means through a Newton non-linear iter-ation coupled with a direct method [4]. Direct solvers ensureconvergence and fast computational time for tha majority of

    cases that can be faced in practice, but fails when they scale uptoo much [5]. However it has been recognized that iterativemethods can perform better in term of performances, scala-bility and robustness when the problem size increase [5]- [7].The DPF tool proposed in this work is an Inexact Newton (IN)method, the Newton-Krylov-Schwarz. The implementation isdone using PETSc (Portable, Extensible toolkit for ScientificComputation) [18] that allows an ease deal with parallel codes.The test case is based on an approximation of Europeangrid topololgy, found in MATPOWER libraries [2]- [3] wherecase9241pegase.m [25] was used in order to simulate the highvoltage European electricity grid.

    II. POWER FLOW

    Given the topology, demand and production for electricity,the power flow problem is the problem of finding voltagemagnitudes and voltage angles in each bus of the grid. TSOsrun power flow simulations to check whether the grid canoperate safely. Given a model for each component in the grid(i.e. transformers, phase-shifters, loads, bus, generators andbranches), the nodal admittance matrix Y = G+jB is defined.Power flow problem consists in the mathematical solution ofthe following algebraic set of non-linear equations:

    Pi =NX

    j=1

    ViVj(Gij cos �ij +Bij sin �ij)

    Qi =NX

    j=1

    ViVj(Gij sin �ij �Bij cos �ij)

    (1)

    Where Vi, �i are the voltage magnitude and voltage an-gles respectively, �ij = �i � �j , the Pi, Qi are the netinjections/withdrawals of active power and reactive power, allrespect to bus i. Let define the vector of unknowns x as:

    x =✓

    V�

    ◆(2)

    Since the left hand side of equation 1 is known, the unknownis practically the right hand term. Let then introduce the powermismatch function Fi according to 1:

    Pi � Pi,mism(x) = Fi(x) = 0 (3)

    Extending at all buses, the solution of 1 is interpreted thezero vector of the non-linear function:

    F(x) = 0 (4)

    Andrea Ceresoli

  • 2

    with respect to x.Solution of 4 can be only carried out iteratively. In Power

    Flow context the most common approach is based on Newton-Raphson’s method (NR). Newton’s method approximate thenon-linear problem to a linear problem according to:

    F(x(k+1)) = F(x(k)) +rF(x(k))�x(k) = 0 (5)

    So that the solution vector at k is the zero vector of the localapproximation of F. Since NR is only locally convergent, thenon-linear iteration is usually modified to increase robustnessaccording to:

    x(k+1) = x(k) � �(k)J(x(k))F(x(k)) (6)

    Where �(k) parameters are chosen so to minimize the norm:���J(x(k))�x(k) + F(x(k))

    ���2

    (7)

    To ensure a descent direction for the norm of F at eachiteration. This modification takes the name of line-searchmethod.

    III. LINEAR SOLVERS

    The arising Jacobian’s linear system can be either solvedthrough direct techniques (i.e. in one single step) or through aninner linear iteration procedure. Given a linear system Ay = b,direct methods factorize A (e.g. LU factorization) to get thelinear system into an equivalent-eased form. On the otherhand, iterative linear solvers attempt to find solution through asequence of repeated approximations. Direct methods are bestfor dense mid-size problems (104 unknowns), rather iterativemethods perform well for large sparse problems. In this workan iterative method is used, not really for its capability toperform better at huge problem sizes, but rather becauseit can be coupled efficiently with preconditioned domaindecomposition techniques. This latter aspect will be analyzedfurther on. A great deal of iterative procedures are based ona linear fixed point iteration scheme as:

    x(j+1) = f(x(j)) (8)

    Where f is a linear function giving the convergence prop-erties of the succession and j this time stands for the numberof linear iteration. Newton’s methods based on iterative pro-cedures are called Inexact Newton’s methods (IN). Traditionalsolvers, such as Matpower, are based on direct solution of theJacobian’s linear system. Quite recent research on IN methodshas shown an easier parallelization and scalability [8]. ThoughIN robustness is worse when compared to direct methods, [4]showed improvements in this sense for Newton.

    IN methods summarily solves the power flow problem intwo steps:

    1) Solve (approximately) J(x(k))�x(k) = �F (x(k))

    2) Update x(k+1) = x(k) + �(k)�x(k)

    IN methods are differentiated depending upon the linearsolver used in step 1. In this work we make use of an INmethod based on a Krylov Subspace Projection method (KSP).

    It has been recognized that such methods are particularlysuitable when dealing with large sparse linear systems [9].

    A. Krylov Subspace MethodsKrylov Subspace Methods are considered one amongst

    the most accepted techniques for solving large sparse linearsystems in a broad range of subjects [10]. Given a full rankmatrix A of order n, representing the coefficient matrix ofthe linear system, the idea of KSP is to look for solutioninto a projected space K out of A, where A denotes thespace spanned by the columns of A. The KSP subspace isbuilt starting from the initial residual r0, involving A-matrixmultiplications:

    Km(A, r0) = span {r0, Ar0, A2r0, . . . , Am�1r0} (9)

    Where m

  • 3

    flexible feature of KSP greatly decrease the possibilities forthe iterative procedure to fail.

    A great deal of KSP methods exist in literature. In thecontext of IN methods for large power flow problems GMRES[11] has already shown very good robustness and least solutiontimes [12]- [13]. These justify the use of GMRES for thiswork. GMRES calculates the solution through two steps:

    xm = x0 + Vmymym = argminy kb �Axk2

    (13)

    Where ym minimizes the residual at projection step mover the Krylov Subspace of dimension m. The calculationof ym vector requires the solution of a least-squares problemof dimension (m + 1) x (m), hence computational muchless expensive than the initial one. Yet GMRES can beused standalone, its preconditioned version can even performbetter. In this work the preconditioning also carry out anotherfunction, which will be explained further on.

    B. Preconditioned-GMRESPreconditioning is a broad used technique that can have

    different aims, depending upon application. In the literaturepreconditioned-Krylov have been used to prove the robustnessand fast-time solution for huge problems [14]- [15].Variousformulations of preconditioning are proposed in the literature.In this work it is used the left-preconditioning formulation,based on:

    M�1J�x(k) = �M�1F(x(k)) (14)

    This system is equivalent to the original one and thus yieldthe same solution. The action of preconditioning is to makethe solution of the linear system easier. The preconditioned-GMRES iteration proceeds with the straightforward appli-cation of the GMRES algorithm to the modified system ofeq.14 by solving eq. 13 and eventually updating the solutionaccording to:

    �x(j+1)(k) = �x(j)(k) + V (j)(k)m y(j)(k)m (15)

    In the next section we see the specific preconditioner appliedin this work.

    C. Domain DecompositionDomain decomposition methods (DDM) are known as

    divide-and-conquer techniques. The idea is to split the initialproblems into many sub-problems, much easier to solve. DDMcan be either used directly (as standalone techniques) or aspreconditioners, for solution of linear systems. In this work,the overlapping Additive-Schwarz Method (ASM), a DDMtechnique, is used to decompose the network into separatezones, that only share some nodes with each other. Theidea is showed in fig.1 for a simple two-zones network withtwo overlapping buses. What mathematically ASM does isto divide into blocks the coefficient matrix of the linearsystem and let those blocks overlap through a small numberof elements, which are those that practically are related to

    Fig. 1. Additive Schwarz method with overlapping nodes.

    overlapping buses in the network. Each block is related to azone into the network is splitted. This is formalized into:

    M�1ASM =sX

    p=1

    RTp A�1p Rp (16)

    Where RTp and Rp are respectively the prolongation andrestriction operators. The RTp and Rp operators extract/put thep block of A into the consistent dimension. Each block is thensolved as a separated linear system. Sub-solvers can be definedat will for sub-problems. Since the dimension of such scalesdown, a direct solver based on LU factorization is used. Asto the shared unknowns, each block solve them giving out adifferent solution. The update for these unknowns is relaxedand mediated among the solution provided by neighboringblocks, leading to fast convergence at interface [10].

    Another fundamental feature of ASM is their easy paral-lelization. Each block is independent and thus can be assignedto a different processor. Message passing communications areonly related to shared elements.

    D. Newton-Krylov-SchwarzNewton-Krylov-Schwarz summarily works its way by com-

    bining different techniques together. Newton method allowsto get the non-linear problem into a sequence of linear onesthrough eq.6. An inner iterative procedure is then startedby means of GMRES preconditioned by ASM. The Krylovsolver works as an accelerator for the iterative solution of theJacobian’s linear problem, giving the least number of lineariterations to solve the problem (hence minimizing compu-tational time). Schwarz preconditioning both ease the lineariterations and allows for network decomposition into sub-zones. At each sub-zone correspond a sub-linear problem thatis solved by directly by means of LU factorization. Interfacingnodes are shared, meaning that the related equations are solvedby all the zones sharing them. Hence, the Krylov-Schwarzlinear solver manage the convergence at neighboring zones.The procedure runs until convergence is reached, according toa given tolerance.

    The way the algorithm works suggest the possibility tocarry out distributed calculations on different workstations,which is part of the scope of this work. According toASM, messages about computed variables at interface mustbe exchanged between workstations. Hence, overall time of

  • 4

    computation will be both affected by message communicationsand computations. Which also means, both software andhardware architectures are fundamental to get nice results. Inthe next sections the methodology for distributed power flowis presented.

    IV. DISTRIBUTED POWER FLOW

    The parallel run of codes must be supported by properhardware. Parallel computing simulations are carried out onshared-memory systems to minimize the message passingof information among processors. This is fundamental inparallel computing, since it is all about minimization ofoverall computational time. On the other hand, distributedcomputing is not really about speeding-up computations, ratherused for necessity of performing calculations in differentgeographical locations, keep privacy of information, providefault-tolerance, and others. In these kind of applications themachines are physically separated, meaning that the architec-ture is distributed-memory based. In this work a distributedcomputation of power flow guaranteeing complete privacy ofinformation would be desired, while keeping an acceptabletime of computation.

    In this section the hardware and software tools, assumptionsand test cases used to carry out distributed computing of powerflow equations are presented.

    A. Software - PETScThe Newton-Krylov-Schwarz model for Distributed Power

    Flow can be carried out through the help of PETSc (seeVII-A for more details). PETSc offers a variety of alreadyimplemented powerful libraries for parallel computing as wellas distributed applications. As far as power flow is concerned,PETSc provide an already implemented code for solving ACpower flow equations named pf.c. Briefly, pf.c makesuse of the non-linear solver class SNES to carry out thenon-linear line-search newton iteration (see II) for solutionof eq.4. Then, KSP and PC objects are called by SNES tosolve the Jacobian’s linear system. Different linear and non-linear solvers can be called at run-time as well (includingNewton-Krylov-Schwarz). Parallel run of pf.c can be doneby means of MPI command mpiexec. The second reason forthe use of PETSc in this work, is its DMNetwork class, thatis in place for modelling and management of the topologyand the physics for large-scale networks [20] and actuallyused by pf.c. The abstraction provides several routines andfeatures for network system composition and decomposition.It is possible to decompose a domain into smaller sub-domainsfollowing topological criteria as well as splitting multiphysicssystems into multiple single physics subsystems. In DMNet-work physical elements such as buses, power transmissionlines, generators and loads can be added. Once that thoseinformation are recorded the abstraction builds a mathematicalmodel for the entire system according to the splitting criteriaused.The decomposition is managed by the function DMNet-workDistribute and it follows an edge partitioning amongprocessors. The nodes and all the attached components are

    then split according to the edge ownership.DMNetworkDistribute is a set of routines built on top ofDMPlex subclass (remember the hierarchy of PETSc). In [21]the logic behind mesh management in DMPlex is presented.Connectivity of topological elements are stored as directedacyclic graph (DAG) divided into two layers (branches andbuses). Moreover DMPlex provides other functionalities forgrid partitioning and domain decomposition. There are graphpartitioning methods already implemented in PETSc and oth-ers that are directly connected to external libraries such asChaco [22] or ParMetis [23]. There are six different parti-tioners that allows the user to decompose the problem in themost suitable way for his own application; by default PETScdecomposes the grid in such a way that all the processors ownmore or less the same number of elements. For our applicationcode a shell partitioner was used to make the partition ofnetwork as desired, that means, following a topological criteriathat reflect the ownership of zone by the entities (i.e. TSOs).

    B. Hardware - Cluster Computing

    For our purposes, the distributed computing hardware isjust made up of two machines. The overall performance ofa distributed computing environment is determined by thebottleneck between computational time and communicationsamong machines. So both hardware aspects are considered.The first machine (machine1) is a 8-node 32GB RAMmachine, each node being an Intel Xeon E3-1275 3.50Ghz,running on an Ubuntu 17.10 64-bit Linux distribution andmounting a network card of 1Gbit/s. The second machine(machine2) is a 4-node 4GB RAM machine, each nodebeing an Intel Core i3-3110M 2,4Ghz, running on a LinuxMint 18.3 Sylvia 64-bit distribution and mounting a networkcard of 100Mbit/s. Notice that different Linux distros havebeen used on purpose to guarantee portability of the model.Moreover, a quite low-performing network card is used onclient machine to purposely act as a bottleneck, to consider anot extremely high-performance environment.

    The distributed computing simulation is tested under threedifferent network configurations, all running on two proces-sors: a) A reference case, where distributed computation isdone on 2-nodes on the same machine (the master) b) Runon 1-processor on master and on 1-processor client througha mid-latency WLAN managed by a switch (108 Mbit/s ofideal maximimum data transfer) and c) Same as two, butthis time machines are connected at the switch through a100 Mbit/s cable. Such different network configurations aimat simulating real conditions for distributed power flow com-puting, hence to understand the practical feasibility. Latencyinfluence of communications on the overall times can be seenby comparing a) with b) and c) (tab.I). The codes are compiledby means of MPICH2 compiler MPICC, where MPICH2 isa portable open-source wide-used MPI implementation byArgonne National Laboratory. The configuration of machinescluster have been done through GNU bash built-in commandsof UNIX systems. First, MPIUSER profiles on both machineshave been configured. Then, connection between machines isconfigured through SSH command capabilities.

  • 5

    Yet the cluster computing made up is simple, it allowed todemonstrate the feasibility of the model. In addition, it allowedto test out the influence of message passing between machinesover the whole time of computation.

    C. Test CasesFor the purpose of this work a source of test cases

    as MATPOWER is considered (see VII-B for more in-formation). In particular, the case-study of this work isbased on a modification of the case9241pegase.m. Thecase9241pegase.m approximate the high voltage EUTransmission Network of 24 state members. This case ischaracterized by 9241 buses, 1445 generators, 16049 branchesand 1319 transformers. There are nine voltage levels: 750, 400,380, 330, 220, 154, 150, 120, 110 kV.The case is divided into zones that span from 1 to 24.

    Fig. 2. Pan European Grid representation: case9241pegase.m [25]

    For our case-study, a portion of the European grid was isolated.More details about case-study as well as the rational on whyinteraction between national grids is so important will be givenin the next section.

    V. REAL APPLICATIONS OF DISTRIBUTED POWER FLOW

    Shifting towards smart (i.e. intelligent) grids is now. Integra-tion of Renewable sources, distributed generation, harmoniza-tion of European Electricity market with TSOs operations areall matters of concern for the next generation power grids. Asa consequence, new challenges are faced at European level,involving flexible management of real-time flows, securityof supply, competitive pricing and many others. For thesereasons, an organization of TSOs (ENTSO-E, i.e. EuropeanNetwork Transmission System Operators for Electricity) iscurrently in place to push TSOs to closely collaborate. Al-though this is wanted in principle and would result in a betterresource management, TSOs yet struggle for sharing detailedinformation. For this reason, collaboration is yet subject tokeep privacy of information.

    Among the many issues that the current evolution of powergrids propose, two issues are relevant for this work. The firstone regards cross-border flow management among nations ofEU high-voltage transmission network. At the current stage

    of things, inter-connection capacity is allocated ex-ante andeach TSO make its own power flow simulations taking asnearly-fixed the cross-border flows. The second one, regardsthe harmonization between TSO-DSO operations. Regardingthis latter, see for instance [26], [27]. In this whole con-text, cross-border flow management (rather at national levelor transmission-distribution level) shows up as an importantissue: a real-time planning of resources together with coor-dinated simulations would give the possibility of scheduleresources in a more efficient way.

    According to these purposes, a distributed calculation ofpower flow equations finds its application, as a possibilityto make real-time coordinated simulations, including cross-border buses and while providing privacy of information. Dueto the lack of data regarding distribution grids, this work onlyfocuses on a single case-study on simulation of TSO-TSOinteraction that will be dealt further below.

    A. TSO-TSO Interaction Case-StudyThe case study is structured imagining that two entities

    have to perform a coordinated power flow simulation overtheir managed network. To do such a thing we created anew MATPOWER case extracting zone 4 and zone 5 out ofcase9241pegase.m and assuming the each zone corre-spond to a national transmission network. For simplicity zone4 will be called zone a and zone 5 will be called zone b.Zone a has 682 buses, 1172 branches and 169 generators.Zone b is characterized by 1354 buses, 1992 branches and 260generators. The two zones are connected by only one branch.

    VI. NUMERICAL RESULTS

    According to IV-B three scenarios were simulated:1) Scenario (a): zone a and b are split among two cores of

    machine1;2) Scenario (b): zone a is owned by machine1 and zone

    b is owned by machine2. The workstations are con-nected through a switch (108Mbit/s of ideal maximumdata transfer);

    3) Scenario (c): same as (b) but workstations are connectedthrough a 100 Mbit/s cable.

    The following options were set:• Non linear solver type: -snes type newtonls• Absolute convergence tolerance: -snes atol 1e-8• Relative convergence tolerance: -snes rtol 1e-20• Linear solver type: -ksp type gmres• Sub blocks preconditioner: -sub pc type lu

    while the other options were set as default. GMRES coupledwith Additive Schwarz Preconditioner was used for solvinginner linear system 14. A shell partitioner is used. Resultsin terms of computational time are reported in Table I.Increasing values of overlap does not lead to a decreasingnumber of computational time. That is due to the topologyof the case taken into account. In fact zone a and zone bare connected through one branch. It means that off-diagonalblock elements in Jacobian matrix are only two. The gainingin performances would be greater as the number of off-diagonal elements increases.

  • 6

    shell PartitionerPreconditioner (a) (b) (c)

    Block Jacobi 1.40 8.1 2.95ASM (s=1) 1.40 7.59 2.96ASM (s=2) 1.39 7.42 2.95ASM (s=3) 1.39 7.65 2.95ASM (s=4) 1.40 7.66 2.96ASM (s=5) 1.40 7.71 2.96ASM (s=6) 1.40 7.96 2.98ASM (s=7) 1.40 8.05 3.01

    TABLE I

    COMPUTATIONAL TIME [S]

    This improvement can be seen if the network would besplit not through the connection branch, but somewhere else.As an example the same scenarios were simulated takinginto account a simple partitioner, where sub-regions aredistributed in such a way that machine1 and machine2own more or less the same number of elements. With thispartition the amount of off-block diagonal elements increases.Gaining in performances increasing overlap values is moreevident as shown in Table II.Increasing overlap values leads to a decreasing number of

    simple PartitionerPreconditioner (a) (b) (c)

    Block Jacobi 5.42 285 48.9ASM (s=1) 1.76 41 7.9ASM (s=2) 1.33 11.8 3.21ASM (s=3) 1.29 9.96 3.02ASM (s=4) 1.28 9.73 2.95ASM (s=5) 1.27 9.03 2.87ASM (s=6) 1.27 9.08 2.87ASM (s=7) 1.28 9.16 2.87

    TABLE II

    COMPUTATIONAL TIME [S]

    linear iteration but at the same time an increasing messagepassing of information between processors. In fact for highoverlap values the computational effort for message passingbecomes greater than the advantages due to lowering numberof linear iterations. The optimal overlap value should takeinto account both aspects.As expected the bottleneck is the latency introduced with theinterconnection between workstations. In Figure 3 slowdowndue to slower interconnections is presented. Slowdown valuesare obtained dividing computational time of (b) and (c) bycomputational time of (a) (best scenario).A slowdown of 5.33 for a shell partitioner can be reached

    with a 108 Mbit/s switch interconnector considering aoptimal overlap value of 3 while a 2.11 slowdown value canbe achived with a 100 Mbit/s cable interconnector for anoptimal overlap of 1.

    VII. CONCLUSIONS

    In this section results and conclusion of the thesis willbe summing up. It has been recognized that Newton-Krylov-Schwarz method performs better with respect to Newton

    Fig. 3. Slow-down due to slow interconnection

    coupled with a direct solver when the problem size increases.Moreover iterative solvers allow domain decomposition pro-cedures, such as Schwarz, that are supported from both dis-tributed and parallel architectures. Different interconnectionsbetween workstations were tested as well as different overlapvalues. Effects of message passing and number of lineariteration on computational time should be taken into accountin order to minimize simulations’ efforts. Even in the worstscenario simulation time stay within an order of magnituderange of 101�100 seconds on a portion of the European highvoltage transmission grid. A distributed power flow modelin PETSc can fulfills a complete exploitation of a network,keeping data privacy within different entities and converge ina reasonable time.

    APPENDIX

    A. PETScThe Portable, Extensible Toolkit for Scientific Computation

    (PETSc) is a set of data structures and routines that providesan interface for the implementation of large-scale applicationcodes on parallel and serial architectures. Application codescan be written in Fortran, C, C++, Python and MATLAB. Ac-cording to [19] PETSc is particularly suitable for developingscalable application for next-generation power grids. Advan-tages and possibilities include combined electromechanical-electromagnetic transient simulations, combined transmission-distribution analysis, electromechanical transients simulation,power flow application, power system optimization, electro-magnetic transients simulation.

    Among other things, the message-passing inter-processorcommunication standard protocol, MPI [17], is integrated inPETSc so to minimize the inputs of the user in this sense.MPI package and BLASLAPACK (a package for basic matrix-vector operations) are the foundations of PETSc, onto whichare then built increasingly complex packages. KSP and PCpackages manage the iterative linear solvers (some of them:conjugate gradient [CG], generalized minimal residual method[GMRES], bi-conjugate gradient method [BICG], minimal

  • 7

    residual method [MINRES] and many others) and precon-ditioners (some of them: block-jacobi [BJACOBI], additiveschwarz [ASM], incomplete lu factorization [ILU] and manyothers) respectively. SNES class include rather non-linearsolvers (some of them: line-search newton [NEWTONLS],trust region newton-raphson [NEWTONTR] and many others),that on their known call the sub-classes (i.e. ksp and pc) asneeded. The hierarchy of objects is showed in 4.

    Fig. 4. Organization of PETSc library [18]

    B. MATPOWERMATPOWER is a MATLAB package for Power Flow (AC

    and DC) and Optimal Power Flow Simulations. Among otherthings, MATPOWER is useful both as reference for power flowtools validations and as a source for test cases. These rangefrom very small five or nine buses cases (case5.m,case9.m)to large size cases. Quite recently, from 2015, brand newtest cases have been introduced [24]. The organization of testcases follows their source. Of particular mention are the rtetest cases represent the French very-high voltage grid, whilepegase (from an EU project ”Pan European Grid AdvancedSimulation State Estimation”) test cases gives a snapshot ofthe European high-voltage grid. Of particular importance is thecase9241pegase that approximate the European TransmissionNetwork of 24 of the member states. The cases structure issimple rather alllowing for complex analysis: there are 6 fields,four being of struct class and respectively related to buses,generators, branches and generator costs data. The two leftover fields are just two scalars that refer to MATPOWER caseversion and base complex power in MVA as per unit reference.Notice that differently from this work, MATPOWER uses arobust direct solver (through the backslash command /) ratherthan an iterative solver.

    REFERENCES

    [1] Alex Jacottet, ”Cross-border electricity interconnections for a well-functioning EU Internal Electricity Market”. Oxford Energy Comment,Jun. 2012.

    [2] R. D. Zimmerman, C. E. Murillo-Snchez, and R. J. Thomas,Matpower: Steady- State Operations, Planning and Analysis Tools

    for Power Systems Research and Ed- ucation. Power Systems,IEEE Transactions on, vol. 26, no. 1, pp. 1219, Feb. 2011.http://dx.doi.org/10.1109/TPWRS.2010.2051168

    [3] C. E. Murillo-Snchez, R. D. Zimmerman, C. L. Anderson, andR. J. Thomas, Secure Planning and Operations of Systems withStochastic Sources, Energy Storage and Active Demand. Smart Grid,IEEE Transactions on, vol. 4, no. 4, pp. 22202229, Dec. 2013,http://dx.doi.org/10.1109/TSG.2013.2281001.

    [4] W. F. Tinney and C. E. Hart, Power flow solution by Newtons method.IEEE Trans. Power App. Syst., vol. PAS-86, no. 11, pp. 14491449, Nov.1967.

    [5] R. Idema, D.J.P. Lahaye, C. Vuik, and L. Sluis, ”IEEE Scalable Newton-Krylov Solver for Very Large Power Flow Problems”. IEEE Transactionson power systems, Vol. 27, no. 1, Feb. 2012.

    [6] A. J. Flueck and H. D. Chiang, Solving the nonlinear power flow equa-tions with an inexact Newton method using GMRES. IEEE Trans. PowerSyst., vol. 13, no. 2, pp. 267273, May 1998.

    [7] F. de Len and A. Semlyen, Iterative solvers in the Newton powerflow problem: Preconditioners, inexact solutions and partial Jacobian

    updates. Proc. Inst. Elect. Eng., Gen., Transm., Distrib, vol. 149, no. 4,pp. 479484, Jul. 2002.

    [8] X. Wang, S.G. Ziavras, C Nwankpa, J. Johnson, P. Nagvajara, Parallelsolution of Newtons power flow equations on configurable chips. Int JElectr Power Energ Syst (2006), doi:10.1016/j.ijepes.2006.10.006.

    [9] J. van den Eshof and G. L. G. Sleijpen, Inexact Krylov SubspaceMethods for Linear Systems. SIAM J. Matrix Anal. & Appl., 26(1),125153 (29 pages).

    [10] Y. Saad, Iterative Methods for Sparse Linear Systems. 2nd ed. Philadel-phia, PA: SIAM, 2000.

    [11] Y.Saad and M.H.Schultz. GMRES: A Generalized Minimal Residual Al-gorithm for Solving Nonsymmetric Linear Systems. SIAM J on Scientificand Statistical Computing, 7(3):856-869, 1986

    [12] A. J. Flueck and Hsiao-Dong Chiang, ”Solving the nonlinear powerflow equations with an inexact Newton method using GMRES”. in IEEETransactions on Power Systems, vol. 13, no. 2, pp. 267-273, May 1998.doi: 10.1109/59.667330.

    [13] Y. S. Zhang and H. D. Chiang, ”Fast Newton-FGMRES Solver for Large-Scale Power Flow Study” in IEEE Transactions on Power Systems, vol.25, no. 2, pp. 769-776, May 2010. doi: 10.1109/TPWRS.2009.2036018

    [14] Tsung-Hao Chen and Charlie Chung-Ping Chen. 2001. ”Efficient large-scale power grid analysis based on preconditioned krylov-subspace

    iterative methods”. In Proceedings of the 38th annual Design Automa-tion Conference (DAC ’01). ACM, New York, NY, USA, 559-562.DOI=http://dx.doi.org/10.1145/378239.379023

    [15] J. Zhang, ”Preconditioned Krylov subspace methods for solving nonsym-metric matrices from CFD applications”. Computer Methods in AppliedMechanics and Engineering, Volume 189, Issue 3,2000, Pages 825-840,ISSN 0045-7825, https://doi.org/10.1016/S0045-7825(99)00345-X.

    [16] F. Tu, Student Member, IEEE, and A.J. Flueck, Member, IEEE. ”AMessage-Passing Distributed-Memory Newton-GMRES Parallel Power

    Flow Algorithm”.[17] Message Passing Interface Forum, Document for a standard message-

    passing interface, Tech Rept CS-93-214 (revised), University of Ten-nessee 1994.

    [18] Satish Balay and Shrirang Abhyankar and Mark F. Adams and JedBrown and Peter Brune and Kris Buschelman and Lisandro Dalcinand Victor Eijkhout and William D. Gropp and Dinesh Kaushik andMatthew G. Knepley and Dave A. May and Lois Curfman McInnes andKarl Rupp and Patrick Sanan and Barry F. Smith and Stefano Zampiniand Hong Zhang, PETSc Users Manual, Argonne National Laboratory,2017, ANL-95/11 - Revision 3.8, http://www.mcs.anl.gov/petsc.

    [19] S. Abhyankar, B. Smith, H. Zhang, A. Flueck. ”Using PETSc to DevelopScalable Applications for Next-Generation Power Grid”. 2012.

    [20] Daniel A.Maldonado, Shrirang Abhyankar, Barry Smith, Hong Zhang,”Scalable Multiphysics Network Simulation Using PETSc DMNetwork”,Argonne National Laboratory.

    [21] Michael Lange, Lawrence Mitchell, Matthew G. Knepley and GerardJ. Gorman, ”Efficient mesh management in Firedrake using PETSc-DMPlex”. SIAM Journal on Scientific Computing, 38(5):S143-S155.(2016)

    [22] Bruce Hendrickson and Robert Lelandy, ”The Chaco User’s GuideVersion”, Sandia National Lab oratories Albuquerque, July 1995

    [23] George Karypis and Kirk Schloegel, ”Parmetis: Parallel Graph Parti-tioning and Sparse Matrix Ordering Library Version 4.0”, University

  • 8

    of Minnesota, Department of Computer Science and Engineering, Min-neapolis, MN 55455, March 30 2013

    [24] C. Josz, S. Fliscounakis, J. Maeght, and P. Panciatici,”AC Power FlowData in MATPOWER and QCQP Format: iTesla, RTE Snapshots, and

    PEGASE” http://arxiv.org/abs/1603.01533[25] S. Fliscounakis, P. Panciatici, F. Capitanescu, and L. Wehenkel, ”Con-

    tingency ranking with respect to overloads in very large power

    systems taking into account uncertainty, preventive and corrective

    actions”, Power Systems, IEEE Trans. on, (28)4:4909-4917, 2013.http://dx.doi.org/10.1109/TPWRS.2013.2251015

    [26] ”General Guidelines for reinforcing the cooperation between TSOs andDSOs”, https://:www.entsoe.eu November 11 , 2015

    [27] ”TSO-DSO interaction: An Overview of current interaction betweentransmission and distribution system operators and an assessment of

    their cooperation in Smart Grids”, ISGAN Discussion Paper Annex 6Power T&D Systems, Task 5 September, 2014

  • Introduction

    Preamble

    Power grids have the task to transport electricity from generation sites to con-sumers location at least cost, ensuring high power quality, safety and reliability.This is carried out in two steps through transmission and distribution levels. Attransmission level, correct grid operation is supervised by Transmission SystemOperators (shortly called TSOs). European power grid is an interconnected gridof 24 national grids, each country having at least one grid operator that manageshis portion of the grid. The mathematical tool used by TSOs to operate the gridis called power flow. Input generation and load profiles are fixed by an electricitymarket. The market operator that is in charge to manage the market, has toensure the most efficient economic arrangement (i.e. in terms of equilibriumprice and MWh exchanged). Given the demand for electricity, the production ofpower plants and the topology of the transmission grid, the power flow algorithmcomputes the voltages and phase angles in the transmission grid. As a result,branch currents, power flows and all the relevant electrical quantities neededto check the proper operation of the grid can be calculated. As the grid couldnot operate in the proper way with given inputs, TSOs should apply the leastinvasive corrective actions.

    As different chunks of the European electricity grid are managed by differentoperators, no single entity possess the entire information of the generation,demand and the topology. Therefore, some sort of collaboration is neededat borders of managed regions. Until quite recently, the collaboration amongEuropean Transmission System Operators was limited. The generation profilescheduled by the electricity markets in national Day-Ahead Market (DAM) and

    1

  • 2 Introduction

    Real-Time Market (RTM) was certain and only slightly affected by changes atdelivery time. With the growing integration of Renewable Energy Sources (RES)in European power grids, uncertainties in scheduling correct power flows hasstarted to involve both demand and generation sides. This practically pushesthe European TSOs to a more consistent coordination not only to schedulecorrect power flows at borders, but also to provide more flexibility to TSOs formanagement of their own zones.

  • Introduction 3

    Motivation

    The aims of this work are various, broken down into one of primary im-portance and others, that have an academic relevance, but are meant to bean addition/integration to the main one. The clear and relevant task of thisdissertation was to get a glimpse into development of a distributed power flowmodel, aiming at a power flow coupling at interfacing nodes, yet keeping privacyof information about input datas for parties involved. Other minor tasks consistin testing the iterative method used to carry out the distributed power flow toolin PETSc, validate its performances, make comparison with Power Flow toolavailable in Matpower, analyze the computer architectures needed to performthe main task.

    The distributed power flow model shall guarantee the interfacing flows tobe the result of the algorithm, and not its input. In the current context eachTSOs take as input the flows at borders and run its power flow simulation tocompute complex voltages and check the security of the grid. In this way, eachoperator is independent in making his calculations and protects himself fromsharing information with other operators. This approach is efficient in termsof data protection but does not give flexibility to face real-time conditions. Inthe ideal case of a perfect distributed power flow tool, the only information thatTSOs share with each other is that related to nodes/branches put in common toalign the interfacing flows to a common value.

    To carry out such a thing, PETSc (Portable Extensible Toolkit for ScientificComputation) is used. The Newton-Krylov-Schwarz iterative method will be usedto approach the mathematical solution of power flow equations in a distributedway. Notice that distributed computing only consists in a different solutionapproach: the solution of the distributed system will be the same of the standardpower flow method. In other way around, as for a single entity case, having accessto all the information regarding the network and be the only one performingthe load flow.

  • 4 Introduction

    Organization

    This dissertation is organized as follows:

    In Chapter 1 will be covered the background needed to full understanding ofthe main topic of this thesis which is the power flow equation. Networkmodel will be fully described, AC power flow formulation will be obtainedas well as DC load flow approximation

    In Chapter 2 Numerical methods for solving power flow equation will bepresent. Newton-Raphson procedure will be described, as well as numericalmethod for solving linear system of equations. The differences direct anditerative solvers will be exploited. Krylov subspace method will be outlinedexplaining the reasons behind the choice of such solvers in load flow context.Moreover, preconditioning theory will be analyzed with a particular focuson Additive Schwarz procedure.

    In Chapter 3 will be focused on distributed computation. MPI (MessagePassing Interface) standard will be introduced in distributed simulationcontext. PETSc (Portable Extensible Toolkit for Scientific Computation)will be fully analized as well as families of object present in the programand used in the implementation of a distributed load flow model.

    In Chapter 4 will be considered the main fields of interests of a distributedload flow approach, including DSOs and TSOs coordination.

    In Chapter 5 will be presented the results obtained and their analysis. In thischapter will be explicitly shown how the distributed power flow modelworks out the solution and how it actually allows in practice improvementsin terms of flow management. Following to this chapter, conclusions andexpectations about future work end up this work.

  • Chapter 1

    Power System Analysis

    1.1 Steady State Approximation

    A power system is most of the time in steady state operation or in a statethat could be approximated with sufficient accuracy as steady state. In a powersystem there are always small load changes, switching actions, and other transi-ents occurring so that in a strict mathematical sense most of the variables arevarying with the time. However, these variations are most of the time so smallthat an algebraic static model of the power system is justified. Solving a powerflow problem means to find the voltage profile (magnitude and phase angle) ofeach bus of the network. With these known, all currents, and hence all activeand reactive power flows can be calculated, as well as other relevant quantities.Knowing these quantities helps in the grid management, the generation plantsschedule, the investments in new facilities, the design of the different power sys-tem components (i.e. generators, lines, transformers, shunt elements), etc. It’sworth to remember that power system components have to be designed so theycan withstand stresses during steady state operation without any risk of damages.

    Before going through the formulation of power flow equations, two piece ofinformation are required: a model describing which type of buses are presentand a physical model for the network.

    5

  • 6 Chapter 1. Power System Analysis

    1.2 Power System Modelling

    As mentioned in the introduction chapter, the load flow problem requiresas input a demand and generation profile plus a model for the network (i.e.transmission lines, transformers and phase shifters). The network model determ-ines the relation between branch voltages and currents, which in turn influencesthe solution of the load flow problem. The network model introduced in thisparagraph reflects those of the test cases used to make up our simulations.

    1.2.1 Branch model

    The focus of this work is transmission networks. In this context brancheshave usually length of kilometers. Lumped parameter approach works fine asthe characteristic length of the conductors is much higher than the wavelengthassociated to electricity flow,1.For this purpose, the mathematical model chosen to describe the physical systemis a ⇡-lumped-circuit line model which allow to obtain a simple algebraic relationbetween branch voltages and branch currents. A pi-transmission model ischaracterized by series parameters as well as shunt elements (i.e. in paralleland theoretically connected to the ground). Those parameters are consideredconstant all through the length of the branch and usually found in documentationin terms of per kilometer values. Thus we define:

    rL = series resistance per km per phase (⌦/km)

    xL = series reactance per km per phase (⌦/km)

    bL = shunt susceptance per km per phase (Siemens/km)

    gL = shunt conductance per km per phase (Siemens/km)

    Given the length L of the branch, one can obtain the overall resistance,reactance, susceptance and conductance of the branch:

    1Electricity is substantially a flow of electrons traveling at the speed of light. That flowcan be modeled similarly to how a wave propagates through a medium. In AC domain, inEurope transmission systems, electric state variables oscillate periodically at the speed of 50hz.

    The fundamental wave equation c =f

    �(c=speed of light, f=50hz) gives the wavelength. If

    wavelength is much higher than the average length of branches then the distributed model canbe neglected in favor of a more simpler lumped parameter approach. This is the case whendealing with transmission line models.

  • 1.2. Power System Modelling 7

    if

    N : 1

    N ⇤ if

    j bc2

    ys =1

    rs+jxs

    j bc2vf

    it

    vf

    Nvt

    Figure 1.1: Lumped-circuit model (⇡ model) of a transmission line between nodes f(from) and t (to)

    r = rLL series resistance per phase (⌦)

    x = xLL series reactance per phase (⌦)

    b = bLL shunt susceptance per phase (Siemens)

    g = gLL shunt conductance per phase (Siemens)

    It’s worth to remember that these quantities above share some importantrelations:

    y = g + jb (1.1)

    z =1

    y= r + jx (1.2)

    So that:g =

    r

    r2 + x2(1.3)

    b =x

    r2 + x2(1.4)

    At this stage, it is possible to derive the expression that link together branchcurrents and branch voltages. That will be done at first in a simple case, thatmeans for a simple ⇡-transmission line model where neither transformers andnor phase shifters are included. Then the model will be extended.To find the relation between branch current and branch voltage it is needed

  • 8 Chapter 1. Power System Analysis

    at first to simplify the network. A good way may be to transform the ⇡ loadsarrangement into a Y shape by means of Y �� transformation. By applyingcircuit simplification (series and parallel rules) the relation desired is found:

    "if

    it

    #=

    2

    64ys +

    jbc2

    �ys

    �ys ys + jbc2

    3

    75

    "vf

    vt

    #(1.5)

    Which, in a more compact form becomes:

    "if

    it

    #= ybr

    "vf

    vt

    #(1.6)

    Notice that ybr is called branch admittance matrix of the network.The really important result here is that the simple ⇡-model leads to a complexsymmetric ybr.Let us know extend the branch model by including an ideal phase shiftingtransformer2 so to obtain the model shown in Figure 1.1. Again, by applyingcircuit simplification and skipping the algebra, the following relation is found:

    "if

    it

    #=

    2

    64

    ⇣ys +

    jbc2

    ⌘ 1⌧ 2

    �ys1

    ⌧e�j#shift

    �ys1

    ⌧ej#shiftys + j

    bc2

    3

    75

    "vf

    vt

    #(1.7)

    It may be noticed that the matrix is no more symmetric. Rather, this timethe branch admittance matrix is an Hermitian matrix3.

    1.2.2 Bus Model

    In the previous section a model for branches have been derived. Here, it iswanted to do the same for buses. As both branch model and bus model aredefined, the whole network model is defined as well and power flow equations maybe formulated according to given network model. The bus model involves the

    2The phase shifting is identified by #shift. The tap ratio, which is the ratio between vfand the exiting voltage, is identified by ⌧ .

    3In mathematics, an Hermitian matrix is a complex square matrix that is equal to itsown conjugate transpose. The concept of Hermitian matrices may be thought as the complexextension of symmetric real matrices.

  • 1.2. Power System Modelling 9

    following three objects: shunt elements, loads and generators. Those componentscan be considered attached to a generic node i and they affect the power flowsover the network as they cause injection/withdrawal of complex power.Since power flow analysis are steady-state, loads and generators can only with-draw/inject constant amount of complex power out of the network (Figure 1.2and 1.3). Considering a generic bus i the active and reactive power consumedcan be expressed as

    Sloadi

    = P loadi

    +Qloadi

    (1.8)

    Where P loadi

    is the active power while Qloadi

    is the reactive power. Since bothquantities are kept constant it means that

    P loadi

    = P loadi

    (Vi) (1.9)

    Qloadi

    = Qloadi

    (Vi) (1.10)

    Where Vi is the complex voltage at bus i. It is assumed that loads, generatorsand shunt elements are connected through a common reference bus which iscalled ground or earth. In context of transmission networks loads represent awhole sub-transmission level, namely a piece of distribution network. Generators

    Load

    I loadi

    i (Vi, �i)

    Figure 1.2: Load connected to the bus i

    in load flow analysis are modeled as complex power injected in a bus (Figure1.3). As steady state assumption occurs, generators can keep active power andvoltage magnitude constant at the generator terminals. For a generic node i thecomplex power injected is

    Sgeni

    = P geni

    +Qgeni

    (1.11)

    A shunt element connected to a generic node k, which can be considered a

  • 10 Chapter 1. Power System Analysis

    Generator

    Igeni

    i (Vi, �i)

    Figure 1.3: Generator connected to the bus i

    yshi

    Ishi

    i (Vi, �i)

    Figure 1.4: Sunt Element connected to the bus i

    capacitor or an inductor, is modeled as a fixed impedance to ground at node i(Figure 1.4). The admittance of the shunt element is

    yshi

    = gshi

    + jbshi

    (1.12)

    The relative injected complex power is

    Sshi

    = P shi

    +Qshi

    = IshiVi = �yshi V 2i (1.13)

    The current is positive defined if it is injected into the bus i so that Ishi

    = �yshiVi

    1.2.3 Admittance Matrix

    A network is a graph representation where nodes (or buses) are connectedtogether by branches. In this context, the network is representative of a trans-mission level power grid. Generators and loads are placed at buses injecting and

  • 1.2. Power System Modelling 11

    withdrawing power out of a bus. Power and current flows are established overthe grid as a consequence of the power flows at buses. The nodal admittancematrix Y is a matrix that relate voltages and injected/withdrawal currents ateach node according to Ohm’s law:

    I = YV (1.14)

    Passing from branch quantities to nodal quantities, a bus-branch incidencematrix needs to be defined.Given a network with N buses and L branches, we can define a matrix A ofdimension NxL in which the element:

    Aij = 1 if the branch j exits the node i

    Aij = -1 if the branch j enters the node i

    Aij = 0 if the branch j and the node i are not connected

    The Kirchhoff’s Current Law (KCL) can be written as follow:

    Ai = A

    2

    664

    i1...iL

    3

    775 =

    2

    664

    I1...IN

    3

    775 = I (1.15)

    Where i is the branch currents vector. As well as CKL, Kirchhoff’s Voltage Law(KVL) can be written as follow:

    ATV = AT

    2

    664

    V1...VN

    3

    775 =

    2

    664

    v1...vL

    3

    775 = v (1.16)

    Where v is the branch voltages drop vector.The admittance matrix y is a diagonal matrix of dimension LxL in which thediagonal element yii is the admittance ybr of the i-line. Starting from the Ohm’slaw for the branches

    i = yv = yATV (1.17)

    It is possible to compute the nodal Ohm’s law. The procedure is the following:

    Ai = I = Ayv = AyATV (1.18)

  • 12 Chapter 1. Power System Analysis

    The equation (1.18) can be written as

    I = YV (1.19)

    Where the admittance matrix Y is of the form:

    Y = AyAT (1.20)

    It is a symmetric matrix of dimension NxN . The Yii element represents thecurrent injected in the bus i when the bus i is supplied with a voltage generatorequal to 1 and all other nodes are short-circuited.The off-diagonal element Yij represents the current injected in the bus i whenthe bus j is supplied with a voltage generator equal to 1 and all other buses areshort-circuited.

    1.2.4 Bus Types

    Before formulating the Power flow problem, each bus has to be classified withrespect to its characterizing parameters. Electrical variables in AC operationcan be expressed by means of phasors. Mathematically, phasors are just complexnumbers, that means:4

    I is the current phasor: I = Iej�I

    V is the voltage phasor: V = V ej�V

    S is the complex power phasor: S = Sej#

    It’s worth to keep in mind that, within a network, these quantities can bebranch-related or bus-related quantities. In the following chapters cap letterswill be used to indicate bus variables and lowercase letters for branch variables.A complex number can be visualized in the Gauss plane so that it resemblesa vector defined in a Cartesian plane. Whether polar coordinates or Cartesiancoordinates are used, two scalar quantities are needed to point the positionof the complex number in the Gauss plane. This means an unknown complexvariable always requires the finding of two scalar quantities. In the power flowproblem the current is a dependent variable that can be found once V and S are

    4x denotes that x is a complex number.

  • 1.2. Power System Modelling 13

    given. This means four scalar quantities are relevant when setting up equationsfor solution of the power flow problem:

    V: bus voltage magnitude

    �V : bus voltage angle

    P: bus active power

    Q: bus reactive power

    Buses are classified depending upon which of these four scalar quantities areknown:

    PQ bus where P and Q are known and V and �V are unknown

    PV bus where P and V are known and Q and �V are unknown

    Slack bus where V and �V are known and P and Q are unknown

    The definition of slack bus serves two functions. First, it sets a reference forvoltage angles and voltage magnitudes, so that these quantities are calculatedas deviations from the reference. Such reference is set to zero radians and 1p.u.5. The second function of the slack bus is related to the way the power flowproblem is posed. Let consider the case all the buses are set as PQ and PV.That, in turn, means the net active power is defined at each bus of the network.However, losses are defined only at the time a current flow is defined alongbranches, which means only after the load flow problem is solved. Basically, atleast an active power at a bus must be set free to accommodate differences inthe active power balance due to losses. The slack bus is thus a need to keep theenergy balance verified.

    5 p.u. stands for "per unit". In power systems analysis, a per-unit system is the expressionof system quantities as fractions of reference unit quantity. Unit quantities are derived for eachphysical quantity starting from the definition of two arbitrary base units. It’s usual to take asbase quantities a complex power reference and a voltage reference. Per unit system allows togreatly simplify calculations. Per-unit quantities do not change when they are referred fromone side of a transformer to the other. This can be a pronounced advantage in power systemanalysis where large numbers of transformers may be encountered.

  • 14 Chapter 1. Power System Analysis

    1.3 Formulation of Power Flow

    The formulation of the power flow problem can be written down in differentways. The aim is to find out the set of complex voltages that make the powerbalance equations fulfilled over the grid. Many formulations may be found inliterature. In this work it is chosen a formulation based on power mismatch atbuses.Let us start from the expression of the net complex power at the generic bus i:

    Si = Pi + jQi = ViIi (1.21)

    Introducing Kirchhoff’s Law at bus i and Ohm’s Law the above expressionbecomes

    Si = ViIi = Vi

    NX

    j=1

    YijVj (1.22)

    Where N = NPQ +NPV and NPQ and NPV are respectively the number of PQand PV nodes, and j are all the other nodes.Writing each phasor in its complex form

    Si =NX

    j=1

    ViVjYijej(�i��j�#ij) (1.23)

    Which in its scalar form is

    Pi =NX

    j=1

    ViVjYij cos (�i � �j � #ij) (1.24)

    Qi =NX

    j=1

    ViVjYij sin (�i � �j � #ij) (1.25)

    An alternative but equivalent writing of the power flow equations can bederived starting from 1.22 and taking Yij down in its real and imaginary com-ponents Gij, Bij. That means:

    Si = ViIi = Vi

    NX

    j=1

    YijVj =NX

    j=1

    ViVj(Gij � jBij)(cos �ij + j sin �ij) (1.26)

  • 1.3. Formulation of Power Flow 15

    Which down into active and reactive power components:

    Pi =NX

    j=1

    ViVj(Gij cos �ij +Bij sin �ij) (1.27)

    Qi =NX

    j=1

    ViVj(Gij sin �ij � Bij cos �ij) (1.28)

    The resulting set of power flow equation has to contain the same number ofequations and unknowns to get a unique solution. Considering a system withN buses, where NPV are of type PV , NPQ are of type PQ and one slack bus,to fully specify the state of the system all the voltage magnitude and voltageangles have to be known, i.e. in total 2N quantities. But the voltage magnitudeand voltage angle of the slack bus are given as well as the voltage magnitude ofNPV buses. The unknown are thus the voltage magnitude of the PQ buses andthe voltage angles of the PV and the PQ buses, giving a total of NPV + 2NPQunknown quantities.From the PV buses we get NPV balance equations regarding active powerinjections, and for the PQ buses NPQ equations regarding active and reactivepower injections, for a total of NPV + 2NPQ equations, which are equal tothe number of unknowns, and the necessary condition for solvability has beenfulfilled.Formally it means that we have a set of equations of the form

    F (x) = 0 where x =

    "V

    #=

    2

    66666666664

    V1...

    VPQ

    �1...

    �PQ+PV

    3

    77777777775

    (1.29)

    We are looking for the zeros of a non-linear function. Strictly speaking, eachequation of the form F (x) = 0 is named power mismatch function. Thereforethe system to be solved is

    Pi �NX

    j=1

    |Vi||Vj||Yij| cos (�i � �j � �ij) = 0 (1.30)

  • 16 Chapter 1. Power System Analysis

    Qi �NX

    j=1

    |Vi||Vj||Yij| sin (�i � �j � �ij) = 0 (1.31)

    This system has to be solved by means of numerical methods. One of themis Newton-Rapson, which will be deeply analized in the following chapters.

    1.4 DC Approximation

    AC load flow provides a method for calculating electric state variables (V,�) for each bus of a power grid under steady operation. Once the electric statevariables are known, the power flows and currents through the branches of thegrid can be determined. The mathematical model consists in a set of non linearequations which require a relevant computational effort. As it would be clearerin the next chapter, AC problem is solved numerically by means of diversenumerical techniques, either based on direct methods or on iterative methods.In this work, a new iterative approach (Newton-Krylov-Schwarz) is proposedto be applied to load flow problem. Roughly speaking, the method solves theproblem through a set of non linear iterations which also are iteratively solvedleading to inner linear iterations.An alternative approach is the so called DC load flow. By means of a set ofsimplifying assumptions applied to AC model, the DC load flow is reduced to aset of linear equations. Moreover, the number of unknowns are reduced from2NPQ +NPV to NPQ +NPV . That allows not only to ease the computationalprocess but also consists in a valid tool to analyze inner linear iterations of theAC iterative procedure.

    Here below, the DC formulation is derived applying the following set ofassumptions:

    1. Let us consider the line admittance ys:

    ys =1

    zs=

    1

    rs + jxs=

    1

    rs + jxs

    rs � jxsrs � jxs

    =rs

    r2s+ x2

    s

    + j�xs

    r2s+ x2

    s

    = gs + jbs

    (1.32)

  • 1.4. DC Approximation 17

    Thus:

    gs =rs

    r2s+ x2

    s

    (1.33)

    bs =�xs

    r2s+ x2

    s

    (1.34)

    In the context of transmission networks usually the resistive component ofthe line impedance is significantly less than the reactance. That means:

    gs ⇡ 0 (1.35)

    ys = jbs ⇡ �1

    xs(1.36)

    Moreover, unless considering very long lines (>150km) the effect of chargecapacitances bc can be neglected.

    bc ⇡ 0 (1.37)

    In the end, the branches are considered loss less.

    2. When making power flow simulations the resulting bus voltage magnitudesstay aproximately in the range:

    0.95 < |Vi| < 1.05 (1.38)

    So, it is evident that considering the bus voltage magnitudes equal to 1p.u. does not lead to large errors. So, for each bus i it is considered that:

    Vi ⇡ 1p.u. (1.39)

    Thus, voltage magnitudes are no more unknowns for the power flowproblem, but actually inputs for all the buses.

    3. Voltage angle differences from slack references are small enough that

    sin �V i ⇡ �V i (1.40)

  • 18 Chapter 1. Power System Analysis

    Applying those three assumptions to 1.26 the active power expression be-comes:

    Pi =X

    j

    Bij#ij (1.41)

    For i = 1, ..., N , where N is the number of buses in the network. This can beput into matrix form as follows:

    Pdc = B� (1.42)

    where:

    • Pdc is the vector of net active power bus injections Pi

    • B is the nodal susceptances matrix

    • � is the vector of voltage angles �i

    The expression just obtained is a linear system. Therefore, all the techniquesrelative to linear systems theory can be applied, which will be investigated forload flow specific case in the next chapter. Before assessing the conditions thatallow to get physical solution out of this system, let point out some propertiesof the nodal susceptances B matrix. Exactly as for Y , B can be constructed byinspection:

    Bij = 0 if the branch i does not connect to branch j

    Bij = �bij if the branch i does connect to branch j

    Bii =NX

    j

    bij for diagonal elements

    The B matrix takes the role of coefficient matrix of the linear system justobtained.This is the same form of a matrix associated to a graph Laplacian.Moreover, this is an SPD matrix (see A.4). Specific numerical techniques can beapplied for DC problem, for more details see 2.2.5. Before applying linear solvertechniques for the DC problem, let us check that the linear system obtainedactually admit an unique solution. This can be ensured by having the followingtwo fulfilled:

  • 1.4. DC Approximation 19

    1. The determinant of matrix coefficients is not equal to zero.

    2. The number of equations equal the number of unknowns.

    Concerning the first one, the determinant of matrix B is not equal to zero aseach row and each column are linear independent with each other. Thus far, thecoefficient matrix B obtained is singular. This is because of the presence of alinear dependent equation (i.e. the global power balance). To make it solvable,the corresponding row and column of matrix B must be cut off, exactly as it hasbeen done for the AC case. Again, the node excluded from computation takesthe name of slack node and also works as reference for results (i.e. �ref = 0).Concerning the second condition, let’s check the number of equations: it ispossible to write power balance equations as many are the number of PV andPQ buses. For each of those buses, the unknown is only �V , given all the voltagemagnitudes known out of the second assumption. Hence, an equal number ofunknowns and equations is obtained.

  • Chapter 2

    Newton-Krylov-Schwarz for PowerFlow

    The load flow problem is the problem of power flows computations overbranches during steady-state grid operation. As shown in 1.3, the load flowproblem leads to a set of non linear equations that have to be solved with respectto complex voltages. In the power flow problem, the number of equations equalthe number of unknowns, thus the following analysis will be limited to this case.For very large grids, the load flow problem can reach the order of magnitude ofhundred thousands of unknowns. For those reasons, it will be needed a solverable to deal with the complexity given by non-linearity as well as the complexityarising from the scale of the problem. Additionally, in this work it is wantedto use a distributed computing approach. Those aspects are in some sensedealt separately and then coupled together. The Newton-Raphson method willbe used to break the non linear problem down into a set of sequential linearproblems, namely the Jacobian related linear systems. The Krylov methodsare a class of iterative methods that, whether properly designed, can be fastconverging and thereby attractive for solving very large linear systems. TheSchwarz domain decomposition algorithm will be used as preconditioner forKrylov method, speeding up convergence and allowing for distributed approach.

    The aim of this chapter is to explain and critically analyzing the mathematicaltheory of Newton-Krylov-Schwarz solver. This will allow to get an understandingabout how distributed solution of load flow problem is given and the rationalbehind the choice of such a complex mathematical method. At this scope, eachbuilding frame of Newton-Krylov-Schwarz will be analyzed in the context ofpower flow problem and eventually put together in a final section.

    21

  • 22 Chapter 2. Newton-Krylov-Schwarz for Power Flow

    2.1 Literature Review - Numerical Methods forPower Flow Equations

    This section covers a short review of numerical methods for power flowequations most commonly used.The first historically known method for solution of load flow problem is Gauss-Seidel, introduced in mid 1950s. Gauss-Seidel iteration scheme is based uponresearch of the local fixed point of complex power flow equation (1.22):

    x = F(x) with x =

    "�

    V

    #(2.1)

    Such a method, despite the advantage of low memory requirements, has veryslow convergence and bad robustness, making it useless as the network sizesbecome large. The basic Newton-Raphson scheme (explained in 2.1.1) allows forslightly better results than Gauss-Seidel, but still involve major constrains:

    • Speed : When a large amount of simulations are required (for instance incontingency analysis) the time for simulations become unfeasible;

    • Scalability1: When there is the need of simulation of very large networks(such as the European power grid), the Newton’s method shall be coupledwith a proper linear solver (Inexact Newton’s methods, such as Newton-Krylov);

    • Robustness: Basic NR’s scheme is only locally convergent. Modified NR’sschemes attempt to make it globally convergent.

    For these reasons improved schemes are required. Usually, it is not thoughpossible to obtain all these three desirable features so that solvers that enhanceone (or two) of those have been specifically developed. For parametrized sim-ulations (loads, generators change or contingency analysis) a rough solutionis usually sufficient, so that speed is the main feature desired. The numericalmethods used in that context are Fast-Decoupled Load Flow (FDLF) and DCPower Flow. FDLF method is a variant of the Newton’s Raphson method forload flow that decouples the reactive power mismatch �Q from the active power

    1With this term it is intended the ability of a solver to deal with problems the grow largerin sizes.

  • 2.1. Literature Review - Numerical Methods for Power FlowEquations 23

    mismatch �P through modifications of the Jacobian matrix. The Jacobian’slinear system is simplified in:

    "�P

    �Q

    #=

    "@P

    @�� 0

    0 @Q@�V

    #"��

    �V

    #(2.2)

    That means, correction upon voltage magnitudes (�V) are solved only withrespect to reactive mismatches, correction upon voltage angles (��) are solvedonly with respect to active mismatches.On the other hand, when the scalability is the more relevant property desiredfor the solver, Inexact Newton’s method based on preconditioned-Krylov linearsolvers are best. As shown in subsection 2.2.2 iterative solvers are best whendealing with large sparse linear systems rather than direct methods. For suchmethods, Robustness can be an issue. For this reason it is important to useaugmented Newton’s outer schemes by means of line-search and trust regionsmethods, that increases the robustness of the method.In industrial applications robustness is most important barrier for commercialsuccess of iterative methods. This is the main reason why power flow solverhave been always relied upon direct methods for solution of the Jacobian linearsystem. Direct methods rely on factorization of Jacobian and, by means ofcomplex pivoting techniques, hardly fail in finding a solution. An example ofsuch a method is that one implemented in MATPOWER2. MATPOWER simply makesuse of the MATLAB command "̈for the solution of the Jacobian linear system,which basically consists in a complex implementation of the LU factorizationwith pivoting.

    2.1.1 Newton-Raphson

    Finding the roots of an algebraic nonlinear system of equations is not aneasy task. Exact (i.e. analytical) solutions exist only for special cases. Forall the other cases this is not possible and the solution shall be investigatednumerically. The Newton-Raphson method is a numerical method largely usedfor solving systems of nonlinear equations. Newton-Raphson method is based onan iterative procedure and thus upon successive refinement of an approximatedsolution. This concept can be simply expressed by:

    2MATPOWER is a package of MATLAB Mfiles for solving power flow and optimal powerflow problems.

  • 24 Chapter 2. Newton-Krylov-Schwarz for Power Flow

    x(k+1) = x(k) +�x(k) (2.3)

    This is a really common way to proceed through an iteration procedure.The term �x(k) works as a "corrective" term upon each step k. Hence, theconvergence conditions and speed will be depending upon �x(k).

    Let us start presenting the method for a mono-dimensional case, namelyfinding the roots of a single non linear equation. Then, the method will beexpanded to the multidimensional case (i.e. system of nonlinear equations) andeventually applied to the case of power flow problem.

    Solving Monodimensional Case

    A simple way to express a nonlinear equation can be:

    f(x) = 0 (2.4)

    With f : R ! R. The idea of the numerical scheme is to find iteratively theroot of an easier equation, starting from an approximation of f . From figure2.1 it is shown how the algorithm works its way up to convergence. The fapproximation is done by means of first-order Taylor expansion around a point(x(0)) (the starting guess3) and set to zero to find its root:

    f(x) ⇡ f(x(0)) + f 0(x(0))�x(0) = 0 (2.5)

    The above espression is a linear equation in the �x(0) unknown. Reordering,the expression for �x(0) is obtained:

    �x(0) = � f(x(0))

    f 0(x(0))(2.6)

    The solution is updated through 2.3 and the procedure iterated. Generalizingat iteration k, equation 2.6 becomes:

    �x(k) = � f(x(k))

    f 0(x(k))(2.7)

    3In case an approximated solution of the nonlinear equation is known, it shall be used asfirst guess. This allow for quick convergence to solution.

  • 2.1. Literature Review - Numerical Methods for Power FlowEquations 25

    Figure 2.1: Newton-Raphson method for one-dimensional case

    Notice that, each f 0(x(k)) must not go to zero (i.e. no stationary points haveto be encountered) in order to get to convergence. In practice, the f 0(x(k)) valuesover the iterative procedure not only must not go to zero, but also must be keptfar enough from low values. The reason behind such a thing can be easily seenby looking at figure 2.1: as the derivative approaches zero, the tangent becomesalmost horizontal, meeting the x-axis way far from the searched solution. Inthis eventuality the Newton-Raphson algorithm may slow down a lot and evendiverge.

    Solving Multidimensional Case

    In the multidimensional case, the problem to be solved includes n unknownsand, in general, m equations, including at least one non linear equation. Inthis context, only systems where the number of equations equal the number ofunknowns are considered (i.e. n = m). Each equation, in principle, dependsupon all the n unknowns of the problem. Mathematically it can be written inthe following way:

    8>>>><

    >>>>:

    f1(x1, . . . , xn) = 0

    f2(x1, . . . , xn) = 0

    . . . . . . . . . . . .

    fn(x1, . . . , xn) = 0

  • 26 Chapter 2. Newton-Krylov-Schwarz for Power Flow

    Defining:

    f(x) =

    2

    66664

    f1(x)f2(x)

    ...fn(x)

    3

    77775with x = (x1, . . . , xn)

    As the vector-valued function, a more compact form of the system of equationsis obtained:

    f(x) = 0

    This is the same form of the problem obtained in the mono-dimensional case,hence, the same procedure seen in the previous paragraph can be applied, wherethis time instead of scalar variables, vectors are in place:4

    f(x) =

    2

    66664

    f1(x(k+1))f2(x(k+1))

    ...fn(x(k+1))

    3

    77775⇡

    2

    66664

    f1(x(k)) +rf1(x(k)) ·�x(k) = 0f2(x(k)) +rf2(x(k)) ·�x(k) = 0

    ......

    ...fn(x(k)) +rfn(x(k)) ·�x(k) = 0

    3

    77775(2.8)

    Each equation has to be solved with respect to �x(k), whereas fi(x(k)) andrfi(x(k)) (with i=1,. . . ,n) are evaluated by means of the solution of previousiteration and are actually just coefficients. Thus, equation 2.8 can be easilywritten in the form of a linear system (seeA.2) and eventually expressed througha compact matricial expression (see A.11):

    � J(x(k))�x(k) = f(x(k)) (2.9)

    The coefficient matrix J is called Jacobian matrix and it is the matrix of allfirst order partial derivatives, related to function f(x), namely:

    J =

    2

    66664

    rf1(x)rf2(x)

    ...rfn(x)

    3

    77775=

    2

    66664

    @f1

    @x1

    @f1

    @x2. . . @f1

    @xn@f2

    @x1

    @f2

    @x2

    @f2

    @xn... . . ....

    @fn

    @x1

    @fn

    @x2

    @fn

    @xn

    3

    77775(2.10)

    4The operator < · > here is intended to be the dot-product or Euclidean inner product.For more details see the appendix A.1.

  • 2.1. Literature Review - Numerical Methods for Power FlowEquations 27

    The solution of the linear system in 2.9 is obtained by inverting the coefficientmatrix (in our case the Jacobian matrix). Out of this procedure the correctiveterm �x(k) is found and eventually the solution vector updated according to2.3. Notice that, at each step k the Jacobian matrix has to be invertible (i.e.det(J) 6= 0). Practically, exactly as for the mono-dimensional case, no saddlepoints5 must be encountered.

    �x(k) =

    2

    66664

    �x1

    �x2...

    �xn

    3

    77775

    (k)

    = �

    2

    66664

    @f1

    @x1

    @f1

    @x2. . . @f1

    @xn@f2

    @x1

    @f2

    @x2

    @f2

    @xn... . . ....

    @fn

    @x1

    @fn

    @x2

    @fn

    @xn

    3

    77775

    �1,(k) 2

    66664

    f1(x)f2(x)

    ...fn(x)

    3

    77775

    (k)

    (2.11)

    Notice that this is an important result: the non linear problem has beenturned into a succession k of linear systems. In section 2.2 it will be discussedthe techniques for solving every generated k linear system.

    Convergence and Stopping Criteria

    Newton-Raphson procedure may fail to converge. The use of a proper startingguess is important to ensure convergence. A starting guess x(0) sufficiently closeto solution is usually a sufficient condition to ensure convergence. Moreover,the closer the initial guess is to the exact solution, the faster the convergence.Theoretically, convergence at exact solution is obtained only after an 1 numberof iterations:

    limk!1

    x(k) = x (2.12)

    Practically, the iteration procedure is stopped as the error e(k) upon solutionis lower than a certain tolerance "6

    5For a single variable function, a stationary point is a point x for which: f 0(x) = 0. Thisconcept can be extended for multi-variable functions: given a function f : R ! R a saddlepoint xP = (x1,P , . . . , xn,P ) is a point for which rf(xP ) = 0.

    6The k·k2 operator in the expression below is the Euclidean norm. The subscript ’2’ standsexplicitly for Euclidean. The Euclidean norm of a generic vector x 2 Rn can be expressed bythe following:

    x =

    vuutnX

    i=1

    x2i

    For more information on norm operator see the appendix.

  • 28 Chapter 2. Newton-Krylov-Schwarz for Power Flow

    e(k) =��x � x(k)

    ��2 " (2.13)

    Since the vector x represents the exact solution, the e(k) at generic iteration kis an unknown quantity. Error estimators are used in its place. Two are the mostcommon choices during iteration procedure, the residual and the increment. Inthis work, convergence and divergence criteria based on residual will be adopted.This aspect will be better clarified in chapter 3, where more detailed informationabout solvers will be given.

    2.1.2 Newton Power Flow

    In this section the aim is to apply the obtained generic results about Newton-Raphson procedure in section 2.1.1 for the specific case of Power Flow Equations.Let us recall the power flow equations from section 1.3:

    Pi =NX

    j=1

    ViVj(Gij cos �ij +Bij sin �ij) (2.14)

    Qi =NX

    j=1

    ViVj(Gij sin �ij � Bij cos �ij) (2.15)

    To make use of Newton-Raphson method it is needed to get the 2.14 in theform of F(x) = 0. Here it follows the procedure to carry out this task. Wewant to split the terms depending upon iteration k and terms given as inputdata. The right hand side term is computed at each following iteration, oncethe solution upon � and V is computed. The left hand side term is known, asthe generation and load profiles are given as inputs. The equation 2.14 relatedto bus i can be thus written as:

    (Pi � P (k)i,calc = 0Qi �Q(k)i,calc = 0

    (2.16)

    And hence define the Power Mismatch Function:

  • 2.1. Literature Review - Numerical Methods for Power FlowEquations 29

    F(x) =

    "P � P(x)Q � Q(x)

    #=

    2

    66666666664

    P1 � P1,calc(x)...

    PNPQ+NPV � PNPQ+NPV ,calc(x)Q1 �Q1,calc(x)

    ...QNPQ �QNPQ,calc(x)

    3

    77777777775

    = 0 (2.17)

    Which gives the form of the problem wanted. Notice that this is a formulationbased on power mismatch in polar coordinates which is the most used. Otherformulations, for instance [3], are based on rectangular coordinates for specificpurposes. According to previous section, Newton-Raphson procedure allowsto break down the nonlinear system of equations (represented by F(x) intosuccessive k linear systems:

    � J(x(k))�x(k) = F(x(k)) (2.18)

    Where, for the power flow problem, the unknown vector is defined as:

    x =

    "�

    |V|

    #=

    2

    66666666664

    �1...

    �NPQ+NPV|V1|...

    |VNPQ |

    3

    77777777775

    (2.19)

    Hence, the last term to be defined is the Jacobian matrix related to F(x):

  • 30 Chapter 2. Newton-Krylov-Schwarz for Power Flow

    J = rF(x)

    =

    "@P(x)@�

    @P(x)@V

    @Q(x)@�

    @Q(x)@V