You are on page 1of 37

eeh

power systems
laboratory

Feifei Teng

Implementation of a Voltage Sweep Power


Flow Method and Comparison with Other
Power Flow Techniques
Semester Thesis
PSL 1432

EEH Power Systems Laboratory


Swiss Federal Institute of Technology (ETH) Zurich
Examiner: Prof. Dr. Goran Andersson
Supervisor: Dr. Stephan Koch
Zurich, November 20, 2014

Abstract
Traditional power flow analysis techniques such as the Newton-Raphson and
the Gauss-Seidel methods are widely used in analyzing power transmission
systems. However, they are inefficient and may diverge due to the different
network characteristics of power distribution systems such as radial and high
R/X ratio. Therefore, other techniques such as the voltage sweep algorithms
are developed for power distribution systems.
In this thesis, the forward and backward sweep algorithm is studied
and validated in Java. The sweep algorithm can deal with balanced networks which are radial or weakly meshed and contain distributed generators. Networks with different topologies are implemented to assess the
convergence behavior of the sweeping algorithm and comparisons with established methods in the open-source Java power flow package JPower (the
Newton-Raphson and Gauss-Seidel methods) are made.
Results show that the sweeping algorithm is more efficient in analyzing
power distribution systems: it has the least runtime among the three methods and the time-saving advantage is more obvious for networks with less
loops and PV nodes.

Acknowledgments
This semester project was conducted at the ETH spin-off Adaptricity since
09/2014. The full time project made me concentrate on my work and time
runs really fast for a 7-week project.
First of all, I would like to express my gratitude to my supervisor Dr.
Stephan Koch for his support and guidance during this work. Thanks for
the opportunity he gave me to learn hands-on knowledge about Java programming and power flow analysis. I like especially the atmosphere in the
Adaptricity office where everyone is so nice.
Thanks my parents for their consistent encouragement. How lucky I am
to have such good parents! I also would like to thank all the friends around
me. Thanks for being someone in my life.

ii

Contents
List of Figures

List of Tables

vi

1 Introduction
1.1 Background of the project . . . .
1.2 Power flow analysis . . . . . . . .
1.2.1 Newton-Raphson method
1.2.2 Gauss-Seidel Iteration . .
1.2.3 Differences between power
tion systems . . . . . . . .
1.3 Goal of the project . . . . . . . .
1.4 Structure of the thesis . . . . . .

. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
transmission and
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .

2 Forward/Backward Sweep Approaches


2.1 Element ordering . . . . . . . . . . . .
2.2 Load flow equations . . . . . . . . . .
2.2.1 Power summation method . . .
2.2.2 Kirchhoffs Law based method
2.3 Weakly meshed networks . . . . . . .
2.4 Distributed generators modeling . . .
2.5 Transformers modeling . . . . . . . . .
2.6 Convergence criteria . . . . . . . . . .
3 Algorithm Implementation
3.1 Element ordering . . . . . .
3.2 Loop impedance matrix . .
3.3 Voltage sweep calculation .
3.4 Breakpoint power injection
3.5 Convergence criteria . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

. . . . . .
. . . . . .
. . . . . .
. . . . . .
distribu. . . . . .
. . . . . .
. . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.

1
1
1
2
3
3
4
4

.
.
.
.
.
.
.
.

5
5
5
6
7
8
9
10
11

.
.
.
.
.

12
12
14
15
15
16

4 Implementation results
17
4.1 Assessment on the sweeping algorithm . . . . . . . . . . . . . 17
4.1.1 Voltage mismatches after each iteration . . . . . . . . 17
iii

CONTENTS

4.2

4.1.2 Influence of convergence criteria . . . . . . . . . . . .


4.1.3 Influence of loops and PV nodes numbers . . . . . . .
4.1.4 Influence of PV node position . . . . . . . . . . . . . .
Comparison with the Gauss-Seidel and the Newton-Raphson
methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Runtime comparison . . . . . . . . . . . . . . . . . . .
4.2.2 Calculation results comparison . . . . . . . . . . . . .

iv
19
19
21
21
22
23

5 Conclusions

25

A Benchmark networks

26

Bibliography

29

List of Figures
1.1

The Newton-Raphson method iteration scheme . . . . . . . .

2.1
2.2
2.3
2.4
2.5
2.6
2.7

Ordered network example . . . . . . . . .


circuit model of a branch . . . . . . . .
Network illustrating adding breakpoints in
Breakpoint current injection . . . . . . . .
The breakpoint power injection method .
PV bus breakpoint . . . . . . . . . . . . .
Single-phase transformer model . . . . . .

3.1

Flowchart of the proposed algorithm . . . . . . . . . . . . . .

13

4.1
4.2
4.3

Successive voltage difference for all buses . . . . . . . . . . . .


Voltage mismatches in breakpoints . . . . . . . . . . . . . . .
Runtime and iteration number under different convergence
criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Runtime and iteration number with increasing loops . . . . .
Runtime and iteration number with increasing PV nodes . . .
Iteration number for different PV node position . . . . . . . .
Runtime comparison . . . . . . . . . . . . . . . . . . . . . . .
Voltage magnitude differences between the sweeping algorithm and the N-R method . . . . . . . . . . . . . . . . . . .
Voltage magnitude differences between the sweeping algorithm and the G-S method . . . . . . . . . . . . . . . . . . .

