Professional Documents
Culture Documents
For to estimate the oxygen uptake rate (OUR) by a real time Kalman Filter, we
have to develop a mathematical model to mimic, relatively well, the dissolved oxygen
(DO) dynamics on activated sludge processes.
This mathematical model consists of a set of equations, whose variables are the
processes states and the coefficients are the processes parameters.
For use these equations on Kalman Filter, we have to find out the best way to
estimate the processes parameters. In this report, we compare some algorithms to
parameters estimation.
Main dynamic equations:
(a) Dissolved oxygen dynamics: describes the dissolved oxygen variation in activated
sludge reactor.
dc(t )
=K L a (t ) ( c sat c ( t ) )R (t)
dt
(0)
Where:
c(t)
KLa(t)
csat
R(t)
(b) Aerator dynamics: describes the presumable first order behavior of the air bubbles
when the aerator turns on/off.
d K L a(t ) 1
1
= K max K L a(t)
dt
tk
tk
(0)
Where:
tk
(c) Sensor dynamics: describes the DO probe as a first order system (assumed in early
researches).
dy (t ) 1
1
= c( t) y (t)
dt
ty
ty
Where:
ty
(0)
I.
Model 1: take into account only the dissolved oxygen dynamics. The system can
be modeled by
Figure 1 DO model 1
R(s) acts like a noise input to the system and U(s) is a step input. Assuming
OUR=cte (endogenous phase, this can be obtained experimentally) and
KLa=Kmax (no aerator dynamics), one can obtain:
K max t
c (t )= [ c ( 0 )c sat + R/ K max ] e
(0)
+ c sat R/ K max
Model 2: take into account the DO dynamics and the DO sensor dynamics.
Figure 2 DO model 2.
c sat R /K maxc ( 0 ) K
e
t y K max 1
max
(0) K ( c ( 0 ) c ) + R (
max
sat
+
K max ( t y K ma
) (
t / t y
Parameters
used in
simulation
K max
c sat
ty
tk
200 [1/h]
8 [mg/l]
8 [s]
5 [s]
0, 10 or a
rwm1
[mg/l/h]
In the simulation we have considered the aerator dynamics, despite in the models
we have neglected its effect.
Three different behavior of OUR have been considered: zero (clean water),
constant (endogenous phase) and random walk model (regular operation). The results
are summarized in the tables below.
(a) Clean water (R = 0): using the model 2 we can obtain a better fit to the data
with respect to model 1. However the confidence interval to parameter
estimation gets worst using the model 2.
K max
csat
ty
[1/h]
[mg/l]
[s]
[mg/l
/h]
111.48
Algorithm
Model 1
9
data
fitted curve
prediction bounds
DO concentration [mg/l]
200
400
600
Time [s]
800
1000
1200
0.6
0.4
0.2
Residual [mg/l]
0
-0.2
-0.4
-0.6
-0.8
-1
-1.2
-1.4
200
400
600
Time [s]
800
1000
1200
1400
Zero Error
900
800
Instances
700
600
500
400
300
200
Errors
Figure 5 Histogram.
Algorithm
K max
csat
ty
0.4642
0.374
0.2838
0.1936
0.1034
0.01314
-0.07709
-0.1673
-0.2575
-0.3478
-0.438
-0.5282
-0.6184
-0.7086
-0.7989
-0.8891
-0.9793
-1.07
-1.16
-1.25
100
Model 2
[1/h]
[mg/l]
[s]
/h]
239
15.06
9
data
fitted curve
prediction bounds
DO concentration [mg/l]
200
400
600
Time [s]
800
1000
1200
0.1
Residual [mg/l]
-0.1
-0.2
-0.3
-0.4
-0.5
200
400
600
Time [s]
800
1000
1200
1400
Errors
Figure 8 Histogram.
0.05854
0.03126
0.003974
-0.02331
-0.05059
-0.07787
-0.1052
-0.1324
-0.1597
-0.187
-0.2143
-0.2416
-0.2688
-0.2961
-0.3234
-0.3507
-0.378
-0.4052
-0.4325
-0.4598
Instances
400
Zero Error
350
300
250
200
150
100
50
(b) Endogenous phase: assuming OUR constant, the model 2 provides better
results with respect to model 1. R and csat can be estimated relatively well,
while KLa and ty are overestimated by the algorithm.
Algorithm
s
Model 1
with R=10
K max
csat
[1/h]
[mg/l]
110.56
7.98
ty
[s]
[mg/l/h]
16
data
fitted curve
prediction bounds
14
DO concentration [mg/l]
12
10
8
6
4
2
0
-2
-4
200
400
600
Time [s]
800
1000
1200
Residual [mg/l]
0
-0.2
-0.4
-0.6
-0.8
-1
-1.2
-1.4
200
400
600
Time [s]
800
1000
1200
1400
700
Instances
600
500
400
300
200
0.46
0.3705
0.281
0.1916
0.1021
0.01263
-0.07683
-0.1663
-0.2558
-0.3452
-0.4347
-0.5242
-0.6136
-0.7031
-0.7926
-0.882
-0.9715
-1.061
-1.15
-1.24
100
Errors
Figure 11 Histogram.
Algorithm
s
Model 2
with R=10
K max
csat
ty
[1/h]
[mg/l]
[s]
[mg/l/h]
238.75
7.99
15.08
10.85
8
data
fitted curve
prediction bounds
DO concentration [mg/l]
200
400
600
Time [s]
800
1000
1200
0.2
0.1
Residual [mg/l]
-0.1
-0.2
-0.3
-0.4
-0.5
200
400
600
Time [s]
800
1000
1200
1400
250
200
150
100
Errors
Figure 14 Histogram.
0.05824
0.03084
0.003436
-0.02397
-0.05137
-0.07877
-0.1062
-0.1336
-0.161
-0.1884
-0.2158
-0.2432
-0.2706
-0.298
-0.3254
-0.3528
-0.3802
-0.4076
-0.435
50
-0.4624
Instances
300
K max
csat
ty
[1/h]
[mg/l]
[s]
[mg/l/h]
110.38
Algorithm
s
Model 1
with
R=rwm
14
data
fitted curve
prediction bounds
12
10
DO concentration [mg/l]
-2
-4
200
400
600
Time [s]
800
1000
1200
Residual [mg/l]
0
-0.2
-0.4
-0.6
-0.8
-1
-1.2
-1.4
200
400
600
Time [s]
800
1000
1200
1400
800
Zero Error
700
600
Instances
500
400
300
200
0.4582
0.3689
0.2796
0.1902
0.1009
0.01155
-0.07779
-0.1671
-0.2565
-0.3458
-0.4351
-0.5245
-0.6138
-0.7032
-0.7925
-0.8818
-0.9712
-1.061
-1.15
-1.239
100
Errors
Figure 17 Histogram.
Algorithm
s
Model 2
with
R=rwm
K max
csat
ty
[1/h]
[mg/l]
[s]
[mg/l/h]
238.15
15.11
9
data
fitted curve
prediction bounds
DO concentration [mg/l]
200
400
600
Time [s]
800
1000
1200
0.1
Residual [mg/l]
-0.1
-0.2
-0.3
-0.4
-0.5
200
400
600
Time [s]
800
1000
1200
1400
400
350
250
200
150
100
Errors
Figure 19 Histogram.
0.0582
0.031
0.003792
-0.02341
-0.05061
-0.07782
-0.105
-0.1322
-0.1594
-0.1866
-0.2138
-0.241
-0.2682
-0.2954
-0.3226
-0.3499
-0.3771
-0.4043
-0.4315
50
-0.4587
Instances
300