Fuzzy model and decision of COD control for an activated sludge process

12
ELSEVIER Fuzzy Sets and Systems 93 (1998) 281 292 FU22Y sets and systems Fuzzy model and decision of COD control for an activated sludge process Chunsheng Fu a'*, Manel Poch b aDepartment of Chemical Engineering, University of Cincinnati, Cincinnati, OH 45221-0171, USA Unitat d'Enginyeria Quimica, Universitat Autbnoma de Barcelona 08193 Bellaterra, Barcelona, Spain Received January 1996; revised July 1996 Abstract An approach for fuzzy modeling and decision is presented based upon fuzzy logic inference. Modeling and decision making for process control in a real-world activated sludge process were studied. The modeling work for the process is based upon some historical on-line measurable and off-line sampling data from the process, and process operational experience. Some calculated data for the modeling resulted from estimation of the developed model. The method of estimation is also briefly introduced in this article. Performance of the fuzzy strategies or fuzzy decisions has been tested by comparing some results of fuzzy decision against results of simulation on dynamic mathematical models for the same process. The test results are satisfactory. © 1998 Elsevier Science B.V. Keywords." Fuzzy model; Fuzzy control; Activated sludge process 1. Introduction Till now, most techniques employed for the anal- ysis of different bioengineering operations or/and whole processes had an analytical or statistical nature. Unfortunately, the existing mathematical tools cannot contribute as much as expected to a better understanding of key bioengineering prob- lems. The kind of mathematical tools commonly used are sometimes not adequate as they bear little resemblance to real-world phenomena. It can hard- ly be expected that conventional techniques (ana- lytical and/or statistical) could analyze a real * Corresponding author. bioengineering problem entirely, which requires enormous quantities of information. This is why a model description of the object under study must be simplified while working with conventional tools. It is not paradoxical that a less intensive method of analysis (e.g., fuzzy logic), under certain circumstances, achieves more realistic results, pro- vided that the system modeled is too complex and/or not well known. Frequently, those systems are characterized by the fact that behavior is semiqualitative (e.g., experience) [1]. A control strategy thus derived is not 'optimal' in the classical sense of minimizing or maximizing a performance index. It should be noted however that the definition of a performance index in the classical approach is an intuitive operation itself, 0165-0114/98/$19.00 4) 1998 Elsevier Science B.V. All rights reserved PII S0165-01 14(96)00208-4

Transcript of Fuzzy model and decision of COD control for an activated sludge process

E L S E V I E R Fuzzy Sets and Systems 93 (1998) 281 292

FU22Y sets and systems

Fuzzy model and decision of COD control for an activated sludge process

Chunsheng F u a'*, M a n e l P o c h b

a Department of Chemical Engineering, University of Cincinnati, Cincinnati, OH 45221-0171, USA Unitat d'Enginyeria Quimica, Universitat Autbnoma de Barcelona 08193 Bellaterra, Barcelona, Spain

Received January 1996; revised July 1996

Abstract

An approach for fuzzy modeling and decision is presented based upon fuzzy logic inference. Modeling and decision making for process control in a real-world activated sludge process were studied. The modeling work for the process is based upon some historical on-line measurable and off-line sampling data from the process, and process operational experience. Some calculated data for the modeling resulted from estimation of the developed model. The method of estimation is also briefly introduced in this article. Performance of the fuzzy strategies or fuzzy decisions has been tested by comparing some results of fuzzy decision against results of simulation on dynamic mathematical models for the same process. The test results are satisfactory. © 1998 Elsevier Science B.V.

Keywords." Fuzzy model; Fuzzy control; Activated sludge process

1. Introduction

Till now, most techniques employed for the anal- ysis of different bioengineering operations or/and whole processes had an analytical or statistical nature. Unfortunately, the existing mathematical tools cannot contribute as much as expected to a better understanding of key bioengineering prob- lems. The kind of mathematical tools commonly used are sometimes not adequate as they bear little resemblance to real-world phenomena. It can hard- ly be expected that conventional techniques (ana- lytical and/or statistical) could analyze a real

* Corresponding author.

bioengineering problem entirely, which requires enormous quantities of information. This is why a model description of the object under study must be simplified while working with conventional tools. It is not paradoxical that a less intensive method of analysis (e.g., fuzzy logic), under certain circumstances, achieves more realistic results, pro- vided that the system modeled is too complex and/or not well known. Frequently, those systems are characterized by the fact that behavior is semiqualitative (e.g., experience) [1].

A control strategy thus derived is not 'optimal' in the classical sense of minimizing or maximizing a performance index. It should be noted however tha t the definition of a performance index in the classical approach is an intuitive operation itself,

0165-0114/98/$19.00 4) 1998 Elsevier Science B.V. All rights reserved PII S 0 1 6 5 - 0 1 1 4 ( 9 6 ) 0 0 2 0 8 - 4

282 C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292