18
18

4.4
4.5
4.6
4.7
4.8
4.9

. . . . . . . .
. . . . . . . .
loops and PV
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .

. . .
6
. . .
6
nodes 9
. . .
9
. . . 10
. . . 10
. . . 10

A.1 14-bus network . . . . . . . . . . . . . . . . . . . . . . . . . .


A.2 29-bus network . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3 106-bus network . . . . . . . . . . . . . . . . . . . . . . . . .

19
20
20
21
22
23
24
26
27
28

List of Tables
4.1
4.2

Characteristics of the benchmark networks . . . . . . . . . . .


Runtime comparison of different methods . . . . . . . . . . .

vi

22
22

Chapter 1

Introduction
1.1

Background of the project

Traditional power flow analysis techniques [1] such as the Newton-Raphson


(N-R) and the Gauss-Seidel (G-S) methods are frequently used in power
transmission systems. However, for special cases which are usually called
ill-conditioned power systems, these methods might be unstable and diverge
[2]. Therefore, for power distribution systems which have high R/X ratio
and are often regarded as ill-conditioned, other methods such as the forward
and backward sweep algorithm are used and developed.

1.2

Power flow analysis

There are basically four variables related to bus b, bus voltage magnitude
Ub , voltage angle b , active power Pb and reactive power Qb . Three basic
types of buses are defined depending on which of the four variables are given
[3]:
PQ bus: Pb and Qb are given; Ub and b are to be calculated, it
represents load buses without voltage control.
PV bus: Pb and Ub are given; Qb and b are to be calculated, it
represents generation buses with voltage control.
U bus: Ub and b are given; Pb and Qb are to be calculated, it is
also called slack bus and is used to balance load or generation and serves as
voltage angle reference.
After defining all the buses in the network, the unknown variables of
every bus are calculated using equality and inequality constraints of the
network. Therefore, power flow analysis is about solving a series of equations
with system parameters and get the result of the system states. A general
power flow equation can be written as Eq. (1.1).
f(x, u, p) = 0 ,
1

(1.1)

CHAPTER 1. INTRODUCTION

where x is a vector of unknown system states, which refers to the unknown


variables of each bus. u is a vector with control output such as the active
power and voltage magnitude of a PV bus. p is system parameters such as
series impedance and shunt admittance of branches.
Therefore, the key to analyze a power system is to find efficient ways
to solve power flow Eq. (1.1). Many algorithms have been adapted and
developed in the past few years. The Newton-Raphson method (N-R) and
the Gauss-Seidel (G-S) method are among the most widely used methods
which have an excellent convergence characteristic and calculation efficiency.

1.2.1

Newton-Raphson method

The Newton-Raphson method is the most widely used iterative technique


[4]. Its basic iteration scheme is illustrated in Figure 1.1.
f (x)

f (x0 )
f (x1 )

x2

x1

x0

Figure 1.1: The Newton-Raphson method iteration scheme


Start with initial value of x(0) , the state x is updated using Eq. (1.2)
and (1.3):
J(x(v) )x(v) = f (x(v) ) ,
(v+1)

(v)

=x

(v)

+ x

(1.2)
(1.3)

where J(x(v) ) is the Jacobian matrix with


J(x(v) ) =

f(x)
x

(1.4)

The N-R algorithm converges to the true value of x after several iterations.
For power system analysis, the state x which needs to be solved and the

CHAPTER 1. INTRODUCTION

function f are formulated as [3]:


 

x =
,
U


P(x)
f =
=0 ,
Q(x)

(1.5)
(1.6)

where P(x) and Q(x) are the differences between active and reactive
power with their specified value.
The solution of x is updated using Eq. (1.7):
(v)

J(x
where


 

P(x(v) )
(v)
)
+
=0 ,
U(v)
Q(x(v) )

(1.7)

P P

U
J =
(1.8)
Q Q .

U
Reference [1] gives detailed explanation of the N-R method application
in power system analysis.

1.2.2

Gauss-Seidel Iteration

Given the same system equation as Eq. (1.1), the Gauss-Seidel iteration
(G-S) is based on the iteration scheme of Eq. (1.9):
x(v+1) = f (x(v) ) .

(1.9)

Given an initial estimate of x(0) , a series of state values could be obtained


