Vous êtes sur la page 1sur 41

The Extended Kalman Filter and the Particle Filter in

the Dynamic State Estimation of Electrical Power


Systems

Holger Cevallos, Gabriel Intriago, Douglas Plaza

Escuela Superior Politécnica del Litoral (ESPOL)


Third Ecuador Technical Chapter Meeting (ETCM) 2018

Cuenca, 18 de Octubre de 2018

(FIEC - ESPOL) ETCM 2018 1 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 2 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 2 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 2 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 2 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 2 / 37


Control Room

State Estimation contributes to proper management of electrical energy:

Modeling Contingencies analysis


Optimizing power flow Corrective actions
Bad data detection
(FIEC - ESPOL) ETCM 2018 3 / 37
Evolution of the state of the system in time

xt xt+1

yt
yt+1

time
t t +1

(FIEC - ESPOL) ETCM 2018 4 / 37


Sequential state estimation

xft xft+1

forecast analysis forecast analysis


xat−1 xat
xat xat+1

xft

xat xft+1
xat+1
yt
yt+1

time
t t +1
(FIEC - ESPOL) ETCM 2018 5 / 37
Gaussian probability density function

p(xt )

p(xt ) is Gaussian
xt ∼ N (x̄t , Qt )
xt ∼ N (x̄t , Qt )

xt
x̄t

(FIEC - ESPOL) ETCM 2018 6 / 37


Estimation in a probabilistic framework

p(xt |yt−1 ) = prior pdf


p(yt |xt ) = likelihood pdf
p(xt |yt ) = posterior pdf

xt
xat yt xft

Bayes filter

p(xt |yt ) is proportional to p(yt |xt ) p(xt |yt−1 )

(FIEC - ESPOL) ETCM 2018 7 / 37


Mathematical description of a system

xt+1 = ft,t+1 (xt , ut , Θt , vt )


yt = ht (xt , zt )

ft,t+1 = function of propagation of the state of the system


ut = vector of inputs (meteorological forcings)
Θt = vector of the parameters of the model
vt = process noise
ht = funcion which maps the states to the observation system
zt = observation noise

(FIEC - ESPOL) ETCM 2018 8 / 37


Forecast in linear systems
p(xt |xt−1 ) p(xt+1 |xt )

xt xt+1
x̄t x̄t+1

xt+1 = Ft,t+1 xt + vt
yt = Ht xt + zt

Ft,t+1 = matrix
= process operator
Ht = matrix
= observation operator

(FIEC - ESPOL) ETCM 2018 9 / 37


Linear Kalman filter
Forecast
1 state propagation
forecast xft = Ft,t−1 xat−1
2 error covariance propagation

Pft = Ft,t−1 Pat−1 FT


t,t−1 + Q

analysis xft Pft


Analysis
1 Kalman gain computation
h i−1
Kt = Pft HT HPft HT + R
yt xat Pat 2 measurement update yt
h i
xat = xft + Kt yt − Hxft

3 error covariance update


Pat = [I − Kt H] Pft

(FIEC - ESPOL) ETCM 2018 10 / 37


Forecast in nonlinear systems

p(x0 ) p(x1 |x0 )

x0 x1
x̄0

xt+1 = ft,t+1 (xt , ut , Θt , vt )

yt = ht (xt , zt )

(FIEC - ESPOL) ETCM 2018 11 / 37


Extended Kalman filter
Forecast
1 State forecast
forecast xft = ft,t−1 (xat−1 )
Pft = Ft,t−1 Pat−1 FT
t,t−1 + Qt

Analysis
analysis xft Pft 1 Kalman gain computation

−1
Kt = Pft HT f T
t [Ht Pt Ht + Rt ]

2 measurement update
yt xat Pat
xat = xft + Kt (yt − ht (xft ))

3 approximate error covariance


update

Pat = Pft − Kt Ht Pft

(FIEC - ESPOL) ETCM 2018 12 / 37


Monte Carlo approximation of the Gaussian distribution
Generate an ensemble of random samples (a set of random state
values).
p(xt )

N
1 X
xt = xt,i
N
i=1
Et,i = [xt,i − xt ]
N
1 X
Qt = Et,i [Et,i ]T
N −1
i=1

