[lecture notes in electrical engineering] recent advances in computer science and information...

6
Z. Qian et al. (Eds.): Recent Advances in CSIE 2011, LNEE 126, pp. 861–866. springerlink.com © Springer-Verlag Berlin Heidelberg 2012 Study on Modeling and Simulation of BSM1 with Matlab Xianjun Du, Xiaohong Hao, and Aimin An Abstract. International Water Association (IWA) and the European Co-operation in the field of Scientific and Technical Research (COST) Action 682/624 develop the activated sludge wastewater treatment Benchmark Simulation Model No.1 (BSM1), the main purpose is to establish an activated sludge process (ASP) control program development platform. This paper detailed describes how to use Matlab M-files to establish BSM1, and then gives out the results of the model simulation. Keywords: Modeling, Simulation, ASP, BSM1, Wastewater Treatment. 1 Introduction Being a basic and main methods in wastewater treatment, the activated sludge process (ASP) aims to achieve, at minimum costs, a sufficiently low concentration of biodegradable matter in the effluent together with minimal sludge production. In recent decades, the mathematical models of the activated sludge wastewater treatment process have been fully developed, there are the early and more applied model ASM1 (Activated Sludge Model No.1) [1] to improved models ASM2 [2], ASM2d [3] and ASM3 [4]. For a complete activated sludge wastewater treatment process, it includes a secondary settler after a biological treatment unit with the activated sludge. Takács double exponential settling velocity model [5] is the internationally recognized mathematical model of the secondary settler. Xianjun Du College of Electrical and Information Engineering, Lanzhou University of Technology, Lanzhou, China e-mail: [email protected] Xiaohong Hao Key Laboratory of Gansu Advanced Control for Industrial Processes, Lanzhou, China e-mail: [email protected]

Upload: huamin

Post on 23-Dec-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

Z. Qian et al. (Eds.): Recent Advances in CSIE 2011, LNEE 126, pp. 861–866. springerlink.com © Springer-Verlag Berlin Heidelberg 2012

Study on Modeling and Simulation of BSM1 with Matlab

Xianjun Du1, Xiaohong Hao, and Aimin An

Abstract. International Water Association (IWA) and the European Co-operation in the field of Scientific and Technical Research (COST) Action 682/624 develop the activated sludge wastewater treatment Benchmark Simulation Model No.1 (BSM1), the main purpose is to establish an activated sludge process (ASP) control program development platform. This paper detailed describes how to use Matlab M-files to establish BSM1, and then gives out the results of the model simulation.

Keywords: Modeling, Simulation, ASP, BSM1, Wastewater Treatment.

1 Introduction

Being a basic and main methods in wastewater treatment, the activated sludge process (ASP) aims to achieve, at minimum costs, a sufficiently low concentration of biodegradable matter in the effluent together with minimal sludge production. In recent decades, the mathematical models of the activated sludge wastewater treatment process have been fully developed, there are the early and more applied model ASM1 (Activated Sludge Model No.1) [1] to improved models ASM2 [2], ASM2d [3] and ASM3 [4]. For a complete activated sludge wastewater treatment process, it includes a secondary settler after a biological treatment unit with the activated sludge. Takács double exponential settling velocity model [5] is the internationally recognized mathematical model of the secondary settler. Xianjun Du College of Electrical and Information Engineering, Lanzhou University of Technology, Lanzhou, China e-mail: [email protected] Xiaohong Hao Key Laboratory of Gansu Advanced Control for Industrial Processes, Lanzhou, China e-mail: [email protected]

Page 2: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

862 X. Du, X. Hao, and A. An

Simulations provide a cost-effective means for the evaluation of control strategies, but the unlimited number of simulation permutations makes the need for a standardized protocol very important if different strategies are to be compared. Each control strategy must be simulated under the same conditions to ensure unbiased comparisons. Validation of the computer simulations is difficult without supporting experimental or full-scale data, but the value of the work is enhanced through the use of accepted ASMs. Because appropriate simulation tools for the ASP are available this approach has numerous advantages, but still there is a need for a standardized procedure.