using Eq. (1.9):
x(1) , x(2) , x(3)
If the solution converges, i.e., |x(v) f (x(v) | <  when xv x , it can be
written as
x = f (x ) .
(1.10)

1.2.3

Differences between power transmission and distribution systems

According to the respective functions of power transmission and distribution


systems, they differ in multiple aspects.
Voltage level: the transmission system is used to carry electricity over
long distances. It is at a higher voltage level in order to reduce losses. However, the distribution system is the final step of the delivery to end consumers
and is operated at a lower voltage level.

CHAPTER 1. INTRODUCTION

Topology: a transmission system is usually meshed whereas a distribution system typically has a radial or weakly meshed network.
Branch type: the transmission system is mainly composed of overhead
lines, which have a lower R/X ratio. For a distribution system, the structure
of both overhead lines and cables makes the R/X ratio higher.
The above mentioned algorithms N-R and G-S are particularly useful
in power transmission systems. That is because they are especially efficient
and have a good convergence characteristic in dealing with meshed networks
with low R/X ratios. However, in the case of a power distribution system,
convergence problems make it necessary to find new possibilities to solve the
power flow equations.
There are two main categories of distribution power systems analysis algorithms. One is based on modified traditional methods N-R and G-S as in
[5], [6], [7], [8]. The other way is the forward and backward sweep algorithm
using Kirchhoffs laws or bi-quadratic equations [9], [10].
The forward and backward sweep method makes use of the ladder structure of a radial network and solves the power flow equations step by step.
It avoids complex calculation of matrices and thus gets rid of convergence
problems caused by high R/X ratio but needs extra effort when dealing
with meshed networks. A detailed explanation of the sweeping algorithm is
presented in Chapter 2.

1.3

Goal of the project

In this semester thesis, a power flow computation method based on the


voltage sweeping algorithm shall be implemented in the distribution system
simulator. It is realized in Java. The computations shall be validated by
comparing the results to an established power flow computation tool JPower
[11](Java port of MATPOWER [12]). The performance (solution time for a
power flow on a large distribution grid) shall be assessed and compared with
the Newton-Raphson and the Gauss-Seidel techniques available in JPower.

1.4

Structure of the thesis

In Chapter 2, the principle of the sweeping algorithm is explained, including


different power flow equations and the way to deal with meshed networks.
The model of distributed generators is also given. In Chapter 3, the sweeping algorithm we implemented in the project is introduced. In Chapter 4,
the implementation results in Java are presented including the individual
assessment on the sweeping algorithm and comparisons with JPower.

Chapter 2

Forward/Backward Sweep
Approaches
During the last few decades, a variety of different approaches based on the
forward/backward sweep algorithm are used by researchers to get good convergence and fast calculation speed of power distribution systems. By avoiding solving simultaneous equations and large dimension matrices, the sweeping algorithm has the advantages of less computation effort and calculation
time compared to the N-R and G-S methods. During the last several years,
multiple sweep based approaches are developed to adapt to different power
system network structures and load types.
This chapter explains the principle of the forward and backward sweep
algorithms.

2.1

Element ordering

An element ordering process must be carried out to determine the calculation sequence in the forward and backward sweep. Here the commonly used
branch and node oriented method is introduced [13]. Figure 2.1 is an example of an ordered network. As it shows, the network is divided into different
layers starting from the root bus. Each branch is ordered only after all the
branches in its upper layers have been ordered.
For the forward sweep, the calculation starts from the root bus to the
last ordered branch. For the backward sweep, the calculation is from the
last ordered bus back to the root bus.

2.2

Load flow equations

According to the different power flow equations used in the sweeping process, there are power summation method, current summation method and

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

root bus
1
2

4
7

10

Figure 2.1: Ordered network example


admittance summation method[10], [14]. Here the first two approaches are
introduced.

2.2.1

Power summation method

Step 1: Backward sweep


Consider the model of a branch i in a distribution network in Figure 2.2,
the series impedance is Ri + jXi and the shunt admittance is yi . The power
in the sending and receiving end are Ps + jQs and Pr + jQr respectively.
Pi0 + jQ0i and Pi00 + jQ00i are the power flow after the shunt element in sending
end and before the shunt element in receiving end respectively. Therefore,
the relation between the powers in both sides can be written as [15]:
PsI + jQIs
Pi00 + jQ00i

Pi0 + jQ0i

jXi

Ri

PrI + jQIr
PrF + jQFr
PrL

Pi + jQi
PsL +

yi
2
jQL
s

yi
2

jQL
r

Figure 2.2: circuit model of a branch


Pi0 = PrL + PrF PrI

Q0i

Vm2 yi /2

QL
r

QFr

QIr

(2.1)
,

(2.2)

where the superscripts L, F and I in P and Q stand for load, flow and
injection respectively. Load power PL is given before calculation. The active

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

and reactive power flow through branch i can be formulated as,


Pi02 + Q02
i
,
Vr2
Pi02 + Q0i 2
= Q02
+
X
Vk2 yi /2 .
i
i
Vm2

Pi = Pi0 + Ri

(2.3)

Qi

(2.4)

If the network is radial, the power injections are assumed to be zero in every
iteration. For meshed networks, the calculation of power injection PI will
be explained in the meshed network part.
Eq. (2.1) (2.4) are calculated backward to get active and reactive power
flow for every branch.
Step 2: Forward sweep
With active and reactive power values available in the backward sweep, the
complex voltage can then be calculated in a forward sequence using Eq. (2.5).
Vr = Vs Ii Zi = Vk

Si00
(Ri + jXi )
Vk

Pi00 jQ00i
(Ri + jXi )
Vk
P 00 Ri + Q00i Xi
P 00 Xi Q00i Ri
= (Vk i
) j( i
)
Vk
Vk
= Vk

(2.5)

where Si00 = Pi00 + jQ00i , Pi00 = Pi , Q00i = Qi + Vk2 yi /2.


Eq. (2.5) is an application of Kirchhoffs Voltage Law. Since the complex
voltage of the slack bus is specified, voltage of other buses can be attained
in a forward sweep calculation.
The backward and forward sweep equations are calculated iteratively
until it converges.

2.2.2

Kirchhoff s Law based method

This approach [10] is a direct application of Kirchhoffs Current Law (KCL)


and Kirchhoffs Voltage Law (KVL). Given the voltage of the root bus and
an initial voltage guess of other buses, the algorithm takes three steps for
each iteration:
Step 1: Nodal current calculation:
The current injection at each node i is calculated using Eq. (2.6):
(k)

Ii

(k)

= (Si /Vi

(k1)

) yi Vi

, i = 1, 2, ..., n
(k)

(2.6)

where Si is the power injection at node i, Vi


is the voltage of node i
calculated from iteration k, yi is the shunt element of node i.
Step 2: Backward sweep:

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

Starting from the last ordered branch, current flow Jl in branch l is calculated
using Eq. (2.7):
X
(k)
Jl = Ilr +
Jlr , l = b, b 1, ..., 1
(2.7)
P
where Ilr is the current injection of node lr calculated from step 1,
Jlr is
the currents in branches emanating from node lr.
Step 3: Forward Sweep:
Starting from the root bus, the node voltages are updated using Eq. (2.8).
(k)

(k)

(k)

Vlr = Vls Zl Jl , l = 1, 2, ..., b

(2.8)

where ls and lr denote the sending and receiving end of branch l, Zl is the
series impedance of branch l.
The element ordering process is the same as in the power summation
method.
There are also other forward and backward sweep methods such as [14],
[16], [17]. Reference [14] proposed an admittance summation method which
is quite efficient for constant admittance loads. In [16], a simplified forward
and backward method is presented which has better performance than the
basic sweeping algorithm. Reference [17] gives a comprehensive review and
comparison of these sweep based approaches.

2.3

Weakly meshed networks

Power distribution systems are radial or weakly meshed in reality. Radial


networks can be solved directly from the above mentioned sweeping equations. For meshed networks, fictitious nodes are added to each loop thus
the loops are broken and the network is converted to a radial one. For loops
in the network, breakpoints are chosen in the ordering process. The last
ordered branch in a loop is treated as a link and the breakpoints are added
in every link.
The PV bus is treated as a special kind of loop [15]: a breakpoint is
added at the PV bus and it is assumed that the PV bus is connected to a
fictitious bus of which the active power and voltage magnitude are specified.
Figure 2.3 illustrates the process of adding breakpoints in the loop and
PV bus. l denotes the link of the loop and l1 and l2 are the two ends of the
breakpoint.
After the conversion of the network, the interrupted current or power
flow in the breakpoints can be replaced by current or power injection in the
two ends of the breakpoints without affecting the network operating condition.
Luo et al. proposed a compensation based power flow method [13]. It

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

root bus

PV bus
l
l2

l1

Figure 2.3: Network illustrating adding breakpoints in loops and PV nodes


uses nodal current injections to compensate for the power flows in the breakpoints. The current injection method is illustrated in Figure 2.4. This approach is suitable for Kirchhoffs Law based sweeping algorithm in which
nodal currents are calculated in each iteration. The current injection can be
added directly to the calculated nodal [13]. Reference [10] improves the former method in that it uses active and reactive power as flow variables rather
than complex currents thus simplifies the treatment of PV buses. The power
injection method is illustrated in Figure 2.5. This approach is suitable for
power summation method which active and reactive power are updated in
each iteration.
Jj
Breakpoint j
Jj

Jj

Figure 2.4: Breakpoint current injection

2.4

Distributed generators modeling

With the development of renewable energy and smartgrids, distributed generators become rather common and should not be omitted in distribution
system analysis. They are classified as PQ or PV nodes thus different ways
of modeling distributed generators have been used. If modeled as a PQ
node, it is identical to a negative constant power load.

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

Rest of the network

Rest of the network

k k0
P, Q

P, Q

10

P, Q

Figure 2.5: The breakpoint power injection method


If modeled as a PV node in the network, the treatment is similar to that
of a loop. Figure 2.6 shows the breakpoint of a PV bus.

Rest
of
the
network

Ps , Q

Rest
of
the
network

Ps , Q

j j0

Vs

Figure 2.6: PV bus breakpoint

2.5

Transformers modeling

The single-phase transformer model is shown in Figure 2.7. The series


impedance is Zt and the shunt element is Ym . The subscripts p and s denote
primary and secondary side respectively.
Vp

Zt

Ip

Vs
Is

Ym

Figure 2.7: Single-phase transformer model

CHAPTER 2. FORWARD/BACKWARD SWEEP APPROACHES

2.6

11

Convergence criteria

Different criteria are used to check the convergence of the sweeping algorithm [13], [18], [19]. Reference [13] compares maximum active and reactive power mismatch between successive iterations to convergence criterion.
Others such as [18] uses voltage differences in successive iterations to check
convergence, which is explained in Eq. (2.9):
|V k+1 V k | < 

(2.9)

For meshed networks or networks with PV nodes, the voltage mismatches


in breakpoints can be used to check convergence:
Vj = |Vj1 Vj2 | < 

(2.10)

where j denotes a breakpoint and j1 and j2 are the two ends of the breakpoint.
For the breakpoint of a PV node, the difference between the node voltage
and its specified voltage magnitude is checked:
Vj = |Vj1 Vs | < 

(2.11)

If the successive power or voltage differences or voltage mismatches in


breakpoints are below the pre-determined convergence criterion, the algorithm has converged and the calculation stops.
For networks with loops and PV nodes, it is not enough to use successive voltage differences to check convergence because the voltages in the two
ends of breakpoints might still mismatch even if the voltages in all buses
has converged. Therefore, the breakpoints voltage mismatches are crucial
to check convergence of a meshed network.
Moreover, the two convergence criteria can be combined to obtain a
faster and more robust sweeping algorithm. Reference [19] gives an adaptive power flow method where the successive voltage differences are checked
to converge before breakpoints voltage mismatches are examined. Both the
two convergence criteria are used to get faster convergence.

Chapter 3

Algorithm Implementation
In this project, the implemented algorithm is the compensation based voltage sweep approach described in [10], [15], [20]. It deals with balanced
distribution networks which are weakly meshed and contain distributed generators. Only one slack bus is assumed in the network. The branches are
modeled as model, thus shunt capacitance is considered. Constant power
loads are assumed in the calculation. The parameters that need to be known
before calculation are active and reactive power loads in PQ buses, slack bus
voltage magnitude and angle as well as specified voltage magnitude and active power in the distributed generators. The flow-chart of the proposed
method is shown in Figure 3.1.
The procedure of this algorithm is explained in several parts in this
chapter according to their implementation order.

3.1

Element ordering

The formation of a suitable model of the electrical network is the first step
of network analysis. Therefore, the element ordering process described in
Chapter 2 needs to be conducted before implementing the forward and backward sweep algorithm.
Before introducing the detailed process of the ordering process, some
basic terminologies must be explained.
In the network, line segments are called elements and their ends are
called nodes. A connected subgraph containing all nodes but without closed
path is called a tree. The elements of a tree are called branches. Other connecting elements which are not included in the tree are called links. Basic
loop is the loop path which contains only one link.
As in Reference [21], the network elements are separated into two subsets: branches and links. In the ordering process, every element is checked
in the following three cases,
a) none of the element nodes are in the list of ordered nodes;
12