xft
xft,1 xft,2 xft,3 xft,4 xft,5 xft,6

(FIEC - ESPOL) ETCM 2018 13 / 37


Importance sampling approach

p(xt |yt )

Approximation

p(xt |yt ) ≈ {xt,i , wt,i }

Weight Computation
p(yt |xt,i )p(xt,i |y1:t−1 )
wt,i =
q(xt,i |y1:t )
xt
xt,1 xt,2 xt,3 xt,4 xt,5 xt,6
wt
wt,1 wt,2 wt,3 wt,4 wt,5 wt,6

(FIEC - ESPOL) ETCM 2018 14 / 37


Particle Filter

Weight Computation
p(yt |xt,i )p(xt,i |y1:t−1 )
wt,i =
q(xt,i |y1:t )

Analysis
xat wt,i = p(yt |xt,i )
wt,i
wt,i = PN
i=1 wt,i
wt Resampling of particle set
according to their respective
wieghts.
Aproximation of the expected
value according to the particle set.

xa∗
t

(FIEC - ESPOL) ETCM 2018 15 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 16 / 37


IEEE-14, 30 bus test cases [University, W., 1993].

Figure: IEEE 30 bus test case


Figure: IEEE 14 bus test case

(FIEC - ESPOL) ETCM 2018 17 / 37


Data

v , θ - state variables. Bus 1- slack bar with angle 0o .


RV 1, 2, 3, 6, 9 and 1, 2, 5, 8, 11, 13 for 14 y 30-bus system.
14-bus - 73 meas.: 5 voltage, the rest power. 30-bus - 93 meas.: 1
voltage, the rest power.
Dynamics of the system was obtained by varying the loads at buses
(4, 5, 7, 9-14 for the 14-bus system and 3, 4, 6, 7, 9, 10, 12, 14-30
for the 30-bus system) following a linear trend of 1% with a random
fluctuation of 3%.
Measurements of voltage, power injections and power transfer were
corrupted with a random additive Gaussian distributed noise with a
mean equal to zero and a low level of variability, this is, with a
standard deviation (σ), to consider the uncertainty of measurement.

(FIEC - ESPOL) ETCM 2018 18 / 37


Values for Qk−1 and Rk

Table: Values of
√ standard deviation p(w ) ∼ N(0, Qk−1 )
Measurement Rk [Sharma, 2017]
p(v ) ∼ N(0, Rk )
Power Injection in pu. 0.01 Qk−1 = 10−6 [Valverde, 2011]
Power Flow in pu. 0.01
Voltage in pu. 0.006 Rk as used in [Sharma, 2017]

(FIEC - ESPOL) ETCM 2018 19 / 37


Performance indices. [Alhalali, 2015], [Valverde, 2011]

1
2N buses
1 X
ε(k) = |x̂n (k) − xtn (k)|
2Nbuses − 1
n=2
2
Nsteps
1 X
εv (n) = |v̂k (n) − vkt (n)|
Nsteps
k=1
Nsteps
1 X
εθ (n) = |θ̂k (n) − θkt (n)|
Nsteps
k=1
3
Pm t
i=1 |ẑi (k) − zi (k)|
J(k) = Pm t
i=1 |zi (k) − zi (k)|

(FIEC - ESPOL) ETCM 2018 20 / 37


Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 21 / 37


The Extended Kalman filter

ANALYSIS (MEASUREMENT
FORECAST (TIME UPDATE) UPDATE)
1 Project the state ahead
1 Compute the Kalman gain
−1
x̃k = fk−1 (x̂k−1 ) + wk−1 Kk = P̃k HT T
k [Hk P̃k Hk + Rk ]

2 Project the error covariance


2 Measurement update zk
ahead x̂k = x̃k + Kk (zk − hk (x̃k ))

P̃k = Fk−1 P̂k−1 FT


3 Error covariance update
k−1 + Qk−1
P̂k = P̃k − Kk Hk P̃k

Initial estimates for


x̂k−1 and Pk−1

(FIEC - ESPOL) ETCM 2018 22 / 37


