Three Phase Distribution System State Estimation
Three Phase Distribution System State Estimation
SARAJEVO
FACULTY OF ENGINEERNG AND
NATURAL SCIENCES
Distribution System
State Estimation
with examples in MATLAB, AMPL and C++
i
Contents Contents
4. Single-phase modeling 77
4.1. Problem Description and Basic Principles . . . . . . . . 79
4.2. Load Estimation with 4-connections . . . . . . . . . . . 82
4.2.1. WLS Estimation with Y -connected loads . . . . 83
4.2.2. Consideration of 4-connected loads . . . . . . . 85
ii
Contents
A. Appendix 157
A.1. MATLAB Programming . . . . . . . . . . . . . . . . . . 157
A.1.1. Import Files to M-file . . . . . . . . . . . . . . . 157
A.1.2. Introduction of Symbolic Variables . . . . . . . . 158
A.1.3. Define Measurements and Parameters . . . . . . 160
A.1.4. Calculate Constraints . . . . . . . . . . . . . . . 161
A.1.5. Matrix Calculation . . . . . . . . . . . . . . . . . 162
A.1.6. Assign Initial Values . . . . . . . . . . . . . . . . 163
A.1.7. Solve Gauss-Newton Method and show Results . 164
A.2. MATLAB code . . . . . . . . . . . . . . . . . . . . . . . 166
iii
Contents Contents
B. Appendix 177
B.1. AMPL Programming . . . . . . . . . . . . . . . . . . . . 177
B.1.1. AMPL Model File . . . . . . . . . . . . . . . . . 177
B.1.2. Declaration of Variables and Parameters . . . . . 178
B.1.3. Objective function and constraints . . . . . . . . 179
B.1.4. Solve problem and Display Results . . . . . . . . 180
B.2. AMPL Code . . . . . . . . . . . . . . . . . . . . . . . . 181
C. Appendix 189
C.1. C++ Programming . . . . . . . . . . . . . . . . . . . . . 189
C.1.1. Assign Initial Values . . . . . . . . . . . . . . . . 189
C.1.2. Jacobian Matrix and right hand side (RHS) . . . 189
C.1.3. Solve problem and Display Results . . . . . . . . 190
C.1.4. C++ Code for Example 3.1 . . . . . . . . . . . 191
C.1.5. C++ Code for Example 3.2 . . . . . . . . . . . . 192
Bibliography 197
Index 201
Nomenclature 205
iv
List of Figures
1
List of Figures List of Figures
2
List of Tables
3
1. Introduction
5
Chapter 1 Introduction
as engineering tool, the power system state estimator became the key
data processing tool in modern EMS systems, and evolved in today’s
industry as a very important application. The block diagram show-
ing the components of a modern state estimator is shown on Fig. 1.1.
Monitoring and control of power system assets is conducted through the
supervisory control and data acquisition (SCADA) system. In the early
days, it was believed that the real-time database provided by SCADA
could provide an operator with an accurate system view. Very soon,
the deficiencies of SCADA were realized. To mention a few: hard to as-
sure availability of all measurements at all times, measurements prone
to errors, etc. A more powerful tool was needed to process collected
measurements and to filter bad ones. A central master station, located
at the control center, gathers information through the SCADA system.
The SCADA system collects measurement data in real time from re-
mote terminal units (RTUs) installed in substations across the power
system. Typical RTU measurements include power flows (both active
and reactive), power injections, voltage magnitude, phase angles and
current magnitude. While there is not much to be said that is not al-
ready known about active and reactive power and voltage magnitude
measurements, voltage angle measurements are relatively new in prac-
tice. Direct measurement of voltage phase angle was impossible for a
long time. In order to be valid, those measurements should be synchro-
nized, i.e. a time reference should be provided. The global positioning
system (GPS) signal made synchronization possible with accuracy bet-
ter than 1 µs. A phasor measurement unit (PMU) equipped with a GPS
receiver allows for synchronization of measurements, yielding accurately
measured and time-stamped voltage phase angles.
The overall state estimation process consists of the following steps:
• Network topology processing: topology processor gathers sta-
tus data about the circuit breakers and switches, and configures
the one-line diagram of the system.
• Observability analysis: Observability analysis determines if a
state estimation solution for the entire system can be obtained us-
ing the available set of measurements, identifies the unobservable
branches, and the observable islands in the system if any exist.
• Estimation of the state vector: State estimation determines
the optimal estimate for the system state, which is composed of
complex bus voltages in the entire power system, based on the
6
1.1 Distribution System State Estimation (DSSE)
V
x=
δ
7
Chapter 1 Introduction
• The lines have high r/x ratios, making a decoupling of the active
and reactive sub-problems not possible. For example, the ratio
may be more or less equal to one for medium voltage overhead lines
and will be generally greater than one for underground cables.
Some lines segments may be very short (lower than hundreds of
meters in an urban environment).
• Because of the lower number of customers, these networks have
very limited measurement sets compared to transmission systems.
Because the number of real-time measurements is too low, load
forecasts (also called pseudo-measurements) are generally needed
to make the system observable.
• The loads are more difficult to forecast than in transmission net-
works, because the number of customers per transformer is smaller,
resulting in greater randomness. Further, with the introduction of
electric vehicles or demand response, the load randomness could
become even higher.
State estimation is becoming necessary in distribution to manage un-
predictable loads and generation. Distribution state estimation (DSSE)
provides a very useful role in providing network operators with im-
proved, consistent and complete information about the present operat-
ing state of their network, as well as ability to drive additional network
automation functions. Network automation functions include: network
restoration(post-fault), real-time system monitoring, energy loss mini-
mization, outage management via ‘what-if’ network analysis, security
assessment, voltage/reactive power optimization, generator control and
intelligent load management.
The state of the system can be estimated from a set of redundant mea-
surements taken on the network, e.g. voltage or current flow mea-
surements. The classical approach of state estimation in power systems
consists of the application of the Weighted Least Square (WLS) method-
ology, in which a set of measurements z can be represented as [1]:
z = h(x) + e (1.1)
where z is the (m×1) measurement vector; x is the an (n×1) state vector
to be estimated; h is a vector of nonlinear functions that relate the states
8
1.2 Mathematical formulation
minimize J(x) = 1
2 [z − h(x)]T W [z − h(x)] (1.2)
∂h(x)
H(x) = (1.4)
∂x
Once the nonlinear measurement function h(x) is linearized
9
Chapter 1 Introduction
WLS problem. Thus, the WLS estimator minimizes the weighted sum
of the squares of the residuals with respect to these constraints:
minimize J(x) = 1
2 [z − h(x)]T W [z − h(x)]
(1.8)
subject to c(x) = 0
∂L(x)/∂x = 0 ⇒ H T W [z − h(x)] + C T λ = 0
(1.10)
∂L(x)/∂λ = 0 ⇒ c(x) = 0
where:
4z k = z − h(xk ) (1.12)
Iteration step 4x can be found only when the gain matrix is nonsingu-
lar. The iterative approach is applied to obtain the state update until
the absolute value of the difference of the states between successive
iterations is less than the some tolerance value ε.
4xk+1 = xk+1 − xk < ε (1.13)
10
1.2 Mathematical formulation
x = x0
(z − h(x ))
k
[ H T WH ]
[ ]−1
[
∆x = H TWH H TW z − h(x k ) ]
Max ( ∆x ) < ε
x = x + ∆x
11
2. Distribution Power Flow
One of the most fundamental calculations related to any system is the
determination of the steady state behavior. It is of utmost importance
to be able to calculate the voltages and currents that different parts of
the power system are exposed to. This is essential not only in order
to design the different power system components such as generators,
lines, transformers, shunt elements, etc. so that these can withstand
the stresses they are exposed to during steady state operation without
any risk of damages. Furthermore, for an economical operation of the
system the losses should be kept at a low value taking various constraints
into account, and the risk that the system enters into unstable modes of
operation must be supervised. In order to do this in a satisfactory way
the state of the system, i.e. all (complex) voltages of all nodes in the
system, must be known. With these known, all currents, and hence all
active and reactive power flows can be calculated, and other relevant
quantities can be calculated in the system. In power systems, this
calculation is the steady state power flow problem, also called load flow.
It essentially involves finding the steady state voltages at each node,
given a certain set of generation and loading conditions. The optimal
power flow (OPF) problem seeks to control the generation/consumption
of generators/loads to optimize certain objectives such as to minimize
the generation cost or power loss in the network.
Since power flow is such a fundamental calculation for a power system,
it is used in many applications in planning and operation. Some of
the optimization problems related to distribution automation, such as
network reconfiguration, service restoration, and capacitor placement,
require the solution of hundreds or even thousands of power flow prob-
lems. These applications place two primary requirements on a distri-
bution power flow program. First, the modeling must reflect the actual
behavior of the system components. Second, the solution algorithm
must be robust and efficient. There are two popular numerical meth-
ods for solving the power-flow equations. These are the Gauss-Seidel
(G-S) and the Newton-Raphson (N-R) methods. The N-R method is
13
Chapter 2 Distribution Power Flow
14
2.1 Modeling of System Components
sh sh
ypq = gpq + jbsh
pq (2.2)
where
rpq
gpq = 2 +x2
rpq
(2.4)
pq
xpq
bpq = − r2 +x 2
pq pq
15
Chapter 2 Distribution Power Flow
sh sh
y pq y pq
For actual transmission lines the series reactance and the series resis-
tance are both positive, and consequently gpq is positive and bpq is
negative. The shunt susceptance and the shunt conductance are both
sh is so small
positive for real line sections. In many cases the value of gpq
that it could be neglected.
The complex currents ip and iq in Fig. 2.2 can be expressed as functions
of the complex voltages at the branch terminal nodes p and q:
ip = y pq (v p − v q ) + y sh v
pq p
(2.5)
sh
iq = y pq (v q − v p ) + y pq v q
y + y sh
" # " #" #
ip −y pq vp
= pq pq
(2.6)
iq −y pq y pq + y sh
pq
vq
As seen the matrix on the right hand side of Equation 2.6 is symmetric
and the diagonal elements are equal.
16
2.1 Modeling of System Components
gen
p
When formulating the load flow equations for power systems, a load is
most often the infeed of power to a network at a lower voltage level, e.g.
a distribution network. Often the voltage in the distribution systems is
kept constant by controlling the tap-positions of the distribution trans-
formers which means that power, active and reactive, in most cases can
be regarded as independent of the voltage on the high voltage side. This
means that the complex power v p (iload ∗
p ) is constant, i.e. independent
of the voltage magnitude Vi . Also in this case the current is defined as
positive when injected into the bus, see Fig. 2.4. In the general case the
complex load current can be written as
iload
p = iload
p (vp ) (2.7)
where the function Iiload () describes the load characteristics. More often
the load characteristics are given for the active and reactive powers
17
Chapter 2 Distribution Power Flow
load
p
The net complex current injection at a network bus, see Fig. 2.5, is
related to the current flows in the branches connected to the bus. Ap-
ip
y p0
ip = y p0 v p + y p1 (v p − v 1 ) + ... + +y pN (v p − v N ) (2.9)
18
2.3 Basic Power Flow Problem
n
X
Pp = vp vq ypq cos(θpq − δp + δq ) (2.13)
q=1
n
X
Qp = − vp vq ypq sin(θpq − δp + δq ) (2.14)
q=1
19
Chapter 2 Distribution Power Flow
which ones are unknown (to be calculated), three types of buses can be
defined:
Slack (swing) bus: For the slack bus, it is assumed that the volt-
age magnitude and voltage phase are known, whereas real and reactive
powers are obtained through the load flow solution.
The slack, also called reference bus, has double functions in the basic
formulation of the power flow problem:
2. Since the active power losses are unknown in advance, the active
power generation of the slack bus is used to balance generation,
load, and losses.
20
2.4 Solution of the Power Flow Problem
n
X
Qgen
p − Qload
p = Qp = − vp vq ypq sin(θpq − δp + δq ) (2.16)
q=1
Another example are real and reactive components of the complex load
power that are given within the boundaries
min ≤ P max
Pload load ≤ Pload (2.18)
Qload ≤ Qload ≤ Qmax
min
load
In all realistic cases the power flow problem cannot be solved analyti-
cally, and hence iterative solutions implemented in computers must be
used. In this chapter we will review two solutions methods, Gauss it-
eration with a variant called Gauss-Seidel iterative method, and the
Newton- Raphson method.
21
Chapter 2 Distribution Power Flow
f1 (x1 , x2 , ..., xN ) = c1
f2 (x1 , x2 , ..., xN ) = c2
.. (2.19)
.
fN (x1 , x2 , ..., xN ) = cN
x1 = c1 + g1 (x1 , x2 , ..., xN )
x2 = c2 + g2 (x1 , x2 , ..., xN )
.. (2.20)
.
xN = cN + gN (x1 , x2 , ..., xN )
xn+1
1 = c1 + g1 (xn1 , xn2 , ..., xnN )
n+1
x2 = c2 + g2 (xn1 , xn2 , ..., xnN )
.. (2.21)
.
xn+1
N = cN + gN (xn1 , xn2 , ..., xnN )
Iteration process ends when the change in all variables in two iterations
is less than specified accuracy.
Power flow solution using Gauss-Seidel method starts with system node
voltage equation [3]:
Y 11 Y 12 ··· Y 1N V1 I1
Y 21
Y 22 ··· Y 2N
V 2 I2
. = . (2.22)
. .. ..
. ..
. . . . .. ..
Y N1 Y N2 · · · Y NN VN IN
22
2.4 Solution of the Power Flow Problem
All the quantities are expresses in per unit. In most cases, instead of
complex current, complex powers are known. In those cases, Gauss-
Seidel method can be used for calculating unknown voltages. Power
can be expressed as:
S p = V p I ∗p (2.23)
Pp − jQp = V ∗p I p = V ∗p Ypq V q
P
(2.24)
= V ∗p Ypp V p + V ∗p Ypq V q
P
(Pp − jQp ) X
⇒ Ypp V p = − Ypq V q (2.26)
V ∗p
(Pp −jQp )
−
P
V ∗p Ypq V q
⇒Vp = (2.27)
Ypq
Solution can be obtained using iterative method:
(Pp −jQp ) (k)
−
P
V ∗p (k)
Ypq V q
V (k+1)
p = (2.28)
Ypq
23
Chapter 2 Distribution Power Flow
Expanding the above equation with the Taylor series, results in:
If the difference 4x0 is very small, the terms of the second and higher
derivatives can be neglected. Thus, previous equation becomes
or
f (x0 )
4x0 = − (2.33)
f 0 (x0 )
f (x0 )
x1 = x0 + 4x0 = x0 − (2.34)
f 0 (x0 )
f (xk )
xk+1 = xk + 4xk = xk − (2.35)
f 0 (xk )
24
2.4 Solution of the Power Flow Problem
f1 (x1 , x2 , ..., xN ) = 0
f2 (x1 , x2 , ..., xN ) = 0
.. (2.36)
.
fN (x1 , x2 , ..., xN ) = 0
(2.38)
h i−1
⇒ X (n+1) = X (n) + 4X (n) = X (n) − J (n) f (n) (2.40)
25
Chapter 2 Distribution Power Flow
∂Pp
= −vp vq ypq sin(θpq − δp + δq ), q 6= p (2.46)
∂δq
The diagonal and off-diagonal elements of J2 are:
∂Pp X
= 2vp ypp cos(θpp ) + vq ypq cos(θpq − δp + δq ) (2.47)
∂vp q6=p
∂Pp
= vp ypq cos(θpq − δp + δq ), q 6= p (2.48)
∂vq
26
2.4 Solution of the Power Flow Problem
∂Qp
= −vp vq ypq cos(θpq − δp + δq ), q 6= p (2.50)
∂δq
∂Qp
= −vp ypq sin(θpq − δp + δq ), q 6= p (2.52)
∂vq
New estimates for voltage magnitudes and phase angles are computed
from:
27
3. Optimization for Power Systems
29
Chapter 3 Optimization for Power Systems
implies looking for the value known as the optimum value, which corre-
sponds to the minimum or maximum of the problem. An optimization
problem depends on different components: objective function, variables
and also, constraints. The objective function, denoted f , corresponds
to the function to minimize or to maximize. It generally gives a sin-
gle number which measures the quality of a solution of the problem.
The variables, denoted x, are the unknowns of the problem to which
the best values must be given in order to optimize the value of the
objective function. The constraints, denoted g, are functions establish-
ing some relations that the variables must fulfill. They usually are of
two types: inequality or equality constraints. Taking into account the
above, problem that is considered here can be described as:
min f (x)
subject to gi (x) = 0, i ∈ E (3.1)
gi (x) ≥ 0, i ∈ I
where f , the objective function, and g, the constraint functions, are con-
tinuously differentiable. Finite sets E and I describe the equality and
inequality constraints respectively. Either of the two sets E and I may
be empty and if so, we have an unconstrained optimization problem.
For instance, the set can contain the possible discrete restrictions on
the variables which require that the concerned variables take only some
particular values, like integer values. The variables which are subject to
such restrictions are known as the discrete variables. A problem which
has no discrete restriction is said to be continuous, otherwise it is re-
ferred to as discrete. If the problem comprises continuous and discrete
variables, the problem is also known as a mixed integer problem.
and is called the feasible region. When, for a given problem, the feasible
set X is empty, the problem has no solution and is said to be infeasible.
A point x̊ which minimizes the objective function is known as an opti-
mum solution and the value of f at this point is the optimum value.
30
3.1 Notation and terminology
3.1.2. Convexity
31
Chapter 3 Optimization for Power Systems
(3.4)
Strictly convex function: A function f is called strictly convex if and
only if
32
3.1 Notation and terminology
3.1.3. Duality
(P ) (D)
T
min c x max bT y
(3.8)
Ax ≥ b AT y ≤ c
x≥0 y≥0
where X and Y are feasible sets of problems (P ) and (D). The following
theorem is easily established and gives us an important relation between
the two problems.
Theorem 3.3 (Weak Duality). If x0 is feasible for the primal, and
y0 is feasible for dual, then
cT x0 ≥ bT y0 (3.9)
33
Chapter 3 Optimization for Power Systems
the primal are all larger than the values associated with the dual. Since
the primal seeks a minimum and the dual seeks a maximum, each seeks
to reach the other. From this follows an important corollary.
Theorem 3.4 (Strong Duality). If primal P has optimal solution x̊
and dual D has optimal solution λ̊, it can be written
cT x̊ = bT ẙ (3.10)
The above corollary shows that if either of the problems (P ) or (D) has
a finite optimal solution, so does the other, and the corresponding values
of the objective functions are equal. If either problem has an unbounded
objective, the other problem has no feasible solution.
min f (x)
(3.11)
gi (x) ≤ 0, i = 1, ..., m
If infinity penalty for leaving feasible set X is introduced
(
0, x∈X
q(x) = (3.12)
+∞, x∈
/X
Problem from Equation 3.11 can be changed to the problem of uncon-
strained optimization
min F (x) = f (x) + q(x), x ∈ Rn (3.13)
where q(x) is approximated with the set of penalty functions. There are
two types of penalty functions: exterior penalty functions, approxima-
tion from outside, and interior penalty functions, approximation from
inside, as shown in Fig. 3.3.
34
3.1 Notation and terminology
if (x̊, λ̊) is the solution of start equations and D1 , ..., Dm+n are main
minors of matrix H(x̊, λ̊), then
• (−1)m D2m+1 > 0, ..., (−1)m Dm+n > 0 implies that x̊ is strict local
minimum
• (−1)m+1 D2m+1 > 0, ..., (−1)n Dm+n > 0 implies that x̊ is strict
local maximum
Theorem 3.5 (Necessary conditions for local minimum). If x̊
is local minimum of Lagrange function L, then for ∃λ̊ = (λ̊1 , ..., λ̊m ) is
satisfied.
Theorem 3.6 (Sufficient conditions for local minimum). If (x̊, λ̊)
is stationary point of Lagrange function L, and if matrix ∇2xx L(x̊, λ̊) is
35
Chapter 3 Optimization for Power Systems
positive definite on tangent area (y T ∇2xx L(x̊, λ̊) > 0, y 6= 0 such that
y T ∇gi (x̊) = 0, i = 1, ..., m) then x̊ is strict local minimum.
Theorem 3.7 (Sufficient conditions for positive definiteness
on tangent area). If (−1)m D2m+1 > 0, ..., (−1)m Dm+n > 0 then
∇2xx L(x̊, λ̊) is positive definite matrix on tangent area.
36
3.2 Unconstrained and constrained optimization
In this section the necessary and sufficient conditions for the minimum
or maximum of an unconstrained function of several variables are con-
sidered.
Theorem 3.10 (Necessary Condition). If f (X) has an extreme
point (maximum or minimum) at X = X̊ and if the first partial deriva-
tives of f (X) exist at X̊, then
∂f ∂f ∂f
(X̊) = (X̊) = ... = (X̊) = 0 (3.17)
∂x1 ∂x2 ∂xn
Theorem 3.11 (Sufficient Condition). A sufficient condition for
a stationary point X̊ to be an extreme point is that the matrix of
second partial derivatives (Hessian matrix) of f (X) evaluated at X̊ is
(i) positive definite when X̊ is a local minimum point, and (ii) negative
definite when X̊ is a local maximum point.
Method of multi-variable unconstrained optimization can be described
with the following steps:
1. Solve ∇f 0 (X) to get a candidate X̊.
2. If H(X̊) is positive definite then X̊ is a local minimum. If H(X̊)
is negative definite then X̊ is a local maximum.
3. If f (X) is convex then a local minimum is a global minimum. If
f (X) is concave then a local maximum is a global maximum.
37
Chapter 3 Optimization for Power Systems
where
x1
x2
X= .. .
.
xn
∂L
= gj (X) = 0, j = 1, 2, ..., m (3.21)
∂λj
Equations 3.20 and 3.21 represent n+m equations in terms of the n+m
unknowns, xi and λj . The solution of Equations 3.20 and 3.21 gives
x̊1 λ̊1
x̊2
λ̊2
X̊ = .. and λ̊ = ..
. .
x̊n λ̊m
38
3.2 Unconstrained and constrained optimization
39
Chapter 3 Optimization for Power Systems
∂L
(X, Y, λ) = Gj (X, Y) = gj (X)+yj2 = 0, j = 1, 2, ..., m (3.28)
∂λj
∂L
(X, Y, λ) = 2λj yj = 0, j = 1, 2, ..., m (3.29)
∂yi
It can be seen that Equations 3.27-3.29 represent n + 2m equations in
the n + 2m unknowns, X, λ, and Y . The solution of Equations 3.27-
3.29 thus gives the optimum solution vector, X̊; the Lagrange multiplier
vector,λ̊; and the slack variable vector, Y̊.
Kuhn–Tucker Conditions
If the set of active constraints is not known, the Kuhn–Tucker conditions
can be stated as follows:
X
(i) ∇f (x̊) + λ̊i ∇gi (x̊) = 0
(ii) λ̊i ∇gi (x̊) = 0, i = 1, ..., m
(3.30)
(iii) λ̊ ≥ 0
(iv) gi (x̊) ≤ 0, i = 1, ..., m
For a class of convex programming problems, Kuhn–Tucker conditions
are necessary and sufficient for a global minimum.
40
3.3 Classical Optimization Techniques
41
Chapter 3 Optimization for Power Systems
42
3.3 Classical Optimization Techniques
The interior point (IP) method is originally used to solve linear pro-
gramming. It is faster and perhaps better than the conventional sim-
plex algorithm in linear programming. IP methods were first applied
to solve OPF problems in the 1990s, and recently, the IP method has
been extended and improved to solve OPF with QP and NLP forms [2].
43
Chapter 3 Optimization for Power Systems
Mixed integer nonlinear programs (MINLP) are one of the most general
types of finite-dimensional, single-objective mathematical programs. Con-
taining both, continuous and integer decision variables, and without
any limitation to the complexity of either the objective function or the
constraints, these problems are classified as NP-hard. Mixed-integer
optimization represents a powerful framework for mathematically mod-
eling many optimization problems. Over the last five years there has
been a significant increase in the development of these models in pro-
cess systems engineering. In the most recent years, considerable number
of researchers including chemical engineers, operations researchers, in-
dustrial engineers, mechanical engineers, economists, statisticians, com-
puter scientists, operations managers, and mathematical programmers
are interested in solving large-scale Mixed Integer Nonlinear Program-
ming (MINLP) problems. This great interest is a result of the fact
that most of the applications from the real-world can be modeled as
MINLP problems. Additionally, the performance of solvers handling
nonlinear constraints was largely improved, making this class of prob-
lems even more challenging. It is possible to restrict MINLP model
44
3.4 Mixed Integer Nonlinear Programming
45
Chapter 3 Optimization for Power Systems
min cT x + dT y
Ax + By ≤ b
(3.32)
x∈X
y∈Y
Different issues arise when one tries to solve this kind of problems. Some
heuristic and exact methods are tailored for a widely studied subclass of
these problems: convex NLPs. In this case, the additional assumption
is that f and g are convex functions. Some of these methods can be
used for more general non-convex NLPs, but no guarantee on the global
optimality of the solution is given. In particular, when no assumption
on convexity is done, the problem usually has local optimal solutions.
46
3.4 Mixed Integer Nonlinear Programming
The most complex case we can face to is non-convex Mixed Integer Non-
linear Programming. In this case, solutions which are optimal within
a restricted part of the feasible region (neighborhood), are not optimal
and not considering entire feasible region. This issue implies, for ex-
ample, that, if sub-problems are solved, there is no guarantee that the
solution provided is a global optimum. It means that the linearization
cuts might cut off not only infeasible points, but also parts of the feasi-
ble region. For this reason, when non-convex constraints are involved,
one has to carefully use linearization cuts. The relaxation of the orig-
inal problem, obtained using convex envelopes or under-estimators of
the non-convex functions, MINLP has the form:
min z
f (x, y) ≤ z
g(x, y) ≤ 0 (3.34)
x∈X
y∈Y
47
Chapter 3 Optimization for Power Systems
minimize f (x),
subject to c(x) ≤ 0,
(3.35)
x∈X
li ≤ xi ≤ ui, ∀i ∈ I
48
3.5 MINLP Methods
Pruning rules
Let U be an upper bound on the optimal value of problem (initialized
as U = inf ). Nodes are pruned in the following three cases:
Infeasible nodes: If any node is infeasible, then any node in its sub-tree
is also infeasible and the node can be assumed to be fathomed (pruned).
Integer feasible nodes: If a node produces an integer feasible solution
then this solution is optimal in the whole sub-tree starting at this node.
And this node can therefore be assumed to be fathomed. The optimal
value of this node provides an upper bound (new incumbent solution)
on the solution of problem, which can be used to fathom nodes.
Upper bounds on NLP nodes: If the optimal value of a node or its
lower bound is greater than or equal to the current upper-bound then
this node is fathomed since no improved solution can be found in its
sub-tree.
Finally, if none of the above conditions are satisfied, one of the variables
is fractional and two new sub-problems can be created, with the variable
alternately relaxed. This is called branching.
yi = 1
yi = 0
Branching
If the solution x̊ is feasible but not integral, then we any non-integral
variable is branched. Branching introduces two new NLP nodes, also
referred to as child nodes. In particular, it is necessary to initialize
bounds for two new problems as (l−, u−) = (l, u) and (l+, u+) = (l, u)
49
Chapter 3 Optimization for Power Systems
minimize f (x)
(j)
subject to c(x) ≤ 0 (N LP (xI )) (3.36)
(j)
x ∈ X and xI = xI
50
3.5 MINLP Methods
minimize η
subject to f (x) ≤ η
c(x) ≤ 0 (3.37)
x∈X
xi ∈ Z, ∀i ∈ I
and observe that the convexity of f and c implies that the linearization
(j)
about the solution x(j) of (N LP (xI )) given by
minimize η
subject to η ≥ f (j) + ∇f (j)T (x − x(j) ), ∀x(j) ∈ χ
0 ≥ c(j) + ∇c(j)T (x − x(j) ), ∀x(j) ∈ χ (3.40)
x∈X
xi ∈ Z, ∀i ∈ I
It is possible to show that Equations 3.37 and 3.40 have the same opti-
mal value and that any solution of Equation 3.37 is an optimal solution
of Equation 3.40. However, the converse is not true. Duran and Gross-
mann (1986) propose a relaxation algorithm that solves an alternating
sequence of MILP problems and NLP sub-problems. Also, it is possible
to add an upper bound on η corresponding to the best solution found
so far:
n o
η < U k = min f (j) |N LP (x(j) ) is f easible (3.41)
51
Chapter 3 Optimization for Power Systems
minimize η
subject to η ≤ U k − ε
η ≥ f (j) + ∇f (j)T (x − x(j) ), ∀x(j) ∈ χ
(3.42)
0 ≥ c(j) + ∇c(j)T (x − x(j) ), ∀x(j) ∈ χ
x∈X
xi ∈ Z, ∀i ∈ I
(j) T
X (j)
η ≥ (f (j) + λ(j)T c(j) ) + ∇f (j) + λi ∇ci (x − x(j) ) (3.43)
52
3.5 MINLP Methods
which is the Benders cut for feasible sub-problems. Also, note that the
(j)
optimality of (N LP (xI )) implies the existence of multipliers of the
bounds and that their value is equal to the gradient in the Benders cut.
Thus, we the Benders cut can be written compactly as
(j) T
(j)
η ≥ f (j) + µi (xI − xI ) (3.46)
The advantage of the Benders cuts is that they involve only the integer
variables and one objective variable. A disadvantage is that the Benders
cuts are almost always dense. Moreover, the Benders cuts are weaker
than the outer approximation cuts from which they are derived.
53
Chapter 3 Optimization for Power Systems
z(k) = min η
s.t. η ≥ f (x̊) + ∇f (x̊)T (x − x̊), x̊ ∈ K
(3.47)
gj (x̊) + ∇gj (x̊)T (x − x̊) ≤ 0, j ∈ J, x̊ ∈ K
x ∈ X, XI ∈ Z I
54
3.5 MINLP Methods
Figure 3.6.: (a) Extended Cutting Plane, (b) LP/NLP Based Branch and
Bound
55
Chapter 3 Optimization for Power Systems
The first work in SQP field can be found in Wilson’s doctoral disser-
tation, where his algorithm represents special case of convex problems
solving an inequality constrained quadratic sub-problem in each itera-
tion. Sequential quadratic programming has become popular with the
work of Big and Han. Bigg proposed algorithm where quadratic sub-
problem had only equality constraints. The modern era of SQP methods
can be traced to the publication of the Han-Powell method in 1976. Han
solved inequality constrained problem with Hessian and quasi-Newton
approximation to the Hessian of the Lagrangian function. Powel pro-
posed a method similar to Han’s method but where algorithm converged
superlinearly even if Hessian and Lagrangian function was indefinite.
Current implementations of SQP methods for large-scale optimization
have solved problems with as many as 40,000 variables and inequality
constraints. SQP represents a conceptual method from which specific
algorithms have evolved.
56
3.7 SQP Methods
57
Chapter 3 Optimization for Power Systems
M (xk )−M (xk +dk ) ≥ η(mk (xk )−mk (xk +dk )), xk +dk ≥ 0 (3.49)
1
minimizexRn fk + gkT (x − xk ) + (x − xk )T Bk (x − xk ) (3.51)
2
subject to
ck + Jk (x − xk = 0, x ≥ 0, )
58
3.7 SQP Methods
subject to
kdk∞ ≤ δk ,
59
Chapter 3 Optimization for Power Systems
(h(x̊), f (x̊)) if h(x̄) ≤ βh(x̊) and f (x̄) ≤ f (x̊) − γh(x̊), whereβ, γ(0, 1)
are constraints.
The filter is called “slooping filter” when filter consists of a list of entries
(hj , fj ). The original filter proposed by Fletcher and Leyffer uses γ =
0, β = 1. A pair of (h(x̊), f (x̊)) is said to be “acceptable to the
filter” F if it is not dominated by another filter which represents h(xk ) ≤
βhj .Sometimes this points are added to filter and then entries that are
dominated by the new pair are removed.
Important property of the filter is that if there are an infinite sequence
of iteration in which (h(xk ), f (xk )) is entered into the filter {f (xk )}is
bounded below than h(xk ) → 0.
60
3.7 SQP Methods
minimize f (x)
subject to h(x) = 0 (3.56)
g(x) ≤ 0
61
Chapter 3 Optimization for Power Systems
δ 2 f (x)
Hf (x)i,j = (3.58)
δxi , δxj
Lagrangian function is defined as
∇g(xk )t dx + g(xk ) ≤ 0
62
3.7 SQP Methods
xk+1 = xk + αdx
uk+1 = uk + αdu
v k+1 = v k + αdv
63
Chapter 3 Optimization for Power Systems
be defined
X
L(x, λ) = f (x) + λj hj (x) = f (x) + λT h(x) (3.64)
jE
X
Q = ∇2 f (x) + λj ∇2 hj (x) = ∇2xx L(x, λ), (3.67)
j
∇h1 (x)T
B = h0 (x) =
..
(3.68)
.
∇hp (x) T
If for the next set of problem, matrix B has full rank and it is positive
defined matrix Q, the linear system of the equations mentioned above
is uniquely solved
" #" # " #
Q BT 4x ∇f (x)
=−
B 0 λ+ h(x)
64
3.8 Example 3.1
1
minimize q(4x) = 4xT Q4x + ∇f (x)T 4x + f (x)
2
subject to ∇gi (x)T 4x + gi (x) ≤ 0, iI (3.70)
where
X X
Q = Q(x, λ, µ) = ∇2 f (x) + λi ∇2 gi (x) + µj ∇2 hj (x) (3.71)
iI jE
Consider the three-bus system shown in Fig. 3.7. Known quantities are
also shown in figure (in p.u.). Given:
65
Chapter 3 Optimization for Power Systems
Figure 3.7.: Three bus network with linear compensation of reactive power
E1 1 0 0 V1
I2 = −Y12 Y12 + Y23 −Y23 V2 (3.72)
I3 0 −Y23 Y23 V3
66
3.8 Example 3.1
E1 1 0 0 V1
0.2 + j0.3 = −1 + j3 2 − j6 −1 + j3 V2
−1 − j5 0 −1 + j3 1 − j3 V3
(3.73)
subject to
67
Chapter 3 Optimization for Power Systems
where
∂f ∂f
= I12r R + λ1 = f1 = I12r + I2r − I23r = f5
∂I12r ∂λ1
∂f ∂f
= I12im R + λ3 = f2 = I23r − I3r = f6
∂I12im ∂λ2
∂f ∂f
= I23r R − λ1 + λ2 = f3 = I12im + I2im t − I23im = f7
∂I23r ∂λ3
∂f ∂f
= I23im R − λ3 + λ4 = f4 = I23im − I3im = f8
∂I23im ∂λ4
∂f
= λ3 I2im = f9
∂t
(3.80)
Next step is to calculate Jacobian matrix J:
∂f ∂f1 ∂f1 ∂f1 ∂f1 ∂f1 ∂f1 ∂f1 ∂f1
1
∂I
∂f
12r
2
∂I12im
∂f2
∂I23r
∂f2
∂I23im
∂f2
∂λ1
∂f2
∂λ2
∂f2
∂λ3
∂f2
∂λ4
∂f2
∂t
∂f2
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f3 ∂f3 ∂f3 ∂f3 ∂f3 ∂f3 ∂f3 ∂f3 ∂f3
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f4 ∂f4 ∂f4 ∂f4 ∂f4 ∂f4 ∂f4 ∂f4 ∂f4
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f5 ∂f5 ∂f5 ∂f5 ∂f5 ∂f5 ∂f5 ∂f5 ∂f5
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f ∂f6 ∂f6 ∂f6 ∂f6 ∂f6 ∂f6 ∂f6 ∂f6
6
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f7 ∂f7 ∂f7 ∂f7 ∂f7 ∂f7 ∂f7 ∂f7 ∂f7
∂I ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
12r
∂f8 ∂f8 ∂f8 ∂f8 ∂f8 ∂f8 ∂f8 ∂f8 ∂f8
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
∂f9 ∂f9 ∂f9 ∂f9 ∂f9 ∂f9 ∂f9 ∂f9 ∂f9
∂I12r ∂I12im ∂I23r ∂I23im ∂λ1 ∂λ2 ∂λ3 ∂λ4 ∂t
(3.81)
In Newton-Raphson method, the vector of system variables is given
with
h i−1
4X (n) = − J (n) f (n) (3.82)
or, when it is applied to the given model, vector of system variables
becomes
(n) −1 (n)
4I12r R f1
0 0 0 1 0 0 0 0
4I12im 0 R 0 0 0 0 1 0 0 f2
4I23r
0 0 R 0 −1 1 0 0 0
f3
4I23im
0 0 0 R 0 0 −1 1 0
f4
4λ1
=−
1 0 −1 0 0 0 0 0 0
f5
4λ2 0 0 1 0 0 0 0 0 0 f6
4λ3 −1
0 1 0 0 0 0 0 I2im f7
4λ4 0 0 0 1 0 0 0 0 0 f8
4t 0 0 0 0 0 0 I2im 0 0 f9
68
3.9 Example 3.2
(3.83)
Results
The main goal here was to minimize losses using linear compensation
of reactive power. For the linear compensation parameter t is used in
reactive component of complex current of generator. To verify effective-
ness of the method, 3-bus system is used for test. The simulations were
performed using C++ software. The test was carried out by solving the
optimal power flow problem of the power loss objective. The obtained
results are presented in Tab. 3.1. The results shown here illustrate that
this method can be used for managing reactive power to improve per-
formance of power system by increasing flow of active power.
69
Chapter 3 Optimization for Power Systems
S = P + jQ
P + jQ = (Vr + jVim )(Ir + jIim )∗ (3.85)
P + jQ = Vr Ir + Vim Iim + j(−Vr Iim + Vim Ir )
M in (I12r )2 + (I12im )2 R + (I23r )2 + (I23im )2 R (3.86)
subject to
70
3.9 Example 3.2
71
Chapter 3 Optimization for Power Systems
active powers PL1 , PL2 , PL3 . Impedance of the line in the network is the
same ZL = 0.01 + j0.05. Aim is to find min 3i=1 Ci , where PGi min ≤
P
PGi ≤ PGi max . In order to solve this problem power flow analysis and
SQP approach are used. More about power flow analysis can be found
in [3].
First step in solving this problem represent forming set of equations for
the nodes in the network. Using power flow analysis set of equations
72
3.10 Example 3.3
can be formed so that power flows from node 1 to the node 6, as follows:
S = P + jQ
where P represents active power which is real part of the complex power
and Q is reactive part and represents imaginary part of the equation.
If real and imaginary part of the equation write as:
n
X
Pi = Vi Vj Yij cos(θij − δi + δj )
j=1
n (3.109)
X
Qi = − Vi Vj Yij sin(θij − δi + δj )
j=1
73
Chapter 3 Optimization for Power Systems
Reactive power equations are formed for all nodes except node 1, since
the first generator is referent one and reactive power does not have any
influence on the network.
74
3.10 Example 3.3
Voltages in the initial state have values 1 V. Elements Yxx are elements
of admittance matrix.
1 1
Admittance matrix YL = ZL = 0.01+j0.05 = ... = 19.61∠ − 1.37S.
Y11 Y12 ... Y1n
Y Y22 ... Y2n
YL = 21
... ... ... ...
After this step power flow analysis is finished. Next step in solving this
problem represents applying a SQP method. This method explained in
detail above, and here will be considered just steps needed for calcula-
tion. SQP method requires minimization of the objective function f .
For this problem it represents minimization of the function
2 2 2
f (x) = 0.1PG1 + 0.2PG1 + 0.15PG2 + 0.18PG2 + 0.2PG3 + 0.15PG3
under the condition B4x + h(x) = 0, which in this specific case repre-
sents sum of the power in the nodes. Lagrangian function state as:
2 2
L(x, λ)=0.1PG1 +0.2PG1 +0.15PG2 +0.18PG2
11
X
2
+0.2PG3 +0.15PG3 + λi hi
i=1
where
X
Q = ∇2 f (x) + λj ∇2 hj (x) = ∇2xx L(x, λ),
j
75
Chapter 3 Optimization for Power Systems
and
∇h1 (x)T
B = h0 (x) =
..
.
∇hp (x) T
76
4. Single-phase modeling
77
Chapter 4 Single-phase modeling
lem into several weighted least squares (WLS) sub-problems where each
corresponds to a single branch state estimation; the sub-problems are
coordinated by a forward/backward sweep load flow scheme. A compre-
hensive implementation based on the algorithm in [22] was also tested
in [23]. However, the efficient implementations of branch oriented radial
load flow based approaches assume that the load flow direction is pre-
dictable; this assumption is becoming invalid with the increased levels
of installed distributed generation. Another class of distribution system
state estimators is based on the theory of transmission system state es-
timation, but uses load data as psedo-measurements. References [24]
and [25] employed the WLS method and a three-phase model to esti-
mate the state of the network; reference [24] used an approximation of
the Jacobian matrix which is held constant over a few iterations, while
[25] converted power measurements into current measurements and ex-
pressed bus voltages in rectangular form to obtain a constant Jacobian
matrix. Recent work [26] also proposed an approximate linear state
estimation formulation by making use of rectangular coordinates; this
formulation is intended for incorporating synchronized phasor measure-
ments in distribution state estimation. Unlike [24, 25, 26], reference
[27] proposed a branch current distribution state estimator which em-
ploys branch current phasors as state variables. For systems with Y -
connected loads, the branch current estimator [27] allows the Jacobian
matrix to be decoupled on a per-phase basis, thus improving the effi-
ciency as compared to node voltage based WLS three-phase distribution
system estimation. Reference [15] extended the approach in [27] so that
data from the advanced metering infrastructure could be used to im-
prove the accuracy of the estimation. Pseudo-measurement modeling
has been recently discussed in [28], where the computations were based
on an artificial neural network in conjunction with load profiles. The
above WLS approaches have been demonstrated on small size networks;
it is unlikely that they can satisfy the performance requirements on very
large scale distribution networks. This chapter presents a real-time dis-
tribution system state estimator (DSSE) that satisfies the performance
requirements on practically sized radial distribution network models
and can easily handle distributed generation. The proposed approach
decomposes the state estimation problem into two sub-problems which
are iterated until convergence: (i) The first sub-problem is a WLS esti-
mation problem on a reduced network consisting of measurement areas.
Each measurement area (MA) can contain several groups of Y - or 4-
78
4.1 Problem Description and Basic Principles
79
Chapter 4 Single-phase modeling
80
4.1 Problem Description and Basic Principles
81
Chapter 4 Single-phase modeling
cess, any significant variations in the values of the load scaling factors
which are adjacent to a branch measurement are checked for possible
gross error in this real time measurement. To reduce the computational
effort, the loads within an MA that have the same weights are grouped
together into one load group; consequently the loads in the same group
will be scaled by the same factor. The size of the WLS problem can
be further reduced if the MAs contain only Y -connected equipment be-
cause this allows the decoupling of the problem into three sub-problems,
one for each phase. The decoupling of the problem was discussed earlier
in the context of the branch current estimator [27]. However decoupling
will no longer be valid when the delta connections are modeled as this
would require the calculation of scaling factors for loads connected be-
tween phases. The modeling of unbalanced 4-connected equipment in
a load estimator has not been previously discussed in the literature and
is a distinctive contribution of this chapter.
The inputs to the DSSE consist of the network data, load forecasts,
loads with known power factor, active and reactive power flow measure-
ments, current magnitude measurements, and voltage measurements.
The branch measurements are used to define the MAs with Y -connected
loads; 4-connected loads are grouped in separate MAs even if sufficient
measurements are not available at the boundaries of these areas. The
load forecasts constitute the initial load values that the estimator aims
to adjust by making use of the real time measurements. The initial
load values together with the branch data are used to run a three-phase
load flow and compute the bus voltages and measurement area losses.
A WLS problem (sec. 4.2.1) is then solved for all phases at once; this
yields the load group scaling factors and which are the ratios of the real
and reactive estimated load values to the initially forecasted ones. The
load flow results are also employed to compute sensitivities with respect
to variations in the load group scaling factors for properly handling 4-
connected loads (sec. 4.2.2) and area losses (sec. 4.2.3). The estimated
scaling factors are checked for possible bad data (sec. 4.2.4); if such data
is identified, it is removed from the set of real time measurements and
the WLS problem is solved again. The algorithm iterates between the
WLS and the load flow solutions until the absolute difference of losses
and of voltage deviations from two consecutive load flow iterations is less
82
4.2 Load Estimation with 4-connections
The real time analog measurements Pφ,n M , QM , I M , V M in a distribu-
φ,n φ,n φ,n
tion network are typically very few and mostly located near the primary
transformers and feeder heads, while the rest is sparsely distributed at
strategic locations in different parts of the network. Many of these mea-
surements are often current magnitudes, a measurement type known to
be the least effective in state estimation [1]. The mathematical formu-
lation described in this section employs the available real time measure-
ments and pseudo-measurements (load forecasts) to estimate the load
scaling factors in an MA. While it is possible that the same scaling
factor could be applied to all the loads within one MA, typically the
load forecasts within an MA are not known within the same accuracy.
Therefore, the loads within an MA are grouped based on their forecast
accuracy, or equivalently their weighting factor, and a scaling factor is
associated with each of these load groups. The WLS problem for a net-
work with MAs having only Y -connected loads is given by minimizing
the sum of squared error between the measured and estimated values as
given by (4.1) and (4.2) subject to the MA constraints; the first three
terms in (4.2) are for the real time measurements, the fourth term is for
the pseudo-measurements or forecasted values of load groups, and the
fifth term is to restrict power factor deviations of loads having a speci-
fied power factor. The MA constraints include the active and reactive
area balance constraints in (4.3) and (4.4), the apparent power con-
straints associated with the current magnitude measurements in (4.5)
and (4.6), and the bound limits of the scaling factors in (4.7):
X
minimize J = Jφ (4.1)
φ∈P HY
83
Chapter 4 Single-phase modeling
X (i) (i)
Jφ = [ωnP M (Pφ,n − Pφ,n
M 2
) + ωnQM (Qφ,n − QM 2
φ,n ) ]
n∈P QM
X (i)
+ [ωnCM (Iφ,n − Iφ,n
M 2
) ]
n∈CM
X (i)
+ [ωnV M (Vφ,n − Vφ,n
M 2
) ]
n∈V M
X (i) (i)
+ [ωnP LG (Pφ,n
LG
(KPφ,n − 1))2 + ωnQLG (QLG 2
φ,n (KQφ,n − 1)) ]
n∈LG
X (i) (i)
+ [ωnP F G (KPφ,n − KQφ,n )2 ]
n∈P F G
(4.2)
X (i) X (i)
LG (i)
Pφ,n = KPφ,n Pφ,n + P LOSSφ,M A(m) ,
n∈IM (m) n∈LG(m) (4.3)
m = 1, . . . , MY , φ ∈ P HY
84
4.2 Load Estimation with 4-connections
85
Chapter 4 Single-phase modeling
depicted in Fig. 4.3, this MA has to be split into Area 1 which includes
the Y loads (not shown) and Area 2 which includes the 4 load. The
(i) (i)
LG (i)
LG (i) LG
Pa(i) + Pb = KPab Pab + KPbc Pbc + KPca Pca + P LOSS (i)
(4.8)
(4.9)
Equations (4.8) and (4.9) are not sufficient for load estimation because
the estimated values of the real/reactive power (on the left hand side
86
4.2 Load Estimation with 4-connections
(i−1)
∂Pa
(i) (i−1)
Pa(i) = PaLF (i−1) + (KPab − KPab )
∂KPab
∂Pa (i−1)
(i) (i−1)
+ (KPbc − KPbc ) (4.10)
∂KPbc
∂Pa (i−1)
(i) (i−1)
+ (KPca − KPca )
∂KPca
(i−1)
∂Pb
(i) LF (i−1) (i) (i−1)
Pb = Pb + (KPab − KPab )
∂KPab
∂Pb (i−1)
(i) (i−1)
+ (KPbc − KPbc ) (4.11)
∂KPbc
∂Pb (i−1)
(i) (i−1)
+ (KPca − KPca )
∂KPca
(i−1)
∂Qa
LF (i−1) (i) (i−1)
Q(i)
a = Qa + (KQab − KQab )
∂KQab
(i−1)
∂Qa
(i) (i−1)
+ (KQbc − KQbc ) (4.12)
∂KQbc
(i−1)
∂Qa
+ (KQ(i) (i−1)
ca − KQca )
∂KQca
(i−1)
∂Qb
(i) LF (i−1) (i) (i−1)
Qb = Qb + (KQab − KQab )
∂KQab
(i−1)
∂Qb
(i) (i−1)
+ (KQbc − KQbc ) (4.13)
∂KQbc
(i−1)
∂Qb
+ (KQ(i) (i−1)
ca − KQca )
∂KQca
87
Chapter 4 Single-phase modeling
∂Pφ,n (i−1)
h i
(i) LF (i−1) (i) (i−1)
− KPρ,k
P P
Pφ,n = Pφ,n + ∂KPρ,k (KPρ,k )
ρ∈P H∆ k∈LG(m)
m = MY + 1, . . . , MY + M∆ , n ∈ IM (m), , φ ∈ P HY
(4.16)
∂Qφ,n (i−1)
h i
(i) LF (i−1) (i) (i−1)
− KQρ,k )
P P
Qφ,n = Qφ,n + ∂KQρ,k (KQρ,k
ρ∈P H∆ k∈LG(m)
m = MY + 1, . . . , MY + M∆ , n ∈ IM (m), , φ ∈ P HY
(4.17)
88
4.2 Load Estimation with 4-connections
The power balance equations, given by (4.3) and (4.4) for Y-connection
areas and (4.14) and (4.15) for 4-connection areas, include an estimate
of the losses per area. Similar to the development of (4.10)-(4.13),
this loss estimate can be also expressed as a first-order approximation
around the loss value obtained from the load flow. For Y -connection
areas the loss estimate is expressed on a per-phase basis as shown in
(4.19) and (4.20), whereas for the 4-connection areas it is given by
(4.21) and (4.22) for all phases taken together:
(i) LF (i−1)
P LOSSφ,M A(m) = P LOSSφ,M A(m)
" #(i−1)
X ∂P LOSSφ,M A(m) (i) (i−1)
+ (KPφ,n − KPφ,n ) (4.19)
n∈LG(m)
∂KPφ,n
m = 1, . . . , MY , φ ∈ P HY
(i) LF (i−1)
QLOSSφ,M A(m) = QLOSSφ,M A(m)
" #(i−1)
X ∂QLOSSφ,M A(m) (i) (i−1)
+ (KQφ,n − KQφ,n ) (4.20)
n∈LG(m)
∂KQφ,n
m = 1, . . . , MY , φ ∈ P HY
(i) LF (i−1)
P LOSSM A(m) = P LOSSM A(m)
" #(i−1)
X X ∂P LOSSM A(m) (i) (i−1)
+ (KPρ,k − KPρ,k )
ρ∈P H∆ k∈LG(m)
∂KPρ,k
m = MY + 1, . . . , MY + M∆
(4.21)
89
Chapter 4 Single-phase modeling
(i) LF (i−1)
QLOSSM A(m) = QLOSSM A(m)
" #(i−1)
X X ∂QLOSSM A(m) (i) (i−1)
+ (KQρ,k − KQρ,k )
ρ∈P H∆ k∈LG(m)
∂KQρ,k
m = MY + 1, . . . , MY + M∆
(4.22)
90
4.2 Load Estimation with 4-connections
91
Chapter 4 Single-phase modeling
The numerical results are reported on three test system models. The
first system is the IEEE 13-node test feeder [37] which is used to demon-
strate the accuracy of the proposed DSSE and to compare it with an
implementation of the current balancing method in [17]. The second and
third systems are employed to demonstrate the solution performance;
the third system is a large network representing a typical US distribu-
tion utility. The DSSE is implemented in C++ and makes extensive use
of shared memory. The weights are set to 100 for measurements, 1 for
industrial loads whose pattern of behavior can be well predicted, and
0.01 for other loads. The numerical calculations are carried out using
the Intel MKL library.
Fig. 4.4 displays the schematic of the IEEE 13-node test feeder, whose
complete data set including the line configuration and unbalanced load
data can be obtained from [37]. Tab. 4.1 includes a summary of the load
connection types, and the phases which carry load. The measurement
set is summarized in the first four columns of Tab. 4.2 which shows
92
4.3 Numerical Results
Note that the percentage deviation error (e) denotes the absolute dif-
ference between the true and estimated values, normalized by the true
value. It is obvious from Tab. 4.2 and Tab. 4.3 that DSSE adjusts the
loads using reasonable scaling factors and produces less error deviations
in the estimated values of the measurements as compared to current bal-
93
Chapter 4 Single-phase modeling
ancing [17]. Tab. 4.4 shows a comparative summary of the average and
maximum error deviations at the base load and with 25% and 50% load
increase. These results again show that DSSE produces significantly
better values for the average and maximum error deviations even at
different operating conditions. In fact, Tab. 4.4 shows that the worst
case error deviation for DSSE is 4.71%, whereas for current balancing
it is 80.74%.
The accuracy of the DSSE was also tested with 3 MAs as shown in
Fig. 4.5, and one MA as shown in Fig. 4.6. For each of these cases,
including the initial case of Fig. 4.4, the sum of the absolute mismatch
between the estimated and true load values was computed and displayed
in Tab. 4.5. The results show that load estimation improves when more
94
4.3 Numerical Results
P-Scaling Q-Scaling
Node
A B C A B C
632 1.00 1.00 1.00 1.00 1.00 1.00
634 1.21 1.09 1.02 0.98 0.99 0.99
645 - 0.99 - - 1.02 -
646 - 0.98 - - 0.99 -
671 1.01 1.01 1.01 0.99 0.99 0.99
675 1.03 1.09 0.97 1.00 1.07 1.02
680 1.09 1.12 0.96 0.97 1.07 1.00
652 1.00 - - 0.96 - -
692 - - 0.99 - - 0.98
611 - - 1.00 - - 1.10
EN 1.11 0.97 1.11 0.97 0.92 1.02
Table 4.3.: Active and Reactive power load scaling factors using DSSE
(13-node test feeder)
REF.[4] DSSE
Load Increase [%]
Avg. Max. Avg. Max.
0 9.1 80.74 1.47 4.71
25 5.52 30.86 1.30 3.85
50 7.77 76.68 1.37 4.04
Table 4.4.: Average and maximum values of the error deviations in %
using current balancing [4] and DSSE (13-node test feeder)
95
Chapter 4 Single-phase modeling
the scaling is around 1. The BDF for L11-A is 5.28, which is larger
than the maximum normal value, thus signaling that this measurement
is bad. In the second test, the measured current magnitude in phase-A
of line 11 is now assumed to be 600 A. In this case, the worst scaling
factor KF ROM corresponding to L11-A is negative; it is clamped to zero
in the DSSE results in Tab. 4.6. The corresponding BDF value of 9.82
is much larger than the maximum normal value, again indicating the
existence of bad data.
96
4.3 Numerical Results
Loc. Ph.
KF ROM KT O BDF KF ROM KT O BDF
T R1 A 1.00 0.91 0.09 1.00 0.91 0.09
T R1 B 1.00 0.98 0.02 1.00 0.98 0.02
T R1 C 1.00 0.98 0.02 1.00 0.98 0.02
L3 A 0.91 0.21 0.70 0.91 0.00 0.91
L3 B 0.98 1.02 0.04 0.98 1.02 0.04
L3 C 0.98 1.02 0.04 0.98 1.02 0.04
L11 A 0.21 5.49 5.28 0.00 9.82 9.82
L11 C 0.98 1.06 0.08 0.98 1.06 0.08
Table 4.6.: Bad data identification in the 13-node test system with 3
MAs
97
Chapter 4 Single-phase modeling
Computing Time
# MA
Without Bad Data [ms] With Bad Data [ms]
2 81.4 94.2
5 84.5 98.7
10 89.9 107.7
20 98.5 119.3
Table 4.7.: Computing time of DSSE for a 642-node distribution
network
DSSE for the network as a whole on one server. To show the capacity
of the proposed approach in handling such cases, the load estimation
performance test was executed on a large distribution network under
simulated real time conditions. A representative network portion of a
large US distribution utility was replicated 50 times to simulate the real
full size of the utility’s network. Tab. 4.8 shows key numbers charac-
terizing the network which has about 1 million nodes and 3500 feeders.
The DSSE for the complete network requires between 375 and 536 s
corresponding to key event characteristics in the network; these figures
are in compliance with standard performance requirements as speci-
fied for DMS control centers. With typical bad data identification, the
computing time increases by an average of 15-20%.
98
4.4 Numerical Sensitivity Factors
99
Chapter 4 Single-phase modeling
∂Qa QSLF
a − QLF
a QSLF − QLF
= Lim ≈ a a
(4.25)
∂KPca ∆KPca →0 ∆KPca ∆KPca
∂Qb QSLF
b − QLF
b QSLF − QLF
= Lim ≈ b b
(4.26)
∂KPca ∆KPca →0 ∆KPca ∆KPca
100
5. Multiphase modeling
101
Chapter 5 Multiphase modeling
or
" # " #" #
Ip Y pp Y pq Vp
= (5.2)
Iq Y qp Y qq Vq
Ip Y pp Y pq Vp
|{z} |{z} |{z} |{z}
nϕp ×1
nϕp ×1 nϕp ×nϕp nϕp ×nϕq
I = Y (5.3)
Y qq V
q qp q
|{z}
|{z} |{z} |{z}
nϕq ×1 nϕq ×nϕp nϕq ×nϕq nϕq ×1
102
5.1 Multiphase branch π equivalent
103
Chapter 5 Multiphase modeling
(k)
(k) jδp
v (k)
p = vp e (5.8)
(k)
(k) jδq
v (k)
q = vq e (5.9)
(k,l)
(k,l) jθpp
y (k,l)
pp
= ypp e (5.10)
(k,l)
(k,l) jθpq
y (k,l)
pq
= ypq e (5.11)
nϕp −1
X
(k)
Ppq = vp(k) vp(l) ypp
(k,l)
cos δp(k) − δp(l) − θpp
(k,l)
+
l=0
nϕq −1
(5.13)
X
vp(k) vq(l) ypq
(k,l)
cos δp(k) − δq(l) − (k,l)
θpq
l=0
nϕp −1
X
Q(k)
pq = vp(k) vp(l) ypp
(k,l)
sin δp(k) − δp(l) − θpp
(k,l)
+
l=0
nϕq −1
(5.14)
X
vp(k) vq(l) ypq
(k,l)
sin δp(k) − δq(l) − θpq
(k,l)
l=0
104
5.1 Multiphase branch π equivalent
(l)
∂Ppq
(k)
|k6=l = vp(l) ypp
(l,k)
cos δp(l) − δp(k) − θpp
(l,k)
(5.15)
∂vp
(l) (l)
∂Ppq Ppq
(l)
= (l)
+ vp(l) ypp
(l,l) (l,l)
cos θpp (5.18)
∂vp vp
(l)
∂Ppq
(k)
|k6=i = vp(l) vp(k) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
(5.19)
∂δp
105
Chapter 5 Multiphase modeling
and when (k = l)
(l) nϕp −1
∂Ppq X
(l)
= − vp(l) vp(k) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
∂δp k=0,k6=i
nϕq −1
X
+ vp(l) vq(k) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
k=0
nϕp −1
X (5.20)
= − vp(l) vp(k) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
k=0
nϕq −1
X
+ vp(l) vq(k) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
k=0
2
+ vp(l) (l,l)
ypp sin (l,l)
θpp
(l)
∂Ppq
2
(l)
= − Q(l) (l)
pq + vp
(l,l)
ypp (l,l)
sin θpp (5.21)
∂δp
∂Pp ∂Pp
5.1.2.2. ∂vq and ∂δq
(l)
∂Ppq
(k)
= vp(l) ypq
(l,k)
cos δp(l) − δq(k) − θpq
(l,k)
, ∀k (5.22)
∂vq
(l)
∂Ppq
(k)
= vp(l) vq(k) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
, ∀k (5.23)
∂δq
106
5.1 Multiphase branch π equivalent
∂Qp ∂Qp
5.1.2.3. ∂vp and ∂δp
(l)
∂Qpq
(k)
|k6=l = vp(l) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
(5.24)
∂vp
and for (k = i)
(l) nϕp −1
∂Qpq X
(l)
= vp(k) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
+
∂vp k=0,k6=l
nϕq −1
X (5.25)
+ vq(k) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
−
k=0
− 2vp(l) ypp
(l,l) (l,l)
sin θpp
(l) nϕp −1
∂Qpq X
(l)
= vp(k) ypp
(l,k)
sin δp(l) − δp(k) − θpp
(l,k)
+
∂vp k=0
nϕq −1
X (5.26)
+ vq(k) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
−
k=0
− vp(l) ypp
(l,l) (l,l)
sin θpp
(l) (l)
∂Qpq Qpq
(l)
= (l)
− vp(l) ypp
(l,l) (l,l)
sin θpp (5.27)
∂vp vp
(l)
∂Qpq
(k)
|k6=l = −vp(l) vp(k) ypp
(l,k)
cos δp(l) − δp(k) − θpp
(l,k)
(5.28)
∂δp
107
Chapter 5 Multiphase modeling
and for (k = l)
(l) nϕp −1
∂Qpq X
(l)
= vp(l) vp(k) ypp
(l,k)
cos δp(l) − δp(k) − θpp
(l,k)
+
∂δp k=0,k6=l
nϕq −1
X
+ vp(l) vq(k) ypq
(l,k)
cos δp(l) − δq(k) − θpq
(l,k)
k=0
nϕp −1
X (5.29)
= vp(l) vp(k) ypp(l,k)
cos δp(l) − δp(k) − θpp(l,k)
+
k=0
nϕq −1
X
+ vp(l) vq(k) ypq
(l,k)
cos δp(l) − δq(k) − θpq(l,k)
k=0
2
− vp(l) ypp (l,l)
cos θpp (l,l)
(l)
∂Qpq 2
(l)
= P (l) (l)
pq − vp
(l,l)
ypp (l,l)
cos θpp (5.30)
∂δp
∂Qp ∂Qp
5.1.2.4. ∂vq and ∂δq
(l)
∂Qpq
(k)
= vp(l) ypq
(l,k)
sin δp(l) − δq(k) − θpq
(l,k)
, ∀k (5.31)
∂vq
(l)
∂Qpq
(k)
= −vp(l) vq(k) ypq
(l,k)
cos δp(l) − δq(k) − θpq
(l,k)
, ∀k (5.32)
∂δq
108
5.1 Multiphase branch π equivalent
109
Chapter 5 Multiphase modeling
nϕp −1 h
(l) X (l) (k) (l) (k)
Q(l)
pq = Qp0 q = (l,k)
vp0 vp0 ypp (l,k)
sin δp0 − δp0 − θpp +
k=0
i
(l) (l)
+vp0 vq(k) ypq
(l,k)
sin δp0 − δq(k) − θpq
(l,k)
(5.35)
Voltages at side p and p’ of phase k are defined as
(k)
v (k) (k)
p = tpq v p0 (5.36)
(k)
After splitting real ans imaginary part by using (5.7)-(5.11) and tpq =
(k)
tpq ej0 , we obtain
(k)
vp(k) = t(k)
pq vp0 (5.37)
and
(k)
δp(k) = δp0 (5.38)
110
5.1 Multiphase branch π equivalent
111
Chapter 5 Multiphase modeling
Voltage and transformer’s phase relation at node p for any two phase k
and l is
(k) (l)
v (k) (l) (k,l)
p − v p = tpq v p0 − v p0 (5.40)
(k)
Similarly, after separating real and imaginary parts, considering δp =
(k)
δp0 we obtain
h i
(k) (l)
vp(k) cos δp(k) −vp(l) cos δp(l) = t(k,l)
pq vp0 cos δp(k) − vp0 cos δp(l)
(5.41)
and
h i
(k) (l)
vp(k) sin δp(k) −vp(l) sin δp(l) = t(k,l)
pq vp0 sin δp(k) − vp0 sin δp(l)
(5.42)
Fig. 5.8 shows a typical wiring for watt-meter placement on a high volt-
age branch on terminal p. If active power entering terminal p of branch
(k)
pq and its phase k is denoted with Ppq then the corresponding active
(k)
power measurement value is represented with P̃pq . Three phase state
(k)
estimation should calculate value of Ppq with minimum deviation to
(k)
P̃pq . Total number of single phase active power branch measurements
is given by NPB value. Similar configuration applies also to reactive
power meter. Number of single phase reactive power branch measure-
ments is given by NQB value.
112
5.1 Multiphase branch π equivalent
Figure 5.8.: Watt meter connection on a phase using current and po-
tential transformers
Using configuration as shown in Fig. 5.9 it can be seen that total (cu-
mulative) active power of branch pq entering terminal p is given as
BC W1 W2
P̃pq = P̃pq + P̃pq (5.43)
Having cumulative active power measurement for all three phases, it is
not possible to search for minimum deviation per phase. Instead, three
BC to
phase state estimation needs to search minimum deviation of P̃pq
BC (0) (1) (2)
Ppq = Ppq + Ppq + Ppq (5.44)
113
Chapter 5 Multiphase modeling
(k) (k)
Three phase state estimation algorithm has to calculate Pmbp and Qmbp values
(k) (k)
with minimum deviation to P̃mbp and Q̃mbp values, respectively.
114
5.1 Multiphase branch π equivalent
¯
X dim(X
pj,p)−1
(ϕ)
Pcmbp = Ppj (5.48)
j∈Ωb (p) ϕ=0
¯
X dim(X
pj,p)−1
(ϕ)
Qcmbp = Qpj (5.49)
j∈Ωb (p) ϕ=0
115
Chapter 5 Multiphase modeling
116
5.1 Multiphase branch π equivalent
Three phase state estimation algorithm has to calculate Imbp value with
minimum deviation to I˜mbp .
(k)
State variable vp is to be calculated with minimum deviation to phase-
(k)
to-ground voltage magnitude measurement ṽp .
v (k,l)
p = v (k) (l)
p − vp (5.52)
117
Chapter 5 Multiphase modeling
we obtain
r
(k) 2 (l) 2
(k) (l) (k) (l)
vp(k,l) = vp + vp − 2vp vp cos δp − δp (5.57)
(k,l)
Value vp as given by (5.55) is to be calculated with minimum devia-
(k,l)
tion to phase-to-phase voltage magnitude measurement ṽp .
118
5.1 Multiphase branch π equivalent
119
Chapter 5 Multiphase modeling
−I (k,l) (l,k)
injp − I injp = 0 (5.60)
and
∗
(l)
S injp
I (l,k)
p = (l)
vp
we obtain:
∗ ∗
(k) (k) (l) (l)
Pinjp + jQinjp Pinjp + jQinjp
− (k)
−
(l)
=0 (5.61)
vp vp
120
5.1 Multiphase branch π equivalent
(kl) (kl)
Three phase state estimation has to calculate P4p and Q4p with mini-
(kl) (kl)
mum deviation to P̃4p and Q̃4p , respectively. Additionally, equations
(5.64), (5.65), (5.66), and (5.67) have to be satisfied.
Approach described by equations (5.64)-(5.67) introduces four addi-
tional unknowns and four equations. An alternative approach, that
does not introduce additional unknowns, can be also implemented:
(k,l) (k,l)
!∗
(l,k)
P4p + jQ4p
I injp = (k) (l)
vp − vp
h i (5.68)
(k,l) (k,l) (k) (k) (k) (l) (l) (l)
P4p −jQ4p vp cos δp +j sin δp −vp cos δp +j sin δp
= 2 2
(k) (l) (k) (l) (k) (l)
vp + vp −2vp vp cos δp −δp
121
Chapter 5 Multiphase modeling
and
(l) (l,k) (l,k)
S injp = vp(l) cos δp(l) + j sin δp(l) Iinjrep − jIinjimp
h
(l,k) (l,k)
= vp(l) Iinjrep cos δp(l) + Iinjimp sin δp(l) (5.72)
i
(l,k) (l,k)
+j Iinjrep sin δp(l) − Iinjimp cos δp(l)
For the circuit shown in Fig. 5.17 we can write, for each two-phase delta
injection, similar equations as those derived in sec. 5.1.7.3. Active and
reactive powers through two-phase delta injections are not injection
loads.
vp(k) Pp(l,k) cos δp(k) −Q(l,k)
p sin δp(k) +vp(l) Pp(k,l) cos δp(l) −Q(k,l)
p sin δp(l) =0
(5.73)
vp(k) Pp(l,k) sin δp(k) +Q(l,k)
p cos δp(k) +vp(l) Pp(k,l) sin δp(l) +Q(k,k)
p cos δp(l) =0
(5.74)
122
5.1 Multiphase branch π equivalent
and finally
(k)
Pp(k,x) + Pp(k,y) − Pinjp =0 (5.77)
(k)
Q(k,x)
p + Q(k,y)
p − Qinjp =0 (5.78)
(k,l) (k,l)
Three phase state estimation has to calculate P4p and Q4p with
(k,l) (k,l)
minimum deviation to P̃4p and Q̃4p , respectively, while satisfying
equations(5.73)-(5.78).
The approach described by (5.73)-(5.78) introduces 12 additional un-
knowns and 12 equations. An alternative approach, that does not in-
troduce additional unknowns, can be implemented:
5.1.8. PV Nodes
Fig. 5.18 shows simplified power generator voltage regulation block di-
agram. The excitation circuit is supplied by DC voltage is
vreg = f (vref − vf b )
(0) (1) (2)
!!
vp + vp + vp (5.79)
= f vref − g
3
Since the rectifier circuit is placed in negative feed-back loop, the ex-
citation circuit will, in case of un-symmetry, actually regulate average
voltage magnitude on terminals of the generator.Clearly, PV generator
cannot regulate separate voltages, but only its average value.
(0) (1) (2)
vp + vp + vp
vP Vp = (5.80)
3
123
Chapter 5 Multiphase modeling
OLTC modeling is explained in sec. 5.1.4. In case when all tap changer
working synchronously (ganged mode), voltage set point is defined with
equiation (5.80). Otherwise, every phase is separately regulated. In any
case, after successful solution it is necessary to round calculated tap
changer values to the closest possible one, according to the step size.
124
5.2 Three-Phase State Estimation Method
5.2.1. Formulation
N QB
1 NXPB
(k) (k) 2
X
(k) (k) 2
J= wPij Pij − P̃ij + wQij Qij − Q̃ij (5.82)
2 ij∈Ω ij∈Ω
b b
NX
P BC 2 NX
QBC 2
+ wpbcij Pbcij −P̃bcij + wqbcij Qbcij −Q̃bcij (5.83)
ij∈Ωb ij∈Ωb
N QI 2 N QI 2
X (k) (k) X (k) (k)
+ wP Ii Pinji − P̃inji + wQIi Qinji − Q̃inji (5.84)
i=1 i=1
NX
P IC 2 NXQIC 2
+ wpici Pcinji −P̃cinji + wqici Qcinji −Q̃cinji
i=1 i=1
(5.85)
N BI
(k) 2
(k)
wIij Iij − I˜ij
X
+ (5.86)
ij∈Ωb
NX
VG NX
V LL
(k) 2 (k,l) 2
(k) (k,l)
+ wv i v i − ṽi + wvLLi vi − ṽi (5.87)
i=1 i=1
NX
TG 2 NX
T LL 2
(k) (k) (k,l) (k,l)
+ wti tij −t̃ij + wtLLi tij −t̃ij (5.88)
ij∈Ωb ,i=1 ij∈Ωb ,i=1
125
Chapter 5 Multiphase modeling
such that
(k) (k)
cP B ≡fij (vi , vj , vi0 , vj 0 , δi , δj ) − Pij = 0 ∀ij, k ∈ Ωb (5.89)
(k) (k)
cQB ≡gij (vi , vj , vi0 , vj 0 , δi , δj ) − Qij = 0 ∀ij, k ∈ Ωb (5.90)
X (k) X (k) (k)
cP N ≡ Pij − P inji,j + Pshi = 0 ∀i, k ∈ Ωn (5.91)
j∈Ωb (l) j∈Ωinji
X (k) X (k) (k)
cQN ≡ Qij − Qinji,j + Qshi = 0 ∀i ∈ Ωn (5.92)
j∈Ωb (l) j∈Ωinji
5.2.2. Solution
126
5.2 Three-Phase State Estimation Method
such that
c(x) = 0 (5.103)
∂L(x)
= 0 =⇒ W (x − x̃) − C T λ = 0 (5.105)
∂x
∂L(x)
= 0 =⇒ c(x) = 0 (5.106)
∂λ
∂c(x)
where the matrix C = ∂x is the Jacobian of c(x).
After applying the Newton method, the nonlinear set of equations
(5.105)-(5.106) is solved iteratively, where in each iteration the following
linearized system is solved:
" #(iter) " #(iter) " #(iter−1)
W CT 4x W (x − x̃)
=− (5.107)
C 0 −λ c(x)
where
• [vδ] is vector of dimension 2(N N 1 + 2 · N N 2 + 3 · N N 3) × 1 and
contains phase voltage and angle pairs for every node. Slack node
angle is fixed at 0◦ . Phase voltages at PV nodes are also fixed.
• [P Q] is vector of dimension 4(N B1 + 2 · N B2 + 3 · N B3) × 1
and contains phase active and reactive power pairs for every both
terminals of every branch.
127
Chapter 5 Multiphase modeling
C1,1 C1,2 0 0 0 0 0 0 C1,9 0 0
C C2,2 C2,3 0 0 0 0 0 0 0 0
2,1
C3,1 C3,2 0 0 C3,5 0 0 0 0 0 0
C4,1 0 0 0 0 0 0 0 C4,9 C4,10 0
C=
C
(5.108)
5,1 0 0 0 0 0 0 0 C5,9 0 C5,11
0
C6,2 0 0 0 C6,6 C6,7 0 0 0 0
0 0 C7,3 C7,4 0 0 0 0 0 0 0
C8,1 0 0 0 0 0 0 C8,8 0 0 0
128
5.2 Three-Phase State Estimation Method
Matrix C1,1
(x) (x)
∂cP B ∂fij (vi , vj , vi0 , vj 0 , δi , δj )
i
(y)
= (y)
(5.109)
∂vj ∂vi
(x) (x)
∂cP Bi ∂fij (vi , vj , vi0 , vj 0 , δi , δj )
(y)
= (y)
(5.110)
∂δj ∂δj
(x) (x)
∂cQB ∂g ij (vi , vj , vi0 , vj 0 , δi , δj )
i
(y)
= (y)
(5.111)
∂vj ∂vi
(x) (x)
∂cQBi ∂g ij (vi , vj , vi0 , vj 0 , δi , δj )
(y)
= (y)
(5.112)
∂δj ∂δj
Matrix C1,2
(x) (x)
∂cP B
(
i
∂Pij −1 ∀x, y, ij, pq : x = y ∧ ij = pq
(y)
= (y)
= (5.113)
∂Ppq ∂Ppq 0 ∀x, y, ij, pq : x 6= y ∨ ij 6= pq
(x)
∂cP B
i
(y)
=0 (5.114)
∂Qpq
(x)
∂cQB
i
(y)
=0 (5.115)
∂Qpq
(x) (x)
∂cQB
(
i
∂Qij −1 ∀x, y, ij, pq : x = y ∧ ij = pq
(y)
= (y)
= (5.116)
∂Qpq ∂Qpq 0 ∀x, y, ij, pq : x 6= y ∨ ij 6= pq
129
Chapter 5 Multiphase modeling
Matrix C1,9
Matrix C2,1
(x)
Qshi −v (x) sin θ (k,l)
∀xy, ij : x=y∧i=j
(x) i shi,i
∂cQN vi (x)
i
= (5.121)
(x) (x) (y) (x,y)
∂vj
(y)
v i sin δi −δ i −θ shi,i ∀xy, ij : x6=y∧i=j
∀ij : i6=j
0
(x) 0
∀xy, ij : x=y∧i=j
∂cQNi
(x) (y) (x) (y) (x,y)
(y)
= −vi vi cos δi −δi −θshi,i ∀xy, ij : x6=y∧i=j (5.122)
∂δj
0 ∀ij : i6=j
130
5.2 Three-Phase State Estimation Method
Matrix C2,2
(x) (x)
∂cP N
(
i
∂Pij 1 ∀x, y, ij, pq : x = y ∧ ij = pq
(y)
= (y)
= (5.123)
∂Ppq ∂Ppq 0 ∀x, y, ij, pq : x 6= y ∨ ij 6= pq
(x)
∂cP N
i
(y)
=0 (5.124)
∂Qpq
(x)
∂cQN
i
(y)
=0 (5.125)
∂Qpq
(x) (x)
∂cQN
(
i
∂Qij 1 ∀x, y, ij, pq : x = y ∧ ij = pq
(y)
= (y)
= (5.126)
∂Qpq ∂Qpq 0 ∀x, y, ij, pq : x 6= y ∨ ij 6= pq
Matrix C2,3
(x) (x)
∂cP N
(
i
∂Pinji −1 ∀x, y, i, j : x = y ∧ i = j
(y)
=− (y)
= (5.127)
∂Pinjj ∂Pinjj 0 ∀x, y, i, j : x 6= y ∨ ij 6= pq
(x)
∂cP N
i
(y)
=0 (5.128)
∂Qinjj
(x)
∂cQN
i
(y)
=0 (5.129)
∂P injj
(x) (x)
∂cQN
(
i
∂Qinji −1 ∀x, y, i, j : x = y ∧ ij = pq
(y)
=− (y)
= (5.130)
∂Qinjj ∂Qinjj 0 ∀x, y, i, j : x 6= y ∨ ij 6= pq
131
Chapter 5 Multiphase modeling
Matrix C3,1
Matrix C3,2
Matrix C3,5
Matrix C4,1
132
5.2 Three-Phase State Estimation Method
variables:
(x) (
∂cti,j −1 ∀xy, i, p : x = y ∧ i = p
(y)
= (5.136)
∂vp 0 ∀i, p : i 6= p
(x)
∂cIi,j
(y)
=0 (5.137)
∂δp
Matrix C4,9
Matrix C4,10
Matrix C5,1
(5.141)
133
Chapter 5 Multiphase modeling
and
(x)
(x,y)
∂ctiLL sin δi
∀xy, k, ij, p : x = k ∧ i = p
ij (y)
(k)
= − sin δi ∀xy, k, ij, p : y = k ∧ i = p (5.142)
∂vp
0 otherwise
(x) (x,y) (x)
(x)
(x,y) v i − tij v 0 cos δi ∀xy, k, ij, p : x=k∧i=p
∂ctiLL i
ij (y) (x,y) (y) (y)
(k)
= vi0 tij − vi cos δi ∀xy, k, ij, p : y=k∧i=p
∂δp
0 otherwise
(5.143)
Matrix C5,9
and
(x,y) (x)
(x,y)
∂ctiLL −tij sin δi
∀xy, k, ij, p : x = k ∧ i = p
ij (x,y) (y)
= t sin δi ∀xy, k, ij, p : y = k ∧ i = p (5.145)
∂vp
(k) ij
0 otherwise
Matrix C5,11
134
5.2 Three-Phase State Estimation Method
and
(x,y)
∂ctiLL − v (x) sin δ (x) − v (y)
0 sin δ
(y)
xy = kl ∧ ij = pq
ij i i i i
(k,l)
=
∂tLLpq 0 otherwise
(5.147)
Matrix C6,2
(
∂cP BCij −1 ∀ij, pq : ij = pq ∧ x ∈ Ωb (ij)
= (5.148)
∂Ppq 0 otherwise
∂cP BCij
=0 (5.149)
∂Qpq
∂cQBCij
=0 (5.150)
∂Ppq
(
∂cQBCij −1 ∀ij, pq : ij = pq ∧ x ∈ Ωb (ij)
= (5.151)
∂Qpq 0 otherwise
Matrix C6,6
(
∂cP BCij 1 ∀ij, pq : ij = pq
= (5.152)
∂PBCpq 0 otherwise
∂cQBCij
=0 (5.153)
∂P BCpq
135
Chapter 5 Multiphase modeling
Matrix C6,7
∂cP BCij
=0 (5.154)
∂QBCpq
(
∂cQBCij 1 ∀ij, pq : ij = pq
= (5.155)
∂QBCpq 0 otherwise
Matrix C7,2
(
∂cPcinji −1 ∀i, p : i = p ∧ x ∈ Ωinj (l)
(x)
= (5.156)
∂Pinjp 0 otherwise
∂cPcinji
(x)
=0 (5.157)
∂Qinjp
∂cQcinji
(x)
=0 (5.158)
∂Pinjp
(
∂cQcinji −1 ∀i, p : i = p ∧ x ∈ Ωinj (l)
(x)
= (5.159)
∂Qinjp 0 otherwise
Matrix C7,3
136
5.2 Three-Phase State Estimation Method
(
∂cPcinji 1 ∀i, p : i = p
= (5.160)
∂Pcinjp 0 otherwise
∂cPcinji
=0 (5.161)
∂Qcinjp
∂cQcinji
=0 (5.162)
∂Pcinjp
(
∂cQcinji 1 ∀i, p : i = p
= (5.163)
∂Qcinjp 0 otherwise
Matrix C8,1
(5.164)
(x) (y) (x)
(x,y)
∂cVLL 2vi vi sin δi
∀xy, k, i, p : x = k ∧ i = p
i (x) (y) (y)
(k)
= −2vi vi sin δi ∀xy, k, i, p : y = k ∧ i = p (5.165)
∂δp
0 otherwise
Matrix C8,8
137
6. Three Phase DSSE IEEE Tests
Power System State Estimation (SE) is one of the most important appli-
cation necessary for efficient Distribution Management System (DMS)
applications. Introduction of near to real time state estimation in elec-
tricity distribution networks provide network operators with improved,
consistent and complete information about the present operating state
of their network, providing increased distribution network automation.
SE has been traditionally a key function in the transmission systems and
the resultant estimates are used for many functions in the operation and
planning throughout the entire system, including power flow optimiza-
tion and bad data analysis. It is a technique used to find unknown values
of the state variables based on some imperfect measurements. The state
estimator provides estimate of unknown variables such as active and re-
active line power flow, active and reactive power bus injection, voltage
magnitude and sometimes line current magnitudes. Using PMUs, even
angle measurements are available, but these types of measurements were
not considered in this study. State estimator uses statistical criteria to
estimate the actual value of those unknown variables. One of the most
common technique is non-linear Weighted Least Square (LS), used to
minimize the sum of the squares of the error based on available set of
measurements in the network. If system state can be obtained from the
available set of measurements, network is said to be observable. The
following sections present an examples of classical power system state
estimation analysis using LS formulation and Gauss-Newton method.
The algorithms have been tested by means of a standard IEEE 4 and
IEEE 13 test systems that can be found in [37].
139
Chapter 6 Three Phase DSSE IEEE Tests
140
6.1 IEEE 4 bus network case
Measured Value
The bus voltage magnitudes and angles were considered as state vari-
ables except at the reference bus (Bus 1) for which the bus angle was
assumed to be zero for phase 0, −120◦ for phase 1 and 120◦ for phase
2, and bus magnitude 1(p.u) for all three phases. Other state variables
are all active and reactive power flows, active and reactive load flow,
and current between nodes 1 and 2. Based on this, it is possible to form
state vector, for a three-phase system as follows:
(i) (i) (i) (i) (i) (i) (i) (i) (i) (i) (i)
[V2 V3 V4 δ2 δ3 δ4 P12 P21 P23 P32 P34
xT = (i) (i) (i) (i) (i) (i) (i) (i) (i) (i) (6.2)
P43 Q12 Q21 Q23 Q32 Q34 Q43 QL PL I12 ]
define the impedance of the line from bus p to bus q. For IEEE 4-bus
network impedance of line segment between nodes 2 and 3 is given with
Z23 = (0.001 + 0.006)(p.u), and impedance between node 1 and 2, and
141
Chapter 6 Three Phase DSSE IEEE Tests
node 3 and 4 are same and given with the following matrix:
0.403 + j1.063 0.128 + j0.486 0.126 + j0.370
Z12/34 = 0.128 + j0.486 0.410 + j1.032 0.130 + j0.408
0.126 + j0.370 0.130 + j0.408 0.406 + j1.050
(6.3)
Impedances Z12 and Z34 are given in ohms per mile. Line segment
between nodes 1 and 2 has a length of 2000 feets, and line segment
between nodes 3 and 4 has a length of 2500 feets. For simplicity, shunt
admittances are not considered here. Base impedances for these line
segments are given by:
Vh2 (12.47kV )2
Z12(base) = = (6.4)
Sbase 6000kV A
Vl2 (4.16kV )2
Z23(base) = = (6.5)
Sbase 6000kV A
where base impedance Z34(base) is the same as base impedance Z12(base) .
Impedances in per units are given with Equations 6.6 and 6.7. All per
unit measurements are based on 6000kV A base.
Z12
Z12(p.u) = (6.6)
Z12(base)
Z23
Z23(p.u) = (6.7)
Z23(base)
31.30 − j71.67 −15.47 + j24.75 −5.41 + j15.41
y12 = −15.47 + j24.75 35.16 − j74.69 −9.36 + j19.16
−5.41 + j15.41 −9.36 + j19.16 28.01 − j69.03
142
6.1 IEEE 4 bus network case
(6.9)
2.70 − j16.22 0 0
y23(p.u) = 0 2.70 − j16.22 0
0 0 2.70 − j16.22
(6.10)
√
|Y | = G2 + B2
(6.11)
θ = tan−1 BG
For electric networks the set of measurements are obtained from bus
voltages, power flows and injected powers, so the equality constraints
can be expressed using the real and reactive power flowing between bus
p and bus q. The non-linear equations are:
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cP12 ≡ P12 − V1 V1 Y11 cos δ1 − δ1 − θ11
k=0 (6.13)
i
(i) (k) (i,k) (i) (k) (i,k)
+V1 V2 Y12 cos δ1 − δ2 − θ12 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cP23 ≡ P23 − V2 V2 Y22 cos δ2 − δ2 − θ22
k=0 (6.14)
i
(i) (k) (i,k) (i) (k) (i,k)
+V2 V3 Y23 cos δ2 − δ3 − θ23 =0
143
Chapter 6 Three Phase DSSE IEEE Tests
n−1
Xh
(i) (i) (0) (i,0) (i) (k) (i,k)
cP34 ≡ P34 − V3 V3 Y33 cos δ3 − δ3 − θ33
k=0 (6.15)
i
(i) (k) (i,k) (i) (k) (i,k)
+V3 V4 Y34 cos δ3 − δ4 − θ34 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cP21 ≡ P21 − V2 V2 Y22 cos δ2 − δ2 − θ22
k=0 (6.16)
i
(i) (k) (i,k) (i) (k) (i,k)
+V2 V1 Y21 cos δ2 − δ1 − θ21 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cP32 ≡ P32 − V3 V3 Y33 cos δ3 − δ3 − θ33
k=0 (6.17)
i
(i) (k) (i,k) (i) (k) (i,k)
+V3 V2 Y32 cos δ3 − δ2 − θ32 =0
n−1
Xh
(i) (i) (0) (i,0) (i) (k) (i,k)
cP43 ≡ P43 − V4 V4 Y44 cos δ4 − δ4 − θ44
k=0 (6.18)
i
(i) (k) (i,k) (i) (k) (i,k)
+V4 V3 Y43 cos δ4 − δ3 − θ43 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cQ12 ≡ Q12 − V1 V1 Y11 sin δ1 − δ1 − θ11
k=0 (6.19)
i
(i) (k) (i,k) (i) (k) (i,k)
+V1 V2 Y12 sin δ1 − δ2 − θ12 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cQ23 ≡ Q23 − V2 V2 Y22 sin δ2 − δ2 − θ22
k=0 (6.20)
i
(i) (k) (i,k) (i) (k) (i,k)
+V2 V3 Y23 sin δ2 − δ3 − θ23 =0
n−1
Xh
(i) (i) (0) (i,0) (i) (k) (i,k)
cQ34 ≡ Q34 − V3 V3 Y33 sin δ3 − δ3 − θ33
k=0 (6.21)
i
(i) (k) (i,k) (i) (k) (i,k)
+V3 V4 Y34 sin δ3 − δ4 − θ34 =0
144
6.1 IEEE 4 bus network case
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cQ21 ≡ Q21 − V2 V2 Y22 sin δ2 − δ2 − θ22
k=0 (6.22)
i
(i) (k) (i,k) (i) (k) (i,k)
+V2 V1 Y21 sin δ2 − δ1 − θ21 =0
n−1
Xh
(i) (i) (k) (i,k) (i) (k) (i,k)
cQ32 ≡ Q32 − V3 V3 Y33 sin δ3 − δ3 − θ33
k=0 (6.23)
i
(i) (k) (i,k) (i) (k) (i,k)
+V3 V2 Y32 sin δ3 − δ2 − θ32 =0
n−1
Xh
(i) (i) (0) (i,0) (i) (k) (i,k)
cQ43 ≡ Q43 − V4 V4 Y44 sin δ4 − δ4 − θ44
k=0 (6.24)
i
(i) (k) (i,k) (i) (k) (i,k)
+V4 V3 Y43 sin δ4 − δ3 − θ43 =0
(i) (i)
cP N 2 : −P21 − P23 = 0
(i) (i)
cQN 2 : −Q21 − Q23 = 0
(i) (i)
cP N 3 : −P32 − P34 = 0
(i) (i)
cQN 3 : −Q32 − Q34 = 0 (6.25)
(i) (i)
cP N 4 : −P43 − PL = 0
(i) (i)
cQN 4 : −Q43 − QL = 0
(i) 2 (i) 2 (i) (i) 2
cI12 : P12 + Q12 − V1 I12
145
Chapter 6 Three Phase DSSE IEEE Tests
146
6.1 IEEE 4 bus network case
With all matrix defined the application of LS approach for the state
estimation of the IEEE 4 bus test case can be applied. Results can be
calculated using Equation 6.30:
This procedure is repeated the for the rest of the iterations until the dif-
ference between xk+1 and xk is within a certain pre-assigned threshold,
ε.
147
Chapter 6 Three Phase DSSE IEEE Tests
Iteration ε J(x)
1 0.9000 0.3776
2 0.1592 0.3244
3 0.0430 0.3231
4 8.3833e-04 0.3231
5 5.3737e-08 0.3231
Table 6.4.: Convergence summary
0.37
Objective function J(x)
0.36
0.35
0.34
0.33
0.32
1 1.5 2 2.5 3 3.5 4 4.5 5
Number of iterations
148
6.2 IEEE 13 bus network case
As a second test case IEEE 13 node test feeder was selected to inves-
tigate possibilities of LS state estimation. For a small feeder IEEE 13
node provide a good test for the most common features of distribution
analysis software. The IEEE 13 Node Test Feeder is one of four stan-
dard distribution models developed by the IEEE Power Engineering
Society’s Power System Analysis Computing and Economics Commit-
tee. This test feeder has several key distribution system components
such as overhead and underground lines, spot and distributed loads,
capacitors, transformers and voltage regulators. In this section, a mod-
ified IEEE 13 bus test case is utilized for case study. Fig. 6.3 gives
schematic diagram of a modified IEEE 13 bus system.
149
Chapter 6 Three Phase DSSE IEEE Tests
this simulation. The unit for the voltage magnitude is per-unit (p.u.),
and the unit for phase angle is degree.Voltage magnitude and angles
are given in Tab. 6.6. Following equations show a system with branch
impedances expressed in ohms per miles. There are seven different
configurations as given by:
0.347 + j1.018 0.156 + j0.502 0.158 + j0.424
Z601 = 0.156 + j0.502 0.338 + j1.048 0.154 + j0.385 (6.32)
0.158 + j0.424 0.154 + j0.385 0.341 + j1.035
0.753 + j1.181 0.158 + j0.424 0.156 + j0.502
Z602 = 0.158 + j0.424 0.748 + j1.198 0.154 + j0.385 (6.33)
0.156 + j0.502 0.154 + j0.385 0.744 + j1.211
0 0 0
Z603 = 0 1.329 + j1.347 0.207 + j0.459 (6.34)
0 0.207 + j0.459 1.324 + j1.357
150
6.2 IEEE 13 bus network case
1.324 + j1.357 0 0.207 + j0.459
Z604 = 0 0 0 (6.35)
0.207 + j0.459 0 1.330 + j1.347
0 0 0
Z605 =0 0 0 (6.36)
0 0 1.329 + j1.348
0.798 + j0.446 0.319 + j0.033 0.285 − j0.014
Z606 = 0.319 + j0.033 0.789 + j0.404 0.319 + j0.033 (6.37)
0.285 − j0.014 0.319 + j0.033 0.798 + j0.446
1.343 + j0.5124 0 0
Z607 = 0 0 0 (6.38)
0 0 0
Each branch between two nodes has defined length of the line segment
and type of impedance configuration. These are summarized in Tab. 6.7.
151
Chapter 6 Three Phase DSSE IEEE Tests
Vh2 (4.16kV )2 Z
Z(base) = = ; Z(p.u) = (6.39)
Sbase 500kV A Z(base)
192.6 − j246.9 −51.75 + j52.12 −74.05 + j58.50
y602 = −51.75 + j52.1 169.9 − j244.47 −37.66 + j47.85
−74.05 + j58.5 −37.66 + j47.85 179.6 − j245.2
152
6.2 IEEE 13 bus network case
(6.41)
0 0 0
y603 = 0 250.06 − j229.99 −83.33 + j34.59 (6.42)
0 −83.33 + j34.59 248.34 − j231.04
248.34 − j231.04 0 −83.33 + j34.59
y604 = 0 0 0 (6.43)
−83.33 + j34.59 0 250.06 − j229.99
0 0 0
y605 =0 0 0 (6.44)
0 0 1226.01 − j229.12
357.14 − j268.9 −83.79 + j103.9 −37.30 + j85.1
y606 = −83.8 + j104 396.2 − j280 −83.8 + j103.95
−37.30 + j85.1 −83.79 + j103.9 357.14 − j269
(6.45)
148.52 − j56.686 0 0
y607 = 0 0 0 (6.46)
0 0 0
and the admittance matrix for line segment between nodes 3 and 4
where transformer is placed:
21.11 − j38.388 0 0
yXF M = 0 21.11 − j38.388 0
0 0 21.11 − j38.388
(6.47)
153
Chapter 6 Three Phase DSSE IEEE Tests
154
6.2 IEEE 13 bus network case
Iteration ε
1 1.8971
2 0.0246
3 3.2283e-05
4 5.1694e-11
Table 6.9.: Convergence Summary
simulations indicate that given method can accurately estimate the tar-
get system conditions.
155
A. Appendix
157
Chapter A Appendix
The importdata function loads data from ASCII file, filename, or the
clipboard, reading numeric data starting from line headerlinesIn+1. In
this example, a text file “3Pbus.txt” is imported and specified with
Delimiter (space) and Column Header. Listing A.2 describes loading
the data from a text file into MATLAB M-file for IEEE 13-bus network,
and assigning the values of each column to the defined variable.
158
A.1 MATLAB Programming
Listing A.3 creates different symbolic variables. First three lines create
three 1×length(branch) vectors of symbolic variables. First line creates
a variable of class sym whose variable name is P pq_0 and elements of
first vector have names of the form
Same logic applies for all other cases. The argument of sym must be
a character-string, i.e. a sequence of symbols. Character strings (more
precisely arrays of character strings) form another class called char. In
MATLAB strings are marked by apostrophes. When symbolic vari-
able are created, MATLAB will be able to manipulate mathematical
expressions that contain variables.
159
Chapter A Appendix
To take into account the fact that loads are not present on each bus,
MATLAB built in function nonzeros can be used. This function returns
column vector of the nonzero elements. This means that, for example,
vector P L_0m will contain active loads just for buses which have de-
fined load in phase zero. Besides the information about measurements,
160
A.1 MATLAB Programming
other two text files contain information about some parameters which
have constant value. These are given by Listing A.6.
1 %f i x i n g v o l t a g e and a n g l e o f s l a c k bus 1
2 V_01=BUS . data ( 1 , 2 ) ;
3 V_11=BUS . data ( 1 , 3 ) ;
4 V_21=BUS . data ( 1 , 4 ) ;
5 d_01=BUS . data ( 1 , 5 ) ∗ p i / 1 8 0 ;
6 d_11=BUS . data ( 1 , 6 ) ∗ p i / 1 8 0 ;
7 d_21=BUS . data ( 1 , 7 ) ∗ p i / 1 8 0 ;
8
9 %Y and t h e t a
10 f o r k =1: l e n g t h ( branch )
11 Zpu1=ybase ∗ f t ( k ) ∗ [ r_00 ( k )+1 i ∗x_00 ( k ) r_01 ( k )+1 i ∗x_01 ( k )
r_02 ( k )+1 i ∗x_02 ( k ) ] ;
12 Zpu2=ybase ∗ f t ( k ) ∗ [ r_10 ( k )+1 i ∗x_10 ( k ) r_11 ( k )+1 i ∗x_11 ( k )
r_12 ( k )+1 i ∗x_12 ( k ) ] ;
13 Zpu3=ybase ∗ f t ( k ) ∗ [ r_20 ( k )+1 i ∗x_20 ( k ) r_21 ( k )+1 i ∗x_21 ( k )
r_22 ( k )+1 i ∗x_22 ( k ) ] ;
14 Zpu=[Zpu1 ( Zpu1~=0) ; Zpu2 ( Zpu2~=0) ; Zpu3 ( Zpu3~=0) ] ; ypu=
i n v ( Zpu ) ;
15 Y=abs ( ypu ) ;
16 t h e t a p p=atan2 ( imag ( ypu ) , r e a l ( ypu ) ) ;
17 t h e t a p q=atan2 (−imag ( ypu ) ,− r e a l ( ypu ) ) ;
Since first bus is reference bus, its voltage magnitude and angle is fixed
and assigned value from file “3Pbus.txt”. Also, impedance and ad-
mittance matrices can be calculated using data stored in a text file
“3Pbranch.txt”. When admittance matrix is defined, magnitude and
phase can be simply found using MATLAB functions abs and atan2.
161
Chapter A Appendix
1 f o r n=2:Nn
2 sumP_0=0;
3 f o r k =1: l e n g t h ( branch )
4 i f ismember ( n , from ( k ) ) & PhaseA ( k ) ~=0
5 sumP_0=sumP_0+Ppq_0 ( k ) ;
6 e l s e i f ismember ( n , t o ( k ) )& PhaseA ( k ) ~=0
7 sumP_0=sumP_0+Pqp_0 ( k ) ; end ; end ;
8
9 sumP_0=Pgen_0 ( n )−Pload_0−sumP_0 ;
10
11 end
where active and reactive power flows from node p to node q for phase
zero is given by Listing A.8:
1 f o r k =1: l e n g t h ( branch )
2 f o r p=1:Nn
3 f o r q =1:Nn
4 i f ismember ( p , from ( k ) ) & ismember ( q , t o ( k ) ) & PhaseA ( k )
~=0
5 CPpq_0=Ppq_0 ( k )−
6 (V_0( p ) ∗V_0( p ) ∗Y( 1 , 1 ) ∗ c o s ( d_0 ( p )−d_0 ( p )−t h e t a p p ( 1 , 1 ) )+
7 V_0( p ) ∗V_0( q ) ∗Y( 1 , 1 ) ∗ c o s ( d_0 ( p )−d_0 ( q )−t h e t a p q ( 1 , 1 ) )+
8 V_0( p ) ∗V_1( p ) ∗Y( 1 , 2 ) ∗ c o s ( d_0 ( p )−d_1 ( p )−t h e t a p p ( 1 , 2 ) )+
9 V_0( p ) ∗V_1( q ) ∗Y( 1 , 2 ) ∗ c o s ( d_0 ( p )−d_1 ( q )−t h e t a p q ( 1 , 2 ) )+
10 V_0( p ) ∗V_2( p ) ∗Y( 1 , 3 ) ∗ c o s ( d_0 ( p )−d_2 ( p )−t h e t a p p ( 1 , 3 ) )+
11 V_0( p ) ∗V_2( q ) ∗Y( 1 , 3 ) ∗ c o s ( d_0 ( p )−d_2 ( q )−t h e t a p q ( 1 , 3 ) ) ) ;
12 e l s e i f PhaseA ( k )==0
13 CPpq_0 = [ ] ; end ; end ;
14 end
15 end
16 end
162
A.1 MATLAB Programming
of state variables X include all bus voltages (except reference bus), and
all power and load flows. Matrix C is defined using MATLAB function
jacobian. It represents partial derivatives of equality constraints with
respect to the state variables. Matrix W is a diagonal matrix of weights
associated to each measurement.
1 %Matrix o f e q u a l i t y c o n s t r a i n t s
2 Con=[Eq1 Eq2 ] ;
3
4%Matrix o f v a r i a b l e s
5X=[V_0 ( 2 : l e n g t h (V_0) ) V_1 ( 2 : l e n g t h (V_1) ) V_2 ( 2 : l e n g t h (
V_2) )
6 d_0 ( 2 : l e n g t h ( d_0 ) ) d_1 ( 2 : l e n g t h ( d_1 ) ) d_2 ( 2 : l e n g t h (
d_2 ) )
7 Ppq Qpq PL_0 PL_1 PL_2 QL_0 QL_1 QL_2 ] ;
8
9 %Matrix C
10 C=j a c o b i a n ( Con ,X) ;
11
12 %Matrix d e l t a Z ( k )−d e r i v a t i v e o f O b j e c t i v e
13 dzk=g r a d i e n t ( Objec , X) ;
14
15 %Matrix ck
16 ck=Con . ’ ;
17
18 %Matrix ␣W
19 W=d i a g (W1) ;
20
21 %Matrix ␣A␣ ( l e f t ␣ s i d e ) ␣AxX=B
22 A=[W␣C ’ ; C z e r o s ( l e n g t h ( Con ) , l e n g t h ( Con ) ) ] ;
23
24 % %Matrix B ( r i g h t s i d e ) AxX=B
25 B=[−W∗ dzk ; −ck ] ;
163
Chapter A Appendix
This vector contains initial values for all variables, plus initial values
for Lagrange multiplies. For simplicity, these values are set to 1 and
placed in vector L.
1 v_0=BUS . data ( : , 2 ) ;
2 v_1=BUS . data ( : , 3 ) ;
3 v_2=BUS . data ( : , 4 ) ;
4 dd_0=BUS . data ( : , 5 ) ∗ p i / 1 8 0 ;
5 dd_1=BUS . data ( : , 6 ) ∗ p i / 1 8 0 ;
6 dd_2=BUS . data ( : , 7 ) ∗ p i / 1 8 0 ;
7 Pload_0m=BUSM. data ( : , 2 ) ;
8 Pload_1m=BUSM. data ( : , 3 ) ;
9 Pload_2m=BUSM. data ( : , 4 ) ;
10 Qload_0m=BUSM. data ( : , 5 ) ;
11 Qload_1m=BUSM. data ( : , 6 ) ;
12 Qload_2m=BUSM. data ( : , 7 ) ;
13 L=o n e s ( 1 , l e n g t h ( Con ) ) ;
14
15 %i n i t i a l v a l u e s f o r v a r i a b l e s
16 Xlambda=[V_0 ( 2 : l e n g t h (V_0) ) V_1 ( 2 : l e n g t h (V_1) ) V_2 ( 2 :
l e n g t h (V_2) )
17 d_0 ( 2 : l e n g t h ( d_0 ) ) d_1 ( 2 : l e n g t h ( d_1 ) ) d_2 ( 2 :
l e n g t h ( d_2 ) )
18 Ppq Qpq PL_0 PL_1 PL_2 QL_0 QL_1 QL_2 −L ] ;
Vector of active and reactive power flows in initial state are calculated
on the same way as it was done with symbolic variables, but now instead
of symbolic variables initial values are used.
164
A.1 MATLAB Programming
8 iteration = 0;
9
10 while ( e p s < epsObtained )
11
12 %i n A and B s u b s t i t u t e v a r i a b l e s i n X with f i r s t l e n g t h (
X) v a l u e s i n Xlambda
13 AN=s u b s (A, X, Xlambda ( 1 : l e n g t h (X) ) ) ;
14 BN=s u b s (B, X, Xlambda ( 1 : l e n g t h (X) ) ) ;
15
16 %c a l c u l a t i o n o f numbers
17 ANE = e v a l (AN) ;
18 BNE = e v a l (BN) ;
19
20 %ch e c k c o n v e r g e n c e f o r c o n s t r a i n t s
21 absB = abs (BNE( l e n g t h (X)+1 : l e n g t h (BNE) ) ) ;
22 epsObtained = max( absB ) ;
23
24 %c a l c u l a t i o n o f dX=i n v (A) ∗B
25 dX=i n v (ANE) ∗BNE;
26
27 %update new v a l u e s X( k+1)=X( k )+dX ( update j u s t v a r i a b l e s
, not lambda )
28 Xlambda=Xlambda ( 1 : l e n g t h (X) ) ’+␣dX ( 1 : l e n g t h (X) ) ;
29 Xlambda=Xlambda ’ ;
30 i t e r a t i o n = i t e r a t i o n + 1 ;
31 end
1 iteration
2 epsObtained
3 Xlambda ( 1 : l e n g t h (X) ) ’
165
Chapter A Appendix
clc
clear a l l
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗IMPORT DATA∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
delimiterIn = ’␣ ’ ; headerlinesIn = 1;
BUS = i m p o r t d a t a ( ’ 13 bus . t x t ’ , d e l i m i t e r I n , h e a d e r l i n e s I n ) ;
BRANCH = i m p o r t d a t a ( ’ 13 branch . t x t ’ , d e l i m i t e r I n , h e a d e r l i n e s I n ) ;
BUSM= i m p o r t d a t a ( ’ 13busM . t x t ’ , d e l i m i t e r I n , h e a d e r l i n e s I n ) ;
bus=BUS . data ( : , 1 ) ;
v_0=BUS . data ( : , 2 ) ;
v_1=BUS . data ( : , 3 ) ;
v_2=BUS . data ( : , 4 ) ;
dd_0=BUS . data ( : , 5 ) ∗ pi / 1 8 0 ;
dd_1=BUS . data ( : , 6 ) ∗ pi / 1 8 0 ;
dd_2=BUS . data ( : , 7 ) ∗ pi / 1 8 0 ;
Pgen_0=BUS . data ( : , 8 ) ; Pgen_1=BUS . data ( : , 9 ) ; Pgen_2=BUS . data ( : , 1 0 ) ;
Qgen_0=BUS . data ( : , 1 1 ) ; Qgen_1=BUS . data ( : , 1 2 ) ; Qgen_2=BUS . data ( : , 1 3 ) ;
branch=BRANCH. data ( : , 1 ) ; from=BRANCH. data ( : , 2 ) ; t o=BRANCH. data ( : , 3 ) ;
r_00=BRANCH. data ( : , 4 ) ; r_01=BRANCH. data ( : , 5 ) ; r_02=BRANCH. data ( : , 6 ) ;
r_10=BRANCH. data ( : , 7 ) ; r_11=BRANCH. data ( : , 8 ) ; r_12=BRANCH. data ( : , 9 ) ;
r_20=BRANCH. data ( : , 1 0 ) ; r_21=BRANCH. data ( : , 1 1 ) ; r_22=BRANCH. data ( : , 1 2 ) ;
x_00=BRANCH. data ( : , 1 3 ) ; x_01=BRANCH. data ( : , 1 4 ) ; x_02=BRANCH. data ( : , 1 5 ) ;
x_10=BRANCH. data ( : , 1 6 ) ; x_11=BRANCH. data ( : , 1 7 ) ; x_12=BRANCH. data ( : , 1 8 ) ;
x_20=BRANCH. data ( : , 1 9 ) ; x_21=BRANCH. data ( : , 2 0 ) ; x_22=BRANCH. data ( : , 2 1 ) ;
PhaseA=BRANCH. data ( : , 2 2 ) ;
PhaseB=BRANCH. data ( : , 2 3 ) ;
PhaseC=BRANCH. data ( : , 2 4 ) ;
Trans=BRANCH. data ( : , 2 5 ) ; f t=BRANCH. data ( : , 2 6 ) ∗ 0 . 0 0 0 1 8 9 3 9 3 9 3 9 ;
busM=BUSM. data ( : , 1 ) ;
Pload_0m=BUSM. data ( : , 2 ) ;
Pload_1m=BUSM. data ( : , 3 ) ;
Pload_2m=BUSM. data ( : , 4 ) ;
Qload_0m=BUSM. data ( : , 5 ) ;
Qload_1m=BUSM. data ( : , 6 ) ;
Qload_2m=BUSM. data ( : , 7 ) ;
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ENTER DATA∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
Nn=length ( bus ) ; %number o f nodes
Nb=length ( branch ) ; %number o f b r a n c h e s
Sbase =500 e3 ; %kVA
Vh= ( 4 . 1 6 ) ∗ 1 e3 ;
Zbase =(Vh^ 2 ) / Sbase ; %Zbase
y b a s e =1./ Zbase ; %Ybase
Sbase1P =500/3;
% %∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗SYMBOLIC VARIABLES∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
Ppq_0=sym ( ’ Ppq_0 ’ , [ 1 length ( branch ) ] ) ;
Ppq_1=sym ( ’ Ppq_1 ’ , [ 1 length ( branch ) ] ) ;
Ppq_2=sym ( ’ Ppq_2 ’ , [ 1 length ( branch ) ] ) ;
Pqp_0=sym ( ’ Pqp_0 ’ , [ 1 length ( branch ) ] ) ;
Pqp_1=sym ( ’ Pqp_1 ’ , [ 1 length ( branch ) ] ) ;
Pqp_2=sym ( ’ Pqp_2 ’ , [ 1 length ( branch ) ] ) ;
Qpq_0=sym ( ’Qpq_0 ’ , [ 1 length ( branch ) ] ) ;
Qpq_1=sym ( ’Qpq_1 ’ , [ 1 length ( branch ) ] ) ;
Qpq_2=sym ( ’Qpq_2 ’ , [ 1 length ( branch ) ] ) ;
166
A.2 MATLAB code
167
Chapter A Appendix
Y=[0 0 0 ; 0 Y( 1 , 1 ) 0 ; 0 0 0 ] ;
t h e t a p p =[0 0 0 ; 0 t h e t a p p ( 1 , 1 ) 0 ; 0 0 0 ] ;
t h e t a p q =[0 0 0 ; 0 t h e t a p q ( 1 , 1 ) 0 ; 0 0 0 ] ;
e l s e i f PhaseA ( k)==0 & PhaseB ( k)==0 %Phase C
Y=[0 0 0 ; 0 0 0 ; 0 0 Y ( 1 , 1 ) ] ;
t h e t a p p =[0 0 0 ; 0 0 0 ; 0 0 t h e t a p p ( 1 , 1 ) ] ;
t h e t a p q =[0 0 0 ; 0 0 0 ; 0 0 t h e t a p q ( 1 , 1 ) ] ;
e l s e i f PhaseC ( k)==0 %Phase AB
Y=[Y( 1 , 1 ) Y( 1 , 2 ) 0 ; Y( 2 , 1 ) Y( 2 , 2 ) 0 ; 0 0 0 ] ;
t h e t a p p =[ t h e t a p p ( 1 , 1 ) t h e t a p p ( 1 , 2 ) 0 ;
thetapp ( 2 , 1 ) thetapp ( 2 , 2 ) 0 ; 0 0 0 ] ;
t h e t a p q =[ t h e t a p q ( 1 , 1 ) t h e t a p q ( 1 , 2 ) 0 ;
thetapq (2 ,1) thetapq (2 ,2) 0 ; 0 0 0 ] ;
e l s e i f PhaseB ( k)==0 %Phase AC
Y=[Y( 1 , 1 ) 0 Y( 1 , 2 ) ; 0 0 0 ; Y( 2 , 1 ) 0 Y ( 2 , 2 ) ] ;
t h e t a p p =[ t h e t a p p ( 1 , 1 ) 0 t h e t a p p ( 1 , 2 ) ; 0 0 0 ;
thetapp ( 2 , 1 ) 0 thetapp ( 2 , 2 ) ] ;
t h e t a p q =[ t h e t a p q ( 1 , 1 ) 0 t h e t a p q ( 1 , 2 ) ;
0 0 0 ; thetapq (2 ,1) 0 thetapq ( 2 , 2 ) ] ;
e l s e i f PhaseA ( k)==0 %Phase BC
Y=[0 0 0 ; 0 Y( 1 , 1 ) Y( 1 , 2 ) ; 0 Y( 2 , 1 ) Y ( 2 , 2 ) ] ;
t h e t a p p =[0 0 0 ; 0 t h e t a p p ( 1 , 1 ) t h e t a p p ( 1 , 2 ) ;
0 thetapp ( 2 , 1 ) thetapp ( 2 , 2 ) ] ;
t h e t a p q =[0 0 0 ; 0 t h e t a p q ( 1 , 1 ) t h e t a p q ( 1 , 2 ) ;
0 thetapq (2 ,1) thetapq ( 2 , 2 ) ] ;
end ; end ; end ; end ; end ; end ; end ;
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ CONSTRAINTS ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
f o r p=1:Nn
f o r q =1:Nn
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
%Ppq , Pqp , Qpq , Qqp
i f ismember ( p , from ( k ) ) & ismember ( q , t o ( k ) ) & PhaseA ( k)~=0
CPpq_0=Ppq_0 ( k)−
(V_0( p ) ∗V_0( p ) ∗Y( 1 , 1 ) ∗ cos ( d_0 ( p ) − d_0 ( p ) − t h e t a p p ( 1 , 1 ) ) +
V_0( p ) ∗V_0( q ) ∗Y( 1 , 1 ) ∗ cos ( d_0 ( p ) − d_0 ( q ) − t h e t a p q ( 1 , 1 ) ) +
V_0( p ) ∗V_1( p ) ∗Y( 1 , 2 ) ∗ cos ( d_0 ( p ) − d_1 ( p ) − t h e t a p p ( 1 , 2 ) ) +
V_0( p ) ∗V_1( q ) ∗Y( 1 , 2 ) ∗ cos ( d_0 ( p ) − d_1 ( q ) − t h e t a p q ( 1 , 2 ) ) +
V_0( p ) ∗V_2( p ) ∗Y( 1 , 3 ) ∗ cos ( d_0 ( p ) − d_2 ( p ) − t h e t a p p ( 1 , 3 ) ) +
V_0( p ) ∗V_2( q ) ∗Y( 1 , 3 ) ∗ cos ( d_0 ( p ) − d_2 ( q ) − t h e t a p q ( 1 , 3 ) ) ) ;
CQpq_0=Qpq_0( k)−
(V_0( p ) ∗V_0( p ) ∗Y( 1 , 1 ) ∗ s i n ( d_0 ( p ) − d_0 ( p ) − t h e t a p p ( 1 , 1 ) ) +
V_0( p ) ∗V_0( q ) ∗Y( 1 , 1 ) ∗ s i n ( d_0 ( p ) − d_0 ( q ) − t h e t a p q ( 1 , 1 ) ) +
V_0( p ) ∗V_1( p ) ∗Y( 1 , 2 ) ∗ s i n ( d_0 ( p ) − d_1 ( p ) − t h e t a p p ( 1 , 2 ) ) +
V_0( p ) ∗V_1( q ) ∗Y( 1 , 2 ) ∗ s i n ( d_0 ( p ) − d_1 ( q ) − t h e t a p q ( 1 , 2 ) ) +
V_0( p ) ∗V_2( p ) ∗Y( 1 , 3 ) ∗ s i n ( d_0 ( p ) − d_2 ( p ) − t h e t a p p ( 1 , 3 ) ) +
V_0( p ) ∗V_2( q ) ∗Y( 1 , 3 ) ∗ s i n ( d_0 ( p ) − d_2 ( q ) − t h e t a p q ( 1 , 3 ) ) ) ;
CPqp_0=Pqp_0 ( k)−
(V_0( q ) ∗V_0( q ) ∗Y( 1 , 1 ) ∗ cos ( d_0 ( q ) − d_0 ( q ) − t h e t a p p ( 1 , 1 ) ) +
V_0( q ) ∗V_0( p ) ∗Y( 1 , 1 ) ∗ cos ( d_0 ( q ) − d_0 ( p ) − t h e t a p q ( 1 , 1 ) ) +
V_0( q ) ∗V_1( q ) ∗Y( 1 , 2 ) ∗ cos ( d_0 ( q ) − d_1 ( q ) − t h e t a p p ( 1 , 2 ) ) +
V_0( q ) ∗V_1( p ) ∗Y( 1 , 2 ) ∗ cos ( d_0 ( q ) − d_1 ( p ) − t h e t a p q ( 1 , 2 ) ) +
V_0( q ) ∗V_2( q ) ∗Y( 1 , 3 ) ∗ cos ( d_0 ( q ) − d_2 ( q ) − t h e t a p p ( 1 , 3 ) ) +
V_0( q ) ∗V_2( p ) ∗Y( 1 , 3 ) ∗ cos ( d_0 ( q ) − d_2 ( p ) − t h e t a p q ( 1 , 3 ) ) ) ;
CQqp_0=Qqp_0( k)−
(V_0( q ) ∗V_0( q ) ∗Y( 1 , 1 ) ∗ s i n ( d_0 ( q ) − d_0 ( q ) − t h e t a p p ( 1 , 1 ) ) +
V_0( q ) ∗V_0( p ) ∗Y( 1 , 1 ) ∗ s i n ( d_0 ( q ) − d_0 ( p ) − t h e t a p q ( 1 , 1 ) ) +
168
A.2 MATLAB code
169
Chapter A Appendix
170
A.2 MATLAB code
sumP_2=sumP_2+Pqp_2 ( k ) ;
sumQ_2=sumQ_2+Qqp_2( k ) ; end ; end ;
end
%Pload and Qload where we have measurements
i f Pload_0m ( n)~=0
Pload_0=PL_0( n ) ; Qload_0=QL_0( n ) ;
e l s e i f Pload_0m ( n)==0
Pload_0 =0; Qload_0 =0; end ; end ;
i f Pload_1m ( n)~=0
Pload_1=PL_1( n ) ; Qload_1=QL_1( n ) ;
e l s e i f Pload_1m ( n)==0
Pload_1 =0; Qload_1 =0; end ; end ;
i f Pload_2m ( n)~=0
Pload_2=PL_2( n ) ; Qload_2=QL_2( n ) ;
e l s e i f Pload_2m ( n)==0
Pload_2 =0; Qload_2 =0; end ; end ;
sumP_0=Pgen_0 ( n)−Pload_0−sumP_0 ;
sumP_1=Pgen_1 ( n)−Pload_1−sumP_1 ;
sumP_2=Pgen_2 ( n)−Pload_2−sumP_2 ;
sumQ_0=Qgen_0 ( n)−Qload_0−sumQ_0 ;
sumQ_1=Qgen_1 ( n)−Qload_1−sumQ_1 ;
sumQ_2=Qgen_2 ( n)−Qload_2−sumQ_2 ;
Pl_0=[Pl_0 Pload_0 ] ; Pl_1=[Pl_1 Pload_1 ] ;
Pl_2=[Pl_2 Pload_2 ] ; Ql_0=[Ql_0 Qload_0 ] ;
Ql_1=[Ql_1 Qload_1 ] ; Ql_2=[Ql_2 Qload_2 ] ;
Eq2= [ Eq2 sumP_0 sumP_1 sumP_2 sumQ_0 sumQ_1 sumQ_2 ] ;
end
Eq2=Eq2 ( Eq2 ~=0);
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
%t a k i n g s y m b o l i c v a r i a b l e j u s t where we have v a l u e
%f o r PLoad and Qload
PL_0=Pl_0 ( Pl_0 ~=0);PL_1=Pl_1 ( Pl_1 ~=0);
PL_2=Pl_2 ( Pl_2 ~=0);QL_0=Ql_0 ( Ql_0 ~=0);
QL_1=Ql_1 ( Ql_1 ~=0);QL_2=Ql_2 ( Ql_2 ~=0);
%f o r V o l t a g e and Angle
vv_0 = [ ] ; vv_1 = [ ] ; vv_2 = [ ] ;
dv_0 = [ ] ; dv_1 = [ ] ; dv_2 = [ ] ;
f o r n=1:Nn
i f v_0 ( n)~=0
v o l t a g e _ 0=V_0( n ) ; angle_0=d_0 ( n ) ;
e l s e i f v_0 ( n)==0
v o l t a g e _ 0 = [ ] ; angle_0 = [ ] ; end ; end ;
i f v_1 ( n)~=0
v o l t a g e _ 1=V_1( n ) ; angle_1=d_1 ( n ) ;
e l s e i f v_1 ( n)==0
v o l t a g e _ 1 = [ ] ; angle_1 = [ ] ; end ; end ;
i f v_2 ( n)~=0
v o l t a g e _ 2=V_2( n ) ; angle_2=d_2 ( n ) ;
e l s e i f v_2 ( n)==0
v o l t a g e _ 2 = [ ] ; angle_2 = [ ] ; end ; end ;
vv_0=[vv_0 v o l t a g e _ 0 ] ; vv_1=[vv_1 v o l t a g e _ 1 ] ;
vv_2=[vv_2 v o l t a g e _ 2 ] ; dv_0=[dv_0 angle_0 ] ;
dv_1=[dv_1 angle_1 ] ; dv_2=[dv_2 angle_2 ] ;
end
V_0=vv_0 ; V_1=vv_1 ; V_2=vv_2 ;
d_0=dv_0 ; d_1=dv_1 ; d_2=dv_2 ;
171
Chapter A Appendix
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗MATRIX∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
%Matrix o f e q u a l i t y c o n s t r a i n t s
Con=[Eq1 Eq2 ] ;
%Matrix o f v a r i a b l e s
X=[V_0 ( 2 : length (V_0) ) V_1 ( 2 : length (V_1) ) V_2 ( 2 : length (V_2) )
d_0 ( 2 : length ( d_0 ) ) d_1 ( 2 : length ( d_1 ) ) d_2 ( 2 : length ( d_2 ) )
Ppq Qpq PL_0 PL_1 PL_2 QL_0 QL_1 QL_2 ] ;
%Matrix C
C=j a c o b i a n ( Con ,X ) ;
%Matrix d e l t a Z ( k)− d e r i v a t i v e o f O b j e c t i v e
Objec_0 =0; Objec_1 =0; Objec_2 =0;
f o r k =1: length (PL_0)
Objec_0=Objec_0 + 0 . 5 ∗ ( (PL_0( k)−PL_0m( k ) ) . ^ 2
+(QL_0( k)−QL_0m( k ) ) . ^ 2 ) ; end ;
f o r k =1: length (PL_1)
Objec_1=Objec_1 + 0 . 5 ∗ ( (PL_1( k)−PL_1m( k ) ) . ^ 2
+(QL_1( k)−QL_1m( k ) ) . ^ 2 ) ; end ;
f o r k =1: length (PL_2)
Objec_2=Objec_2 + 0 . 5 ∗ ( (PL_2( k)−PL_2m( k ) ) . ^ 2
+(QL_2( k)−QL_2m( k ) ) . ^ 2 ) ; end ;
Objec=Objec_0+Objec_1+Objec_2 ;
dzk=gradient ( Objec , X ) ;
%Matrix ck
ck=Con . ’ ;
%Matrix W
f o r k =1: length ( dzk )
i f dzk ( k)==0
W1( k )=0;
else
i f ismember ( k , ( length ( dzk)−1−(length (QL_0)
+length (QL_1)+length (QL_2 ) ) : length ( dzk ) ) )
W1( k)=wQL;
else
W1( k)=wPL ; end ; end ;
end
W=diag (W1) ;
% % Matrix A ( l e f t s i d e )
A=[W C ’ ; C zeros ( length ( Con ) , length ( Con ) ) ] ; %AxX=B
% %Matrix B ( r i g h t s i d e )
B=[−W∗ dzk ; −ck ] ;
%∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗VARIABLES∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
Ppq = [ ] ;
Qpq = [ ] ;
V_0=v_0 ; V_1=v_1 ; V_2=v_2 ;
d_0=dd_0 ; d_1=dd_1 ; d_2=dd_2 ;
172
A.2 MATLAB code
173
Chapter A Appendix
174
A.2 MATLAB code
175
Chapter A Appendix
%t o l e r a n c e ( s t o p p i n g c r i t e r i a )
eps = 1 e −5;
%t o l e r a n c e c a l c u a l t e d i n l o o p
epsObtained = 1 ;
%number o f i t e r a t i o n
iteration = 0;
%i n A and B s u b s t i t u t e v a r i a b l e s i n X w i t h
% f i r s t l e n g t h (X) v a l u e s i n Xlambda
AN=s u b s (A, X, Xlambda ( 1 : length (X ) ) ) ;
BN=s u b s (B, X, Xlambda ( 1 : length (X ) ) ) ;
%c a l c u l a t i o n o f numbers
ANE = eval (AN) ;
BNE = eval (BN) ;
%c h e c k c o n v e r g e n c e f o r c o n s t r a i n t s ( m a t r i x ck i n m a t r i x B)
absB = abs (BNE( length (X)+1 : length (BNE ) ) ) ;
e p s O b t a i n e d = max( absB ) ;
%c a l c u l a t i o n o f dX=i n v (A) ∗B
dX=inv (ANE) ∗BNE;
176
B. Appendix
model Name.mod;
177
Chapter B Appendix
After loading your model, you should choose the type of the solver you
want to use to solve your problem. Other option is to immediately
write solver type in text file (not in command window) like it is done
in Listing B.1.
1 reset ;
2 option s o l v e r knitroampl ;
Since you are interested in loading your model more than once (chang-
ing coefficients, after correcting some errors, etc.), you will need to
periodically reset AMPL. You cannot load your model with variables,
constraints, or objective function using names which already exist –
reset allows AMPL to forget all names.
178
B.1 AMPL Programming
179
Chapter B Appendix
1 s u b j e c t to
2
3 C1 : P12_0−(v1_0∗v1_0∗y11_00∗ c o s ( d1_0−d1_0−theta11_00 )
4 +v1_0∗v2_0∗y12_00∗ c o s ( d1_0−d2_0−theta12_00 )
5 +v1_0∗v1_1∗y11_01∗ c o s ( d1_0−d1_1−theta11_01 )
6 +v1_0∗v2_1∗y12_01∗ c o s ( d1_0−d2_1−theta12_01 )
7 +v1_0∗v1_2∗y11_02∗ c o s ( d1_0−d1_2−theta11_02 )
8 +v1_0∗v2_2∗y12_02∗ c o s ( d1_0−d2_2−theta12_02 ) ) =0;
solve;
180
B.2 AMPL Code
1 reset ;
2 option s o l v e r knitroampl ;
3
4 # WEIGHTING GROUPS
5 param wVoltage =0; param wP=0;
6 param wQ=0; param wPLoad=100;
7 param wQLoad=100; param wCurrent =0;
8 param wV20:= wVoltage ; param wV21:= wVoltage ;
9 param wV22:= wVoltage ; param wV30:= wVoltage ;
10 param wV31:= wVoltage ; param wV32:= wVoltage ;
11 param wV40:= wVoltage ; param wV41:= wVoltage ;
12 param wV42:= wVoltage ; param wP0:=wP ;
13 param wP1:=wP; param wP2:=wP;
14 param wQ0:=wQ; param wQ1:=wQ;
15 param wQ2:=wQ; param wPL0:=wPLoad ;
16 param wPL1:=wPLoad ; param wPL2:=wPLoad ;
17 param wQL0:=wQLoad ; param wQL1:=wQLoad ;
18 param wQL2:=wQLoad ; param wI0 := wCurrent ;
19 param wI1 := wCurrent ; param wI2 := wCurrent ;
20
21 # MEASUREMENTS
22 param PL_0m: = 0 . 9 0 0 0 ; param PL_1m: = 0 . 9 0 0 0 ;
23 param PL_2m: = 0 . 9 0 0 0 ; param QL_0m: = 0 . 4 3 5 9 ;
24 param QL_1m: = 0 . 4 3 5 9 ; param QL_2m: = 0 . 4 3 5 9 ;
25 param P43_0m=−PL_0m ; param P43_1m=−PL_1m ;
26 param P43_2m=−PL_2m ; param Q43_0m=−QL_0m;
27 param Q43_1m=−QL_1m; param Q43_2m=−QL_2m;
28 param I12_0m : = 1 . 2 4 0 5 ; param I12_1m : = 1 . 1 5 8 1 ;
29 param I12_2m : = 1 . 2 0 3 1 ;
30
31 # PARAMETERS
32 param v2_0m= 0 . 9 8 7 7 ; param v2_1m= 0 . 9 9 2 1 ;
33 param v2_2m= 0 . 9 8 9 5 ; param v3_0m= 0 . 9 3 6 8 ;
34 param v3_1m= 0 . 9 4 5 1 ; param v3_2m= 0 . 9 3 9 7 ;
35 param v4_0m= 0 . 8 0 6 1 ; param v4_1m= 0 . 8 6 3 5 ;
36 param v4_2m= 0 . 8 3 1 1 ; param y12_00 := 7 8 . 2 0 8 4 ;
37 param y12_01 := 2 9 . 1 8 7 1 ; param y12_02 := 1 6 . 3 2 7 0 ;
38 param y12_10 := 2 9 . 1 8 7 1 ; param y12_11 := 8 2 . 5 4 7 4 ;
39 param y12_12 := 2 1 . 3 2 2 3 ; param y12_20 := 1 6 . 3 2 7 0 ;
40 param y12_21 := 2 1 . 3 2 2 3 ; param y12_22 := 7 4 . 4 9 7 3 ;
41 param y23_00 := 1 6 . 4 3 9 9 ; param y23_01 := 0 ;
42 param y23_02 := 0 ; param y23_10 := 0 ;
43 param y23_11 := 1 6 . 4 3 9 9 ; param y23_12 := 0 ;
44 param y23_20 := 0 ; param y23_21 := 0 ;
45 param y23_22 := 1 6 . 4 3 9 9 ; param y34_00 := 6 . 9 6 3 0 ;
46 param y34_01 := 2 . 5 9 8 6 ; param y34_02 := 1 . 4 5 3 6 ;
47 param y34_10 := 2 . 5 9 8 6 ; param y34_11 := 7 . 3 4 9 3 ;
48 param y34_12 := 1 . 8 9 8 4 ; param y34_20 := 1 . 4 5 3 6 ;
49 param y34_21 := 1 . 8 9 8 4 ; param y34_22 := 6 . 6 3 2 6 ;
50 param y11_00 := 7 8 . 2 0 8 4 ; param y11_01 := 2 9 . 1 8 7 1 ;
51 param y11_02 := 1 6 . 3 2 7 0 ; param y11_10 := 2 9 . 1 8 7 1 ;
52 param y11_11 := 8 2 . 5 4 7 4 ; param y11_12 := 2 1 . 3 2 2 3 ;
181
Chapter B Appendix
182
B.2 AMPL Code
183
Chapter B Appendix
184
B.2 AMPL Code
185
Chapter B Appendix
186
B.2 AMPL Code
187
Chapter B Appendix
188
C. Appendix
This section explains how to solve some simple problems using C++
programming. Method used here is Newton-Raphson method and whole
procedure consists of just few steps. First is to initialize values of all
variables, such as voltages, currents, values of Lagrange multipliers, etc.
Next step is enter elements of Jacobian matrix, and elements of right
hand side as explained in Section 2.4.2. Finally, method is solved and
iterated until the convergence criteria is satisfied.
189
Chapter C Appendix
1 p S o l v e r −>a d d T r i p l e ( 0 , 0 ,R) ;
2 p S o l v e r −>a d d T r i p l e ( 0 , 4 , 1 ) ;
3 p S o l v e r −>a d d T r i p l e ( 1 , 1 ,R) ;
4 p S o l v e r −>a d d T r i p l e ( 1 , 6 , 1 ) ;
For entering right hand side value command setRHS is used. Example
of entering functions f1 and f2 from Example 3.1 is given in Listing C.3.
1 p S o l v e r −>setRHS ( 0 , −( I 1 2 r ∗R+L1 ) ) ;
2 p S o l v e r −>setRHS ( 1 , −(I12im ∗R+L3 ) ) ;
190
C.1 C++ Programming
191
Chapter C Appendix
192
C.1 C++ Programming
193
Chapter C Appendix
69 pSolver - > addTriple (6 ,23 , - V2im ); pSolver - > addTriple (6 ,24 , V2r );
70 pSolver - > addTriple (7 ,6 , L10 ); pSolver - > addTriple (7 ,11 , - L11 );
71 pSolver - > addTriple (7 ,12 , L13 ); pSolver - > addTriple (7 ,19 , - G );
72 pSolver - > addTriple (7 ,20 , - B ); pSolver - > addTriple (7 ,21 , G );
73 pSolver - > addTriple (7 ,22 , B ); pSolver - > addTriple (7 ,24 , bc );
74 pSolver - > addTriple (7 ,25 , - I2r ); pSolver - > addTriple (7 ,27 , I2im );
75 pSolver - > addTriple (8 ,6 , - L9 ); pSolver - > addTriple (8 ,11 , - L13 );
76 pSolver - > addTriple (8 ,12 , - L11 ); pSolver - > addTriple (8 ,19 , B );
77 pSolver - > addTriple (8 ,20 , - G ); pSolver - > addTriple (8 ,21 , - B );
78 pSolver - > addTriple (8 ,22 , G ); pSolver - > addTriple (8 ,23 , - bc );
79 pSolver - > addTriple (8 ,25 , - I2im ); pSolver - > addTriple (8 ,27 , - I2r );
80 pSolver - > addTriple (9 ,13 , - L12 ); pSolver - > addTriple (9 ,14 , L14 );
81 pSolver - > addTriple (9 ,21 , - G ); pSolver - > addTriple (9 ,22 , - B );
82 pSolver - > addTriple (9 ,26 , - I3r ); pSolver - > addTriple (9 ,28 , I3im );
83 pSolver - > addTriple (10 ,13 , - L14 ); pSolver - > addTriple (10 ,14 , - L12 );
84 pSolver - > addTriple (10 ,21 , B ); pSolver - > addTriple (10 ,22 , - G );
85 pSolver - > addTriple (10 ,26 , - I3im ); pSolver - > addTriple (10 ,28 , - I3r );
86 pSolver - > addTriple (11 ,7 , - L11 ); pSolver - > addTriple (11 ,8 , - L13 );
87 pSolver - > addTriple (11 ,15 ,1); pSolver - > addTriple (11 ,25 , - V2r );
88 pSolver - > addTriple (11 ,27 , - V2im ); pSolver - > addTriple (12 ,7 , L13 );
89 pSolver - > addTriple (12 ,8 , - L11 ); pSolver - > addTriple (12 ,17 ,1);
90 pSolver - > addTriple (12 ,25 , - V2im ); pSolver - > addTriple (12 ,27 , V2r );
91 pSolver - > addTriple (13 ,9 , - L12 ); pSolver - > addTriple (13 ,10 , - L14 );
92 pSolver - > addTriple (13 ,16 , -1); pSolver - > addTriple (13 ,26 , - V3r );
93 pSolver - > addTriple (13 ,28 , - V3im ); pSolver - > addTriple (14 ,9 , L14 );
94 pSolver - > addTriple (14 ,10 , - L12 ); pSolver - > addTriple (14 ,18 , -1);
95 pSolver - > addTriple (14 ,26 , - V3im ); pSolver - > addTriple (14 ,28 , V3r );
96 pSolver - > addTriple (15 ,0 ,1); pSolver - > addTriple (15 ,2 , -1);
97 pSolver - > addTriple (15 ,4 , -1); pSolver - > addTriple (15 ,11 ,1);
98 pSolver - > addTriple (16 ,2 ,1); pSolver - > addTriple (16 ,13 , -1);
99 pSolver - > addTriple (17 ,1 ,1); pSolver - > addTriple (17 ,3 , -1);
100 pSolver - > addTriple (17 ,5 , -1); pSolver - > addTriple (17 ,12 ,1);
101 pSolver - > addTriple (18 ,3 ,1); pSolver - > addTriple (18 ,14 , -1);
102 pSolver - > addTriple (19 ,0 , -1); pSolver - > addTriple (19 ,7 , - G );
103 pSolver - > addTriple (19 ,8 , B ); pSolver - > addTriple (20 ,1 , -1);
104 pSolver - > addTriple (20 ,7 , - B ); pSolver - > addTriple (20 ,8 , - G );
105 pSolver - > addTriple (21 ,2 , -1); pSolver - > addTriple (21 ,7 , G );
106 pSolver - > addTriple (21 ,8 , - B ); pSolver - > addTriple (21 ,9 , - G );
107 pSolver - > addTriple (21 ,10 , B ); pSolver - > addTriple (22 ,3 , -1);
108 pSolver - > addTriple (22 ,7 , B ); pSolver - > addTriple (22 ,8 , G );
109 pSolver - > addTriple (22 ,9 , - B ); pSolver - > addTriple (22 ,10 , - G );
110 pSolver - > addTriple (23 ,4 , -1); pSolver - > addTriple (23 ,6 , - V2im );
111 pSolver - > addTriple (23 ,8 , - bc ); pSolver - > addTriple (24 ,5 , -1);
112 pSolver - > addTriple (24 ,6 , V2r ); pSolver - > addTriple (24 ,7 , bc );
113 pSolver - > addTriple (25 ,7 , - I2r ); pSolver - > addTriple (25 ,8 , - I2im );
114 pSolver - > addTriple (25 ,11 , - V2r ); pSolver - > addTriple (25 ,12 , - V2im );
115 pSolver - > addTriple (26 ,9 , - I3r ); pSolver - > addTriple (26 ,10 , - I3im );
116 pSolver - > addTriple (26 ,13 , - V3r ); pSolver - > addTriple (26 ,14 , - V3im );
117 pSolver - > addTriple (27 ,7 , I2im ); pSolver - > addTriple (27 ,8 , - I2r );
118 pSolver - > addTriple (27 ,11 , - V2im ); pSolver - > addTriple (27 ,12 , V2r );
119 pSolver - > addTriple (28 ,9 , I3im ); pSolver - > addTriple (28 ,10 , - I3r );
120 pSolver - > addTriple (28 ,13 , - V3im ); pSolver - > addTriple (28 ,14 , V3r );
121 // pSolver - > s e r i a l i z e (" A " , cout , matrix :: V I E W _ S C I L A B );
122 if (! pSolver - > factorize ())
123 {
124 cout << " Cannot ␣ factorize ␣ the ␣ matrix ! " << endl ;
194
C.1 C++ Programming
125 return ;
126 }
127 pSolver - > setRHS (0 , -( I12r * R + L1 - L5 ));
128 pSolver - > setRHS (1 , -( I12im * R + L3 - L6 ));
129 pSolver - > setRHS (2 , -( I23r *R - L1 + L2 - L7 ));
130 pSolver - > setRHS (3 , -( I23im *R - L3 + L4 - L8 ));
131 pSolver - > setRHS (4 , -( - L1 - L9 ));
132 pSolver - > setRHS (5 , -( - L3 - L10 ));
133 pSolver - > setRHS (6 , -( - L9 * V2im + L10 * V2r ));
134 pSolver - > setRHS (7 , -( - L5 *G - L6 * B + L7 * G + L8 * B + L10 * bc
135 - L11 * I2r + L13 * I2im ));
136 pSolver - > setRHS (8 , -( L5 *B - L6 *G - L7 * B + L8 *G - L9 * bc
137 - L11 * I2im - L13 * I2r ));
138 pSolver - > setRHS (9 , -( - L7 *G - L8 *B - L12 * I3r + L14 * I3im ));
139 pSolver - > setRHS (10 , -( L7 *B - L8 *G - L12 * I3im - L14 * I3r ));
140 pSolver - > setRHS (11 , -( L1 - L11 * V2r - L13 * V2im ));
141 pSolver - > setRHS (12 , -( L3 - L11 * V2im + L13 * V2r ));
142 pSolver - > setRHS (13 , -( - L2 - L12 * V3r - L14 * V3im ));
143 pSolver - > setRHS (14 , -( - L4 - L12 * V3im + L14 * V3r ));
144 pSolver - > setRHS (15 , -( I12r + I2r - I23r - Icr ));
145 pSolver - > setRHS (16 , -( I23r - I3r ));
146 pSolver - > setRHS (17 , -( I12im + I2im - I23im - Icim ));
147 pSolver - > setRHS (18 , -( I23im - I3im ));
148 pSolver - > setRHS (19 , -(( V1r - V2r )* G -( V1im - V2im )* B - I12r ));
149 pSolver - > setRHS (20 , -(( V1r - V2r )* B +( V1im - V2im )* G - I12im ));
150 pSolver - > setRHS (21 , -(( V2r - V3r )* G -( V2im - V3im )* B - I23r ));
151 pSolver - > setRHS (22 , -(( V2r - V3r )* B +( V2im - V3im )* G - I23im ));
152 pSolver - > setRHS (23 , -( - bc * V2im - Icr ));
153 pSolver - > setRHS (24 , -( bc * V2r - Icim ));
154 pSolver - > setRHS (25 , -( P2 - V2r * I2r - V2im * I2im ));
155 pSolver - > setRHS (26 , -( P3 - V3r * I3r - V3im * I3im ));
156 pSolver - > setRHS (27 , -( Q2 + V2r * I2im - V2im * I2r ));
157 pSolver - > setRHS (28 , -( Q3 + V3r * I3im - V3im * I3r ));
158 if ( pSolver - > solve ())
159 {
160 // * * * * * * * * * * * * * * * * RESULTS * * * * * * * * * * * * * * * * * * * * * *
161 cout < < " ␣ I12r = ␣ " << I12r << endl ;
162 cout < < " ␣ I12im = ␣ " << I12im << endl ;
163 cout < < " ␣ I23r = ␣ " << I23r << endl ;
164 cout < < " ␣ I23im = ␣ " << I23im << endl ;
165 cout < < " ␣ Icr = ␣ " << Icr << endl ;
166 cout < < " ␣ Icim = ␣ " << Icim << endl ;
167 cout < < " ␣ bc = ␣ " << bc << endl ;
168 cout < < " ␣ V2r = ␣ " << V2r << endl ;
169 cout < < " ␣ V2im = ␣ " << V2im << endl ;
170 cout < < " ␣ V3r = ␣ " << V3r << endl ;
171 cout < < " ␣ V3im = ␣ " << V3im << endl ;
172 cout < < " ␣ I2r = ␣ " << I2r << endl ;
173 cout < < " ␣ I2im = ␣ " << I2im << endl ;
174 cout < < " ␣ I3r = ␣ " << I3r << endl ;
175 cout < < " ␣ I3im = ␣ " << I3im << endl ;
176 cout << " Loss " << I12r * I12r * R + I12im * I12im * R
177 + I23r * I23r * R + I23im * I23im * R ;
178 cout < < endl ;
179 I12rNew = I12r + pSolver - > getX (0);
180 I12imNew = I12im + pSolver - > getX (1);
195
Chapter C Appendix
196
Bibliography
197
Bibliography
198
Bibliography
199
Bibliography
200
Index
A Equality constraints, 21
Accuracy Test, 92 evolutionary algorithms, 29
Active and Reactive Power Flows, Extended Cutting Plane, 54
18
analytic hierarchical process, 29 F
automated meter readings, 79 feasibility and optimality, 29
feasible region, 30
B Filter method, 59
Bad data, 90 Fortescue transformation, 79
Bad Data Factor, 90 fuzzy set application, 29
branch and bound, 48
G
Branch Measurements, 112
Gauss-Newton method, 10
C Gauss-Seidel algorithm, 14
Concave function, 32 Generalized Benders Decompo-
convergence criteria, 155 sition, 52
Convex function, 31 global minimum, 31
convexity, 29 global positioning system, 6
cross node phase coupling, 101 H
Han-Powell method, 58
D
delta transformer side, 128 I
Distribution Management System, inequality constraints, 21
97 information and communication
Distribution System State Esti- technologies, 5
mation, 5 information matrix, 9
DMS, 5 Injection Measurements, 119
DSSE, 5 intelligence search methods, 29
duality, 29 interior point methods, 29
E J
Energy Management System, 5 Jacobian matrix, 9
201
Index
K O
Karush -Kuhn-Tucker Theorem, objective function, 30
32 Observability analysis, 6
KCL, 18 OLTC on Delta side, 111
OLTC on Wye side, 109
L optimal power flow, 13
Lagrange function, 29 optimum solution, 30
Lagrange multipliers, 10 optimum value, 30
Least Absolute Value, 11 outer approximation, 51
Line search method, 57
P
linear programming, 29
particle swarm optimizations, 29
Load bus, 20
penalty functions, 29
load flow, 13
per unit, 19
local minimum, 31 phase mutual admittances, 101
LP/NLP-Based Branch and Bound, phasor measurement unit, 6
54 power flow, 13
probability optimization, 29
M protection systems, 5
measurement area (MA), 78 Pruning rules, 49
measurement devices, 5 psedo-measurements, 78
merit function, 60
Mixed Integer nonliner Program- Q
ming, 29 quadratic programming, 29
mixed-integer programming, 29
R
Multi-variable optimization with
real-time model, 5
equality constraints, 37
relaxation algorithm, 51
Multi-variable optimization with
remote terminal units, 6
inequality constraints, 39
Multi-variable unconstrained op- S
timization, 37 SCADA, 6
sensitivity factors, 99
N Sequantial Quadratic Program-
Network topology processing, 6 ming, 29
network-flow programming, 29 Shunt equivalent, 109
neural networks, 29 simple load flow (SLF), 99
Newton-Raphson algorithm, 14 single-line diagram, 101
Node Measurements, 117 Single-variable unconstrained op-
nonlinear programming, 29 timization, 36
normalized residuals, 90 Slack (swing) bus, 20
202
Index
T
tabu search, 29
three-phase model, 78
trust-region approach, 57
U
unbalanced load, 77
unsymmetrical network design,
77
V
virtual tap changer nodes, 128
volt/VAr control, 77
voltage controlled bus, 20
W
Weak Duality, 33
Weighted Least Square, 8
203
Nomenclature
k, l, x, y phase indices
p, q, i, j node indices
PFG Set of P/Q load groups in which loads are specified with
power factors
205
Nomenclature
(i)
P LOSSM A(m) Estimated active power loss at iteration i and in mea-
surement area m
(i)
P LOSSφ,M A(m) Estimated active power loss at iteration i and in phase
φ of measurement area m
QLG
φ,n Load group (forecasted) reactive power at phase φ and
corresponding to load group n
QM
φ,n Measured reactive power at phase φ and corresponding
to measurement n
206
Nomenclature
M
Vφ,n Measured voltage magnitude at phase φ and correspond-
ing to measurement n
iload
p load current at bus p
Ppgen , Qgen
p active and reactive load power at bus p
Ppload , Qload
p active and reactive load power at bus p
207
Nomenclature
˜• measurement of • value
(k,l)
tij delta tap position between nodes i and j and between
phases k and l
(k)
vq voltage magnitude between phase k on node p
(k,l)
vp voltage magnitude between phases k and l on node p
208
Nomenclature
209