CHAPTER 3. ALGORITHM IMPLEMENTATION

Read in data

Element ordering

Loop impedance matrix construction

Breakpoint power injection calculations

Power summation (backward sweep);


Node voltage calculation (forward
sweep); Breakpoint voltage calculation
Incremental changes of breakpoint current calculation

NO

Converged ?

YES
Print results
Figure 3.1: Flowchart of the proposed algorithm

13

CHAPTER 3. ALGORITHM IMPLEMENTATION

14

b) only one of the element nodes is in the list of ordered nodes;


c) both element nodes are in the list of ordered nodes.
Case a changes nothing, case b denotes a branch and the element takes
the next ordering element position with the other node takes the next ordering nodes position. Case c suggests a link and it takes the next element
ordering position. After checking all the elements in the network, fictitious
links are added if there are PV nodes in the network.
Two arrays are obtained after the element ordering process, which are
denoted as NS and NR. They contain the corresponding sending and receiving nodes of each branch and link. The NS and NR arrays are preparations
for the sweeping process and determine the calculation sequence.

3.2

Loop impedance matrix

This step is only necessary when there are loops or PV nodes in the network.
Since breakpoints are added in loops, current or power injections are needed
to compensate for the current flow in the breakpoints.
Power injection is calculated using the incremental changes of breakpoint
current Il and breakpoint voltage Vl . Therefore, in order to get the power
injections Pinj , loop impedance matrix Z must be constructed for every
breakpoint. The relation of breakpoint power injection, breakpoint current
and voltage are explained in Eq. (3.1)(3.3) .
Pinj

