State Estimation
State Estimation
2
The problem is to determine the state of the
circuit, which in this case is nodal voltages v1,
v2, and the voltage e across the voltage source.
+ V -
R1
Node 1 Node 2
A1
+ -
e A3
I1 I2
R2 R3
A2
Node 3
Fig. 1
s write each one of the measured currents in
terms of the node voltages, and we may also
write down our one voltage measurement.
m v1 v2 e
i1, 2 v1 v2 e 1.0 (1)
1
m 0 v1
i3,1 v1 3.2 (2)
1
m v2 0
i2,3 v2 0.8 (3)
1
e 1.1 (4)
Expressing all of the above in matrix form:
3
1 1 1 1.0
v1
1 0 0 3.2
v2
0 1 0 0.8
e (5)
0 0 1 1.1
(5) as A, x, and b, so:
Ax b (6)
4
There is no single solution to eq. (5), but there is
a single solution that is normally thought of as
5
2
1.0 v1 v2 e
2
3.2 v1
2
0.8 v2
2
1.1 e
and the sum of the squared errors is:
2 2 2 2
1.0 v1 v2 e 3.2 v1 0.8 v2 1.1 e
Careful tracking of the previous expression will
indicate that it could be written as
T
b Ax b Ax
name:
1 T
J
2
b Ax b Ax (10)
Our problem is then to choose x so as to
minimize J. Under requirements on the form of
J (convexity), we minimize it by setting its
gradient with respect to x to 0; then solve for x.
To do this, we can expand J as follows:
1 T 1 T T
J b Ax b Ax b Ax b Ax
2 2
1 T T T T (11)
b b Ax b b Ax Ax Ax
2
Using (Ax)T=xTAT, we have:
1 T
J b b xT AT b bT Ax xT AT Ax (12a)
2
6
Consider the second and third terms in (12a).
Using a 2x2 to illustrate,
A11 A21 b1
xT AT b x1 x2 b1 x1 A11 b1 x2 A12 b2 x1 A21 b2 x2 A22
A12 A22 b2
A11 A12 x1
bT A x b1 b2 b1 x1 A11 b2 x1 A21 b1 x2 A12 b2 x2 A22
A21 A22 x2
we observe these terms are equal, which we can
prove by using (Ax)T=xTAT to show that
[xTATb]T=bTAx and recognizing that these terms
are scalar in (12a). Therefore, (12a) becomes
1 T
J b b 2bT Ax xT AT Ax(12b)
2
which is identical to (12A.12), p. 504 of W&W.
To remind us about gradients, we recall that it is
given by (13):
J
x1
J
xJ x2
(13)
J
xn
Now (12) is written in compact notation, and it
may not be obvious how to differentiate each
7
term in it. To assist with this, your text, in the
Appendix to Chapter 12, develops the following
relations, which are summarized in (12A.25, pg.
506), and repeated here for convenience:
Function Gradient
#1 F xT b xF b
#2 F bT x xF b
#3 F xT Au xF Au
#4 F uT A x xF AT u
#5 F xT Ax xF 2 Ax
Relation #5 applies only if A is symmetric.
8
(Applying #5 to the third term is acceptable
since ATA must be symmetric.)
9
Reference [3, p. 157] shows that if A has
linearly independent columns, then ATA is
invertible.
10
The pseudo-inverse is then
3 1 1 1 1 0 0 1 3 1 1
I 1 T 1 1
A G A 1 3 1 1 0 1 0 1 1 3 1
4 4
1 1 3 1 0 0 1 1 1 1 3
11
3.0 A motivating system and some basics
Bus 1
P23, Q23
Bus 3
Fig. 2
We denote the measured quantities as follows:
z1 V1
z2 P12
z3 Q12
z4 P23 (22)
z5 Q23
Then we can write
zi zi i (23)
where
12
zi is the measured value
zi is the true value (unknown)
i is the error (unknown)
Not knowing zi and i is a problem. However,
we may obtain statistical information from
calibration curves (error as a function of
measurement) of measuring instruments. It is
usually assumed that i is a random variable
with a normal (Gaussian) distribution having
zero mean, as illustrated in Fig. 3.
i)
i
0
Fig. 3
Calibration curves for measuring instruments
enable determination of the variance i.
13
Recall the expectation operator, which we
denote as ). It
is defined as:
E ( x) xf ( x)dx x (24)
which gives x, the mean value of a variable x
described by the probability distribution
function f(x).
x2 2x x ( x)
2
f ( x)dx
x 2 f ( x)dx 2 x xf ( x)dx ( x)
2
f ( x)dx
(26)
2 2 2
E ( x ) 2( x) ( x)
E( x2 ) ( x)
2
14
From eq. (26) (which is true for any random
variable x), we see that if the mean is 0
(E(x)=0), then the last term in eq. (26) is 0 and
2 2
x E ( x ) (27)
In regards to the calibration error, characterized
by the random variable i, we have then:
E ( i ) 0 (zero mean)
E ( i2 ) 2
i (variance)
Note that the larger the variance, the less
accurate is the measuring device.
15
It can be shown [4] from eq. (26) that
2
xy cov( x, y) E ( xy ) E ( x) E ( y) (29)
If x and y are independent, then
E(xy)=E(x)E(y).
Therefore, for two independent random
variables, the covariance is:
2
xy cov( x, y) 0
Two variables having 0 covariance are
uncorrelated, i.e., variation in one gives no
information about variation in the other.
A basic assumption:
The errors i and j for any two measuring
instruments i and j are independent. This means:
0, i j
cov( i , j ) 2 (30)
i , i j
Thus, we can define a covariance matrix R,
where the element in position (i,j) is cov( i j).
Given (30), the matrix will appear as:
16
2
1 0 0
2
0 2 0 0
R
0 0 (31)
2
0 0 0 m
x1 N
x
x2 N 1 V1
(32)
VN
17
zi hi (x) (33)
For a voltage measurement, the function hi is
very simple:
zi Vk (34)
where measurement i occurs at bus k.
18
z1
z
True values: (38)
zm
1
Errors (39)
m
20
Recall equation (10) which expressed our sum
of squared errors as
1 T
J
2
b Ax (10)
b Ax
2
1
Bad device large i , small i
2
21
Therefore, we will modify eq. (44) to be:
m 2
1
(45)
i
J 2
2 i 1 i
(47)
22
The problem then becomes to find x that
minimizes J. Note, however, that h is nonlinear,
and so our solution will necessarily be iterative.
mimimize
m 2 m 2
1 i 1 T 1 1 T 1 1 zi hi ( x)
J 2
R z h( x ) R z h( x) 2
2 i 1 i 2 2 2 i 1 i
(48)
We can apply first order conditions, which
means that all first derivatives of the objective
function with respect to decision variables must
be zero, i.e., that x J 0 . That is,
J
x1 0
J
xJ
x J (49)
0
xn
For a single element in x J, we have:
m 2
1 zi hi ( x)
J
2 i 1 i
2 (50)
23
J 1 m 2 zi hi ( x) hi ( x) m
zi hi ( x) hi ( x)
x1 2i1 i
2
x1 i 1 i
2
x1 (51)
This can be written in matrix form as
z1 h1 ( x)
J h1 ( x) h2 ( x) hm ( x) 1 z2 h2 ( x)
R
x1 x1 x1 x1 (52)
zm hm ( x)
And we then see how to write the vector of
derivatives, according to:
h1 ( x) h2 ( x) hm ( x)
x1 x1 x1 z1 h1 ( x)
h1 ( x) h2 ( x) hm ( x) z2 h2 ( x)
J 1
x2 x2 x2 R
x
(53)
h1 ( x) h2 ( x) hm ( x) zm hm ( x)
xn xn xn
We recognize the matrix of partial derivatives in
(53) as a sort of Jacobian matrix but
(a) it is n×m, i.e., it is not square and
(b) unlike standard Jacobian, here the rows
vary with variable (x1, x2
(h1, h2
24
s define a matrix H that does not have the
second (b) attribute, i.e.,
h1 ( x) h1 ( x) h1 ( x)
x1 x2 xn
h2 ( x) h2 ( x) h2 ( x)
H x1 x2 xn
(54)
hm ( x) hm ( x) hm ( x)
x1 x2 xn
Note that H is m×n, and it is the transpose of the
first matrix in eq. (53).
25
Because there are n elements in the partial-J
vector on the left, we observe that eq. (55) gives
n equations. Since there are n variables in x, it is
possible to solve eq. (55) explicitly for x.
26
Recall that in a Taylor series expansion, the
higher order terms (h.o.t.) contain products of
x, and so if x is relatively small, terms
x will be very small,
and in fact, negligible. So we will neglect the
h.o.t. in eq. (57). This results in:
G( x 0 x) G ( x 0 ) x G ( x) x x 0 (58)
0
27
Or we can write
( k 1) (k )
x x x (60)
Evaluating G at the better guess, we have
( k 1) (k ) (k )
G( x ) G( x x) G ( x )
(61) x G ( x) x
x(k )
28
Since there are n functional expressions and n
derivatives to take for each one, we can see that
x G ( x) x will be n×n, a square matrix.
(k )
29
derivatives of the measurement equations do not
change. Is this a good assumption? Remember,
from eq. (54),
h1 ( x) h1 ( x) h1 ( x)
x1 x2 xn
h2 ( x) h2 ( x) h2 ( x)
h( x)
H x1 x2 xn
x (54)
hm ( x) hm ( x) hm ( x)
x1 x2 xn
where the functions hi are the expressions for
the measurements (voltages, real and reactive
power flows) in terms of the states (angles and
voltage magnitudes).
30
G ( x) 1
x G ( x) H T ( x) R z h( x )
x x
H T ( x) R
1 h( x )
H T ( x) R
1 h( x ) (66)
x x
h( x)
But we recognize from eq. (54) the term x in
eq. (66) as H. Therefore, eq. (66) becomes:
1
x G ( x) H T ( x) R H ( x)
(67)
Making this substitution into eq. (63) results in:
(k )
x G ( x ) x G ( x(k )
) (63)
x
1 (k )
H T ( x) R H ( x ) x(68) G( x )
x( k )
31
6.0 Solution Algorithm
Given:
measurements z [z1 m]
standard deviations 1 m
the network
T
Compute : state estimate x=[x1 n]
(all voltage magnitudes and all voltage angles
except for swing bus angle)
1. Form measurement expressions h(x)
h( x )
2. Form derivative expressions H x
3. Form R
4. Let k=0. Guess solution x(k).
5. Compute H(x(k)), h(x(k))
1
1
6. Compute A H ( x) R H ( x) x , b
T
H T ( x) R z h( x)
(k )
x( k )
32
Example:
Consider the system below. Real power measurements are taken as follows: P12=0.62 pu , P13=0.06 pu,
and P32=0.37 pu .
3 angle is reference. So the state vector is therefore x 1 2]T. Your textbook solves this problem using
DC power flow equations on pp. 467-471, which are reviewed below. Your homework requests that you
repeat the analysis using AC power flow equations.
Bus 1 Bus 2
P12 x12=0.2pu
P12=0.62pu
P13=0.06pu x23=0.25pu
P32=0.37pu Bus 3
X13=0.4pu
33
h1 ( x) h1 ( x) P12 ( x) P12 ( x)
x1 x2 1 2 5 5
h( x ) h2 ( x) h2 ( x) P13 ( x) P13 ( x)
H 2.5 0
x x1 x2 1 2
h3 ( x) h3 ( x) P32 ( x) P32 ( x) 0 4
x1 x2 1 2
In this particular case, H is a constant matrix. In general, it will be a function of the
states and will thus change from iteration to iteration. It is constant in this case since
we have used linearized (DC) power flow expressions.
1 1
c) Compute A H T ( x) R H ( x) , b H T ( x) R z h( x)
x( 0 ) x( 0 )
First, get R, which is given by
2
1 0 0
2
0.0001 0 0
0 2 0 0
R 0 0.0001 0
0 0
2
0 0 0.0001
0 0 0 m
1
0.0001 0 0 5 5
5 2.5 0
A H T ( x) R 1 H ( x ) 0 0.0001 0 2.5 0
x
( 0)
5 0 4
0 0 0.0001 0 4
10000 0 0 5 5
5 2.5 0 312500 - 250000
0 10000 0 2.5 0
5 0 4 - 250000 410000
0 0 10000 0 4
1
b H T ( x) R z h( x ) ( 0)
x
34
though we started from differ i functions are linear (and therefore
the H matrix is constant).
r z h( x) x
(k )
T
To get this, we need to recompute h(x), using x= 1 2] =[0.0286 -.0943]T as follows:
h1( x) P12 5 1` 5 2 5(.0286) 5( .0943) 0.6145
h2 ( x) P13 2.5 1` 2.5(.0286) 0.0715
h3 ( x) P32 4 2 4( .0943) 0.3772
The measurements are P12=0.62 pu , P13=0.06 pu, and P32=0.37 pu, and so residuals
are given by
0.62 0.6145 0.0055
r 0.06 0.0715 0.0115
0.37 0.3772 .0072
Compare to our previous residual
0.62 0.585 0.035
0.06 0.06 0
0.37 0.372 0.002
and we see that it got better in r1 and worse in r2 and r3. However, the squared error
for this iteration is 0.000214 and that for the previous iteration is 0.0012, and so, in
fact, our solution has improved. We are able to look at just squared error in this example
instead of weighted squared error because all of the weights are the same.
Note that your text, at the bottom of page 469, calculates J. This is the objective function,
the weighted squared error, which is a measure of how good our solution is. They
get 2.14, which can be compared to our above calculations by multiplying by 2=.0001,
which gives 0.000214, the same as what we obtained.
References:
[1
Computer Conference (PICA), Denver, Colorado June, 1969.
[2]
[3] G. Strang,
[4] A. -Hill, New York, 1984.
35