which is necessary for the mathematical optimal theory to apply, and consequently a 'suboptimal' fuzzy logic system [2,3] may well work more satisfactorily in practice than a mathematically 'op- timal' one. Experience with the control of such systems has shown that the main control problem is to resolve ambiguous requirements and situ- ations, i.e. making decisions in a fuzzy environment, rather than driving the available actuators 'opti- mally'.

During the past several years, fuzzy control has emerged as one of the most active and fruitful areas for research in the application of fuzzy set theory [4, 5]. It is applied in washing machines, video cameras and many other products [6]. In addition, fuzzy logic has now found applications in the medi- cal field, stock market predictions and various in- dustries, e.g., in the control of cement kilns [-7] and paper making machines [8, 9].

Wastewater processing by means of activated sludge is the most widespread sewage treatment process. Predictive modeling and control of waste- water treatment systems based upon conventional analytical or statistical model development have been of little practical significance due to the com- plexity of the systems and the fact that many envir- onmental parameters affect the degradation processes. The activated sludge process has the further complication of operating in a widely changing environment where process conditions may be appreciably altered by unmeasurable inputs.

The objective of this article is to present a fuzzy modeling approach based upon the compositional rule of inference [10] for fuzzy logic control (FLC) and an application in an activated sludge process. The following section presents an approach for FLC design for the investigated process and an application of the approach for chemical oxygen demand (COD) control in the investigated process. Section 3 introduces a method for implementing the developed FLC for the process, an approach for testing the developed FLC and some test results. The last section of this article presents some con- clusions. The method to obtain estimated oxygen uptake rate (OUR) for the process is presented in Appendix A. Appendix B describes a simulation method for the test, based on a set of dynamic mathematical models for the process.

Notation

A(t)

C Ci

Csat Ftot

Kla

K(t)

OUR S Si V T X Xi

The aeration factor relating to the number of aerators switched on at each moment DO in the bioreactor output (ppm) dissolved oxygen (DO) in the bioreactor input (ppm) saturated DO (ppm) total input flow including input flow and recirculation flow, ma/h the global mass transfer coefficient of oxygen a recursive coefficient the growth rate of the biomass oxygen uptake rate in the reactor, mg/(1 h) COD in the output, mg/1 COD in the input flow, mg/1 volume of the reactor, M 3 sampling interval biomass in the reactors, rag/1 biomass in the input, mg/1

2. Design of an FLC

2.1. A controlled process

Our investigated objective is a real-world ac- tivated sludge process. Its technological process is briefly shown in Fig. 1. There are two primary settlers, six 1800 m 3 bioreactors with stirring equip- ment, and two secondary settlers as the last units of technological process in the plant. Two main con- trol loops are recirculating flow to control chemical oxygen demand (COD) at output and the working time for stirring motors to control dissolved oxygen (DO) in the bioreactors. Both of them are based on manual operation. Some key parameters, such as COD at the input and output, concentrations of biomass in the bioreactors and recirculating flow, etc., have to be measured by off-line analysis. Therefore, time delay to obtain results of measure- ment is considerably long.

The process can be briefly described as follows. After the pretreatment through the primary settlers, input flow (sludge) is treated in the bioreactors where the level of substrate is reduced by the biode- gradation. Then, the flow goes to the secondary

C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281 292 283

oN line

bioreactors(1-6)

Fig. 1, Wastewater treatment process.

settlers at the bottom. Thus, clean water remains at the top of settlers and it goes out of the plant. A fraction of the sludge is returned to the input of the bioreactor in order to maintain an appropriate level of biomass, allowing oxidation of the organic matter. The rest of the sludge is carried out to a purge process [11].

As the most important parameter to be control- led for an activated sludge process, COD is a measure of the oxygen equivalent of the organic matter content in a sample when decomposed by strong chemical oxidant, usually dichromate. This determination is thoroughly employed in the char- acterization of natural waters and wastewater, as well as industrial effluent and sewage entering wastewater treatment plants [12].

To realize FLC for the investigated process, the first step is to establish an FLC model. This section presents a fuzzy modeling approach based on fuzzy compositional rule of inference, and an application of building an FLC model for the process.

2.2. Collection of historical data

Based upon some basic knowledge and concepts of process dynamics for the process and some ex- perience by which operators carried out their man- ual control for the loop in the past, all possible input-output pairs of historical data were collected.

I Fuzzy Controller

CODi

OUR

Fig. 2. A simple fuzzy control system.

Those data include on-line recorded data such as input flow (Fin), recirculation flow (Fr), waste flow (Fw), dissolved oxygen (DO) and oxygen uptake rate (OUR) in the reactors, and off-line analytical data such as COD in the input flow (CODi), bio- mass in the recirculation flow (Xr), COD in the output flow (CODo), biomass in the reactors (Xin). Here, OUR can be estimated by our developed models presented in Appendix A. CODo is a con- trolled variable (as an output of the system). Fr is a controlling variable (as an output of the control- ler). The others are used as input conditions of the control system.