= Il Vl

ZIl = Vl

(3.1)

Vl = Vlr Vls

(3.2)
,

(3.3)

where lr and ls denotes the receiving and sending end of breakpoint l.


Before introducing the way to get loop impedance matrix, basic loop incidence matrix C is constructed and the loop impedance matrix is deducted
accordingly. The elements of basic loop incidence matrix are:
cij = 1 if the ith element is incident to and oriented in the same direction
as the jth basic loop;
cij = 1 if the ith element is incident to and oriented in the opposite
direction as the jth basic loop;
cij = 0 if the ith element is not incident to the jth basic loop.
The loop impedance matrix Z is constructed based on the loop incidence
matrix. The elements of matrix Z are:
zii , which is the diagonal element, is the sum of all the branches impedance
which form the loop;
zij , which is the off-diagonal element, is the sum of all the mutual
branches impedance of basic loop i and j, the impedance takes the opposite
sign if loop i and j have opposite orientation at the mutual branches.

CHAPTER 3. ALGORITHM IMPLEMENTATION

3.3

15

Voltage sweep calculation

The power summation method is used in this step. The sending real and
reactive power is added to the receiving power using a backward sweep calculation. Based on the introduction of power summation method in Chapter
2, Eq. (2.1)(2.4) are used to do the backward calculation and Eq. (2.5) is
used in forward sweep. More precisely, Eq. (3.4)(3.9) are used to get the
real and imaginary part of complex voltage.
Ps jQs
,
V s
Ps Rsr + Qs Xsr
Qs Rsr Ps Xsr
= V s (1
+j
)
2
Vs
Vs2

