Sei sulla pagina 1di 13

ANALYSIS OF ALGORITHMS TO PARAMETER ESTIMATION

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)

dissolved oxygen concentration;


oxygen transfer function;
saturation of DO;
oxygen uptake rate.

(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

air bubbles time constant.

(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

DO sensor time constant.

Equations used in the algorithms

(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

Where: c(0) is the initial DO concentration.


II.

Model 2: take into account the DO dynamics and the DO sensor dynamics.

Figure 2 DO model 2.

With the same considerations done in DO model 1, one can obtain:


y ( t )=

c sat R /K maxc ( 0 ) K
e
t y K max 1

max

K max ( t y K max 1 ) ( y ( 0 )c sat )


K max ( t y K max 1 )

(0) K ( c ( 0 ) c ) + R (
max
sat
+
K max ( t y K ma

) (
t / t y

Where y(0) is the initial measurement of the DO sensor.


Analysis of the estimation algorithms with simulation data
Non-linear least squares algorithm was used to evaluate the models and the
applicability of the method in parameter estimation.

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

95% confidence interval


KLa = [109.55 113.4]
csat = [8 8]

9
data
fitted curve
prediction bounds

DO concentration [mg/l]

200

400

600
Time [s]

Figure 3 Step response

1 Randon Walk Model.

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

Figure 4 Estimation error.


Error Histogram with 20 Bins
1000

Zero Error

900
800

Instances

700
600
500
400
300
200

Errors

Figure 5 Histogram.

Algorithm

K max

csat

ty

95% confidence interval


[mg/l

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

KLa = [-1.7 +2.2]e+3


csat = [8 8]
ty = [-112.7 +142.9]

9
data
fitted curve
prediction bounds

DO concentration [mg/l]

200

400

600
Time [s]

800

1000

1200

Figure 6 Step response.


0.2

0.1

Residual [mg/l]

-0.1

-0.2

-0.3

-0.4

-0.5

200

400

600

Time [s]

800

Figure 7 Estimation error.

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

Error Histogram with 20 Bins

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]

95% confidence interval


KLa = [108.61, 112.53]
csat = [-3.5, +3.5]e+6
R = [-1, +1]e+8

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

Figure 9 Step response.


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

Figure 10 Estimation error.

1000

1200

1400

Error Histogram with 20 Bins


Zero Error

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

95% confidence interval


KLa = [237.67, 239.83]
csat = [7.99, 7.99]
ty = [15.08, 15.08]
R = [10.47, 11.23]

8
data
fitted curve
prediction bounds

DO concentration [mg/l]

200

400

600
Time [s]

800

Figure 12 Step response.

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

Figure 13 Estimation error.


Error Histogram with 20 Bins
Zero Error
400
350

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

(c) Regular operation: similar consideration to endogenous case.

K max

csat

ty

[1/h]

[mg/l]

[s]

[mg/l/h]

110.38

Algorithm
s
Model 1
with
R=rwm

95% confidence interval


KLa = [108.43, 112.32]
csat = [-3.5, +3.5]e+6

14
data
fitted curve
prediction bounds

12

10

DO concentration [mg/l]

-2

-4

200

400

600
Time [s]

800

1000

1200

Figure 15 Step response.


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

Figure 16 Estimation error.


Error Histogram with 20 Bins

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

95% confidence interval


KLa = [237.06, 239.24]
csat = [8, 8]
ty = [15.11, 15.11]

9
data
fitted curve
prediction bounds

DO concentration [mg/l]

200

400

600
Time [s]

800

1000

1200

Figure 18 Step response.


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

Figure 19 Estimation error.


Error Histogram with 20 Bins
Zero Error

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

Conclusion and remarks


The model 2 yielded better results when compared to model 1, however it has
produced overestimates to KLa and ty.
The nonlinear least squares algorithm presented convergence problems due to
the initial choices of the parameters. The start values of the parameters have an
important role in the algorithm.
The confidence interval is affected by the way in which the equations are
inserted in the estimation algorithm.
Using the model 2, in endogenous and regular operation mode, a warning about
ill-conditioned Jacobian has appeared frequently.

Potrebbero piacerti anche