2.3. Determination of input-output data pairs

After the analysis of the collected historical data, considering the interrelated degrees of all the col- lected input-output variables and the possibility and necessity to realize FLC for the process, four input variables for the FLC were selected, such as Fin, CODi, Xin, OUR. Then, all the historical data of Fin, CODi, Xin, OUR, Fr and CODo were used as an initial database for fuzzy modeling of COD fuzzy logic control for the process. A simple struc- ture of an FLC system is shown in Fig. 2.

Actually, some of the data in the initial data base were polluted by measurement noise or came from mis-analysis of off-line sampled analytical data. De- sign of FLC based upon those polluted data is not in accordance with the actual system, so that there would be some contradictions in developed control rules. Some process output data beyond the normal region resulted from unsuccessful manipulations (bad values of control variables) of operators in the past. Those data are obviously not good for design- ing an FLC system. Therefore, it is necessary to

284 C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292

make some selections on the initial data base, in order to establish a 'successful' data base including all the successful input output historical data pairs.

2.4. Data fuzzification

To establish an FLC model for the process, all the data in the data base were fuzzified. A method for fuzzifying historical data is presented as follows.

(A) Determine some quantitized linguistic vari- ables for all the input and output (from the point of view of the FLC) variables shown in Fig. 2.

For the investigated process, each of the four universe of discourses for the input variables (Fin, CODi, Xin, OUR) are divided into 9 fuzzy linguis- tic labels. They are (1) negative very big (NVB); (2) negative big (NB); (3) negative medium (NM); (4) negative small (NS); (5) zero (O); (6) positive small (PS); (7) positive medium (PM); (8) positive big (PB) and (9) positive very big (PVB). Universe of dis- course for the controlling variable (Fr) (output from the FLC) is divided into 11 fuzzy linguistic labels. They are: (1) negative very big (NVB); (2) negative big (NB); (3) negative medium (NM); nega- tive small (NS); (5) negative zero (NO); (6) zero (O); (7) positive zero (PO); (8) positive small (PS); (9) positive medium (PM); (10) positive big (PB) and (11) positive very big (PVB).

(B) Determine membership functions for all the linguistic variables.

After determining the universe of fuzzy subsets' discourses for all the input and output linguistic labels, establish membership functions for each of them. The method including two steps to determine membership functions is presented as follows:

(i) Define initial subsets or subregions such as

{(Y~, Y{], (Y~, Y~] . . . . . (yl, y[-]}, where L is the number of subregions in the universe of discourse for any input or output variable (L = 9 for each of the four input variables, L = 11 for Fr). Yl, Y~ are the left and right margins for the ith subregion of any input or output variable, which resulted from the modification on each of the input and output linguistic labels. The objective of the modification is to obtain approximate normal dis- tribution in terms of the number of historical data

in subregions or for the linguistic labels. Distribu- tive characteristics of the data for Fin on its uni- verse of discourse, as an example, is shown in Fig. 3.

However, widths of those initial subregions are different from each other. To establish normalized membership functions for all the linguistic labels related to those subregions, further modifications on those subregions are made as follows:

First, calculate each mean value of historical data within each subregion. For the input Fin, as an example, there are 27 and 35 historical data Fin(6,k) and Fin(7,k) within their subregions (y~, y~] and (yl, y~] corresponding to their linguis- tic labels PS and PM, respectively. Mean values a 6 and av for PS and PM can be obtained by

1 2v a6 = ~ ~ Fin(6, k), (1)

k = l

1 35 aT = ~ ~ Fin(7, k). (2)

k = l

Then, calculate a new boundary point y~ = yl :

_y~ = _yl 7 = I (a 6 4- av). (3)

After the modification of subsets (or subregions), linguistic labels have been determined, used as the

200 E~0-500(M3/h) I r~500-1000(M3/h) l]

i I]~ 1000-1250(M3/h) (~ 150 ......................................................................... ~1250-1500(M3/h) -o i D 1500-1750(M3/h) .=~ D 1750-2000(M3/h) O E~2000-2250(M3/h)

"6~e_ ~ $ 100 ...................................................... ~ ~[]2500"2800(M3/h)[]2250-2500(M3/h)

I - - 5 0 ..................................................... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

NVB NB NM NS O PS PM PB

Input flow (linquistic labels)

Fig. 3. Data distribution of input flow.

PVB

C. Fu, ivL Poch / Fuzzy Sets and Systems 93 (1998) 281 292 285

basis for establishing membership functions for all the linguistic labels.

(ii) Considering this multi-input and single-out- put (MISO) control problem in terms of the FLC, the number of input variables is 4. Universe of discourse for each (input or output) variable xj is characterized by Lj ( = 9 for input or = 1 1 for output) linguistic labels Y~ (i = 1 . . . . , L j , j = 1 . . . . . 4, 5, j = 5 for the output variable, Fr). A general form of membership function for a middle linguistic label (or a fuzzy subset) Y~ (i = 2 . . . . . Lj - 1) is determined by

/~r,(Xj)=exp~. ~ bji ) - - , x~ < a~i (4)