V r = V s (Rsr + jXsr )
Vr

(3.4)
.

(3.5)

Define a and b as,


Ps Rsr + Qs Xsr
Vs2
Qs Rsr Ps Xsr
.
Vs2

a = 1
b =

(3.6)
(3.7)

Then the real and imaginary part of receiving voltage can be calculated
using Eq. (3.8)(3.9),
Re{V r } = aRe{V s } bIm{V s }

Im{V r } = bR{V s } + aIm{V s } .

3.4

(3.8)
(3.9)

Breakpoint power injection

After the sweeping process, complex voltages of each bus are known and the
breakpoints power injections can be calculated using the following equations,
V ms + V mr
(Cm jDm ) ,
2
= S mr .

S mr =

(3.10)

S ms

(3.11)

Since the active power of a PV bus is specified, only reactive power


injection is updated:
Qms = Dm

2
Vms
Re{V ms }

(3.12)

To get the breakpoint current Cm + jDm , loop impedance matrix Z and


breakpoint voltage difference are used in Eq. (3.13).


 

X R D
E
=
,
(3.13)
R X
C
F

CHAPTER 3. ALGORITHM IMPLEMENTATION

16

where R and X are the real and imaginary part of loop impedance matrix
Z, C and D are the real and imaginary part of incremental change of
complex breakpoint current, E and F are the real and imaginary part
of complex breakpoint voltage difference.
At breakpoint l, the breakpoint complex voltage difference is:
El + jF = V lr V ls
For the PV nodes,
El = (

Vlssp
1)Re{V ls }
Vls

(3.14)

(3.15)

where Vlssp is the specified value of PV nodes voltage magnitude.


Thus, the power injection of every breakpoint can be updated using the
above equations.

3.5

Convergence criteria

In each iteration, the above mentioned steps are cycled until the results get
converged. For radial networks, the difference of successive voltage is used to
check convergence. For meshed networks as well as networks with PV Nodes,
the breakpoints voltage mismatches are used to check convergence. The
maximum successive voltage difference among all buses or maximum voltage
mismatch in breakpoints are compared to the pre-determined convergence
criterion. Once it is below the convergence criteria, the calculation stops.

Chapter 4

Implementation results
The algorithm introduced in Chapter 3 was implemented in Java. In this
chapter, the convergence behavior of the sweeping algorithm is assessed using
different network topologies. Besides, implementation results are compared
with the G-S and N-R methods in JPower.
First of all, an individual assessment on the sweeping algorithm is made
using a 29-bus network. The topology is given in Appendix A. As shown in
Figure A.2, there are in total 29 buses with 2 loops and 3 PV buses in the
network.

4.1
4.1.1

Assessment on the sweeping algorithm


Voltage mismatches after each iteration

For radial networks, the successive voltage differences for each bus are usually used to check convergence of the sweeping algorithm. By removing the
loops and PV nodes in the 29-bus network, the convergence behavior of the
sweeping algorithm is assessed for a radial network. The successive voltage
differences for all buses are calculated and plotted in Figure 4.1.
As in Figure 4.1, the successive voltage differences in all buses are decreasing with each iteration. When the convergence criterion is set to 107 ,
the sweeping algorithm converges in 2 iterations.
Assessment of the sweeping algorithm with meshed networks is made using the original 29-bus network. The voltage mismatches in the five breakpoints are calculated for each iteration and plotted in Figure 4.2.
As in Figure 4.2, the voltage mismatches in the breakpoints are decreasing with each iteration. Once all the mismatches are within the convergence
criteria, the calculation stops. When the convergence criterion is set to 107 ,
the sweeping algorithm converges in 11 iterations.

17

CHAPTER 4. IMPLEMENTATION RESULTS

18

-5

Successive voltage difference (p.u.)

10

-6

10

-7

10

-8

10

-9

10

-10

10

-11

10

-12

10

-13

10

Iteration number

Figure 4.1: Successive voltage difference for all buses

-3

3.0x10

loop 1

-3

2.5x10

loop 2

-3

Voltage mismatch (p.u.)

2.0x10

PV 1
PV 2

-3

1.5x10

PV 3

-3

1.0x10

-4

5.0x10

0.0
-4

-5.0x10

-3

-1.0x10

-3

-1.5x10

-3

-2.0x10

-3

-2.5x10

-3

-3.0x10

10

Iteration number

Figure 4.2: Voltage mismatches in breakpoints

12

CHAPTER 4. IMPLEMENTATION RESULTS

4.1.2

19

Influence of convergence criteria

The convergence criteria determine how far the calculations are from the true
value. Therefore, the effect of different convergence criterion is analyzed using its influence on iteration number and runtime of the sweeping algorithm.
Figure 4.3 shows results of increasing runtime and iteration number of the
sweeping algorithm under decreasing convergence criteria.

-4

2.1x10

-4

Runtime (s)

2.0x10

-4

1.9x10

-4

1.8x10

-4

1.7x10

-4

1.6x10

-4

1.5x10

-4

1.4x10

-4

1.3x10

-4

1.2x10

Iteration number

16
14
12
10
8
6
1E-5

1E-6

