You are on page 1of 137

1

State Estimation
A. J. Conejo
Univ. Castilla La Mancha
2011
2
0. References
1. Introduction
2. Example
3. Formulation and solution
3.1 Linear case
3.2 Nonlinear case
4. Observability
5. Detection and identification of bad measurements
State Estimation
3
State Estimation
0. Referencias
A. Gmez Expsito, A. J. Conejo, C. Caizares.
Electric Energy Systems. Analysis and Operation.
CRC Press, Boca Raton, Florida, 2008.
A. Abur, A. Gmez Expsito.
Power System State Estimation. Theory and Implementation.
Dekker, New York, 2004.
4
SCADA (Supervisory Contron Adn Data Adquisition):
Data Adquisition
Data base maintenance
Issue warning
EMS (Energy Management System)
State Estimation
1. Introduction
5
Estimate the state variables using a redundant set of
measurements that include measurement errors.
Statica problem: all measurements are symultaneous.
State Estimation
1. Introduction
6
Reduncancy in measurements to improve the
estimation
Measurements:
1. P and Q flows.
2. P and Q injections.
3. Voltage magnitudes.
4. Current magnitues (uncommon).
5. Voltage and current angles (if PMUs)
Other measurements: virstual (no error) and pseudo-
measurements (inexacts).
State Estimation
1. Introduction
7
1. Measurement filtering
2. Topology checking
3. Observability analysis
4. Estimation
5. Detection and identification of bad measurements
Functions:
State Estimation
1. Introduction
8


Online data

Measurement
Filtering

Topological
Analysis


State
Estimation


Bad Measurement
Detection


Bad Measurement
Suppression


Man-machine interface

Fixed data

Observability
Analysis

System state
Warning:
Measurement errors
U
n
o
b
s
e
r
v
a
b
l
e

a
r
e
a
s