/ / x j - /~y , (x j )=exp~-~ . bji+l ) , xj>>.aji, (5)

where aj~ is a mean value of the historical data for the j th (input or output) variable within its initial subregion (y}i, y~], bj~ is a parameter to control the fuzzy degree of the membership function for the independent variable xj. bj~ can be determined by

p y , ( x . ) = e x p ( _ ( _ j __aji \ \ bjl > fl' (6)

i.e., x* -- aji

bji > ~/. _ log fi" (7)

Meanwhile, the selected b i~ should satisfy

i.e°,

(( aji -- aji + 1 ~ r . , (aji) = exp - @2]- < 6, (9)

where x* is a cross-point (i.e., a new margin point y~ or yli+l) between two relative membership func-

x* t ions ]Jyi(Xy) and [Ay,+, ( j ) , ]~ (0 < ]~ < 1) is a factor chosen by experience and debugging and 6 is a small positive constant. Membership functions for the lowest and highest linguistic labels Yi (i = 1, L j) were considered as the following forms:

[Ayt(Xj) = I, Xj < a j l , (10)

x j - a j L j 2 , (12) / q % ( x ~ ) = e x p ( - - ( ~ - ) ) x ~ < a m j ,

#rL,(xj) = 1, xj ~> aiL, (13)

where a~i and b~i (i = 1,Lj) can be determined by using the same methods mentioned above.

Then, normalized membership functions for all the linguistic labels were obtained as

py,(Xj) ~ 1 - pr,+,(xj), x j e ( a j i , a j , i+l). (14)

Especially, this method could be useful to deal with the problem of establishing membership functions for linguistic labels with different widths of sub- regions in the universe of discourse.

Profiles of membership functions for nine lin- guistic labels of CODi for the investigated process are determined as shown in Fig. 4.

1.5

= 1.0

e~

• ~ 0.5

0.0 0

NVB NB NM NS 0

250

PS PM PB PVB

500 750

CODi ( m g / L ) 1000

Fig. 4. Profiles of membership functions for CODi.

2 8 6 C. Fu, 114. Poch / Fuzzy Sets and Systems 93 (1998) 281-292

(C) Convert each of the input-output historical data pair in the data base into input-output fuzzy data pair by calculating the developed membership functions.

2.5. Establishment o f FLC tables

For the investigated MISO process with M pairs of fuzzified input-output data in its data base after data processing, based on the compositional rule of inference [10], six steps to establish an FLC model are presented as follows.

(1) Any fuzzy output of the process results from contributions of all fuzzy inputs (considering four main inputs: Fin, CODi, Xin and OUR). First of all, based upon the analysis of historical data and talking with some experienced operators, establish a 'cross' operational fuzzy relationship Rxl x x2 x x3 x x4 (denoted by Rx) between all four fuzzy in- puts (x~, i = 1 . . . . ,4) and the output (Fr) [-13]. Here RXl x x2 x x3 x x4 resulted from intuition or experience.

(2) As mentioned above, we defined 11 fuzzy subsets or linguistic labels Y1, Y2, .--, Yll for the output variable. Some fuzzy inference from input to output for each of all the input-output pairs was conducted. In other words, based on fuzzified input historical data for four inputs, Rx, their corres- ponding fuzzified output historical data and the output membership function #~ (Eqs. (4), (5), (10)-(13)), we calculated fuzzy relationships be- tween the inputs and outputs for all the fuzzy sub- sets Y1, Y2 . . . . . Yll , i.e.,

Rr,, k = IJ~,,, k / x R x

(i = 1, . . . , 11, k = 1 . . . . . M), (15)

where 'A ' is the MIN, '/~,, k' calculated from the historical data is a membership degree of the kth output historical data to the ith output fuzzy subset or linguistic label Yi, the superscript 5 represents output Fr, and M is the number of historical data for Ft.

(3) Compose the inferential results of all the M fuzzified input-output pairs. That is to calculate the fuzzy relationship 'AND' represented by

M

Rr, = U Rr , ,k (i = 1,2 . . . . . 11). (16) k = l

(4) Carry out a-cut processing on Rr,. After the determination of the threshold a, a-cut relationship R~,, can be obtained by

R}, = {1,0, RV,Ry, ~>< ac~ (i = 1 . . . . , 11). (17)

(5) Substitute R}, by its fuzzy subset (or linguistic label) Yi if the value of R}, is 1. Then, fuzzy relation- ships R~,~ can be obtained by

R ' r , = { Y i : R ~ , = 1} ( i = l . . . . ,11), (18)

where R'r, represents a group of FLC rules. (6) Compose all the fuzzy relationship R'r,