The idea to produce a standardized ‘simulation benchmark’ was first devised and developed by the first IAWQ Task Group on Respirometry-Based Control of the Activated Sludge Process [6,7]. This original benchmark was subsequently modified by the European Co-operation in the field of Scientific and Technical Research (COST) 682/624 Actions in co-operation with the second IWA Respirometry Task Group [8-11].

2 BSM1 Overview

2.1 Plant Layout

Figure 1 shows a schematic representation of the layout. BSM1 plant consists of 5 bioreactors and a 10-layer secondary settler.

Fig. 1 Schematic representation of BSM1 configuration

2.2 Process Models

To increase the acceptability of the results, two internationally accepted process models were chosen. The IAWQ’s ASM1 was chosen as the biological process model [1] and the double-exponential settling velocity function of Takács, et al. [5] was chosen as a fair representation of the settling process model. The influent data were initially proposed by Vanhooren and Nguyen [12]. The three influent file with disturbances now can be downloaded from the website http://www.benchmarkWWTP.org/. Each file contains two weeks of dynamic weather influent data.

Page 3: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

Study on Modeling and Simulation of BSM1 with Matlab 863

3 Use Matlab M-Files to Establish the BSM1 Model

A number of parameters are used in this paper has been defined in the following Table 1. Establish the model is to write out the differential formulas of the corresponding variable in all 5 reactors and the secondary settler based on the first principle. There are 145 formulas include 65 of the 5 reactors and 80 of the secondary settler, and they can be described in state space style to reduce the amount of the formulas.

Table 1 Parameters and its descriptions and units in this paper

Parameter Description Unit

Bio-reactor

Q0 wastewater flow rate m3 d-1 Qf flow rate from the 5th reactor to the secondary settler m3 d-1 Qa internal recycle flow rate m3 d-1 Z0 a vector of the wastewater variables concentration - V volume of reactor tank m3 r observed conversion rates g m-3 d-1

x(i), i=1 to 13 variables come out from the 1st reactor g m-3 x(i), i=14 to 26 variables come out from the 2nd reactor g m-3 x(i), i=27 to 39 variables come out from the 3rd reactor g m-3 x(i), i=40 to 52 variables come out from the 4th reactor g m-3 x(i), i=53 to 65 variables come out from the 5th reactor g m-3 dx(i), i=1 to 65 differential of the corresponding variable in all 5 reactors -

Secondary Settler

Qe plant exit flow rate m3 d-1 Qr external recycle flow rate m3 d-1 Qw wastage flow rate m3 d-1

x(i), i=66 to 75 variables of the total particulate matter from the bottom to the

top layer g m-3

x(i), i=76 to 145

variables of the soluble matter in each layer g m-3

dx(i), i=66 to 145

differential of the corresponding variable in all 10 layers -

vup up-flow velocity m d-1 vdn down-flow velocity m d-1 Xf concentration of the total particulate matter g m-3

3.1 Establish the Bio-reactors Model

The model is established in proper order according to sequence of the wastewater flow in the 5 reactors, where the 13 components are in the order of the influent file form. For example, the 1st component come out from the 1st reactor is SI (coded in 1), then the last is SALK (coded in 13), and so on, the 13th component come out from the 5th reactor is SALK (coded in 65). Variables of the total particulate matter from the bottom to the top layer in the secondary settler are coded in 66 to 75, and the variables of the soluble matter in each layer are coded in 76 to 145 in layer sequence from the bottom to the top.

Use the 8 processes and 13 components reaction rates to gain the 65 differential formulas like:

Page 4: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

864 X. Du, X. Hao, and A. An

( ) ( ( ( ) ( 13))) / , 1,2, 52 1,2, 13jdx i Q x i x i V r i and j= − + + = = (1)