Breaker status
Measurements
State Estimation
1. Introduction
9
25 . 0 X
4 . 0 X
0.2 X
MVA) 100 (Base
23
13
12
=
=
=
reference
Estimate voltage angles
Reactances in pu
State Estimation
2. Example
10
Power flow meters:
32 13 12
M , M , M
One meter is
redundant
State Estimation
2. Example
11
Only two measurements (exact):
2 state variables:
2 meters:
) reference , 0 ( , ,
3 2 1
=
32 13
M , M
32 13
M , M
( )
( ) pu 40 . 0 M
x
1
P
pu 05 . 0 M
x
1
P
pu 4 . 0 MW 40 M , pu 05 . 0 MW 5 M
32 2 3
23
32
13 3 1
13
13
32 13
= = =
= = =
= = = =
State Estimation
2. Example
12
Exact solution:
0.02
1
=
0.1
2
=
0
3
=
State Estimation
2. Example
13
Solution using measurements:
0.024
1
=
0.0925
2
=
pu .37 0 M , pu 0.06 M
32 13
= =
MW 60 MW 25 . 58 = M
12
=
0
3
=
M
13
13
M
32
M
State Estimation
2. Example
14
0.0315
1
=
0.0925
2
=
pu .37 0 M , pu 0.62 M
32 12
= =
MW 5 MW 875 . 7 M
13
= =
0
3
=
M
12 32
M
State Estimation
2. Example
Solution using measurements:
15
z z
r m
+ =
Measurement
True value
Measurement error
Erroneous measurements:
h(x) z
m
+ =
State vector is x, thus
State Estimation
3. Formulation
16
True values are unknown: they need to be estimated.
Weighted least squares is a common approach for
estimation.
State Estimation
3. Formulation
17
Quadratic errors
Weights
Weight for measurement i
Measurement number
Objective function
ii
w
m
J(x)
| |

=
=
N
1 i
2
i
m
i
ii
x
(x) h z w J(x)
J(x) Minimizar
Weighted least squares (WLS):
State Estimation
3. Formulation
18
( ) | | ( ) | |
(
(
(
(

=
=
mm
22
11
m m
w
w
w
W
x h z W x h z J(x)
T

Measurement verctor
Functions to compute measurement
Weighting matrix
State variable (n)
m
z
h(x)
W
x
( ) 1 m
( ) m m
( ) 1 m
State Estimation
3. Formulation
19
is a measure of the measurement involved
higher involves higher precision
2
1 o
2
1 o
(
(
(
(
(

= =
2
m
2
2
2
1
1 -
1
1
1
R W

State Estimation
3. Formulation
20
First order optimality conditions:
( )
( ) ( ) | |
( )
( )

x
x h
x H : where
0 x h z W x 2H 0
x
x J
m T
c
c
=
= =
c
c
State Estimation
3. Formulation
21
( ) ( ) | | ) E1 ( ) x ( h - z W x H x x G
k k T k k
=
( ) ( )WH(x) x H x G
T
=
where the gain matrix is
State Estimation
3. Formulation
Newton solution at iteration k
22
If H has full rank then G is definite positive an (E1) has a
single solution
k k 1 k
x x x + =
+
1. Initialize x
0
(flat start) (k=0).
2. Compute H(x
k
) and calculate G(x
k
).
3. Solve .
4. Update
5. Is Ax is small enough stot, otherwise go to 2
( ) ( ) | | ) h(x - z W x H x x G
k k T k k
=
State Estimation
3. Formulation
23
If h(x) is linear, everything is easier.
Just one iteration:
observable not : m n If -
ts measuremen needed just , z H x

: m n If -
estimation OK , Wz H G x

: m n If -
m 1
m T 1
>
= =
= <

( )
| |
m T 1 m T
z W H G x 0 Hx z W 2H 0
x
x J

= = =
c
c
State Estimation
3. Formulation
24
4 4 4
m
32 13 12
10 10 10 w
0.37 0.06 0.62 z
M M M
2 estate variables:
3 measurements:
2 1
,
32 13 12
M , M , M
n < m
State Estimation
Example
25
( )
(

=
(

=
=
(
(
(

=
(
(
(

=
=
(
(
(

=
(
(
(

0,1
0,02

0,0943
0,0286

Wz H G

0,37
0,06
0,62
z ,
10 0 0
0 10 0
0 0 10
W
WH H ) x ( G
4 0
0 2,5
5 5
H ,
4
2,5
5 5
h
REAL
m T 1
m
4
4
4
T
2
1
2 1
State Estimation
Example
26
4 6 4
m
32 13 12
10 10 10 w
0.37 0.06 0.62 z
M M M
Better meter
m T 1
REAL
4
6
4
Wz H G

0,1
0,02

0,0970
0,0241

10 0 0
0 10 0
0 0 10
W

=
(

=
(

=
(
(
(

=
State Estimation
Example
27
Optimization problem with no contraints
| |

=

N
1 i
2
i
m
i ii
x
(x) h z w Minimize
1. P measurement
2. Q measurement
3. Voltage measurement
( )
ij
m
ij
p p
( )
ij
m
ij
q q
i
m
i
v v
-
() q - q
() p p
i
m
i
i
m
i
4. P, Q injections
State Estimation
Example
28
Active Power flow:
( ) ( )
j i ij
ij
j i
ij
ij
2
i
ij
cos
z
v v
cos
z
v
p + =
Reactive Power flow:
( ) ( )
j i ij
ij
j i
ij
ij
2
i
ij
sen
z
v v
sen
z
v
q + =
State Estimation
Example
29
Estimation problem
( )
( ) | |
( ) | |
2
m
ij ij
i
j i
q
ij
2
m
ij ij
i
j i
p
ij
2
i
m
i i
v
i
i
,
i
v
q q w
p p w
v v w Minimizar
+
+

e e
e e
e

State Estimation
Example
30
2 buses, 1line with reactance x = 0.15 puO
Voltage measurements at buses 1 y 2 are,
respectively, 1.07 y 1.01 puV
Active power flow measurements (1-2) are 0.83 y 0.81
puW
Reactive power flow measurements (1-2) are 0.73 y
0.58 puVar
Reference bus is 2
State Estimation
Example
31
Optimization problem:
( ) ( )
2
m
21
2
2 1 2 1
2
m
21 1 2 1
2
m
12 1 2 1
2
1
2
m
12 1 2 1
2
m
2 2
2
m
1 1
, v , v
q v
x
1
cos v v
x
1
p sen v v
x
1
q cos v v
x
1
v
x
1
p sen v v
x
1
v v v v e
Minimize
1 2 1
|
.
|

\
|
+
|
.
|

\
|

+
|
.
|

\
|
+
|
.
|

\
|

+ + =
State Estimation
Example
32
( ) ( )
( ) ( )
( ) ( )
2
0,58
2
2
v
0.15
1
1
cos
2
v
1
v
0.15
1 -
2
0.81
1
sen
2
v
1
v
0.15
1 -
2
0,73
1
cos
2
v
1
v
0.15
1
2
1
v
0.15
1
2
0.83
1
sen
2
v
1
v
0.15
1
2
1.01
2
v
2
1.07
1
v e
Minimize
1
,
2
v ,
1
v
+ + + + +
+ +
+ =
- - -
- -
Also
State Estimation
Example
33
scalars
x Reactancia de la linea /0.15/
*mediciones
v1m Tension medida en el nudo 1 /1.07/
v2m Tension medida en el nudo 2 /1.01/
p12m Potencia activa medida en el nudo 1 /0.83/
q12m Potencia reactiva medida en el nudo 1 /0.73/
p21m Potencia activa medida en el nudo 2 /0.81/
q21m Potencia reactiva medida en el nudo 2 /0.58/;
variables
v1 Modulo de la tension en el nudo 1. Valor exacto: 1.0966
v2 Modulo de la tension en el nudo 2. Valor exacto: 1.0000
d1 Argumento de la tension en el nudo 2. Valor exacto: 0.1097
e Error cuadratico medio;
equations
error Ecuacion del error cuadratico medio;
*Definicion de la ecuacion del error cuadratico medio
error .. e =e= sqr(v1-v1m) + sqr(v2-v2m) +
sqr((1/x)*v1*v2*sin(d1)-p12m) +
sqr((1/x)*(sqr(v1)-v1*v2*cos(d1))-q12m) +
sqr((1/x)*v1*v2*sin(d1)-p21m) +
sqr((1/x)*(-sqr(v2)+v1*v2*cos(d1))-q21m);
model estimo /all/;
solve estimo using nlp minimizing e;
State Estimation
Example
34
LOWER LEVEL UPPER MARGINAL
---- VAR v1 -INF 1.088 +INF -1.185E-8
---- VAR v2 -INF 0.994 +INF 7.6054E-9
---- VAR d1 -INF 0.114 +INF -1.043E-8
---- VAR e -INF 7.9359E-4 +INF .
v1 Modulo de la tension en el nudo 1. Valor exacto: 1.0966
v2 Modulo de la tension en el nudo 2. Valor exacto: 1.0000
d1 Argumento de la tension en el nudo 1. Valor exacto: 0.1097
e Error cuadratico medio
State Estimation
Example
35
Wood & Wollenberg, pg. 477
6-bus network:
State Estimation
Example
36
Wood & Wollenberg, pg. 478
Measurements
State Estimation
Example
37
Wood & Wollenberg, pg. 480
Estimation:
State Estimation
Example
38
Network
1
2
3
State Estimation
Example
39
Data:
Measurement Value p.u. Variance
V1 0.95 10
-3
V2 1.02 10
-3
V3 1.03 10
-3
P12 1 10
-2
Q21 -0.4 10
-2
P13 0.8 10
-2
Q31 -0.2 10
-2
X
12
= X
13
= X
23
= 0.1j
State Estimation
Example
40
Solution
State vertor:
(
(
(
(
(
(

=
(
(
(
(
(
(

=
3
2
3
2
1
5
4
3
2
1

V
V
V
x
x
x
x
x
x
i i
VZ
0
slack
=
State Estimation
Example
41
Measurements:
(
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(
(

=
2 . 0
80 . 0
40 . 0
00 . 1
03 . 1
02 . 1
95 . 0
Q
P
Q
P
V
V
V
z
31
13
21
12
3
2
1
State Estimation
Example
42
Weighting matrix
(
(
(
(
(
(
(
(
(

=
100 0 0 0 0 0 0
0 100 0 0 0 0 0
0 0 100 0 0 0 0
0 0 0 100 0 0 0
0 0 0 0 1000 0 0
0 0 0 0 0 1000 0
0 0 0 0 0 1000
W
State Estimation
Example
43
Functional measurement vector
| |
| |
1
2
3
1 2
4
2
1 4 2
1 3
5
3
3 1 5
sin( )
( )
cos( )
sin( )
cos( )
x
x
x
x x
x
X
h x
x
x x x
X
x x
x
X
x
x x x
X
(
(
(
(
(
(

(
(
=

(

(
(

(
(
(

(

State Estimation
Example
44
Jacobian matrix, :
j
i
ij
x
h
H
c
c
=
( ) | |
( ) | |
(
(
(
(
(
(
(
(
(
(
(
(


=
) x ( sen
X
x x
0
X
x 2 x cos x
0 ) x cos(
X
x
) x cos(
X
x x
0 ) x ( sen
X
x
0 ) x ( sen
X
x
0 ) x ( sen
X
x x
0
X
x 2 x cos x
) x cos(
X
x
0 ) x cos(
X
x x
0 ) x ( sen
X
x
) x ( sen
X
x
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
5
3 1 3 5 1
5
3
5
3 1
5
1
5
3
4
2 1 2 4 1
4
2
4
2 1
4
1
4
2
State Estimation
Example
45
1. Initialization x
0
:
2. Compute H(x
k
) and calculate G(x
k
).
-Funcitonal vector:
| |
T 0
0 0 1 1 1 x =
| |
T
0
0 0 0 0 1 1 1 ) x ( h =
State Estimation
Example
46
- Jacobian matrix:
(
(
(
(
(
(
(
(
(

=
0 0 10 0 10
10 0 0 0 0
0 0 0 10 10
0 10 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
0
State Estimation
Example
47
- Gain matrix:
(
(
(
(
(
(


= =
10 0 0 0 0
0 10 0 0 0
0 0 11 0 10
0 0 0 11 10
0 0 10 10 21
10 WH H ) x ( G
3 T 0
State Estimation
Example
48
- Residual vector:
(
(
(
(
(
(
(
(
(

= =
=
2000 . 0
8000 . 0
4000 . 0
0000 . 1
0300 . 0
0200 . 0
0500 . 0
) x ( h z ) x ( r
h(x) - z r(x)
0 0
State Estimation
Example
49
3. Solution of the system of equations
Thus
(
(
(
(
(
(

= = A

0800 . 0
1000 . 0
0007 . 0
0184 . 0
0177 . 0
Wr H G x
T 1 0
| | ) x ( h z W ) x ( H x ) x ( G
k K T k k
= A
State Estimation
Example
50
4. Update the state vector:
k k 1 k
x x x A + =
+
(
(
(
(
(
(

= A + =
0800 . 0
1000 . 0
0007 . 1
9816 . 0
0177 . 1
x x x
0 0 1
State Estimation
Example
51
5. Repeat until residuals below 0.001
State Estimation
Example
52
Solution:
J(x) V
1
V
2
V
3

2

3
Matlab 7.8062 1.0216 0.9800 1.0013 -0.0996 -0.0781
State Estimation
Example
53
Matlab solution:
1.0215 ; 0.9800 ; 1.0014 ; -0.0996 ; -0.0781
x=
Residuals:
r 1 2 3 4
V1 -0.0500 -0.0677 -0.0714 -0.0715
V2 0.0200 0.0384 0.0401 0.0400
V3 0.0300 0.0293 0.0287 0.0286
P12 1.0000 0.0027 0.0043 0.0043
Q21 -0.4000 -0.0950 -0.0427 -0.0428
P13 0.8000 -0.0139 0.0024 0.0023
Q31 -0.2000 -0.0615 -0.0293 -0.0293
State Estimation
Example
54
GAMS solution:
scalars
x reactancias de todas las lineas /0.1/
*mediciones
v1m tension medida del nudo 1 /0.95/
v2m tension medida del nudo 2 /1.02/
v3m tension medida del nudo 3 /1.03/
p12m potencia activa medida en el nudo 1 /1.00/
q21m potencia reactiva medida en el nudo 2 /0.4/
p13m potencia activa medida en el nudo 1 /0.8/
q31m potencia reactiva medida en el nudo 3 /0.2/
sg1 varianza 1 /0.001/
sg2 varianza 2 /0.01/;
variables
v1 modulo de la tension en el nudo 1. Valor exacto:1.0216
v2 modulo de la tension en el nudo 2. Valor exacto:0.9800
v3 modulo de la tension en el nudo 3. Valor exacto:1.0013
d2 argumento de la tension en el nudo 2. Valor exacto:-0.0996
d3 argumneto de la tension en el nudo 3. Valor exacto:-0.0781
e error cuadratico medio;
State Estimation
Example
55
equations
error ecuacion del error cuadratico medio;
error.. e =e= 1/sg1*(sqr(v1-v1m))+1/sg1*(sqr(v2-v2m))+
1/sg1*(sqr(v3-v3m))+
1/sg2*(sqr((1/x)*v1*v2*sin(d2)-p12m))+
1/sg2*(sqr((1/x)*v1*v3*sin(d3)-p13m))+
1/sg2*(sqr((1/x)*(-sqr(v2)+v1*v2*cos(d2))-q21m))+
1/sg2*(sqr((1/x)*(-sqr(v3)+v1*v3*cos(d3))-q31m));
model estimo /all/;
solve estimo using nlp minimizing e;
State Estimation
Example
56
LOWER LEVEL UPPER MARGINAL
---- VAR v1 -INF 1.022 +INF 8.2392E-9
---- VAR v2 -INF 0.980 +INF -3.839E-9
---- VAR v3 -INF 1.001 +INF -4.782E-9
---- VAR d2 -INF -0.100 +INF -2.068E-9
---- VAR d3 -INF -0.078 +INF -2.375E-9
---- VAR e -INF 7.806 +INF .
GAMS actual solution:
State Estimation
Example
57
Comparison:
Variable Matlab GAMS Error
V1 1.0215p.u. 1.022p.u. 0.04%
V2 0.9800p.u. 0.980p.u. 0.00%
V3 1.0014p.u. 1.001p.u. 0.04%
2 -0.0996 -0.100 0.40%
3 -0.0781 -0.078 0.13%
State Estimation
Example
58
Two alternatives:
1. Zero injections
modeled using large
weights.
2. Zero injection
equalities explicitly
modeled
Variable Value p.u Variance
V
1
1.05 10
-3
V
2
1 10
-3
V
3
0.95 10
-3
P
3
1 10
-2
Q
3
0.2 10
-2
One
Two Three
State Estimation
Example
59
Matlab solution (case 1):
Matrix W:
(
(
(
(
(
(
(
(
(

=
2
2
6
6
3
3
3
10 0 0 0 0 0 0
0 10 0 0 0 0 0
0 0 10 0 0 0 0
0 0 0 10 0 0 0
0 0 0 0 10 0 0
0 0 0 0 0 10 0
0 0 0 0 0 0 10
W
State Estimation
Example
60
Z is:
P
2
y Q
2
are zero (exact!)
(
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(
(

=
0.2
1
0
0
0.95
1
1.05
Q
P
Q
P
V
V
V
Z
3
3
2
2
3
2
1
State Estimation
Example
61
Vector h(x):
x1
x2
x3
( ) h x =

-10((x1 x2 sin(x4))+(x2 x3 sin(x4-x5)))
10 x2((x1 cos(x4)-x2)-(x2-x3 cos(x4-x5)))
10x2 x3 sin(x4-x5)
10x3 (x2 cos(x4-x5)-x3)




(
(
(
(
(
(
(
(
(
(

State Estimation
Example
62
Iteration:
Tolerance for x below |0.00001|
k k 1 k T 1 k
k
T
x x x Wr H G x
) x ( h z ) x ( r
WH H G
A + = = A

=
=
+
State Estimation
Example
63
Values per iteration:
Iteration 1 2 3 4
V
1
1.025000 1.035781 1.035794 1.035793
V
2
0.999999 0.996133 0.996001 0.995999
V
3
0.974999 0.966660 0.966443 0.966440
o
2
-0.099999 -0.097648 -0.0977013 -0.097702
o
3
-0.199999 -0.202269 -0.202438 -0.202440
State Estimation
Example
64
Solution in 4 iterations
Results (Caso 1):
Estimate Residual
V
1
1.035794 0.014205
V
2
0.996001 0.003998
V
3
0.966443 -0.016443
o
2
-0.0977013 -0.006335
o
3
-0.202438 -0.032906
State Estimation
Example
65
GAMS (case 1) (NO weights):
scalars
x Reactancia de la linea /0.1/
*mediciones
v1m Tension medida en el nudo 1 /1.05/
v2m Tension medida en el nudo 2 /1/
v3m Tension medida en el nudo 2 /0.95/
p2m Potencia activa medida en el nudo 2 /0/
q2m Potencia reactiva medida en el nudo 2 /0/
p3m Potencia activa medida en el nudo 3 /1/
q3m Potencia reactiva medida en el nudo 3 /0.2/;
variables
v1 Modulo de la tension en el nudo 1. Valor exacto: 1.0000
v2 Modulo de la tension en el nudo 2. Valor exacto: 1.0000
v3 Modulo de la tension en el nudo 3. Valor exacto: 1.0000
d2 Argumento de la tension en el nudo 2. Valor exacto: -0.0100
d3 Argumento de la tension en el nudo 3. Valor exacto: -0.0100
State Estimation
Example
66
e Error cuadratico medio;
equations
error Ecuacion del error cuadratico medio;
*Definicion de la ecuacion del error cuadratico medio
error .. e =e= sqr(v1-v1m) + sqr(v2-v2m) + sqr(v3-v3m) +
sqr(((-1/x)*v1*v2*sin(d2)+(-1/x)*v2*v3*sin(d2-d3))-p2m) +
sqr(((1/x)*v2*(v1*cos(d2)-v2)-((1/x)*v2*(v2-v3*cos(d2-d3))))-q2m) +
sqr((1/x)*v2*v3*sin(d2-d3)-p3m) +
sqr((1/x)*v3*(v2*cos(d2-d3)-v3)-q3m);
model estimo /all/;
SOLVE estimo USING nlp MINIMIZING e;
display v1.L,v2.L,v3.L,d2.L,d3.L;
State Estimation
Example
67
GAMS (caso 1):
Solution is:
error Ecuacin del error cuadrtico medio
LOWER LEVEL UPPER MARGINAL
---- VAR v1 -INF 1.033 +INF EPS
---- VAR v2 -INF 0.996 +INF 1.8628E-8
---- VAR v3 -INF 0.970 +INF -1.837E-8
---- VAR d2 -INF -0.097 +INF -1.350E-8
---- VAR d3 -INF -0.201 +INF 9.2908E-9
State Estimation
Example
68
Comparison case 1:
Matlab GAMS
V
1
1.035794 1.033
V
2
0.996001 0.996
V
3
0.966443 0.970
o
2
-0.0977013 -0.097
o
3
-0.202438 -0.201
State Estimation
Example
69
Case 2
Zero injections explicitly modeled as equalities.
This generally avoid numerical issues.
State Estimation
Example
70
Vector h(x) is:
(
(
(
(
(
(

=
(
(
(
(
(
(

=
2 . 0
1
95 . 0
1
05 . 1
Q
P
V
V
V
Z
3
3
3
2
1
(
(
(
(
(
(



=
x3) - x5) - cosx4 (x2 10x3
x5) - sin(x4 x3 10x2
x3
x2
x1
) x ( h
State Estimation
Example
71
Constraint vector:
(



=
x5))) - cos(x4 x3 - (x2 - x2) - cos(x4) ((x1 x2 10
x5))) - sin(x4 x3 (x2 + sin(x4)) x2 ((x1 10 -
c
State Estimation
Example
72
System to be solved:
C is the Jacobian matrix of the constraints and the
multipied vector of the constraints
(

=
(


A
(

) x ( c
Wr H x
0 C
C WH H
k
k T k T T
State Estimation
Example
73
Values per iteration:
Iteration 1 2 3 4
V
1
1.025000 1.035781 1.035794 1.035793
V
2
1 0.996133 0.996001 0.995999
V
3
0.975 0.966660 0.966443 0.966440

2
-0.1 -0.097648 -0.0977013 -0.097702

3
-0.2 -0.202269 -0.202438 -0.202440
State Estimation
Example
74
Solution in 4 iterations
Final results (Case 2):
Variable Estimate Residual
V
1
1.035794 0.014205
V
2
0.996001 0.003998
V
3
0.966443 -0.016443
o
2
-0.0977013 -0.006335
o
3
-0.202438 -0.032906
State Estimation
Example
75
GAMS (Cas2 2) (NO weights):
scalars
x Reactancia de la linea /0.1/
*mediciones
v1m Tension medida en el nudo 1 /1.05/
v2m Tension medida en el nudo 2 /1/
v3m Tension medida en el nudo 2 /0.95/
p2m Potencia activa medida en el nudo 2 /0/
q2m Potencia reactiva medida en el nudo 2 /0/
p3m Potencia activa medida en el nudo 3 /1/
q3m Potencia reactiva medida en el nudo 3 /0.2/;
Variables
v1 Modulo de la tension en el nudo 1. Valor exacto: 1.0000
v2 Modulo de la tension en el nudo 2. Valor exacto: 1.0000
v3 Modulo de la tension en el nudo 3. Valor exacto: 1.0000
d2 Argumento de la tension en el nudo 2. Valor exacto: -0.0100
d3 Argumento de la tension en el nudo 3. Valor exacto: -0.0100
e Error cuadratico medio;
State Estimation
Example
76
equations
error Ecuacion del error cuadratico medio
R1 Restriccion 1
R2 Restriccion 2;
*Definicion de la ecuacion del error cuadratico medio
error .. e =e= sqr(v1-v1m) + sqr(v2-v2m) + sqr(v3-v3m) +
sqr((1/x)*v2*v3*sin(d2-d3)-p3m) +
sqr((1/x)*v3*(v2*cos(d2-d3)-v3)-q3m);
R1 .. ((-1/x)*v1*v2*sin(d2)+(-1/x)*v2*v3*sin(d2-d3)-p2m)=E=0;
R2 .. ((1/x)*v2*(v1*cos(d2)-v2)-((1/x)*v2*(v2-v3*cos(d2-d3)))-
q2m)=E=0;
model estimo /all/;
SOLVE estimo USING nlp MINIMIZING e;
display v1.L,v2.L,v3.L,d2.L,d3.L;
State Estimation
Example
77
GAMS solution (caso 2):
error objective function
R1 Constraint 1
R2 Constraint 2
LOWER LEVEL UPPER MARGINAL
---- VAR v1 -INF 1.032 +INF -1.290E-8
---- VAR v2 -INF 0.996 +INF .
---- VAR v3 -INF 0.970 +INF 1.3559E-8
---- VAR d2 -INF -0.097 +INF .
---- VAR d3 -INF -0.201 +INF -4.461E-9
State Estimation
Example
78
Comparison:
CASE 1 CASE 2
Matlab GAMS Matlab GAMS
V
1
1.035794 1.033 1.035794 1.032
V
2
0.996001 0.996 0.996001 0.996
V
3
0.966443 0.970 0.966443 0.970

2
-0.097701 -0.097 -0.097701 -0.097

3
-0.202438 -0.201 -0.202438 -0.201
State Estimation
Example
79
Do we have enough measurement to estimate
the state?
State Estimation
4. Observability
80
If the system as al whole is not observable, some
islands would be observable.
State Estimation
4. Observability
81
State variables: n
Measurements: M
1) m<n unboservable;
2) m=n no redundancy;
3) m>n generally observable.
Measurements have to be properly distributed.
State Estimation
4. Observability
82
It the system is unobservable, we use pseudo-
measurements
1) Reasonable values.
2) Previous estimates.
State Estimation
4. Observability
83
N bus network: n=2N-1 state variables, and m
measurements:
) x ( h ) x ( H ;
) x ... , x , x ( h
) x ... , x , x ( h
) x ... , x , x ( h
) x ( h ;
z
z
z
z
x
n 2 1 m
n 2 1 2
n 2 1 1
m
2
1
V =
(
(
(
(

=
(
(
(
(

=

State Estimation
4. Observability
84
For obervability purposes:
We also linearize. If the linear system is observable,
the nonlinear system is observable too:
z Hx =
z ) x ( h =
State Estimation
4. Observability
85
H
z x H =
m
measurements
N
State variables
H
Linear system of
equations
State Estimation
4. Observability
86
General solution:
+ = = N x x z x H
Par
where,
- x
Par
is a particular solution
- N is the null space of the system
- is a coefficient vector
State Estimation
4. Observability
87
For a single solution, the null space needs to be null:
j , i ; 0 N x
ij SINGLE i
=
If so, the system is observable
State Estimation
4. Observability
88
Observability algorithm:
1) Compute H.
(
(
(
(

=
) x ... , x , x ( h
) x ... , x , x ( h
) x ... , x , x ( h
) x ( h
n 2 1 m
n 2 1 2
n 2 1 1

State Estimation
4. Observability
89
To compute the Jacobian
a) Flat start:
b) Typical values:
i 0 , 1 V
i i
= o =
i 0 ], , [ ] 05 . 1 , 95 . 0 [ V
i i i
= o t t e o e
State Estimation
4. Observability
90
2) Compute the null space of H,
using MatLab N=null(H);
3) Chech N
T
columnwise
A) Null columnvariable is observable.
B) No null column variable not observable.
C) Null matrix system observable.
State Estimation
4. Observability
91
System
V1
P
13
2
V2
1
Q
31
Q
21
V3
3
X
ij
=0.1j j , i
State Estimation
4. Observability Example
92
Measurements:
Variable Value p.u. Variance
V
1
0.95 10
-3
V
2
1.02 10
-3
V
3
1.03 10
-3
P
12
1 10
-2
Q
21
-0.4 10
-2
P
13
0.8 10
-2
Q
31
-0.2 10
-2
State Estimation
4. Observability Example
93
State variables
3 3 3 2 2 2 1 1
V U , V U , 0 V U Z = Z = Z =
(
(
(
(
(
(

=
(
(
(
(
(
(

=
3
2
3
2
1
5
4
3
2
1

V
V
V
x
x
x
x
x
x
(
(
(
(
(
(
(
(
(
(
(
(
(


=
) x x ( cos [x
X
x
) x sen(
X
x x
) x x ( cos [x
X
x
) x sen(
X
x x
x
x
x
h(x)
3 5 1
13
3
5
13
3 1
2 4 1
12
2
4
12
2 1
3
2
1
State Estimation
4. Observability Example
94
Jacobian matrix h(x): H
ij
=
j
i
x
h
c
c
(
(
(
(
(
(
(
(
(
(
(
(
(


=
) x ( sen
X
x x
0
X
] x 2 ) x cos( x [
0 ) x cos(
X
x
) x cos(
X
x x
0 ) x ( sen
X
x
0 ) x ( sen
X
x
0 ) x ( sen
X
x x
0
X
] x 2 ) x cos( x [
) x cos(
X
x
0 ) x cos(
X
x x
0 ) x ( sen
X
x
) x ( sen
X
x
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
5
13
3 1
13
3 5 1
5
13
3
5
13
2 1
5
13
1
5
13
3
4
12
2 1
12
2 4 1
4
12
2
4
12
2 1
4
12
1
4
12
2
State Estimation
4. Observability Example
95
1) H evaluated as a typical woring point and at the flat
start
T
fun
] 3 . 0 2 . 0 98 . 0 98 . 0 01 . 1 [ x =
T
0
] 0 0 1 1 1 [ x =
State Estimation
4. Observability Example
96
Results:
Significant differences
(
(
(
(
(
(
(
(
(

=
0 0 10 0 10
10 0 0 0 0
0 0 0 10 10
0 10 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
0
(
(
(
(
(
(
(
(
(

=
95 . 2 0 86 . 9 0 36 . 9
55 . 9 0 01 . 3 0 89 . 2
0 99 . 1 0 60 . 9 61 . 9
0 80 . 9 0 03 . 2 95 . 1
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
fun
State Estimation
4. Observability Example
97
2) Compte the null space H(x
fun
) N
3) Check columnwise N
T
MatLab
N_t=null(H)'
N_t =
Empty matrix: 0-by-5

Null space is null.
State Estimation
4. Observability Example
98
Two redundant measurements
- We eliminate Q
31
- State still observable
V1
1
V3
V2
2
P
13
P
12
Q
21
Q
31 =
T
N
Empty matrix: 0-by-5
State Estimation
4. Observability Example
99
- We eliminate P
13

3
is no longer observable
This is consistent because the only
Information availbe at bus 3 is the voltage
magnitude.
V1
1
V3
2
P
13
P
12
Q
21
Q
31
=
T
N [ 0 0 0 0 1 ]
V2
State Estimation
4. Observability Example
100
Once observability is guarenteed we estimate the
state
State Estimation
4. Observability Example
101
)] x ( h z [ W ) x ( H x ) x ( G
k k T k k
= A
) x ( WH ) x ( H ) x ( G
k k T k
=
x x x
k 1 k
A + =
+
State Estimation
4. Observability Example
102
Tolerance is 10
-3
x A
Iteration 1 2 3 4
V
1
1 1.0177 1.0214 1.0214 0.1005
V
2
1 0.9816 0.9799 0.9799 0.1173
V
3
1 1.0007 1.0013 1.0013 0.0995

2
0 -0.1000 -0.0966 -0.0996 0.0209

3
0 -0.0800 -0.0781 -0.0781 0.0014
3 4
10 x

A
State Estimation
4. Observability Example
103
GAMS
State Estimation
4. Observability Example
104
Solution:
State Estimation
4. Observability Example
105
Comparison
Solution V
1
V
2
V
3
Delta
2
(rad)
Delta
3
(rad)
MatLab 1.0214 0.9799 1.0013 -0.0966 -0.0781
GAMS 1.022 0.980 1.001 -0.103 -0.078
State Estimation
4. Observability Example
106
Flat start
Flat start is good to copute the Jacobian because such Jacobian
involves teh minumum amount of non-natural couplings.
) x ( H ] 0 0 1 1 1 [ x
0
T
0
=
State Estimation
4. Observability Example
107
V1
P
13
2
V2
1
Q
31
Q
21
V3
3
X
ij
=0.1j j , i
State Estimation
4. Observability Example
108
Natural coupling:
If P
13
is eliminated, info pertaining to bus 3 is:
V Q P
31 3
Q V
State Estimation
4. Observability Example
109
Jacobians
(
(
(
(
(
(
(
(
(

=
0 0 10 0 10
10 0 0 0 0
0 0 0 10 10
0 10 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
0
(
(
(
(
(
(
(
(
(




=
7976 . 0 0 84 . 9 0 98 . 9
19 . 10 0 79 . 0 0 78 . 0
0 99 . 0 0 43 . 9 75 . 9
0 95 . 9 0 02 . 1 98 . 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
) x ( H
fun
Row 5 not used (P
13
)
State Estimation
4. Observability Example
110
Null space is obtaine for both matrices
Flat start: [ 0 0 0 0 1 ]
variable
3
NOT observable
Estimate: Empty matrix: 0-by-5
variable
3
is observable
What do we do?
State Estimation
4. Observability Example
111
Using GAMS:
Phase of bus 3 is nullno flow through line 1-3
Inconsistent result.
State Estimation
4. Observability Example
112
- System analytically observable since
3
is computed
using Q
13
y V
3
, which are measurements loosely
related to
3
. The outcome is thus unreliable.
- Flat start result is more appropriate from a practical
viewpoint.
State Estimation
4. Observability Example
113
Some bad measurements may scape the initial
screening.
Bad measurement detection: Test x
2
.
Bad measurement identification: Largest normalized
residual test.
State Estimation
5. Bad measurements
114
Chi-square with K degrees of freedom. ( ) : x J
: n N K = Number of measurement minus number of
state variables.
( ) : K x J =
( )
: 2K
x J
=
If J(x) large enough, bad measurement likely.
Average value.
Standard deviation.
State Estimation
5. Bad measurements
115
Specifically:
If we fix (e.g. 0.01), since J(x) is x
2
with K
degrees of freedom, we can compute t
j
If the value for J(x) from the optimization problme
is smaller than t
j
no bad measurements within a
confidence level of 1
( ) ( ) t x J P
j
= >
State Estimation
5. Bad measurements
116
State Estimation
5. Bad measurements
117
1. Compute J(x), where x is the state estimate
2. Considering a x
2
with K degrees of freedom and o
confidence level, compute t
j
3. If J(x) > t
j
, bad measurments are present with a degree
of certitude of 1-.
Algorithm:
( ) ( ) t x' J P
j
= >
State Estimation
5. Bad measurements
118
51 K
11 n
62 N
=
)
`

=
=
76.6 t 0.01
j
= =
If no bad measurement with
donfidence 99 %
( ) 40.33 x J =
If bad measurements are detected, they need to
be identified.
If bad measurement present with
confidence 99 %
( ) 207.94 x J =
Six-bus case:
State Estimation
5. Bad measurements
119
State Estimation
5. Bad measurements
120
Identification:
1. Residuals, r = z-h(x), are distributes following a
N(0,), where is the covariance matrix:
2. Normalized residual follow a N(0,1).
( )
T
1
1 T
H H R H H R

=
ii
i
N
i

r
r =
State Estimation
5. Bad measurements
121
n
i
r
( )
n
i
r PDF
ri
est
i
m
i n
i

h z
r

=
Valor real
State Estimation
5. Bad measurements
Largest normalized residual test:
122
If r
i
N
is N(0,1), for a condidence level of 95%:
If |r
i
N
| >1.6449 z
i
m
erroneous
If |r
i
N
| <1.6449 z
i
m
OK

State Estimation
5. Bad measurements
123
Convariance matrix:
(
(
(
(
(
(
(
(
(

=

6400 . 0 0501 . 0 - 3260 . 0 - 0326 . 0 6260 . 0 - 3043 . 0 3218 . 0
0501 . 0 - 0039 . 0 0255 . 0 0025 . 0 - 0490 . 0 0238 . 0 - 0252 . 0 -
3260 . 0 - 0255 . 0 6808 . 0 0680 . 0 - 3188 . 0 6355 . 0 - 3431 . 0
0326 . 0 0025 . 0 - 0680 . 0 - 0068 . 0 0319 . 0 - 0635 . 0 0343 . 0 -
6260 . 0 - 0490 . 0 3188 . 0 0319 . 0 - 6124 . 0 2976 . 0 - 3148 . 0 -
3043 . 0 0238 . 0 - 6355 . 0 - 0635 . 0 2976 . 0 - 5933 . 0 3203 . 0 -
3218 . 0 0252 . 0 - 3431 . 0 0343 . 0 - 3148 . 0 - 3203 . 0 - 6612 . 0
10
3
State Estimation
5. Bad measurements - example
124
Residual and normalized residual verctor:
Since |r
1
N
| >1.6449, voltage measumrent at bus 1 is
erroneous.
(
(
(
(
(
(
(
(
(

=
0.0299 -
0.0023
0.0433 -
0.0043
0.0286
0.0400
0.0715 -
r
(
(
(
(
(
(
(
(
(

= =
1806 . 1 -
1733 . 1
6599 . 1 -
6611 . 1
1557 . 1
6406 . 1
7806 . 2 -

r
r
ii
i
N
State Estimation
5. Bad measurements - example
125
Measuremnt V1 eliminated:
X
12
,X
13
,X
23
= 0.1
V1
V3
V2
M13
M12
tres
dos
Magnitud Valor p.u. Varianza
V
2
1.02 10
-3
V
3
1.03 10
-3
P
12
1 10
-2
Q
21
-0.4 10
-2
P
13
0.8 10
-2
Q
31
-0.2 10
-2
State Estimation
5. Bad measurements - example
126
(
(
(
(
(
(

=
(
(
(
(
(
(

=
3
2
3
2
1
5
4
3
2
1

V
V
V
x
x
x
x
x
x
State Estimation
5. Bad measurements - example
127
Measurement vector:
Measurement V1 not used.
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(

=
2 . 0
80 . 0
40 . 0
00 . 1
03 . 1
02 . 1
Q
P
Q
P
V
V
z
31
13
21
12
3
2
State Estimation
5. Bad measurements - example
128
Weighting matrix:
Measurements as a function of state variables:
(
(
(
(
(
(
(

=
100 0 0 0 0 0
0 100 0 0 0 0
0 0 100 0 0 0
0 0 0 100 0 0
0 0 0 0 1000 0
0 0 0 0 0 1000
W
| |
| |
2
3
1 2
4
2
1 4 2
1 3
5
3
3 1 5
sin( )
( )
cos( )
sin( )
cos( )
x
x
x x
x
X
x
h x
x x x
X
x x
x
X
x
x x x
X
(
(
(
(

(
(

(
=

(
(
(

(
(

(


State Estimation
5. Bad measurements - example
129
Jacobian:
j
i
ij
x
h
H
c
c
=
( ) | |
( ) | |
(
(
(
(
(
(
(
(
(
(
(


=
) x ( sen
X
x x
0
X
x 2 x cos x
0 ) x cos(
X
x
) x cos(
X
x x
0 ) x ( sen
X
x
0 ) x ( sen
X
x
0 ) x ( sen
X
x x
0
X
x 2 x cos x
) x cos(
X
x
0 ) x cos(
X
x x
0 ) x ( sen
X
x
) x ( sen
X
x
0 0 1 0 0
0 0 0 1 0
) x ( H
5
3 1 3 5 1
5
3
5
3 1
5
1
5
3
4
2 1 2 4 1
4
2
4
2 1
4
1
4
2
State Estimation
5. Bad measurements - example
130
1. Initialization:
2. H(x
k
) and G(x
k
):
| |
T 0
0 0 1 1 1 x =
| |
T 0
0 0 0 0 1 1 ) x ( h =
State Estimation
5. Bad measurements - example
131
- Jacobian:
- Gain matriz:
(
(
(
(
(
(
(


=
0 0 10 0 10
10 0 0 0 0
0 0 0 10 10
0 10 0 0 0
0 0 1 0 0
0 0 0 1 0
) x ( H
0
(
(
(
(
(
(


= =
10 0 0 0 0
0 10 0 0 0
0 0 11 0 10
0 0 0 11 10
0 0 10 10 20
10 WH H ) x ( G
3 T 0
State Estimation
5. Bad measurements - example
132
- Residual vector:
(
(
(
(
(
(
(

= =
=
2000 . 0
8000 . 0
4000 . 0
0000 . 1
0300 . 0
0200 . 0
) x ( h z ) x ( r
h(x) - z r(x)
0 0
State Estimation
5. Bad measurements - example
133
3. Solving
4. New state:
(
(
(
(
(
(

= = A

0800 . 0
1000 . 0
0345 . 0
0155 . 0
0550 . 0
Wr H G x
T 1 0
| | ) x ( h z W ) x ( H x ) x ( G
k K T k k
= A
k k 1 k
x x x A + =
+
(
(
(
(
(
(

= A + =
0800 . 0
1000 . 0
0345 . 1
0155 . 1
0550 . 1
x x x
0 0 1
State Estimation
5. Bad measurements - example
134
5. We iterate until Ax is smaller than 0.001.
State Estimation
5. Bad measurements - example
135
Solution:
J(x) V
1
V
2
V
3
Matlab 0.0644 1.0581 1.0147 1.0355 -0.0932 -0.0731
Gams 0.0645 1.0581 1.0147 1.0355 -0.0932 -0.0731
2

State Estimation
5. Bad measurements - example
136
Checking again:
J(x) = 0.0645 < 3.8415, no bad measurements within
a confidence level of 95%.
( ) 8415 . 3 t 95 . 0 1 05 . 0 = = =
State Estimation
5. Bad measurements - example
137
Residual and normalized residual vectors:
Since |r
i
N
| <1.6449, no bad measurements.
(
(
(
(
(
(
(

=
0.0052
0.0001 -
0.0058 -
0.0007
0.0055 -
0.0053
r
(
(
(
(
(
(
(

= =
2432 . 0
0814 . 0 -
2650 . 0 -
3616 . 0
2536 . 0 -
2540 . 0

r
r
ii
i
N
State Estimation
5. Bad measurements - example

You might also like