(i = 1, 2 . . . . ,11) into a total fuzzy table R, i.e., 11

R = U R~,,. (19) i = l

This table is an FLC model. It includes FLC rules. Based upon this table, a set of fuzzy conditional sentences '/f ... then ... ' can be obtained. Also, this table could be a knowledge base, an important part in a FLC system.

It should be mentioned that for a specific system to be modeled, a suitable threshold value a should be selected carefully, so that one and only one element exists in each cell of the fuzzy total table.

A part of COD FLC rules for the investigated process is shown in Table 1.

In actual cases, if the number of input variables and the number of linguistic labels for each input variable are big, to carry out the developed fuzzy control rules requires too much time and space on a computer. It is one of the bottle necks for imple- mentation of fuzzy control in real-world processes. For the investigated process, a typical part of the developed COD fuzzy control rules shown in Table t contains 81 rules. Since the number of input variables is four, and the number of linguistic labels for each input variable is nine, there are 94 = 6561 fuzzy logic rules as COD control strategies. It means there are 81 tables like Table 1. They would need a very large computer memory size for imple- menting process control although time would not be a big problem for such a slow process.

After the analysis of all the developed fuzzy con- trol rules, we found that a lot of rules among them are similar to each other. It seemed there was a method to generate a rule table for different

C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292 287

Table 1 Basic fuzzy control rules for COD in the output (Xin = 'O', OUR = 'O')

Fin CODi NVB NB NM NS O PS PM PB PVB

NVB NVB NVB NB NB NM NM NS NS NO NB NVB NB NB NM NM NS NS NO PO NM NB NB NM NM NM NS NO PO PO NS NB NB NM NM NS NO PO PO PS O NB NM NM NS NS PO PO PS PS PS NB NM NM NS NO PO PS PS PM PM NB NM NM NS NO PO PS PM PM PB NM NM NS NO NO PS PM PM PB PVB NM NM NS NO NO PS PM PB PVB

Table 2 Factors (flt) for fuzzy decisions

Xin OUR NVB NB NM NS O PS PM PB PVB

NVB 0.92 0.85 0.82 0.8 0.78 0.75 0.7 0.61 0.51 NB 0.98 0.9 0.88 0.85 0.83 0.83 0.81 0.72 0.63 NM 1.02 0.95 0.93 0.9 0.88 0.86 0.85 0.82 0.75 NS 1.05 1.02 0.98 0.95 0.93 0.92 0.91 0.88 0.82 O 1.1 1.07 1.05 1.03 1 0.97 0.95 0.92 0.89 PS 1.19 1.15 1.09 1.07 1.04 1.02 0.98 0.96 0.92 PM 1.27 1.21 1.13 1.12 1.08 1.08 1.02 0.99 0.96 PB 1.36 1.29 1.2 1.18 1.1 1.12 1.05 1.02 0.99 PVB 1.51 1.37 1.24 1.22 1.15 1.17 1.1 1.06 1.02

linguistic labels: rules to be selected from a typical or basic rules table. Fo r this reason, a solut ion was found as follows.

First, Table 1 for the case of X = O, O U R = O was selected as a basic rules table denoted by Table(O, O). Then, all other tables except Table(O, O) were considered to be represented by relative f a c t o r s f ij where i,j ( = 1, ... , 9) represent the ith and the j th quant i t ized degrees for Xin and O U R , respectively, (i = 1 represent ing NVB for Xin, j = 1 NVB for O U R . . . . . i = 9 representing PVB for Xin, j = 9 representing PVB for OUR). All the factorsf /J ( i , j = 1 . . . . . 9) are shown in Table 2.

Since every developed control rule in

Table(O, O) appears in the form of a linguistic variable or fuzzy subset, it is necessary to defuzzify each active fuzzy control rule before br inging it to bear on the process. After defuzzification, each lin- guistic label in Table(O, O) will be replaced by its

mean value ai (i = 1, . . . , 11) defined by Eq, (1). For example, if inputs F in = NS, C O D i = PS, Xin =

PS, and O U R = NS are found out, NS for Fr and f 6 , 4 should be selected from Table 1 for Xin = O,

O U R = O and Table 2 for the factors. Then, the defuzzified rule for the case of Xin = PS and O U R = NS, which should be in Table(PS, NS), can be generated by a mult ipl icat ive opera t ion on f4,6 = 1.07 (from Table 2) with mean value of the

linguistic value NS for Fr (from Table 1). By using the above method, only 162 ' rooms '

(space of a computer) are needed to store all the rules. Tha t is, the half of the total space is for the 81 basic fuzzy rules in Table(O, O). The other half is

for the 81 fac to rs f i~ ( i , j = 1, . . . , 9). Al though some of the initial developed rules are different from the new rules (economic in space) result ing from the mult ipl icat ive operations, the differences are very small and most of the new rules have been checked

288 C. Fu, hi. Poch / Fuzzy Sets and Systems 93 (1998) 281-292