Linearization (Holt’s method)
Assuming a quasi-steady-state behavior of the system:
xk = Fk−1 xk−1 + gk−1 + qk−1
Linear exponential smoothing of Holt. [Valverde, 2011]
[Neguyen et al., 2013]
I matrix Fk−1 and gk−1 represents the transition speed between states.
Fk−1 = αk−1 (1 + βk−1 )I
I vector gk−1 is related with the behavior tendency of the states.
gk−1 = (1 + βk−1 )(1 − αk−1 )x̃k−1 − βk−1 ak−2 + (1 − βk−1 )bk−2
I the vectors a and b can be obtained from previous (a priori) knowledge.
ak−1 = αk−1 xtk−1 + (1 − αk−1 )x̃k−1
bk−1 = βk−1 (ak−1 − ak−2 ) + (1 − βk−1 )bk−2
Fixed constant throughout the whole simulationα = 0.8, β = 0.5
[Valverde, 2011]

(FIEC - ESPOL) ETCM 2018 23 / 37


chart
input x̂0 , P0 , #steps(s)

Forecast Step (Holt’s method)


x̃k , P̃

Analysis Step
Kk , x̂k , Pk

i≤
i +1
Y #iter

Calculate average of estimated


state vectors: x̂mean

Load flow with load increase (x̂mean )


xt, zt

k ≤ #s
Y

END
Outline

1 Motivation

2 Methodologies

3 Description of Simulation Studies


General
Extended Kalman Filter
Particle Filter

4 Results

5 Conclusions

(FIEC - ESPOL) ETCM 2018 25 / 37


hart1
input
x0 , x0true = x0 , k = 1
N = 100, steps(s) = 30, m = 73/93

Particle Generation
xP(i) = x0 + noise

Update State and Measurement


xtemp1 = loadflow (xk−1 ) + noise
[xk , zk ] = loadflow (xtemp1 )
zk = zk + noise

Update Particles and Measurement


xtemp2 = loadflow (xP(i)) + noise
[xPupdate , zupdate ] = loadflow (xtemp2 )
zupdate = zupdate + noise

Weights Generation
true −z
(z 2
update )
1 − k
Pw (i,j) = √ e 2Rk
2∗pi∗Rk

j = j +1 j ≤m
Y

1
hart2
2 1

i +1 i ≤N
Y

Probability Normalization
[P1 P2 ...Pn ]
Pwnorm = (P1 +P2 +···+Pn )

Resampling
xP(i) = resampling (xPupdate , Pwnorm )

Forecast States
xest = mean(xP(i))

k≤s
Y

END
Performance

Table: Average Performance indexes (∗10−3 )

Bus Average Error Indexes


Test EKF PF EKF PF EKF PF
Case εv (n) εv (n) εθ (n) εθ (n) ε(k) ε(k)
14 3.03034 0.33914 0.45452 0.03730 1.80697 0.19520
30 2.18795 0.20176 0.46647 0.02550 1.34970 0.11403

(FIEC - ESPOL) ETCM 2018 28 / 37


Table: Voltage and angle magnitude error for bus n - 14 bus test case
Voltage and Angle Error Indexes
# EKF PF EKF PF
Bar εv (n) εv (n) εθ (n) εθ (n)
−3 −3 −3
∗10 ∗10 ∗10 ∗10−3
1 0.07064 0.10532 — —
2 2.30614 0.36903 0.53414 0.05991
3 0.70920 0.09693 0.68404 0.06735
4 1.96822 0.28629 0.22141 0.00450
5 1.89637 0.27955 0.22306 0.01022
6 3.99940 0.37438 0.40602 0.04643
7 3.62343 0.48452 0.40888 0.02142
8 4.45831 0.35994 0.40360 0.02142
9 3.74959 0.40222 0.65168 0.03849
10 3.77679 0.41531 0.63580 0.04267
11 3.88650 0.39977 0.48894 0.04516
12 4.03918 0.37924 0.49642 0.05459
13 4.02787 0.38485 0.48794 0.05339
14 3.91311 0.41069 0.72140 0.05675
AVG 3.03034 0.33914 0.45452 0.03730

(FIEC - ESPOL) ETCM 2018 29 / 37


Table: Voltage and angle magnitude error for bus n - 30 bus
(FIEC - ESPOL)