Special case for the 1st reactor because of the Qr and Qa are both input in it with Q0, so the differential formula of the first component SI in the first reactor should be wrote in:

0 0 0 1 1(1) ( (1) (53) (76) ( ) (1)) /a r a rdx Q Z Q x Q x Q Q Q x V r= + + − + + + (2)

Where: 76 is the first component SI in the bottom layer of the settler. When the wastewater flow into the 2nd reactor, the differential formula of SI is

wrote in:

0 2 1(14) (( )( (1) (14)) /a rdx Q Q Q x x V r= + + − + (3)

For the other components in reactor 1, the formulas are similar to Equation (2) and (3).

3.2 Establish the Secondary Settler Model

The 10 layers settler includes 8 components in each layer, 7 soluble components and one particulate component Xf. There are 8 formulas in each layer and a total of 80 formulas for all layers. The formulas will be easily to write out according to [5] and [14]. For example, the 66th variable of the model is the Xf in the bottom layer should be calculated in:

(66) ( ( (67) (66)) min( (2), (1))) /dn S S mdx v x x J J z= − + (4)

Where: JS(•) is the solid flux due to gravity, and zm is the height of each layer m. For the other components, the formulas are similar to Equation (4).

3.3 Initialization

The initial values were posted in [14], which shows a 100-day period of stabilization in closed-loop using constant inputs with no noise on the measurements has to be completed before using the dry weather file followed by the weather file to be tested. Noise on measurements should be used with the dynamic files.

4 Simulation Results

4.1 Steady State Simulation

A 100-day steady state simulation result is carried out by Matlab and compares the result with the reference values posted in the website http://www.benchmarkWWTP.org/. Result shows that the established model is correct, and the dynamic simulation can be worked on.

Page 5: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

Study on Modeling and Simulation of BSM1 with Matlab 865

4.2 Dynamic Simulation

The type of system defined in the BSM1 is normally considered to be a stiff dynamic system, i.e. the time constants for the different processes involved vary significantly. Such systems are quite difficult to solve numerically unless special numerical solvers are used, which have been developed especially to deal with these difficulties. In this paper, ode15s was chosen for solving the dynamic simulation, which is designed for solving continuous, stiff systems based on Gear’s method.

With importing the Dry Weather influent file into the dynamic simulation, Figure 2 shows the results of that the KLa (oxygen transfer coefficient) with sine wave excitation and random white noise excitation.

0 2 4 6 8 10 12 141

1.5

2

2.5

3

3.5x 10

4 Influent Flow

Time in days

Q0

in m

3/d

0 2 4 6 8 10 12 1410

20

30

40

50

NH4+NH3 Nitrogen

Time in days

SNH in

g/m

3

0 2 4 6 8 10 12 140

100

200

300

400

Time in days

KLa

Oxygen Transfer Coefficient in the Aeration Tanks

Kla3

Kla4Kla5

0 2 4 6 8 10 12 140

2

4

6

8

Time in days

SO in

g/m

3

DO in the 3rd to 5th Reactors

SO3

SO4SO5

0 2 4 6 8 10 12 140

5

10

15

Time in days

NO

3 & N

H4 in

g/m

3

Nitrogen in the 5th Reactor

NO3

NH4

0 2 4 6 8 10 12 1450

100

150

200

250

Time in days

KLa

Oxygen Transfer Coefficient in the Aeration Tanks

Kla3

Kla4Kla5

0 2 4 6 8 10 12 140

1

2

3

4

5

Time in days

SO in

g/m

3

DO in the 3rd to 5th Reactors

SO3

SO4SO5

0 2 4 6 8 10 12 140

5

10

15

Time in days

NO3 &

NH4 in

g/m

3

Nitrogen in the 5th Reactor

NO3

NH4

Fig. 2 Simulation results: (a) shows the dynamic flow rate of Q0; (b) shows the nitrate and nitrite nitrogen、NH4+ + NH3 nitrogen concentration (SNH) in the influent; (c) shows the KLa in the three aeration tanks with sine wave excitation; (d) shows the DO concentration in the three aeration tanks with sine wave excitation; (e) shows the results of SNO5 and SNH5 influenced by the KLa with sine wave excitation; (f) shows the KLa in the three aeration tanks with random white noise excitation; (g) shows the DO concentration in the three aeration tanks with random white noise excitation; (h) shows the results of SNO5 and SNH5 influenced by the KLa with random white noise excitation

5 Conclusions

The key for an ideal control performance is to establish a good and accurate model. This paper establishes BSM1 simulation model by read the description

Page 6: [Lecture Notes in Electrical Engineering] Recent Advances in Computer Science and Information Engineering Volume 126 || Study on Modeling and Simulation of BSM1 with Matlab

866 X. Du, X. Hao, and A. An

[14] carefully, the simulation results show that the modeling work is successful. These data obtained from the simulation model can be used for more control method based on model as the input and output. Also, they can be used to do cluster analysis for classification, pattern recognition, model reduction and optimization.

Acknowledgment. This work is supported by the National Natural Science Foundation of China (No. 61064003) and the Key Laboratory of Gansu Advanced Control for Industrial Processes.

References

1. Henze, M., Grady Jr., C.P.L., Gujer, W., et al.: Activated Sludge Model No.1. In: IAWPRC Scientific and Technical Reports no.1. IWA Publishing, London (1987)

2. Gujer, W., Henze, M., Mino, T., et al.: The Activated Sludge Model No.2: Biological Phosphorus Removal. Wat. Sci. Tech. 31(2), 1–11 (1995)

3. Henze, M., Gujer, W., Mino, T., et al.: Actiatved Sludge Model No.2d, ASM2d. Wat. Sci. Tech. 39(1), 165–182 (1999)

4. Gujer, W., Henze, M., Mino, T., et al.: The Activated Sludge Model No.3. Wat. Sci. Tech. 39(1), 183–193 (1999)

5. Takács, I., Patry, G.G., Nolasco, D.: A Dynamic Model of the Clarification Thickening Process. Wat. Res. 25(10), 1263–1271 (1991)

6. Spanjers, H., Vanrolleghem, P., Nguyen, K., et al.: Towards a Benchmark for Evaluating Control Strategies in Wastewater Treatment Plants by Simulation. Wat. Sci. Tech. 37(12), 219–226 (1998)

7. Spanjers, H., Vanrolleghem, P., Olsson, G., et al.: Respirometry in Control of the Activated Sludge Process: Principles, IAWQ Scientific and Technical Report No.7. IWA Publishing, London (1998)

8. Copp, J.B.: Defining a Simulation Benchmark for Control Strategies. Water 21, 44–49 (2000)

9. Alex, J., Beteau, J.F., Copp, J.B., et al.: Benchmark for Evaluating Control Strategies in Wastewater Treatment Plants. In: Proceedings of the European Control Conference (ECC 1999), Karlsruhe, Germany, August 31-September 3 (1999)

10. Pons, M.N., Spanjers, H., Jeppsson, U.: Towards a Benchmark for Evaluating Control Strategies in Wastewater Treatment Plants by Simulation. In: Proceedings of 9th European Symposium on Computer Aided Process Engineering, Budapest, Hungary, May 31-June 2 (1999)

11. Copp, J.B.: The COST Simulation Benchmark – description and simulator manual. Office Publications of the European Community, Luxembourg (2001)

12. Vanhooren, H., Nguyen, K.: Development of a Simulation Protocol for Evaluation of Respirometry-Based Control Strategies, Technical Report, University of Gent, Gent, Belgium (1996)

13. IWA Task Group on Benchmarking of WWTPs website, http://www.benchmarkWWTP.org/

14. Copp, J.B., Alex, J., Benedetti, L., et al.: Description BSM1. Publishing by the IWA Taskgroup on Benchmarking of Control Stategies for WWTPs (April 2008)