1E-7

1E-8

Convergence criteria

Figure 4.3: Runtime and iteration number under different convergence criteria

4.1.3

Influence of loops and PV nodes numbers

Known from the principle of the sweeping algorithm in Chapter 2, loops and
PV nodes are treated as breakpoints and need extra treatment. Therefore,
the sweeping algorithm needs more effort dealing with more loops and PV
nodes. This is illustrated by the following process: by adding or subtracting
loops and PV nodes in the 29-bus network, the runtime and iteration number of the sweeping algorithm are calculated. Figure 4.4 shows increasing
runtime and iteration number with more PV nodes in the network. Figure
4.5 shows increasing runtime and iteration number with more loops in the
network.
Generally speaking, the iteration number and runtime of the sweeping
algorithm are increasing with more loops and PV node added since they
increase the complexity of the network. However, the relationship is not
necessarily a strictly positive correlation because the position of the loops
or PV nodes also count. This results from the element ordering process of
the sweeping algorithm. The network topology determines the calculation

CHAPTER 4. IMPLEMENTATION RESULTS

20

-4

4.0x10

Runtime (s)

-4

3.5x10

-4

3.0x10

-4

2.5x10

-4

2.0x10

-4

1.5x10

Iteration number

30
25
20
15
10

Loop number

Figure 4.4: Runtime and iteration number with increasing loops

-4

2.8x10

-4

Runtime (s)

2.6x10

-4

2.4x10

-4

2.2x10

-4

2.0x10

-4

1.8x10

-4

1.6x10

-4

1.4x10

Iteration number

9
8
7
6
5
4
1

PV node number

Figure 4.5: Runtime and iteration number with increasing PV nodes

CHAPTER 4. IMPLEMENTATION RESULTS

21

sequence in the backward and forward sweeping process thus has an influence
on the final iteration number and runtime.

4.1.4

Influence of PV node position

To illustrate the influence of PV node position, only one PV bus is put in


the 29-bus network and calculations are made with it in different positions.
The iteration number of each calculation is recorded. As in Figure 4.6, the
influence of PV node position can be shown by the different iteration number
the sweeping algorithm used to do the calculation. (No result is there for
bus 28 because it is the slack bus.)

12

Iteration Number

10
8
6
4
2
0

10

15

20

25

30

PV node position

Figure 4.6: Iteration number for different PV node position

4.2

Comparison with the Gauss-Seidel and the NewtonRaphson methods

In this part, the performance comparison among the sweeping algorithm,


the G-S method and the N-R method is presented. Three systems are used
to assess the convergence behaviors of the algorithms. The characteristics of
the three grid topologies are listed in Table 4.1 and the network topologies
are given in Appendix A.

CHAPTER 4. IMPLEMENTATION RESULTS

4.2.1

22

Runtime comparison

Each algorithm is run for 1000 times and Table 4.2 gives average runtime
for the three networks respectively. Figure 4.7 compares the runtime of the
three algorithms.
Table 4.1: Characteristics of the benchmark networks
Network
Bus number
Loops
PV nodes
Transformers

1
14
7
0
4

2
29
2
3
13

3
106
0
0
5

Table 4.2: Runtime comparison of different methods


Method\Network
Sweeping Algorithm
Newton-Raphson
Gauss-Seidel

14-bus
1.58e-4 s
1.82e-4 s
7.92e-4 s

29-bus
6.86e-5 s
1.32e-4 s
3.89e-3 s

106-bus
8.76e-5 s
2.37e-3 s
3.26e-1 s

-1

3.50x10

Sweeping algorithm
N-R

-1

3.25x10

G-S

-4

Runtime (s)

2.5x10

-4

2.0x10

-4

1.5x10

-4

1.0x10

-5

5.0x10

0.0
14-bus

29-bus

106-bus

Different bus system

Figure 4.7: Runtime comparison


As shown in Figure 4.7, the sweeping algorithm uses the least runtime
for all networks. More concrete comparison is given in Table 4.2. Comparing
average runtime with the network characteristics, conclusion can be made
that the time-saving advantage of the sweeping algorithm is more obvious

CHAPTER 4. IMPLEMENTATION RESULTS

23

for networks with less loops and PV nodes. The reason of that is easy to
explain: for networks with more loops or PV nodes, more breakpoints are
added thus increasing effort is needed, which results in more runtime in the
calculation.

4.2.2

Calculation results comparison

The voltage magnitude differences between the sweeping algorithm and the
G-S and the N-R methods are calculated under different convergence criteria.
For the following results, the convergence criteria of the three algorithms
are equally set. Figure 4.8 shows voltage magnitude differences between
the sweeping algorithm and the N-R method. Figure 4.9 shows voltage
magnitude differences between the sweeping algorithm and the G-S method.
The results show that the solutions of the three algorithms get closer with
smaller convergence criteria and the solution differences are mostly under
the convergence criteria.

10
10

-6

10

Voltage magnitude difference (p.u.)

10

-8

-7

-6

-7

10

-8

10

-9

10

10

15

20

25

30

Bus number

Figure 4.8: Voltage magnitude differences between the sweeping algorithm


and the N-R method

CHAPTER 4. IMPLEMENTATION RESULTS

24

10
-6

10

10