Table(PVB,PVB) I

Table(NVB,NVB) :_

81tabl~

t> 9 f g,e

0 ' f 5,e

I able(O,O) I fs,s =1

© f ~,4 {3 'fh~

1 table with 81 factors .(f.!:i) ....

Fig. 5. Illustration of rule transformation.

appearing as the same as their initial ones. A struc- ture of the rules' transform is shown in Fig. 5.

3. Results and discussion

3.1. Development of FLC strategies

The principle of rules driven and fuzzy decision for the investigated activated sludge process is illus- trated in Fig. 6. Several steps to drive an active FLC rule as a new set point of recirculation flow (Fr) are detailed as follows.

(1) Data sampling for Fin (on-line measure- ment), CODi and Xin (off-line analysis), and OUR (estimation by the model presented in Appendix A).

.. R ~+~,i+~ ~'ff M~0, l ";i -

M~,4 M'o0,t , ,..

Fin CODi R

OUR i Xin

¢4 ,.i.t

fi , i

i÷1 ,j+l

Fig. 6. Fuzzy inference and decision.

C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292 289

(2) Fuzzyfy all the input variables by calculating the developed membership functions: /~r,(Fin), #y,(CODi), (#y,(OUR), #r,(Xin), among them py,(Fin) is the membership degree of Fin to its ith linguistic label, #y~(CODi), pr,(OUR) and #y~(Xin) have similar meanings with/~y,(Fin) (i,j = 1 . . . . . 9). The form of these membership functions are de- fined by Eqs. (4),(5) and (10)-(13).

(3) Do the following operation to get LM ~'j and FLM ~'i as

LM ~'j =/~y,(Fin) /x #rj(CODi)

FLM ~'j = #y~(OUR) A /~y,(Xin)

(i,j = 1, . . . ,9) ,

(20)

(i,j = 1, . . . , 9),

(21)

where A represents taking a smaller one. (4) Do the MAX operation to get /-/~'J and

FHM ;'~ as

10 if L M i ' J = M a x { L M 1"1, . , L M L'L} HMi'J = if LMi ' J~ Max{LM 1'1, ii. , L M L'L}

i,j = 1 . . . . ,9, (22)

3.2. Performance evaluation

Performance of the developed fuzzy control strategies has been tested by comparing fuzzy infer- ential results (set points of Fr) with testing data for the same set of input conditions. The data for the test result from simulation on a set of dynamic mathematical models (Appendix B) which were de- veloped for the same process in the past. For some input conditions (Fin, CODi and Xin), the goal of the model simulation is to satisfy with a set of given indexes, i.e., CODo < I * (80mg/1) and m~ < DO ~< m 2 (with the meaning of DO in a normal range) when the process states are steady. The con- trolling variables are both Fr (mainly for CODo) and stirrer configuration (SC) (mainly for DO). Using the same condition, Fin, CODi and steady states of Xin and OUR for a specific corresponding historical data Fr' and SC' used during the simula- tion, the test of the fuzzy inferential model was conducted to obtain Fr* as a set point of Fr. Then Fr* was compared with Fr'. The process of the simulation and test for the developed fuzzy strat- egies is illustrated in Fig. 7.

FHMi,J

f l if FLM/ ' j Max{FLM l ' t . . . . . FLM L'L} = ]0 if FLM i'j :~ Max{FLM 1'1 . . . . ,FLML'L}

i,j = 1, . . . , 9. (23)

(5) From H i'j and a basic rule Rid j (basic set point of Fr) from Table 1, do MAX operation to get Ro by

9 Ro = Max{(R /- riM',J)}. (24)

t,J

From F H M ~'j and a factor f~'J from Table 2, do MAX operation to get f* by

9 f , = FHM"J)}. (25)

i , j

(6) A final set point of Fr is R given by

R = R*- f* , (26)

where R* is a basic active rule after defuzzification from Ro.

Input initial condition: Fin(0), CODi(0), Xin(0),OUR(0),SC',Fr'

] Simulation on the models ]

