Purpose -The purpose of this work is that of providing the guidelines of an efficient implementation of power flow computations using the MATLAB computation environment. Design/methodology/approach -The goal of obtaining high efficiency from MATLAB programs often proves elusive unless special care is taken in exploiting the vectorising capability of MATLAB programming. In the present paper the implementation of Newton-Raphson power flow in MATLAB is examined with particular emphasis on the way of obtaining a vectorisable code capable of achieving effective numerical performance by exploiting its formulation in terms of complex variables. Findings -Tests on actual networks with up to 1,300 buses are presented. They show that the complex power flow is as efficient as the best implementations of the Newton Raphson power flow using real variables, as long as the operations involved are reordered with the aim of exploiting the vectorisation capabilities of the MATLAB environment. Originality/value -It is shown that improved numerical efficiency in the MATLAB can be obtained through its formulation in terms of complex variables. The complex Newton-Raphson load flow, not very common in practical uses, is shown to have many desirable qualities from the point of view of MATLAB programming and is presented in detail.
IntroductionSince its early versions, MATLAB has provided scientists and technicians with a very powerful language for numerical computing and data presentation. Its basic capabilities in matrix algebra have been continuously extended with the addition of specialized toolboxes covering many areas of scientific computing, also including control systems and power system analysis.The addition of an efficient support for sparse matrix manipulation makes it possible to design MATLAB programs (M-files) for such specialized computations as power flow, state estimation and power system dynamics, cutting down the time for programming and debugging the code. Furthermore, MATLAB not only appeared as a useful tool for testing methods and ideas in view of an implementation using other programming languages, but it could be adopted as a platform for software applications development.Obtaining high performance from MATLAB programs, however, is not always straightforward. The key-point of efficient programming lies in making systematic use of the vector syntax of the MATLAB language (MathWorks, 2010); all numerical operations are more efficiently executed if they are expressed in the form of matrix or vector operations with speed-ups exceeding one order of magnitude with respect to non-vector code. As a result, the potential of MATLAB programming mostly depends on the programmer's ability of re-thinking solution algorithms originally designed for scalar efficiency, in a vector-oriented mode (MathWorks, 2010;Alvarado, 1999).