Voltage magnitude difference (p.u.)

10

-8

-7

-6

-7

10

-8

10

-9

10

10

15

20

25

30

Bus number

Figure 4.9: Voltage magnitude differences between the sweeping algorithm


and the G-S method

Chapter 5

Conclusions
In the thesis, a backward and forward voltage sweep algorithm is implemented in Java. The algorithm is validated using different network examples
and comparisons with established power flow techniques (N-R and G-S) in
JPower were made.
The assessment of the sweeping algorithm using a 29-bus network shows
that the voltage differences between successive iterations and voltage mismatches in breakpoints are decreasing with the iteration process. It needs
more effort when dealing with an increasing number of loops and PV nodes
which can be demonstrated by its increasing iteration number and runtime.
Different convergence criteria and PV node position also have an influence
on the solution.
The comparison results show that the sweeping algorithm has faster
convergence speed than the N-R and the G-S methods. The time-saving
advantage is more obvious especially for networks with less loops or PV
nodes. Since power distribution systems are often radial or weakly meshed,
the sweeping algorithm shows its convergence efficiency in analyzing power
distribution systems compared to N-R and G-S.

25

Appendix A

Benchmark networks

Figure A.1: 14-bus network

26

APPENDIX A. BENCHMARK NETWORKS

Figure A.2: 29-bus network

27

APPENDIX A. BENCHMARK NETWORKS

Figure A.3: 106-bus network

28

Bibliography
[1] William F Tinney and Clifford E Hart. Power flow solution by Newtons method. Power Apparatus and Systems, IEEE Transactions on,
(11):14491460, 1967.
[2] S Suresh Reddy, S Sarat Kumar, and SVJ Kumar. Load flow solution
for ill-conditioned power systems using runge-kutta and iwamoto methods with facts devices. Journal of Theoretical & Applied Information
Technology, 5(6), 2009.
[3] G
oran Andersson. Power system analysis. lecture notes, ETH Zurich.
[4] Tjalling J Ypma. Historical development of the Newton-Raphson
method. SIAM review, 37(4):531551, 1995.
[5] Fan Zhang and Carol S Cheng. A modified Newton method for radial
distribution system power flow analysis. Power Systems, IEEE Transactions on, 12(1):389397, 1997.
[6] Vander Menengoy da Costa, Nelson Martins, and Jose Luiz R Pereira.
Developments in the Newton Raphson power flow formulation based on
current injections. Power Systems, IEEE Transactions on, 14(4):1320
1326, 1999.
[7] Paulo AN Garcia, Jose Luiz R Pereira, Sandoval Carneiro Jr, Vander M
da Costa, and Nelson Martins. Three-phase power flow calculations
using the current injection method. Power Systems, IEEE Transactions
on, 15(2):508514, 2000.
[8] Jen-Hao Teng. A modified GaussSeidel algorithm of three-phase power
flow analysis in distribution networks. International journal of electrical
power & energy systems, 24(2):97102, 2002.
[9] GW Chang, SY Chu, and HL Wang. An improved backward/forward
sweep load flow algorithm for radial distribution systems. Power Systems, IEEE Transactions on, 22(2):882884, 2007.

29

BIBLIOGRAPHY

30

[10] Guang-Xiang Luo and Adam Semlyen. Efficient load flow for large
weakly meshed networks. Power Systems, IEEE Transactions on,
5(4):13091316, 1990.
[11] Jpower website: https://github.com/rwl/JPOWER.
[12] MATPOWER website: http://www.pserc.cornell.edu/matpower/.
[13] Dariush Shirmohammadi, HW Hong, A Semlyen, and GX Luo. A
compensation-based power flow method for weakly meshed distribution and transmission networks. Power Systems, IEEE Transactions
on, 3(2):753762, 1988.
[14] Dragoslav Rajicic and Rubin Taleski. Two novel methods for radial
and weakly meshed network analysis. Electric power systems research,
48(2):7987, 1998.
[15] MH Haque. Efficient load flow method for distribution systems with radial or mesh configuration. IEE Proceedings-Generation, Transmission
and Distribution, 143(1):3338, 1996.
[16] GW Chang, SY Chu, and HL Wang. A simplified forward and backward
sweep approach for distribution system load flow analysis. In Power
System Technology, 2006. PowerCon 2006. International Conference
on, pages 15. IEEE, 2006.
[17] Ulas Eminoglu and M Hakan Hocaoglu. Distribution systems forward/backward sweep-based power flow algorithms: a review and comparison study. Electric Power Components and Systems, 37(1):91110,
2008.
[18] Kultar Deep Singh and Smarajit Ghosh. A new efficient method for
load-flow solution for radial distribution networks. Przeglad
, Elektrotechniczny, 87:6673, 2011.
[19] Y Zhu and Kevin Tomsovic. Adaptive power flow method for distribution systems with dispersed generation. Power Delivery, IEEE Transactions on, 17(3):822827, 2002.
[20] Dragoslav Rajicic, Risto Ackovski, and Rubin Taleski. Voltage correction power flow. Power Delivery, IEEE Transactions on, 9(2):1056
1062, 1994.
[21] Jos Arrillaga and CP Arnold. Computer analysis of power systems.
Wiley New York, 1990.

You might also like