Load Flow Analysis: Semestral Project Ondrej Ivan C Ik
Load Flow Analysis: Semestral Project Ondrej Ivan C Ik
Semestral Project
Ondrej Ivanck
[email protected]
June 23, 2011
1 Introduction
Load ow (LF) analysis is the most important
approach for investigating power system prob-
lems and planning. Based on a specied gen-
erating state and transmission network struc-
ture, LF analysis solves the steady operation
state with node voltages and branch power ow
in the power system. LF analysis can provide
a balanced steady operation state of the power
system, without considering system transient
processes. Hence, the mathematic model of LF
problem is a nonlinear algebraic equation sys-
tem without dierential equations.
Power system steady state analysis includes
LF analysis and static security analysis. LF
analysis is mainly used in analyzing the normal
operation state, while static security analysis
is used when some elements are out of service.
Its purpose is to check whether the system can
operate safely, i.e., if there are equipment over-
loads, or some node voltages are too low or too
high. In principle, static security analysis can
be replaced by a series of LF analyses.
2 Formulation of the Load
Flow Problem
2.1 Classication of Node Types
An electric power system is composed of gen-
erators, transformers, transmission lines and
loads, etc. In the process of power system anal-
ysis, the static components, such as transform-
ers, transmission lines, shunt capacitors and re-
actors, are represented by their equivalent cir-
cuits consisting of R, L, C elements. There-
fore, the network formed by these static com-
ponents can be considered as a linear network
and represented by the corresponding admit-
tance matrix or impedance matrix. In LF cal-
culation, the generators and loads are treated
as nonlinear components. They cannot be em-
bodied in the linear network. The connecting
nodes with zero injected power also represent
boundary conditions on the network.
The relationship between node current and
voltage in the linear network can be described
by the following node equation:
I = YV (1)
or
I
i
=
n
j=1
Y
ij
V
j
, (i = 1, 2, . . . , n) (2)
where
I
i
and
V
j
are the injected current at bus i
and voltage at bus j, respectively, Y
ij
is an
element of the admittance matrix, n is the total
number of nodes in the system.
To solve the LF equation, the relation of
node power with current should be used
I
i
=
P
i
jQ
i
V
i
, (i = 1, 2, . . . , n) (3)
1
where P
i
, Q
i
are the injected active and re-
active power at node i, respectively. If node
i is a load node, then P
i
and Q
i
should take
negative values. In (3),
V
i
is the conjugate of
the voltage vector at node i. Substituting (3)
to (2), we have,
P
i
jQ
i
V
i
=
n
j=1
Y
ij
V
j
, (i = 1, 2, . . . , n)
(4)
or
P
i
+ jQ
i
V
i
=
n
j=1
Y
ij
V
j
, (i = 1, 2, . . . , n)
(5)
There are n nonlinear complex equations
in (5). They are the principal equations in LF
calculation.
In the power system LF problem, the vari-
ables are nodal complex voltages and complex
powers: V , , P, Q. If there are n nodes in a
power system, then the total number of vari-
ables is 4n.
As mentioned above, there are n complex
equations or 2n real equations dened in prin-
cipal by (5), thus only 2n variables can be
solved from these equations, while the other 2n
variables should be specied as original data.
Usually, two variables at each node are as-
sumed known, while the other two variables are
treated as state variables to be resolved. Ac-
cording to the original data, the nodes in power
systems can be classied into three types:
PQ nodes For PQ nodes, the active and reac-
tive power (P, Q) are specied as known
parameters, and the complex voltage (V ,
) is to be resolved. Most nodes in power
systems belong to the PQ type in LF cal-
culation.
PV nodes For PV nodes, active power P
and voltage magnitude V are specied as
known variables, while reactive power Q
and voltage angle are to be resolved.
Usually, PV nodes should have some con-
trollable reactive power resources and can
thus maintain node voltage magnitude at
a desirable value.
Slack node In LF studies, there should be
one and only one slack node specied in
the power system, which is specied by a
voltage, constant in magnitude and phase
angle. Therefore, V and are given as
known variables at the slack node, while
the active power P and reactive power Q
are the variables to be solved. The eec-
tive generator at this node supplies the
losses to the network. This is necessary
because the magnitude of losses will not
be known until the calculation of currents
is complete, and this cannot be achieved
unless one node has no power constraint
and can feed the required losses into the
system.
2.2 Node power equations
The complex node voltage has two representa-
tion forms the polar form and the rectangular
form. I want to compare the computation of
foad ow with polar and rectangular form and
discuss the results. My version of LF imple-
mented in MATLAB uses rectangular form, so
I deduce equation only in this form.
From (5), the node power equation can be
expressed as
P
i
+ jQ
i
=
V
i
ji
Y
ij
V
j
(i = 1, 2, . . . , n)
(6)
where j i means the node j should be di-
rectly connected with node i, including j = i.
If the voltage vector of (6) adopts rectangular
form,
V
i
= e
i
+ jf
i
2
where
e
i
= V
i
cos
i
f
i
= V
i
sin
i
where V
i
and
i
the magnitude and phase an-
gle of voltage at node i. The elements of ad-
mittance matrix can be expressed as
Y
ij
= G
ij
+ jB
ij
Let
ij
(G
ij
e
j
B
ij
f
j
) = a
ij
ij
(G
ij
f
j
+ B
ij
e
j
) = b
ij
_
_
(i = 1, 2, . . . , n)
(7)
Obviously, a
i
and b
i
are the real and imaginary
parts of injected current at node i and we can
obtain from (6):
P
i
= e
i
a
i
+ f
i
b
i
Q
i
= f
i
a
i
e
i
b
i
_
(i = 1, 2, . . . , n) (8)
Nonlinear equations of node voltage phasors
(8) are usually expressed as the following forms
as mathematical models of the load ow prob-
lem:
P
i
= P
is
e
i
a
i
f
i
b
i
Q
i
= Q
is
f
i
a
i
+ e
i
b
i
_
(i = 1, 2, . . . , n)
(9)
where P
is
, Q
is
are the specied active and reac-
tive powers at node i. Based on the above two
simultaneous equations, the load ow problem
can be roughly summarized as: for specied
P
is
, Q
is
, nd voltage vectors e
i
, f
i
, such that
the magnitudes of the power errors P
i
, Q
i
,
are less then an acceptable tolerance.
2.3 Correction equations
Equations for PV nodes are
P
i
= P
is
e
i
a
i
f
i
b
i
V
2
i
= V
2
is
(e
2
i
+ f
2
i
)
_
(i = 1, 2, . . . , n)
(10)
Dierentiating the (9) and (10), we can ob-
tain elements of the Jacobian matrix. The o-
diagonal elements of the Jacobian matrix for
j = i can be expressed as,
P
i
e
j
=
Q
i
f
j
= B
ij
f
i
+ G
ij
e
i
P
i
f
j
=
Q
i
e
j
= B
ij
f
i
G
ij
e
i
V
2
i
e
j
=
V
2
i
f
j
= 0
(11)
The diagonal elements can be expressed as,
P
i
e
i
= a
i
G
ii
e
i
B
ii
f
i
Q
i
f
i
= a
i
+ G
ii
e
i
+ B
ii
f
i
P
i
f
i
= b
i
B
ii
e
i
G
ii
f
i
Q
i
e
i
= b
i
+ B
ii
e
i
G
ii
f
i
V
2
i
e
i
= 2e
i
V
2
i
f
i
= 2f
i
(12)
3 Newton-Raphson method
A set of nonlinear algebraic equations in ma-
trix format is given by
f (x) = y (13)
where x and y are N vectors and f (x) is an N
vector of functions. Rewritting (13),
0 = y f (x) (14)
Adding Dx to both sides of (14), where D is a
square N N invertible matrix,
Dx = Dx +y f (x) (15)
Premultiplying by D
1
,
x = x +D
1
[y f (x)] (16)
3
The old values x(i) are used on the right side
of (15) to generate the new values x(i + 1) on
the left side. This is,
x(i + 1) = x(i) +D
1
{y f [x(i)]} (17)
For linear equations, f (x) = Ax and (17) re-
duce to
x(i + 1) = x(i) +D
1
[y Ax(i)] =
= D
1
(DA)x(i) +D
1
y
(18)
For nonlinear equations, the matrix D in (17)
must be specied.
One method for specifying D, called
Newton-Raphson, is based on the following
Taylor series expansion of f (x) about the op-
erating point x
0
.
y = f (x
0
) +
df
dx
x=x
0
(x x
0
) . . . (19)
Neglecting the higher order terms in (19) and
solving for x,
x = x
0
+
_
df
dx
x=x
0
_
1
[y f (x
0
)] (20)
The Newton-Raphson method replaces x
0
by
the old value x(i) and x by the new value x(i+
1) in (20). Thus,
x(i + 1) = x(i) +J
1
(i){y f [x(i)]} (21)
where
J(i) =
dx
dx
x=x
0
=
_
_
f
1
x
1
f
1
x
2
f
1
x
N
f
2
x
1
f
2
x
2
f
2
x
N
.
.
.
.
.
.
.
.
.
f
N
x
1
f
N
x
1
f
N
x
1
_
_
x=x(i)
(22)
The N N matrix J(i), whose elements are
the partial derivatives shown in (22), is called
Jacobian matrix.
4 MATLAB implementation
The problem is divided into three modules:
model.m (for loading data from input les and
initialization the structures used in computa-
tion), newton raphson.m (the generic nonlin-
ear solver) and pf.m (implemented callback
functions for newton rapson.m). In the Ap-
pendix, there are codes for newton raphson
and jacobian functions.
5 Discussion
My main goal was to compare the results of LF
computed in polar with one in the rectangular
coordinates. I observed, that the computation
in polar coordinates has converged better. Bel-
low are displayed results of convergence for the
LF of the small electrical power system consist-
ing of 6 nodes (1 Slack, 2 PV and 3 PQ) and
6 branches. Results are same, but the number
of iteration diers. Very interesting is the con-
vergence step in polar case after 3th iteration.
The convergence of rectangular form is linear
for each iteration, one or two place more ac-
curate.
LF convergence of rectangular | polar form:
iter: 1 norm( y ) = 6.8686E+01 | 6.8686E+01
iter: 2 norm( y ) = 1.9751E+00 | 2.3644E+00
iter: 3 norm( y ) = 8.8241E-02 | 3.3183E-03
iter: 4 norm( y ) = 3.5354E-03 | 1.0816E-12
iter: 5 norm( y ) = 1.6320E-04
iter: 6 norm( y ) = 6.6014E-06
iter: 7 norm( y ) = 3.0833E-07
iter: 8 norm( y ) = 1.2986E-08
iter: 9 norm( y ) = 6.2807E-10
References
[1] Xu-Fan Wang et al., Modern Power Systems
Analysis, Springer, rst edition, 2008.
4
A Codes
function cbdata = newton_raphson( start, iteration, opt, cbdata )
x = start( cbdata ); % starting point
for iter = 1:opt.iter_max
[ y, J, cbdata ] = iteration( x, cbdata ); % jacobian, function vector
if norm( y ) < opt.eps % convergence criterion
return;
end
x = x - J \ y; % compute new point
end
lastwarn( newton_raphson: did not converged );
end
function J = jacobian( m )
Jpe = m.Y; Jpf = m.Y; Jqe = m.Y; Jqf = m.Y;
[ ii, jj, ~ ] = find( m.Y );
for k = 1:length( ii )
i = ii( k ); j = jj( k );
dSdv = m.Y( i, j ) * m.n.v( i );
if i == j
Jpe( i, i ) = real( - dSdv - m.n.c( i )); % dP(i) / de(i)
Jpf( i, i ) = imag( dSdv - m.n.c( i )); % dP(i) / df(i)
if m.n.tn( i ) ~= 2
Jqe( i, i ) = imag( dSdv + m.n.c( i )); % dQ(i) / de(i)
Jqf( i, i ) = real( dSdv - m.n.c( i )); % dQ(i) / df(i)
else % PU node
Jqe( i, i ) = -2 * real( m.n.v( i )); % dV(i)^2 / de(i)
Jqf( i, i ) = -2 * imag( m.n.v( i )); % dV(i)^2 / df(i)
end
else
Jpe( i, j ) = - real( dSdv ); % dP(i) / de(j)
Jpf( i, j ) = imag( dSdv ); % dP(i) / df(j)
if m.n.tn( i ) ~= 2
Jqe( i, j ) = imag( dSdv ); % dQ(i) / de(j)
Jqf( i, j ) = real( dSdv ); % dQ(i) / df(j)
else % PU node
Jqe( i, j ) = 0; % dV(i)^2 / de(j)
Jqf( i, j ) = 0; % dV(i)^2 / df(j)
end
end
end
J = [ Jpe( m.ipqu, m.ipqu ) Jpf( m.ipqu, m.ipqu )
Jqe( m.ipqu, m.ipqu ) Jqf( m.ipqu, m.ipqu ) ];
end
5