Wirtinger's Calculus for the Load Flow in Power Distribution Grids
Alejandro Garces

TL;DR
This paper introduces a novel load-flow method for power distribution grids using Wirtinger's Calculus, enabling efficient complex domain computations and providing a tutorial for implementation in modern scripting languages.
Contribution
It applies Wirtinger's Calculus to power system load-flow analysis, offering a new, compact, and efficient computational approach not previously utilized in this context.
Findings
Effective load-flow algorithm using Wirtinger's derivatives
Implementation guidance for Matlab/Octave
Simulation results demonstrating method viability
Abstract
This short paper presents a Wirtinger's-Calculus based load-flow methodology for power distribution grids. This approach allows to obtain an algorithm which works directly on the complex domain maintaining some useful symmetries and a compact representation. The paper aims to introduce Wirtinger's Calculus as a suitable tool for power systems analysis and simulations; therefore, it is presented as a tutorial, playing especial attention on the implementation in modern scrip languages such as Matlab/Octave, which allow easy representation of complex-arrays with fast calculations. A Newton's-based method is proposed in which the Jacobian is replaced by Wirtinger's derivatives obtaining a compact representation. Simulation results complement the analysis. Despite being a mature theory, Wirtinger's-Calculus has not been applied before in this type of problems.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Wirtinger’s Calculus for the Load Flow in Power Distribution Grids
Alejandro Garcés
ORCiD:0000-0001-6496-0594
Universidad Tecnologica de Pereira,
post code 660003,
Abstract
This short paper presents a Wirtinger’s-Calculus based load-flow methodology for power distribution grids. This approach allows to obtain an algorithm which works directly on the complex domain maintaining some useful symmetries and a compact representation. The paper aims to introduce Wirtinger’s Calculus as a suitable tool for power systems analysis and simulations; therefore, it is presented as a tutorial, playing especial attention on the implementation in modern scrip languages such as Matlab/Octave, which allow easy representation of complex-arrays with fast calculations. A Newton’s-based method is proposed in which the Jacobian is replaced by Wirtinger’s derivatives obtaining a compact representation. Simulation results complement the analysis. Despite being a mature theory, Wirtinger’s-Calculus has not been applied before in this type of problems.
1 Introduction
Load-flow calculations are indispensable in power systems operation, planning and control. Early algorithms were based on the Newton’s and Gauss methods, easily implementable in digital computers. These methods were modified in order to obtain fast and efficient algorithms such as the decoupled and fast-decoupled load-flow [EI-Hawary(1995)]. However, these approximations showed to be inadequate in power distribution grids for which new methodologies were developed such as the backward/forward sweep load flow[Cespedes(1990)], perhaps the most popular algorithm among them.
Despite being a classical research area, there is a renewed interest amongst the scientific community, in studding new aspects of the load-flow problem in power distribution grids. Recent investigations have demonstrated the possibility to obtain linear and convex approximations to the power-flow in distribution grids with low demand. Indeed, at least three linear approximations in power distribution grids have been recently suggested standing out the one proposed by Bolognani [Bolognani and Zampieri(2015)] and Marti [Marti et al.(2013)Marti, Ahmadi, and Bashualdo] as well as the methodology proposed on [Garces(2015)] which is based on a Taylor expansion on the complex plane. Convex analysis for the load-flow has been also an active research area in which semi-definite and second order cone optimization are the most prominent examples [Low(2014)]. Formal analysis about the existence of the solution and convergence of the numerical methods have been also presented; in this aspect, we can highlight the works proposed in [Miu and Chiang(2000)][Sur and Sarkar(2017)][Chiang and Baran(1990)].
On the other hand, most of the methodologies in ac power distribution grids are based in real analysis despite being a problem on a complex domain . In that conventional approach, the power-flow equations are divided into real and imaginary part obtaining a model on a Euclidean domain with a double dimensionality , and losing algebraic properties of the complex domain. Complex analysis would be of course, the most natural approach for power-flow problems; however, the power-flow equations are non-analytic functions and hence we cannot obtain a direct Taylor series expansion on the complex domain. In this context Wirtinger’s calculus could provide an alternative formulation.
A general theory for non-analytical complex functions comes back to the initial works of Poincaré further developed by Wilhelm Wirtinger[Wirtinger(1927)]. This theory deals with non-analytical functions in the complex domain by defining new operators named Wirtinger’s derivatives. These operators do not fulfill all the properties of conventional complex derivative (for example the Cauchy-Riemann conditions); This is perhaps the main reason why Wirtinger’s calculus is few known even in the mathematical community. However, Wirtinger’s calculus could present advantages for power systems analysis at both, high-power and power distribution level. It could be also important for micro-grids operation. In addition, Wirtinger’s calculus can simplify the implementation of load-flow algorithms in modern scripting languages such as Matlab/Octave and Python. Recent applications of Wirtinger’s calculus outside power systems researches include gradient descent algorithms for machine learning [Amin et al.(2011)Amin, Amin, Al-Nuaimi, and Murase] and signal processing algorithms [Bouboulis(2010)]. However, to the best knowledge of the authors, it has not been applied in computer simulations for power systems.
This paper presents a Newton’s method for the load-flow in power distribution grids using a Wirtinger’s calculus formulation. The proposed formulation is clearly more compact than the conventional approach and can be easily implemented in Matlab/Octave. The paper is presented in a tutorial way and therefore it include some scripts in Matlab/Octave which demonstrate how easy is the implementation of a Wirtinger’s calculus-based formulation of the load flow. The rest of the paper is organized as follows: Section II presents a brief introduction to complex analysis and Wirtinger’s calculus. The proposed load-flow is presented in Section III followed by numerical simulation in Section IV. Finally, some conclusions (Section V) and relevant references.
2 Mathematical preliminaries
2.1 brief introduction to complex analysis
Among this paper we represent the complex imaginary unit as . Therefore, a complex number can be represented as where is the real part and the imaginary part. A function is a complex-analytical function, also known as complex differentiable or holomorphic function, if has a derivative at each point of and if is single valued.
The complex derivative can be intuitively defined as
[TABLE]
However, an intermediate problem appears when the function is defined on the complex numbers since there are infinitely many directions in which it is possible to achieve the limit as shown in Fig 1. This is similar to the concept of semi-differentiability in real function where we can obtain a right-derivative different from the left-derivative for discontinuous functions. Therefore, an analytical complex function has the same derivative regardless the direction in which the limit is obtained.
Let us define as the complex conjugate of , then a necessary condition for a complex function to be analytic is that
[TABLE]
In other word, the function must depend only on and not on its conjugate . This condition can be represented in real and imaginary part as follows:
[TABLE]
These are known as the Cauchy-Riemann equations, a set of strong conditions that generates very interesting results on the complex analysis with applications in all sciences including power system engineering [Flanigan(2010)]. Consequently, the study of complex-analytical function is a mayor area of interest in applied mathematics. However, many practical problems are non-analytical. In those cases, the conventional approach is to split the problem into real and imaginary part, and use real analysis.
2.2 Wirtinger’s calculus
Definition 1** (wirtinger’s derivatives).**
Given a complex function defined in real and imaginary parts as with , we define the Wirtinger’s derivative, the conjugate Wirtinger’s derivative and the total Wirtinger differential as follows
[TABLE]
Remark 1**.**
When is complex differentiable then its Wirtinger’s derivative degenerates to the standard complex derivative, while its conjugate Wirtinger’s derivative derivative vanishes[Bouboulis(2010)].
Given a complex function with , we define the Wirtinger’s derivative and the conjugate Wirtinger’s derivative as follows
[TABLE]
When is complex differentiable then its Wirtinger’s derivative degenerates to the standard complex derivative, while its conjugate Wirtinger’s derivative derivative vanishes[Bouboulis(2010)], that is:
[TABLE]
In general, we are interested in non-analytic functions and therefore does not satisfied the Cauchy-Riemann equations. However, we can define easily the following Wirtinger differential
[TABLE]
Each operator behaves similarly as a partial derivative taking into consideration that depends on both and its conjugate . Therefore, we can apply common rules for differentiation concerning the sum and the product of functions as follows
[TABLE]
Wirtinger differential also allows to use the chain rule. In addition, it holds that
[TABLE]
for the sake of clarity, let us see a simple example
[TABLE]
It is important to remember that is a Wirtinger differential and not the conventional complex derivative. In fact, is non-analytical on the complex domain. The same function can be represented as a real function given by which is analytical in the real domain. This is the trick usually applied in load-flow calculations. The real diferential of is the gradient given by , that is
[TABLE]
Notice that, in this case, the Wirtinger differential is exactly equal to the gradient of when the former is spitted in real and imaginary part.
3 Load-flow in power distribution grids
Let us consider a power distribution grid represented by its admitance matriz . The slack node is marked with a subscript [math] and the remaining nodes . All vectors and matrices are represented in uppercase letters whereas their components are represented by lowercase letter. Voltage in the slack node is known, hence our objective is to obtain the nodal voltages with .
In the following, all variables and equations are represented in the complex domain and all derivatives are Wirtinger’s derivatives. For the sake of simplicity we assume initially that all loads admit a constant power model, after that we generalize for the case of ZIP loads.
3.1 Load-flow with constant power models
Let us define and as the nodal power in each node , hence, the nodal power is given by
[TABLE]
where
[TABLE]
we use instead of for the sake of simplicity. Notice that the function is non-analytic since it depends on both, and . In order to obtain a Newton’s step we require to calculate a the following derivatives and conjugate derivatives:
[TABLE]
Therefore we can obtain the differential as
[TABLE]
After simple algebraic manipulations we obtain the following matrix representation
[TABLE]
This is clearly a linear function that can be easily solved generating the Newton’s iteration described in Algorithm 1.
The main advantage of Wirtinger’s calculus is that load flow equations can be obtained in a straightforward manner without separate in real and imaginary parts, resulting in a compact representation of the Jacobian given by (30) which remains in the complex domain. Distributed generation can be included in the model by changing the sign of .
3.2 Solution of the algebraic system
The most time consuming step in Algorithm 1 is the solution of the linear-complex algebraic system (30). In this aspect, it is possible to apply different techniques in order to obtain a fast algorithm. First, notice that (otherwise the grid is in short-circuit), therefore, we can pre-multiply (30) by obtaining the following equation
[TABLE]
where and represent element-wise divisions. Let us define and then we can further simplify Equation (30)
[TABLE]
Notice that and is a vector and a diagonal matrix respectively. Thus, they can be obtained at low computational cost. By a simple conjugation we can obtain a double-size linear system as follows
[TABLE]
There are many well known techniques for solving systems of this type, specially taking into account that is highly disperse and can be easily factorized using an LDU technique.
3.3 Load-flow with ZIP models
Let us consider now the case of ZIP models. In this case, the nodal power is given by
[TABLE]
where the real value indicates the type of model: [math] for constant power, for constant current and for constant impedance. Define now a function as
[TABLE]
with its corresponding Wirtinger derivatives
[TABLE]
hence, we obtain the following differential
[TABLE]
where is the Hadamard product (i.e the element-wise multiplication in Matlab). The Newton’s iteration can be represented by Algorithm 2.
Notice that Eqs (30) and (40) are compact and elegant representations of the power flow which simplify analysis and calculations. The advantages in term of simplicity are evident, however the numerical performance of the algorithm depends highly on the solution of the complex conjugate linear system. As in the previous case, we can pre-multiply by obtaining the following expresion
[TABLE]
with
[TABLE]
Again, each of these matrices can be calculated at low computational effort with the following linear representation
[TABLE]
Other representations of this linear system are possible. More research is required in this area.
4 Numerical results
The proposed algorithms were evaluated on the IEEE 69-nodes test system [Savier and Das(2007)] depicted in Fig 2. This test system was designed for network reconfiguration and therefore it has some tie lines. Initially, the load-flow was calculated considering all nodes as constant power loads and tie lines open. Algorithm 1 converged in only 3 iterations with a tolerance of . The script was implemented in Matlab2016 and computation time was seconds in a computer with processor Intel(R) Core(TM) [email protected] with RAM8.00Gb and windows 64bits operative system.
A second numerical simulation was performed but this time the tie lines were connected resulting a meshed power distribution grid. Algorithm 1converged in 3 iterations with the same tolerance. Computation time was seconds. It is important to notice the proposed algorithm does not require any modification for meshed grids.
In order to maintain the tutorial presentation of this paper, we include the code for Algorithm 1 in Matlab (see appendix A). Notice the simple implementation of the algorithm thanks to use of the capability of matrix calculations in the complex domain.
A third set of numerical calculations was performed but this time, the grid was considered with ZIP loads and renewable energy generation. Convergence was achieved in 3 iterations and computation time was 0.007484 seconds. Matlab code is available in Appendix B.
5 Conclusions
A general methodology for the load-flow calculations in power distribution grids was presented. This methodology uses Wirtinger’s calculus instead of conventional complex analysis allowing a compact representation of the algebraic equations and a simple implementation in scripting based languages such as Matlab/Octave.
The proposed method allows to include constant power loads, ZIP models and distributed generation. In addition, meshed distribution grids can be directly implemented without any change in the code or the convergence performance. Numerical results in Matlab demonstrated the methodology is easily implementable and allows fast solutions.
It is the author belief, this approach is very useful from the pedagogical point of view, since the equations can be effortless obtained and interpreted. Moreover, the implementation of the method is intuitive and this simplify debugging process, especially in complex algorithms were the load flow is just one sub-routine. The use of Wirtinger’s calculus could be extended to other areas of power system analysis, optimization and control. Possible applications include economical dispatch, optimal power flow, stability and short-circuit analysis.
.1 Script in Matlab for Algorithm 1
tic
Vn = ones(n-1,1)*Vo;
In = YnoVo + YnnVn;
dS = Sn - Vn.*conj(In);
epsilon = norm(dS);
while epsilon>1E-4
Jn = dS./Vn;
Kn = diag(In./conj(Vn));
DV = linsolve([Ynn,Kn;Kn’,Ynn’],[conj(Jn);Jn]);
Vn = Vn + DV(1:n-1);
In = YnoVo + YnnVn;
dS = Sn - Vn.*conj(In);
epsilon = norm(dS);
end
toc
.2 Script in Matlab for Algorithm 2
tic
Vn = ones(n-1,1)*Vo;
In = YnoVo + YnnVn;
dFn = conj(Vn).*In-conj(Sn).*abs(Vn).^alpha;
epsilon = norm(dFn);
while epsilon>1E-4
Ln = dFn./conj(Vn);
Kn = diag(In./conj(Vn));
Hn = diag(alfa/2.*conj(Sn).*Vn.^(alpha-2));
DV = linsolve([Ynn-Hn,Kn-Hn;Kn’-Hn’,Ynn’-Hn’],...
[Ln;conj(Ln)]);
Vn = Vn - DV(1:NumN-1);
In = YnoVo + YnnVn;
dFn = conj(Vn).*In-conj(Sn).*abs(Vn).^alpha;
epsilon = norm(dFn);
end
toc
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[EI-Hawary(1995)] M. E. EI-Hawary, Electrical Power Systems, vol. 1, IEEE Press-Wiley Interscience, 1995.
- 2[Cespedes(1990)] R. Cespedes, New method for the analysis of distribution networks, IEEE Transactions on Power Delivery 5 (1) (1990) 391–396, ISSN 0885-8977, doi:10.1109/61.107303.
- 3[Bolognani and Zampieri(2015)] S. Bolognani, S. Zampieri, On the Existence and Linear Approximation of the Power Flow Solution in Power Distribution Networks, Power Systems, IEEE Transactions on PP (99) (2015) 1–10, ISSN 0885-8950, doi:10.1109/TPWRS.2015.2395452.
- 4[Marti et al.(2013)Marti, Ahmadi, and Bashualdo] J. Marti, H. Ahmadi, L. Bashualdo, Linear Power-Flow Formulation Based on a Voltage-Dependent Load Model, Power Delivery, IEEE Transactions on 28 (3) (2013) 1682–1690, ISSN 0885-8977, doi:10.1109/TPWRD.2013.2247068.
- 5[Garces(2015)] A. Garces, A Linear Three-Phase Load Flow for Power Distribution Systems, Power Systems, IEEE Transactions on PP (99) (2015) 1–2, ISSN 0885-8950, doi:10.1109/TPWRS.2015.2394296.
- 6[Low(2014)] S. H. Low, Convex Relaxation of Optimal Power Flow Part I: Formulations and Equivalence, IEEE Transactions on Control of Network Systems 1 (1) (2014) 15–27, ISSN 2325-5870, doi:10.1109/TCNS.2014.2309732.
- 7[Miu and Chiang(2000)] K. N. Miu, H.-D. Chiang, Existence, uniqueness, and monotonic properties of the feasible power flow solution for radial three-phase distribution networks, IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications 47 (10) (2000) 1502–1514, ISSN 1057-7122, doi:10.1109/81.886980.
- 8[Sur and Sarkar(2017)] U. Sur, G. Sarkar, A Sufficient Condition for Multiple Load Flow Solutions Existence in Three Phase Unbalanced Active Distribution Networks, IEEE Transactions on Circuits and Systems II: Express Briefs PP (99) (2017) 1–1, ISSN 1549-7747, doi:10.1109/TCSII.2017.2751542.