IMo i Fr'a.dsc'[ No r

N o ~ k + 1<I* ? a~"~nd

Yes

Carry out the test

[Input: Fin(0),CODi(0),Xin(0),OUR(0) ]

1 [ Fuzzy inference ]

Change initial condit ons

Fig. 7. Diagram for testing fuzzy control rules.

290 C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281 292

Table 3 Results of fuzzy decision and simulation on the developed model

Fin (m3/h) CODi (mg/1) Xin (mg/1) OUR (mg/1 h) CODo (mg/1) Fr'(m3/h) Fr* (m3/h)

1550 250 1200 7.3 70.6 1150 1133 1050 350 1200 5.8 75.6 525 765 1050 475 1360 7.7 80.5 800 900 1550 250 1600 6.2 57 1150 1023 2150 250 1600 6.8 72.9 1150 1200 1150 350 1600 7.7 73.4 1150 1248 1050 475 1600 7.1 78.3 800 900 2150 350 2000 7.8 77 1350 1428 1550 475 2000 11.4 77.7 1150 1456 1050 625 2000 10.7 74 800 972

Results of the test are summarized in Table 3 in which Fin, CODi, Xin and OUR represent the initial condition for both the simulation and the test, Fr' was used in the simulation to obtain CODo from the model presented in Appendix B, and Fr* resulted from the fuzzy inferential model. The results show no big difference between Fr' and Fr*. As shown in Table 3, the values of Fr* are generally bigger than the values of Fr'. It could be explained that if Fr* are selected as set points of Fr, corresponding values of CODo would be lower than the values produced from the simulation, which was good for satisfying with the index (CODo < 80 rag/l).

4. Conclusions

As for traditional identification methods, estab- lishment of accurate mathematical models for sys- tems depends on finding some internal relationships between inputs and outputs. It is based upon a great amount of measurement data of the systems to be identified and use of some suitable mathematical methods to mathematically describe the relationships. However, in practice, there are a lot of processes which are difficult to identify by using traditional methods. The reason for this could be considered as: (1) some measurement data could not reflect their real systems; (2) there would not be enough measurement data to describe sys- tems by the traditional methods and (3) some in- formation might be from human experience with

some fuzzy concepts. Hence, fuzzy set theory ap- pears to have an advantage to tackle such prob- lems.

The basic idea to establish fuzzy methods for systems is nearly the same as the traditional way. But, for a fuzzy modeling method, usually it is necessary to fuzzify all the measurement data of a system to be modeled, and convert them into fuzzy subsets. Thus, internal fuzzy relationships be- tween inputs and outputs of the system could be described by a set of conditional sentences/f(fuzzy subsets of input linguistic variables are true) then (fuzzy subsets of output linguistic variables can be determined), which is a fuzzy model. Those de- veloped conditional sentences are easy to modify and for operators to accept.

A method of FLC design is proposed in this article. Its application for an activated sludge pro- cess is presented. Two types of continuous fuzzy variables (a bell type and triangular type) are nor- mally used [-13]. In this study, the bell type was used for fuzzying input and output data in the design of our FLC. However, as illustrated in Fig. 4, the fuzzy subsets or linguistic labels do not have the same size of their domains. This is because the values of the historical data in two opposite direc- tions from the normal point (350 mg/1 for CODi as shown in Fig. 4) are not symmetric. It is under- standable that formulating linguistic labels as given here can increase control accuracy.

To solve the problem of expense of space occu- pied in the computer by the system, some coeffi- cients (factors) are defined instead of tables with

C. Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292 291

a lot of rules. This strategy could be helpful for implementing multi-input/multi-output FLCs. But it is suggested that a detailed design of your FLC rule tables be done initially for the process to be controlled. Then you may consider using the pro- posed strategy in this paper if computer memory space is critical and similarity exists in developed control rule tables.

The result of simulation for testing the FLC strategies is satisfactory. Hence, the modeling ap- proach and the fuzzy decision method presented in this paper have shown a promising way to tackle modeling and real-time control for real world com- plex processes.

where T is the sampling interval. Then, from Eq. (A.1), a discrete model for identification can be written as

c(t) = f , c( t - 1)

+ f 2 [ K , . e ~ a t a ( t - 1) - - K , a c V t o t ( t -- 1)

- OUR + FtotCo(t - 1)]. (A.8)

Define:

y( t ) = c(t) - f l c ( t - 1) - FtotCo(t - 1), (A.9)

(~(t) = [ f 2 ( C s a ( t - 1) - ca( t - 1)), - f 2 ] , (A.10)

OX(t) = [-K,a , OUR]. (A.11)

A p p e n d i x A

Recursive estimation of OUR is based on the following differential equation:

d C Fto,(Ci -- C) - - K l a A t ( C s a t - C ) - OUR +

dt V

(A.1)

From Eq. (A.I), if K l a (the global mass transfer coefficient of oxygen) is known, OUR (oxygen up- take rate in the reactor) can be simply determined. However, in practice, Kla is unknown and varies gradually in time. Thus, it is better to be determined simultaneously with OUR,

The following presentation briefly introduces how to obtain estimated values of OUR and Kla, arising from measures of DO and having A(t ) and Fto, as disturbances.

Consider a stationary working point of DO as C~, define

a(t ) = A ( t ) - Ae , (A.2)

ca(t) = C ( t ) A ( t ) - [C( t ) A( t ) ]e , (A.3)

our = OUR - OURe, (A.4)

Co(t) = Co(t ) - Coe, (A.5)

f l = e F,o,T, (A.6)

f2 = (1 - - f l ) / V t o , , (A.7)

Thus, the recursive equation can be written as

O(t) = O(t - 1) + K ( t ) [ y ( t ) - (~(t)O(t - 1)]. (A.12)

Using the method of recursive least squares, both OUR and K~a can be estimated.

A p p e n d i x B

The following developed models are used in the simulation.

d X K d X 2 F t o t ( X i - X ) - - = ~ x s + , (B.1) dt S V

d S - p X S Ftot(Si - S) - + - - , (B.2)

dt Y V

dC F,ot (Ci- C) - - K l a At (Csa t - C) - OUR 4

dt V

(B.3)

OUR = K ~ I~X S. (B.4)

For simplicity, some constant parameters are con- sidered as follows: yield Y = 0.6; decay constant Kd = 2.044 x 10-4; K l a = 2.5 (considering it varies slowly and is a constant for a period of time); Csat = 9,4 (assuming that temperature is 20°C); K x = 1000.

The growth rate of the biomass, #, is assumed to depend on the oxygen level in the reactors in the

292 C Fu, M. Poch / Fuzzy Sets and Systems 93 (1998) 281-292

fol lowing s imple way:

~max C - - - ( B . 5 )

C + K c

where pmax = 2.583 X 10-4; Kc = 0.05. Choos ing

for the cons t an t Kc a small value, it means tha t the growth ra te stays the same for near ly the whole range of D O . On ly when D O app roaches zero # d rops d o w n quickly.

Besides the s impl i f ica t ion of the mode l s in rela- t ion to the real s i tua t ion of the inves t iga ted process, o ther a s sumpt ions are made: - n o b iomass in the outflow. W h e n there are no

set t l ing p rob lems , this is a r easonab le assumpt ion . - n o oxygen in the inpu t flow (Cin = 0) and no

fur ther deg rada t i on of the subs t ra te dur ing its t ravel with the recycle flow to the inlet of the reactors . F o r s implici ty, the con t r ad i c t i on be- tween a des i red D O in ou tpu t and no D O in recycle flow is accepted. State of the tu rb ine for reac tors cou ld no t be

changed cont inuous ly . Each of the first two reac- tors (on the left in Fig. 1) has three different perfor- mances: 'off ' , ' s low' and 'fast ' . Each of the o ther reactors only has two different per formances : ' o f f ' and 'on' . The ae ra t ion factor A (t) is based upon the s t i r rer conf igura t ion for the reactors .

Acknowledgements

This work has been pa r t i a l ly s u p p o r t e d by the C I C T Y Spanish pro jec t R o b 91/1139. Chunsheng F u acknowledges f inancial suppor t f rom a Spanish gran t (SB90/437).

References

I-1] M. Dohnal, Fuzzy bioengineering models, Biotechnol. Bioen 9. 27 (1985) 1146-1151.

[2] C. Fu, S. Wang and J. Wang, Region fuzzy control for batch processes - I. A modeling approach, Int. J. Systems Sci. 21 (1990) 1901-1910.

[3] C. Fu, S. Wang and J. Wang, Region fuzzy control for batch processes - II. Feed timing prediction and control for an antibiotic fermentation production process, Int. J. Systems Sci. 21 (1990) 1911-1921.

[4] C. Lee, Fuzzy logic in control systems: fuzzy logic control- ler - part I, IEEE Trans. System Man Cybernet. 20 (1990) 404 410.

[-5] J. Langari, R. Yen and L.A. Zadeh, Industrial Applications of Fuzzy Logic and Intelligent Systems (Library of Con- gress Cataloging-in-Publication Data (IEEE Press, New York, 1995).

[-6] A. Sangalli, Fuzzy logic goes to market, New Scientist 8 (1992) 36-39.

I-7] L.P. Holmblad and J.J. Ostrgaard, Fuzzy Information and Decision Processes (North-Holland, Amsterdam, 1982).

[8] M. Fan-Can, Fuzzy logic and studies on its application in papermaking machine automation, in: 6th lnternat. IFAC/IFIP/IMEKO Conf. on Instrumentation and Auto- mation in the Paper, Rubber, Plastics and Polymerization Industry (Akron, Ohio, 1986).

[91 R. Brian and A.C. Patrick, Application of fuzzy logic in control of polymerization reactors, Proc. 1992 IFAC/ IFIP/ IMACS lnternat. Symp. on Artificial Intelligence in Real- Time Control (Delft, The Netherlands, 1992) 95-101.

[10] L.A Zadeh, Fuzzy sets, Inform. Control 8 (1965) 338-353. [ l l ] P. Serra, J. Lafuente, C. Moreno, C. de Prada and M.

Poch, Development of a real-time expert system for waste- water treatment plants control, Proc. 1992 IFAC/ IFIP/IMACS Internat. Symp. on Artificial Intelligence in Real-Time Control (1992) 347 350.

[12] M. del Valle et al., Evaluation of microwave digestion for chemical oxygen demand determination, Environ. Tech- nol. 11 (1990) 11087-11 092.

[13] T. Terano, K. Asai and M. Sugeno, Fuzzy Systems Theory and Its Applications (Academic Press, San Diego, 1992).