test case
Voltage and Angle Error Indexes
# EKF PF EKF PF
Bar εv (n) εv (n) εθ (n) εθ (n)
−3 −3 −3
∗10 ∗10 ∗10 ∗10−3
1 0.16335 0.11194 — —
2 1.03012 0.13037 0.37602 0.01114
3 1.17884 0.12882 0.40193 0.00763
4 1.43330 0.12001 0.37982 0.00894
5 1.31670 0.07552 0.51154 0.01349
6 1.63579 0.14376 0.35859 0.00531
7 1.48783 0.10574 0.33712 0.00785
8 1.93061 0.07472 0.48693 0.01448
9 2.21905 0.23174 0.42784 0.01632
10 2.62787 0.23280 0.55035 0.02776
11 2.41184 0.37456 0.42613 0.01632
12 2.53278 0.23600 0.33114 0.01512
13 3.06382 0.35146 0.33132 0.01512
14 2.58198 0.25746 0.36753 0.02246
15 2.62259 0.26363 0.42419 0.02514
16 2.60319 0.26024 0.45643 0.02378
17 2.62461 0.21066 0.51898 0.02776
18 2.65915 0.24751 0.52294 0.03185
19 2.69154 0.24192 0.58205 0.03422
20 2.68115 0.26002 0.57713 0.03306
21 2.67999 0.25439 0.57759 0.03073
22 2.66517 0.25129 0.59110 0.03051
23 2.66821 0.22948 0.51248 0.02954
24 2.71006 0.19480 0.60680 0.03248
25 2.41069 0.17805 0.56890 0.03453
26 2.50136 0.21455 0.61743 0.03691
ETCM 2018

27 2.19590 0.18490 0.51099 0.03394


28 1.75095 0.11408 0.37512 0.00667
29 2.26916 0.19210 0.59487 0.03904
30 2.29088 0.18016 0.67090 0.04295
AVG 2.18795 0.20176 0.46647 0.02550
30 / 37
Figures(1)

Figure: Estimation error for step k - 14 bus test case

(FIEC - ESPOL) ETCM 2018 31 / 37


Figures(2)

Figure: Voltage magnitude in bar 9 - 14 bus test case

Figure: Angle magnitude in bar 9 - 14 bus test case

(FIEC - ESPOL) ETCM 2018 32 / 37


Figures(3)

Figure: Estimation error for step k - 30 bus test case

(FIEC - ESPOL) ETCM 2018 33 / 37


Figures(4)

Figure: Voltage magnitude in bar 14 - 30 bus test case

Figure: Angle magnitude in bar 14 - 30 bus test case


(FIEC - ESPOL) ETCM 2018 34 / 37
Conclusions

Dynamic State Estimation of EPS: EKF


The methodology used in this work to estimate states of an EPS is
showing good results and the error indices reported can be accepted
as referential values in this types of studies to compare accuracies
between other methods.
EKF and PF behavior is correct. Estimated values follow true values.
The initial values for x0 and P0 in EKF filter influence the tracking of
the estimated values over the true values on the four first steps
approximately.

(FIEC - ESPOL) ETCM 2018 35 / 37


References
Valverde and Terzija (2011)
Unscented kalman filter for power system dynamic state estimation
Generation, Transmission and Distribution, IET 5(1), 29 – 37.

Neguyen, H., Venayagamoorthy, G., Kling, W., and Ribeiro, P., (2013)
Dynamic state estimation and prediction for real time control and operation.
In Power Systems conference 2013 (PS13). Technische Universiteit Eindhoven

Sharma, A., Srivastava, S.C., and Chakrabarti, S. (2017)


A Cubature Kalman Filter Based Power System Dynamic State Estimator.
IEEE Transactions on Instrumentation an Measurement 66(8), 2036 – 2045.

University, W. (1993)
http://www2.ee.washington.edu/research/pstca/pf14/ieee14cdf.txt.

Alhalali, S. M. O. and Elshatshat, R. A. (2015)


State Estimator for Electrical Distribution Systems Based on a Particle.
2015 IEEE Power and Energy Society General Meeting 1 - 5.

Introduction to Particle Filter Sampling Algorithm in PF BayesianTeacher Assistant


at Isfahan University of Technology
(FIEC - ESPOL) ETCM 2018 36 / 37
Thank you!

(FIEC - ESPOL) ETCM 2018 37 / 37