APPLYING ARTIFICIAL INTELLIGENCE HYBRID TECHNIQUES IN WASTEWATER TREATMENT
A Thesis presented to The Faculty of the Russ College of Engineering and Technology Ohio University, Athens OH
I Partial Fulfillment n
of the Requirements for the Degree Master of Science
by
Chien-Hsien Wen June, 1997
ACKNOWLEDGMENTS
My deepest appreciation belongs to my thesis advisor, Dr. Constantinos Vassiliadis, for his unending support, advice and encouragement throughout this work. I have really enjoyed the pleasant association that I have had with him.
I would like to thank my thesis committee members Dr. Jeffrey J. Giesey, Dr.
Joseph H. Nurre, and Dr. Eric P Steinberg for their critical review of my work. My parents have my greatest love and admiration, and I deeply appreciate the sacrifices they made on my study.
TABLE OF CONTENTS
CHAPTER 1 INTRODUCTION .....................................................................................1
1.1 1.2 1.3 The Challenge of Wastewater Treatment............................................................... Historical background ............................................................................................ 1 4
Object of Research ................................................................................................. 6 Overview of Wastewater Treatment .....................................................................8 The Complete-Mix Activated-Sludge System .............................................. 10 Kinetics of biological growth ........................................................................ 13 Complete-mix Activated Sludge Reactor Without Recycle .......................... 17 Sedimentation................................................................................................ 20 Secondary Clarifier ....................................................................................... 2 2 23
24-
CHAPTER 2 THEORIES OF WWTP AND ARTIFICIAL INTELLIGENCE .........8
2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2
Artificial Intelligence Theory .............................................................................. Expert Systems ..............................................................................................
2.2.1 2.2.2 2.3
Neural Networks ........................................................................................... 27 33
Development Environment ..................................................................................
2.3.1 2.3.2
Brief Description of G2 ................................................................................. 33 Brief Description of Neuron-Line .............................................................. 40
CHAPTER 3 DEVELOPMENT OF A SIMULATION MODEL FOR WWTF .......42 3.1
3.2 Analysis of the Simulation model of WWTP and The Object Definition ........... 42 Simulation Treatment Equipment ........................................................................ 49 Foundation models of Simulation ................................................................. 49 Development Simulation For Treatment Equipment .................................... 51
3.2.1 3.2.2
CHAPTER 4 DEVELOPMENT OF A1 CONTROL SYSTEMS FOR WWTP........62
4.1
Development Expert System Controlling Sludge Recycle Rate .......................... 62 Development Hybrid A1 System Controlling Sludge Recycle Rate .................... 66
4.2
CHAPTER 5 RESULTS
5.1
5.2
................................................................................................. 79
80 The WWTP Simulation Results Before Flow into Aeration Tank ...................... 83 The Simulation of WWTP Controlled by the Expert System .............................. WWTP Controlled by the A1 Hybrid System ..................................................... 90 Apply A1 Hybrid System with a Peak Loading ....................................................97
5.3
5.4
.................................................................................100 REFERENCES ..........................................................................................................103
CHAPTER 6 CONCLUSIONS
LIST OF FIGURES
Figure 1.1. Typical hourly variation in domestic wastewater flow rate [3]....................... 3 Figure 1.2. Typical hourly variation in concentration of domestic wastewater................. 4 Figure 2.1. The four units in WWTP: the preliminary unit, the primary unit. the secondary unit. and the sludge treatment unit ...........................................10 Figure 2.2. Process flow diagram for wastewater treatment plant designed.................... 11 Figure 2.3. Definition sketch for a mass-balance analysis for a complete-mix reactor.... 12 Figure 2.4. Structure model schematic of the biological reaction in the aeration tank .... 18 Figure 2.5. The A1 hybrid Architecture............................................................................ 24 Figure 2.6. Basic concept of an expert system function ................................................... 26 28 Figure 2.7. The Structure of neuron cell .......................................................................... 30 Figure 2.8. An artificial intelligent network (ANN)......................................................... Figure 2.9. Look ahead editor for editing a rule that shows that the variables can be selected...................................................................................................... 34 Figure 2.10. Another look ahead editor for editing a rule that can select any of the syntax under the editing box: [.
...". *. and etc........................................ 35
Figure 2.1 1. Message #36 indicates error on the RULE-XXX-1 on logbook.................. 34 Figure 2.12. On the note of the attribute table, an error shows flow is not defined for the class item............................................................................................. 37 Figure 2.13. The computational features and structure of G2 [21].................................. 39
45 Figure 3.1. The class hierarchy of WWTP .......................................................................
Figure 3.2. The sludge pump inherits attributes from sludge and pump .......................... 46 Figure 3.3. The classes and the class hierarchy of the treatment plant ............................. 47 Figure 3.4. The icon editor. It is editing the icon of a pump ............................................50 Figure 3.5. A schematic of a WWTP shows the wastewater flows and process units ..... 52 Figure 3.6. The primary unit: a primary clarifier and a sludge pump .............................. 55
Figure 3.7. A schematic of a primary clarifier ............................................................... 56 Figure 3.8. The Secondary Unit: wastewater from the primary unit combines with the 58 recycled sludge and flow to the aeration tank ........................................... Figure 3.9. The schematic of the aeration tank ................................................................ 59 Figure 4.1. Diagram of Aeration tank .............................................................................. 67 Figure 4.2. The input and out models for a predicting neural network............................. 68 Figure 4.3. Collecting data for training and testing the neural network ...........................69 Figure 4.4. Training and retraining workspace for neural network .................................. 70 71 Figure 4.5. The sigmoidal function .................................................................................. Figure 4.6. Test for hidden layers .................................................................................... 72 Figure 4.7. Training diagram for neural network ............................................................. 73 Figure 4.8. An A1 hybrid system diagram for WWTP ..................................................... 74 Figure 4.9. An A1 hybrid system applies for the control in this project ........................... 75 Figure 4.10. Control architecture of an A1 hybrid system applies in WWTP .................. 75 Figure 4.11. The predicting of the status of the aeration tank .......................................... 76 Figure 4.12. The rules for combining expert system and neural network ........................ 77 Figure 5.1. The five sample points (A, B, C, D, and E) are to monitor the wastewater treatment process ....................................................................................... 80 Figure 5.2. The influent flow rate (bold line) and effluence flow rate of the simulation wastewater in the WWTP ......................................................................... 82 Figure 5.3. The simulation value of the concentration of the SS and the BOD (bold line) inflow to the WWTP ........................................................................ 83 Figure 5.4. The concentration of the BOD (bold line) and the SS flow to the aeration tank without the recycled sludge ...............................................................84 Figure 5.5. The control panel to set the desired values of the concentration of the BOD, the MLSS, and the WSSC ...............................................................86 Figure 5.6. The sludge recycle rate controlled by the expert system and the concentration of the BOD at aeration tank ................................................ 87
viii Figure 5.7. The concentration of the mixed-liquid suspended solids (MLSS) at the aeration tank (recycle sludge rate controlled by the expert)......................88 Figure 5.8. This figure is zoom from Figure 5.6 and Figure 5.7 to show the expert system is still in control after Point F and why every thing become unstable ..................................................................................................... 90 Figure 5.9. The concentration of the BOD and the SS (bold line) in the effluent wastewater to the river .............................................................................. 91 Figure 5.10. The control system for the sludge recycle rate is switched from the expert
1 system to the A hybrid system ............................................................... 92
Figure 5.12. The sludge recycle rate as it is controlled by the A1 hybrid system............. 93 Figure 5.14. The chart of the BOD at aeration tank and the sludge recycle.....................95 Figure 5.15. Comparing different control systems with the range of the BOD ................97 Figure 5.16. Influent (Point A at Figure 5.1) and effluent wastewater (data from Point
D at Figure 5.1). Comparing with Figure 5.2, there is a peak loading at
6.00PM..................................................................................................... 98 Figure 5.17. The concentration of BOD and SS in effluent wastewater. Comparing Figure 5.3, both BOD and SS have a peak loading at 6.00PM .................98 Figure 5.18. The concentration of the BOD and the SS collected from Point .................99 Figure 5.19. The concentration of the MLSS at aeration tank .........................................99 Figure 5.20. The recycle rate and the concentration of the BOD at aeration tank ........... 99 Figure 5.21. The effluent of the SS and the BOD ............................................................99
LIST OF TABLES
Table 3-1. The components used in the simulation .......................................................... 48 Table 4- 1. Rules for the control the sludge recycle flow rate ........................................... 66 Table 4-2. The Rules is used to communicate the expert system with neural network. .. 78 Table 5-1. Comparing the range of the BOD in aeration tank and in the effluent wastewater control by the expert system and the A1 hybrid system. ............... 95
CHAPTER 1 INTRODUCTION
The present paper proposes an automatic control system for the operation of the wastewater treatment process applying hybrid artificial intelligence (AI) techniques in real-time control. The main goal of a wastewater treatment plant (WWTP) is to reduce the level of pollution of the wastewater, that is, to remove within certain limits pollutants in the inflow water prior to discharge to the environment. Most WWTP designs, based on the crisis condition, waste resources and energy, and also reduce the cost effectiveness of reaching permissible effluent levels. Application of A1 techniques in wastewater treatment is an alternative way to operate the complex treatment process, to reduce the energy consumption in the operation, and to improve the efficiency of the treatment equipment.
1.1
The Challenge of Wastewater Treatment
The problems of the dynamic behavior and operational characteristics of wastewater treatment processes are frequently greater than that for industrial processes because of the large temporal variations which occur in wastewater composition,
2 concentration, and flow rate [I]. Compared with industrial processes, most wastewater treatment processes are in a primitive state with respect to process operation. This dynamic condition is different from steady state chemical reactions. In steady state, the operator does not consider the variation in inputs. The industrial processes can control the inflow and the reaction condition. The wastewater treatment process has variant inflow as well as wavering concentration of the components in the wastewater. In addition, the rate at which the raw sewage comes to the wastewater treatment plant is dynamic and cannot be controlled. Therefore, the WWTP design is based on the crisis condition--summer time: high temperature, low flow rate, and high solid concentration. The daily loading, such as inflow rate, biochemical oxygen demand (BOD). suspended solids (SS), and other factors, dynamically change from time to time. The flow rate of the domestic wastewater from the sewage system to the WWTP changes from hour to hour based on the water consumption with a lag of several hours (refer to Figure 1.1). The concentration of the biochemical oxygen demand and the suspended solids change from time to time, and their peak values do not appear at the same time (refer to Figure 1.2). In addition, there are significant variations in treatment plant efficiency, not only from one plant to another, but also from day to day and hour to hour in the same plant. It is difficult to construct models of several processes such as active sludge that completely describes the process due to the complexity of the operation and interaction of microorganisms. Therefore, there are operation and maintenance challenges during wastewater treatment process. According to Kim et al. [ 2 ] , the failure of operation of
0 12:OO AM 4:00 AM
8:00 AM
12:OO PM 4:00 PM
Hour
8:00 PM 12:OO AM 4:00 AM
'
Figure 1.1. Typical hourly variation in domestic wastewater flow rate [3].
US Army WWTP is due to incompetent operators; insufficient specific guidance on adequate operation maintenance; and compliance, and a poor maintenance program. However, those problems are found not only in the US Army WWTP but also found in most WWTP. Generally, the challenges related to WWTP are the variant of the compounds and the concentration in wastewater, dynamic flow rate to WWTP, lack of the input information from the treatment, need of trained operators, and computer technologybased solution to improve WWTP operation.
0
12:OO AM
4:00 AM
8:00 AM
12:OO PM
HOUR
4:00 PM
8:00 PM
12:00 AM
Figure 1.2. Typical hourly variation in concentration of domestic wastewater. BOD is biochemical oxygen demand and SS is suspended solids [3].
1.2
Historical background
The types of artificial intelligent (AI) tools applying in WWTP are expert systems, fuzzy logic, cased based reasoning, and neural networks. Expert system was the first A1 technique applied in WWTP. Most of the researchers used expert systems to diagnose the plant operation or play an advisor to assist the operators [ 5 ] and [ 6 ] . Although the expert system approach is the most prevalent, difficulties in acquiring and representing knowledge of the complex phenomena in WWTP have led to the search for additional approaches. The knowledge sources are from human experts, the statistical data of the WWTP, or documents.
To compensate for the shortcomings of the diagnosis-oriented expert system and to quantify process control, one approach is to build a simulation based upon process models, which represents our partial knowledge of the process. The Simulation
approach can simulate different control strategies before they are actually implemented. The simulation results are evaluated and compared with either the operator or the expert system [7]. Mathematical modeling techniques are used and involve the application of material balances for transport analysis and kinetic expressions to describe the response of the physical system. Design and simulation of a wastewater treatment plant can be based on those mathematical models. Krovvidy and Wee [B] developed an intelligent hybrid system combining inductive learning, artificial neural network approaches, and case based reasoning for a wastewater treatment plant. Boger [9] points out the fuzzy logical statistical process control used for formulating expert rules from plant historical operating data. However, artificial neural networks (ANN), which can learn from example, are believed to be a better solution for this task and for many additional problems encountered in the operation of the I W T P . In his paper, he reviews various applications of neural networks in the field of wastewater engineering and discusses both the advantages and the limits of the neural network approach. CBtC et al. [lo] used a two step procedure to improve the accuracy of the mechanistic model of the activated sludge process. The first step is the parameter
6
optimization of the mechanistic model using a least square regression analysis based on a large set of experimental data of five key process variables. The second step is to use feed-forward neural network models simulating the prediction errors of the mechanistic model. The hybrid system accurately simulates the dynamics of the activated sludge process. Capodaglio et al. [ l l ] analyze the input and output of the activated sludge system applying stochastic models and artificial neural network system models to treatment plant data. The models are subsequently applied to predict the occurrence of future bulking events in aeration tanks. Artificial neural networks can be applied to solve problem domains that are poorly understood andlor difficult to model with traditional methods. Wilcox et al. [12] utilized a neural network simulation to classify potentially damaging events during the anaerobic digestion process with an on-line bicarbonate alkalinity sensor.
1.3
Object of Research
The purpose of the research was to develop a dynamic WWTP model and
artificial intelligent systems to perform computer simulation and control of a wastewater treatment plant that specified compounds and accounted for degradation. The system can assist the simulation, operation, and control of the wastewater treatment process. The simulation is based on mathematical models [7] for a general complete mixed
7
activated sludge wastewater treatment plant including a primary settle, aeration tank, and clarifier.
In the control process, the AI hybrid system uses rule-based knowledge to
control pumping systems and neural networks to predict and control the aeration tank. The control system presents the automatic control, but also provides manual control to override the system when the control system is not stable. The project has two major components: the simulation and the AI hybrid system. The simulation produces effluent biological oxygen demand, and suspended solids as well as microorganisms in the treatment equipment in a fixed period of time. The A1 hybrid system converts the data collected from the simulation to a knowledge base. The results of the simulation illustrate the effects of variable waste quality upon effluent quality with and without A1 control. These systems possess the capability to provide fully automated process control as well as acting as a teaching and development tool for operators in full-scale treatment facilities. In addition, the system will provide the operators with more opportunities to make better decisions by allowing them to try different operations in the simulation system. A special interest of the study was to observe the dynamic state system responses under different A1 controlled operations determined.
CHAPTER 2 THEORIES OF WWTP AND ARTIFICIAL INTELLIGENCE
This chapter will introduce the theoretical base of this project. The project
applies different techniques including the mathematical model for WWTP, A1 hybrid system, and object-oriented model. The mathematical model is for building a
simulation for testing and operating the AT hybrid system. The object-oriented program is to build a class hierarchy from a real WWTP.
2.1
Overview of Wastewater Treatment
Three major units in the WWTP are preliminary, primary, and secondary.
Historically, the term preliminary and primary referred to physical unit operations; secondary referred to chemical and biological application. A more rational approach is first to establish the level of contaminant treatment required before the wastewater can be reused or discharged to the environment. The required unit operations and processes necessary to achieve the required level of treatment can then be grouped together on the basis of fundamental consideration.
9 Preliminary wastewater treatment is defined as the removal of wastewater constituents that may cause maintenance or operational problems with the treatment operations, processes, and ancillary system. Preliminary operations are screening and grit chamber for the removal of debris and rags, grits, the elimination of coarse suspended materiel that may cause wear or clogging of equipment; and flotation or the removal of large quantities of oil and grease (refer to Figure 2.1).
In primary wastewater treatment, a portion of the suspended solid and organic
matter is removed from the wastewater. This primary sludge which is usually
accomplished with primary treatment will ordinarily contain considerable organic matter and will have a relatively high BOD. The principal function of the primary treatment will continue to be as a precursor to the secondary treatment. Secondary treatment is directed principally toward the removal of the biodegradable organic and the suspended solids. Conventional secondary treatment is defined as the combination of processes customarily used for the removal of these constituents. It includes biological treatment to convert dissolved and colloidants to cells mass, water, and gases, by an activated sludge system and sedimentation and final clarifiers. Disinfection is included frequently in the definition of conventional
secondary treatment. The process flow diagram for wastewater treatment plant designed is shows in Figure 2.2.
From Sewage System
To River
Sludge Treatment Unit
I
Figure 2.1. The four units in WWTP: the preliminary unit, the primary unit, the secondary unit, and the sludge treatment unit.
2.1.1 The Complete-Mix Activated-Sludge System A mass balance affords a convenient way of defining what occurs within
treatment facilities as a function of time. To illustrate the basic concepts involved, a mass-balance analysis will be performed on the contents of the container shown schematically in To apply a mass-balance analysis to the liquid contents of the complete-mix reactor, it will assume that: (1) The liquid within the reactor is not subject to evaporation;
(2) The liquid in the reactor is mixed completely;
I
Influent Wastewater
water
I
Figure 2.2. Process flow diagram for wastewater treatment plant designed.
(3) A chemical or physical reaction involving the reactant is occurring only
within the reactor; (4) The rate of change in the concentration of the reactant occurring within the reactor is governed by the first-order reaction ( r , = kc).
For the state assumption, the mass balance can be formulated as follows: 1. Simplified word statement: Accumulation = Inflow - Outflow 2. Symbolic representation:
+ Generation -
Utilization
Figure 2.3. Definition sketch for a mass-balance analysis for a complete-mix reactor.
dC -Vr dt
=Q , , C
- QC+V(Change rate of reactant, r,)
A negative sign on k is used for the rate-of-utilization term. Where Symbol
Units
Description
DC/dt
M C ~ 'the rate of change of reactant concentration in the reactor
I
I
I measured in term of volatile suspended solids
I
V
Qo
Q
CO C
k
IL 1 LT' I L?" I ML" I ML-J
I
reactor volume
#
I
I inflow rate
I
I
I outflow rate
I
I concentration of reactant in influent 1 concentration of microorganisms in reactor
first-order reaction-rate constant for generation
T-
L: length M: weight T: time
2.1.2 Kinetics of biological growth
The growth of bacteria in batch cultures by laboratory experimentation was studied by Monod (1949) in which he defined the specific growth rate of the organisms in first order. The mathematical relationship of the growth of bacteria is the rectangular hyperbolic equation shown in Equation (2-4).
Where:
Symbol Units time-' time-' masslunit volume Description specific growth rate maximum specific growth rate concentration of growth-limiting substrate in solution surrounding the microorganism saturation constant (substrate concentration @
1/2 the maximum growth rate)
P
Pm
S
Ks
masslunit volume
It follows that the gross biomass growth rate (dXldt), which is defined as the product of the concentration of biomass (X)and the specific growth rate ( p ) is given by Equation (2-5):
Symbol (dXldt),
X
Units time" masslunit volume
Description gross growth rate (ignoring death) concentration of substrate
Pirt (1975) defined the maximum growth yield coefficient (Y) as the ratio of the mass of cells formed to the mass of substrate consumed. The growth yield term (Y) can
be introduced to link the gross growth rate to the substrate removal rate. In derivative
from this relationship is presented in Equation (2-6):
Where: Symbol Units time-' mass of substratefmass of microbe Description substrate utilization rate maximum growth yield
(dSldt),
Y
Substituting Equation (2-5) into Equation (2-6), produces the relationship:
The rate of substrate utilization both to the concentration of microorganisms in the aeration tank and to the concentration of substrate surrounding the organism is quite similar to that of Equation (2-7). This equation, proposed by Lawrence and McCarty (1970), appears in Equation (2-8):
Where: Symbol Units time-' Description maximum rate of substrate utilization per unit mass of microorganism
K
16
In bacterial systems, the growth of organisms is accompanied by a simultaneous
death phase. The level of substrate surrounding the microbe is usually very small and growth limiting. Thus, microbes are competing for small levels of substrate that results in an increase in the significance of the microbial death rate. Death results from one organism consuming another because of the low availability of substrate. This death phenomenon is called endogenous decay and is accompanied by a decrease in viable cell concentration. To account for the reduction in viable cell mass concentration, the first order death rate coefficient (Kd) is introduced into Equations (2-4), (2-5), and (2-6). Equation (2-4) then becomes:
Where:
Symbol
Pnet
Units time-' time-'
Description net specific growth rate death rate coefficient
k d
Similarly, Equations (2-7) and (2-8) yield:
Where (dXldt) y'is net biomass growth rate (time").
17
2.1.3 Complete-mix Activated Sludge Reactor Without Recycle
A mass balance for the mass of microorganisms in the complete-mix activatedsludge reactor can be written as Equation (2-2) for complete-mix reactor and substituted the reaction-rate constant k as microorganism growth rate r',. If the value of r', from Equation (2-10) is substituted into equation (2-3), the result is
Where
Symbol
S
Units
Description substrate concentration in effluent from reactor
mg/L
Performing a substrate balance corresponding to the microorganism mass balance given in Equation (2-9) result in the following expression.
Busty (1973) developed a structured model representing aeration that not only could account for all the four growth phases of the biomass but could also simulate various activated sludge processes including a step-feed activated sludge process and a contact-stabilization process. Figure 2.4 represents the information flow in the
structured model that was adopted in this investigation.
18
In Busby's work, stored mass included not only the poly- P -hydroxy butyrate or
glycogen-like compounds stored internally in cells, but also suspended and colloidal biodegradable materials entrapped in the bioflocs. Busby modified Blackwell's transfer rate (1971) for stored mass to include the effect of substrate concentration.
Consult the notation list for the definition of the symbols. When the substrate concentration is high, the storage capacity of the bioflocs will approach the maximum available storage level, js Lowering the substrate concentration results in a decrease . in the storage capacity of the bio-flocs, which agrees with Eckhoff & Jenkins' (1967) suggestion that because adsorption is a relatively rapid process, an equilibrium should
Figure 2.4. Structure model schematic of the biological reaction in the aeration tank [7].
19
quickly prevail in which the quantity adsorbed is proportional to its concentration in the liquid phase. Stenstorm pointed out that Busby's model for active mass was not appropriate for young sludge ages because the specific active mass formation rate approached zero as the sludge age neared washout. He proposed instead
Thus, the net rate of stored mass formation becomes:
Where
XT= XS + XA + X I + XNS + XNB ~s=XS/XT
Therefore, the substrate balance, including dissolved and suspended, can be presented below:
And the net rate of active mass formation becomes
The following expression accounts for the buildup of biologically inert mass and the decay of microorganisms:
2.1.4 Sedimentation
Shiba and Inoue [13] developed a dynamic model based on an ideal settling basin.
Where wp = settling velocity of sediment particles. The mean of wp is equal to 0.026
Symbol
A
Units
Description the surface area of the button basin
L~
The relationship between the scouring parameter, k, and the longitudinal turbulent diffusion coefficient, Ex, in the model basin is
A relationship between the longitudinal turbulent diffusion coefficient, Ex, and
Froude number, F, was also experimentally obtained with the same model basin.
In which F is a Froude number defined as
Where Symbol
v
Description the mean flow velocity the mean depth of a basin the gravitational acceleration
-
H
-
G
2.1.5
Secondary Clarifier
The efficiency of the secondary clarifier is crucial for the BOD-reduction
efficiency of the whole activated sludge process. The dynamic model of the secondary clarifier can be idealized to two completely mixed regions, the thickened sludge and the clarifier [14]. The suspended solids can be expressed as differential equations as follows:
In which
Symbol
I Description
concentration of solids in influent
C
re
Fr
A,,A.
I average concentration of solids in the clarifier zone
I
average concentration of solids in the thickened zone
I time delay
Coefficient describing the net transfer of solid particles to the clarifier
Kx
23 The term k , ~ , C ( t- A,) corresponds to the net mass transfer from the thickened zone to the clarifier zone. The assumption that C, and C,are constants throughout the clarifier of mixing is not exactly valid. Instead it can be assumed that
C, = k r c
for k , 2 1 for k , 5 1
C, = k , c e
Where C,is the solids concentration in the recycle and C, is the solids concentration in the effluent. By considering Equation (2-27), then the diffusion for the masses in the thickened and clarified zones can be written as
ke Where kxe = k -, kr = 1 , k, = 0.05, and k, = 0.1.
kr
2.2
Artificial Intelligence Theory
The A1 field is divided into five major branches: expert systems, neural
networks, machine learning, fuzzy logic, and genetic learning. Figure 2.5 shows the structure of the areas of the artificial intelligence and how the hybrid system operation.
The expert system and the neural network are applied in the control system. The next sections will briefly cover the theories of the expert system and the neural network as well as the expert system shell.
Output
I
1
Figure 2.5. The A1 hybrid Architecture. The most common model for A1 hybrid is the expert system combine with the neural network [24].
221 ..
Expert Systems
At the core of an expert system is knowledge about a specific problem domain.
This knowledge is a reduction of the domain to its premises and the relationships that link those premises. The relationships are usually defined as rules. Expert system
25
shells make the development of these systems easier than previously possible. Two concerns for those using or considering the use of expert system tools are the development of the rule base and the logical structure for combining knowledge into a decision. Expert system is a branch of A1 that makes extensive use of specialized knowledge to solve problems at the level of a human expert. An expert is a person who has expertise in a certain area. That is, the expert has knowledge or special skills that are not known or available to most people. An expert can solve problems that most people cannot solve at all or solve them less efficiently. The knowledge in expert systems may be either expertise, or knowledge that is generally available from books, magazines, and knowledgeable persons. The terms, expert system, knowledge-based system or knowledge-based expert system, are often used synonymously. Most people use expert system simply because it is shorter, even though there may be no expertise in their system, only general knowledge. The user supplies facts or other information to the expert system and receives expert advice or expertise in response. Internally, the expert system consists of two main components. The knowledge base contains the knowledge with which the These conclusions are the expert system's
inference engine draws conclusions.
responses to the user's queries for expertise. There are four control components of an inference engine: matching, selection, fire, and action. On matching, the inference engine compares the current rule with a given pattern and chooses the most appropriate rule for the selection step. Then the inference engine fires the best rule and executes the
26
result of the rule. Figure 2.6 illustrates the basic concept of knowledge-based expert systems.
i
j Knowledge-Base i
?---------------------------------J
I
I
1-
Inference Engine
I
1
I
Figure 2.6. Basic concept of an expert system function [22].
The knowledge of an expert system may be represented in a number of ways. One common method of representing knowledge is in the form of IF THEN type rules, such as
IF the traffic light is red THEN stop
If a fact that the light is red is known, this matches the
the light is red. The rule
is satisfied and performs its action of stop. Although this is a very simple example, many significant expert systems have been built by expressing the knowledge of experts in rules. The integration of expert systems and real-time systems is a logical next step in the development of these two technologies. Real-time expert systems could be used to replace or assist human operators in a wide range of applications. A related reason,
27
which supports the development of real-time expert systems, is to reduce cognitive overload on operators to improve productivity. A model of human interaction with complex dynamic systems shows high workload correlates to low handling qualities. This relationship reflects the overwhelmed feeling and poor response of human operators when presented with many rapidly changing streams of information (Hodson and Kandel, 1991).
2.2.2 Neural Networks
In general, a neural network is composed of layers of interconnected parallel
processing elements. Each element processes input from the prior layers and transmit output to a subsequent layer. Motivations for building and studying such networks stems from trying to emulate the human neuron's abilities in parallel processing and associative memories.
Biological Neural Network
The human brain is a huge network that contains about ten billion nerve cells (neurons) connected to each other by dendrites (inputs) and axons (outputs). The body of the neuron is called the soma (refer to Figure 2.7). One neuron can have up to ten thousand connections. The working mechanism of certain neurons is well known. Generally, a nerve cell can be found in one of three possible states: rest, excited and non-exciting.
Axon
Synaptic terminals
Figure 2.7. The Structure of neuron cell. Soma: the body of the neuron. Axon: the outputs of the neuron cell. Apical dendrites: the inputs of the neuron cell. Synaptic terminals: connectors with other neurons.
The transformation between these states is a result of the internal process of the cell and of external electric signals entering the cell. Excitement of the neuron at rest takes place when a large number of pulse signals enter the neuron at the same time. During a period of time the excited neuron does not change its state, but then transmits to non-exciting state. In this state the neuron is not able to react to the incoming signals, but in a while its ability to be excited restores and the neuron returns to the resting state. During neuron transmission to the state of excite, a pulse traveling with a speed of 1 to 100 m/s, is generated on the axon transmission line. In most cases there are no direct electric connections between neurons. The transmission of the signal from axon to dendrite of the other neuron is done chemically in synapses where membranes of two neurons are close to each other. The number of synapses in the brain is about lo4. Synapses play the role of memory elements and their modification is a result of
29
simultaneous activity of two connected neurons. There is a special rule (Hebbian rule) for modification of synapses. For instance:
Where wu is the weight of the synapse between neurons i and j; qi is the ith neuron output; a is a constant. Some of synapses generate inhibitory pulses in the dendrite, which have an opposite polarity with an incoming signal. If these pulses enter the neuron at the same time, it is possible for them to cancel the pulses of excite. There are different types of biological neural networks (BNN) with local or global connections. In the last case all neurons can be connected with each other.
Artificial Neural Network
The rigorous name of ANN is "artificial neural network," showing the similarity of concepts to the neural cell networks in the human brain. By analogy with BNN,
ANN is a device, consisting of many processors (neurons). Each of the neurons
exchanges the information with other neurons. Depending on the input signals, the neuron can change its internal state. The important elements of an ANN are the connections between neurons (synapses). The resistively of synapses changes in time when an ANN memorizes the information coming into the system. The rule of synaptic modification can be Hebbian as well as any other.
Let us first take a look at the feedback ANN (refer to Figure 2.8) which consists of a number of separate elements - neurons, connected with each other by synapses, a,, a2 ... a,. Synapses transmit the signals only in one direction and they are the only
information to enter in any neural cell. The output signal, bl, bz ... b,, from any neuron creates excitatory or inhibitory signals in connected neurons. For some neurons there are external inputs from the outside spaces or from different ANN. Other neurons generate an external output to operate other systems. The state of ith neuron can be described as a value of ai(t). Therefore the state of the
lnput
'eight
A
Tib,
ai
a2
a3
I
an
lnput Layer
Hidden Layer
................
Output Layer
b2
b3
bn
Output
Figure 2.8. An artificial intelligent network (ANN). A fully connected feed forward ANN with one hidden layer and output layer.
al,
a2 ... a, are the inputs to
the ANN and bl, b2 ... b, are the outputs from the ANN.
31 ANN is represented by vector a(t) = {ai(t), i = 1 ... N}, where N is a number of neurons. The time t can be continuous or discrete. In the last case the step o f t is equal to 1. The state of a neuron ai(t) can be continuous or discrete, bounded or unbounded.
If the state is bounded then it is common to use the boundary interval (0,l). Among the
neurons with discrete values of state, the binary is most common (0, 1 or -1, 1). If the sum over all inputs to a neuron is larger than a bias term, the neuron will fire. The neuron output, which is multiplied by the connection weights, is transferred to all neurons receiving input from this neuron. The matrices of weight w describe the interactions between neurons. Its components wo show the value and the sign of the connection from the jth neuron to the ith neuron (if they are not connected wij= 0). The activity of neurons in ANN and external signals at time t create a signal in the ith neuron:
neti (t) =
woai(t) + si (t) + b, (t)
Where si is an external signal and bi is a so-called bias, which controls the state of ith neuron. In discrete time, the state of ith neuron ai in the moment of time t+l is described by some function of neti(t):
a, (t
+ 1) = f,(net, ( t ) )
32
In continuous time the state of the ith neuron ai in the moment of time t is described by
equation:
ridai (t)
dt
+ a, (t) = f,(net, (t))
Where Ti is characteristic time of the ith neuron.
On the whole, ANN generates output signals (from the output layer) according
to input signals (to input layer). The character of such a transformation is described by the connections. The example of a fully connected feed forward network with orie hidden layer and an output layer is shown on the Figure 2.8. This network consists of a number of layers. The elements of any layer do not connect with each other, and are connected only with elements of previous and subsequent layers. The most common learning algorithm is the supervised back-propagation algorithm, in which a data set of system inputs and outputs are presented to a neural net having initial connection weights. Before a neural network is able to function, it nust go through the process of training. The training for the backpropagation is supervised, which means the training set is accomplished with a set of input-output pairs. The term of backpropagation comes from the fact that during training the error signal propagates back from the output layer to the input layer, adjusting the weights only after the procedure has moved to a previous layer. On one iteration, an error is calculated from the network output compared with the known output, and the connection weights are
33
modified to decrease the sum of squared error. The iteration is the training of an ANN for a single training set and an epoch is an entire series of training sets. The training is finished when the error of the whole epoch is under the desired threshold.
2.3
Development Environment
Expert system shells make the development of these systems easier than
previously possible. The whole project is developed under a real-time expert system G2, developed by Gensyrn Corp. G2, one of the expert system shells, is a complete development environment for building and deploying intelligent applications. Gensym also has developed a number of application packages for G2. Neuron-Line, one of the packages built for G2, is a tool to develop a neural network in a real-time environment for collection of data, selection of data, and training ANN.
2.3.1 Brief Description of 6 2
The unique ability of G2 is that it can dynamically control all of components in real-time no matter which is built in G2 or edited by users. In addition, G2 is a graphical, object-oriented environment for building and developing intelligent real-time expert systems. G2's natural language editor allows users to easily enter rules, modules, and procedures that describe real-time operation. There are support tools for testing and verifying the application, including dynamic simulation to test performance under various scenarios. The capabilities of G2 include - concurrent real-time execution,
34
object-oriented design, interactive graphics, rule-based and model-based reasoning, structured natural language, dynamic modeling and simulation. A look-ahead editor guides the user on editing rules, procedures, and models by showing choices and interactively checking for errors (see Figure 2.9 and Figure 2.10). When users finish editing any of the items in G2, the program will compile the item into execution-relation knowledge and feedback about any syntax error in objects, rules, procedures, or formulas on the message board or in the note of the items' tables (refer to Figure 2.1 1 and Figure 2.12). G2's executable items include procedures and methods, rules, action buttons, and user menu choices. The power of object-oriented development in G2 is readily apparent by merging modules and objects from previous applications; defining object and their properties arid behaviors; and creating new object instances cloning existing objects. G2 objects have built-in conceivability that adds to the ability to represent the system operations. Users
any attribute-name any class any graphic-attribute any color-attribute any region any system-attribute flowrate
flow-meter flow-pipe
Figure 2.9. Look ahead editor for editing a rule that shows that the variables can be selected.
35
p G x G G - q
m&l
[
A
%
t
I=
c
.. ..
has is exists does not exist
/
-
and then or
> <= >=
Figure 2.10. Another look ahead editor for editing a rule that can select any of the syntax under the editing box: [, ::, ", *, and etc. can graphically connect objects to represent their actual application - such as process flow, electrical circuits, mechanical linkages, conveyor, and information routings or logic flows. Most of an expert's knowledge about an application can be expressed in the form of rules. G2's rules work in real time and can mimic the human ability to focus on specific problems while maintaining a general awareness. G2 rules can be event-driven (through forward chaining) to automatically respond to whenever new data arrives. They can be data seeking (through backward chaining) to automatically invoke other rules, procedures, or formulas. G2 rules can determine the value of referenced
variables. Or, they can be scanned to evaluate rules at regular time intervals specified by the user.
36
Operator Logbook 21 Jan 97
#32
v A Page 7
1:53:32 p.m. Resuming running of KB from where it last paused.
#33 42325 p.m. Saving knowledge base "/home/homer/l/b/wenchien/nol/wastewater-treatment-plant.kb" completed successfully
WORKSPACE-XXX-2 to "/tmp/printl-l.psU at
#35 4:28:45 p.m. Finished printing KBWORKSPACE-XXX-2 to "/tmp/printl- 1.psm
detected in RULE-XXX-1; see its notes for details,
Figure 2.1 1. Message #36 indicates error on the RULE-XXX-I on logbook.
Like rules, G2's procedures work in real time. Procedures, rules, and models execute concurrently based on priorities. G2 lets a user dynamically model the systems and processes with objects, rules, procedures, and formulas. With the models and G2's built-in dynamic simulator, users can quickly get their prototypes up and running and continually test their applications during their development. The models can be used as part of the delivered application for comparing actual to ideal performance.
Options
Notes RULE-XXX-1: OK, and note that the attribute flow is not defined for the class item Authors wenchien (21 Jan 1997 1:54 p.m.)
'
invocable via backward chaining, invocable via forward chaining, may cause data seeking, may cause forward chaining
Item configuration none Names none
1)
I
Tracing and breakpoints default if the flow of PC1 > 5 then inform the operator that 'The inflow rate is too high." Scan interval none Focal classes Focal objects none none
I
1
I 11
Categories Rule priority Depth first backward chaining precedence
I none
II 11
Timeout for rule completion use default
I
Figure 2.12. On the note of the attribute table, an error shows flow is not defined for the class item.
G2 graphics may represent objects, connections, and relationships between
objects. G2 can reason in terms of connections, following networks of connected objects to determine causes and effects. The graphical connectivity of G2 objects
allows one to extend the application by "clone and connect" graphical operations. The connections can be interactively created and deleted even while G2 is running on line. Users can efficiently capture knowledge and save development effort by creating generic rules, procedures, and formulas that apply across entire classes of objects. Figure 2.13 identifies G2's major computational features. Compared the
conventional expert system, G2 not only contains an inference engine but also contains simulation, interfaces, and schedule. Each of these features can affect the knowledge contained in the current knowledge base (KB). Users interactively operate the overall execution of the current KB, while G2 automatically maintains the KB's executionrelated knowledge. By execution-related knowledge the users mean the permanent and current knowledge of the KB's objects, the communications status of interface objects, and the state of each executable item that has been invoked. The G2 scheduler, a key making G2 executes real-time, schedules and manages all of the activities required to execute the current KB. The scheduler has properties for user choices, many of which reside in the Timing Parameters system table. Each item has two kinds of attributes, priority and update interval, which can change the schedule of the update or trigger. G2's scheduler also queries the real time computer's own clock. The G2 inference engine and other G2 components perform the KB's rules, provide data service for the KB's variables, call foreign functions in other processes, and support remote procedure call (RPC) to and from other processes across your computer's network. Foreign function is a function written in C or C++ code that a KB can access as if it were a local function. The foreign function interface is platforrn-
39 independent and efficient, allowing it to isolate G2 from the effects of possible coding errors.
In conclusion, G2 is a real-time expert system shell that runs on workstations
and personal computers. It has real-time temporal reasoning, with rules, procedures, modules, objects, and functions built around an object-oriented paradigm. One can interface both locally and over a network to other programs (C or C++) control systems, and databases.
Function and RPCs
Figure 2.13. The computational features and structure of G2 [21]. The current KB that is knowledge base created by users. The variable servers are to get the values of the variables from inference engine, simulator, and inference to other system. Each server can not communicate each other.
40
2.3.2 Brief Description of NeurOn-Line
NeurOn-Line is a visual, object-oriented software tool for building neural networks and applying them in real-time environments
- G2.
Unlike other tools for
ANN, Neuron-Line provides training and on-line deployment in a single, consistent
environment. NeurOn-Line can solve complex nonlinear problems and combine with G2's rule-based knowledge base. Layered on G2 - real-time expert system, NeurOnLine delivers the power of neural nets in an easy-to-use form as part of an integrated real-time environment. Since some complex processes are difficult to monitor and control with conventional modeling tools or even rule-based systems, NeurOn-Line's unique combination of neural networks, statistical features, and object-oriented graphics provides a powerful tool for easily solving these complex problems. Integration of NeurOn-Line with G2 is the significant reason to make neural networks run on real-time. For comprehensive on-line applications, neural networks must integrate with procedural or rule based systems for such tasks as filtering input data or taking action on the resulting outputs from the neural networks. Objects in Neuron-Line interface directly with other objects, rules, procedures, and relations in G2. Combined with G2's extensive collection of system integration tools, NeurOn-Line forms a complete solution for on-line process monitoring, optimization, and modelbased reasoning tasks. From the training set, NeurOn-Line builds a neural net model that identifies dynamic, nonlinear relationships in the data. NeurOn-Line can learn models that are difficult for a process specialist to describe analytically or with a set of rules. During on-line use, NeurOn-Line forecasts behavior or classifies real-time data
patterns into fault or decision categories. Neuron-Line integrates directly with other Gensym tools that can then interpret the neural net outputs, trigger alarms, make recommendations, or take corrective actions. Along with its predictive capability,
Neuron-Line provides features for assessing the information content of the accumulated data. These tools can detect shifts in process performance, determine the significance of individual inputs, and derive probability estimates and other statistics. Neuron-Line automatically detects when the input data is outside the range of learned behavior. The visual environment provides all the facilities needed to get on line quickly and reliably. A user creates a Neuron-Line application by interactively connecting predefined blocks on graphical diagrams. Neuron-Line allows users to arrange blocks hierarchically and to hide details where appropriate. Once connected, data patterns flow in real time between the blocks. A user can inspect and modify a diagram even as it is executing. Neuron-Line provides important neural network paradigms that have been extended with specific features for real-time process applications. One of the four Neural network provided by the Neuron-Line is Backpropagation Network. This
standard feed forward architecture is most often used to build nonlinear models for prediction and control. Neuron-Line provides specialized training algorithms that far outperform traditional backpropagation training methods. An example application is a nonlinear quality model that correlates ingredient levels and processing conditions with product performance in a paint formulation process.
CHAPTER 3 DEVELOPMENT OF A SIMULATION MODEL FOR WWTP
In this Chapter, the author illustrates the building of an object-oriented model
and treatment simulation in the development environment, G2. Simulation is the
inexpensive way to test new ideas in a development application without a real world implementation. Developers use substrate simulator for development when they are unable to find an environment to fit the situation or if it is too expensive to have one. This project uses simulation because a WWTP was not found to test the A1 hybrid system. The simulation of the WWTP uses G2's built in simulator ability to objectify the mathematical model in G2.
3.1
Analysis of the Simulation model of WWTP and The Object Definition
The equipment in the WWTP can be classified by the process into four units:
preliminary, primary, secondary, and sludge treatment unit.s. Comparing Figure 2.1 and Figure 2.2 in Chapter 2, the screen, the p t chamber, and the equalization tank are in the preliminary unit. The main purposes of this unit are to remove coarse solids and grit that can damage other equipment and to equalize the inflow rates of the wastewater.
43
The equalization tank is to equalize the inflow strength of wastewater. This simulation system only considers the suspended solids and dissolved components in wastewater; therefore, the necessary equipment in the preliminary unit is the equalization tank. The major component in the primary unit is the primary clarifier that is to sediment the suspended solids that are heavier than water and are settleable within 30 minutes. To remove the suspended solids in the primary unit, a sediment tank to settle suspended solids and a pump to remove sludge from the basin are needed. The
secondary unit combines aeration tanks with final clarifiers and a sludge recycle unit. The aeration tank is used to reduce the dissolved BOD. Microorganisms are used to digest the organic matter in the wastewater. When the microorganisms digest the organic matter, they need oxygen; otherwise, they will become anaerobic and emit a bad odor to the air. The aeration tank needs an air pump to introduce air. The mixed microorganisms and suspended solids in wastewater can settle in the secondary clarifier since they become large suspended particles during aeration in aeration tank. The sludge recycle unit controls recycling sludge in order to maintain the concentration of the microorganisms in the aeration tank. The object-oriented model displayed in Figure
3.1 shows the class hierarchy.
The sludge treatment unit digests and de-waters sludge. In this project, the purpose is to control the sludge recycle rate to reach the permissible effluent level. The capacity of the sludge digest unit was not considered. The project considered only preliminary, primary, and secondary units for the simulation.
44
In conclusion, three units in this simulator module are necessary to test the
control system. The simulation is based on the mathematical models presented in the pervious chapter and uses G2 built in simulator ability to build the simulation WWTP. The object-oriented model is to design the lay out of WWTP. The treatment equipment, sensors, and pumps are the three major control components in the treatment plant.
Definition of the Class and Class Hierarchy
One of the advantages of the object-oriented model is apparent when super class declared for the attribute, and the subclass inherit the attributes from the super class. G2, like other object-oriented languages, permits multiple inheritance. Multiple
inheritance allows subclasses to have any number of super-classes. On the other hand, the subclass inherits all the attributes and methods from its parents with multiple inheritance. All of the parts in the WWTP contain wastewater or sludge; therefore the first part of the attribute for the all equipment is the character of wastewater. For example, the sludge pump has two super classes - sludge and pump (shown in Figure
3.1). Therefo~e,the sludge pump inherits attributes from sludge and pump (refer to
Figure 3.3). Fluids in a wastewater treatment plant are described by attributes relating to flow quantity and quality. There are two types of fluids flowing in the treatment plant sludge and sewage, and they flow as continuous streams. The purpose of the pipes and the pump is to connect to two parts of the WWTP. The operator can control the power and the flow rate with the pump. The pipe only connects parts. Therefore the pump is a
45
subclass of the parts and the pipe is a subclass of the connector. The sensors collect the data from the WWTP to the diagnosis or control program. The control equipment controls the sludge recycle rate. The wastewater coming to WWTP cannot be controlled. The only equipment to control incoming wastewater is the equalization tank that equalizes flow rate but cannot equalize the concentration of the wastewater. For this reason, the only parameter on WWTP being controlled is the sludge recycle rate. However, if the concentration of return sludge is high, then the effluent concentration of suspended solids will increase. Increasing the concentration of microorganism will decrease the dissolved BOD, on the other hand, increasing of concentration of microorganisms in aeration tank requires increase in the concentration of returned sludge from the secondary clarifier. The class hierarchy of the treatment plant is shown in Figure 3.3.
Fluids
WWTP
-
Parts
Connector
Smart Sensors
Sludge
Sewage
pump
container
Slug Pipe
Water Pipe
Valve
Sludge pump
Water pump -
Clarifier
Aeration
Equalization Tank
Figure 3.1. The class hierarchy of WWTP
rbod WtUly Isglven b y a h r t . d m v r ;
Unr (1 0.42) (0.53) (46,53)((36.42); oulllne (23.0) n o (23.46) (45, 16) (58.
Figure 3.2. The sludge pump inherits attributes from sludge and pump.
47
This project takes only the most major components in wastewater and product of treatment since the simulation is not the major concern of this project; therefore, only necessary of components in wastewater are selected for the physical and biological treatment in the simulation. Eleven components in wastewater are selected for
development of the simulation (showing on Table 3-1). However, different treatment processes lead to different may add some attributes in the object definition.
ITEM -0SJECT
Figure 3.3. The classes and the class hierarchy of the treatment plant.
Unit Symbol Expression Flowrate Mgallday
Description Typical Value Variation wastewater flowing to the treatment plant
200 300 200 150 155 165
DVS DFS DBOD SVS SFS SBOD DO xs
mg/L mg/L mg/L mg/L mg/L mg/L mg/L mg/L mg/L mg/L
fixed dissolved solids volatile dissolved solids dissolved BOD volatile suspended solids fixed suspended solids suspended BOD dissolved oxygen stored mass (substrate store in microorganism)
set-high-bod WHEN conclude the level-bod is high THEN WHENEVER the mlss M of mlss-at 1 receive a value AND M > set-high-mlss WHEN THEN conclude the level-mlss is high WHENEVER the mlss M of rnlss-at 1 receive a value AND M < set-low-mlss WHEN THEN conclude the level-mlss is low WHENEVER the mlss M of mlss-at 1 receive a value AND M >= set-low-mlss AND WHEN M <= set-high-mlss THEN conclude the level-mlss is normal WHENEVER the mlss S of mlss-sep 1 receive a value AND WHEN S > set-high-recycle-mlss THEN conclude the level-wssc is high WHENEVER the mlss S of mlss-sepl receive a value AND S < set-low-recycle-mlss WHEN conclude the level-wssc is low THEN WHENEVER the mlss S of mlss-sepl receive a value AND S >= set-low-recycle-mlss AND WHEN S <= set-high-recycle-mlss THEN conclude the level-wssc is normal WHENEVER the bod B of bod-at 1 receive a value AND WHEN B < the average value of the bod-at 1 during the last 60 seconds THEN conclude the bod-status is decrease WHENEVER the bod B of bod-at 1 receive a value AND WHEN B >= the average value of the bod-at1 during the last 60 seconds THEN conclude the bod-status is increase
Table 4-1
(Continued)
R16
WHENEVER the mlss M of mlss-at 1 receive a value AND M < the average value of the mlss-at 1 during the last 60 WHEN seconds conclude the mlss-status is decrease THEN WHENEVER the mlss M of mlss-at 1 receive a value AND M >= the average value of the mlss-at1 during the last 60 WHEN seconds conclude the mlss-status is increase THEN WHENEVER the mlss W of mlss-sep 1 receive a value AND W < the average value of the mlss-sepl during the last 60 WHEN seconds THEN conclude the wssc-status is decrease WHENEVER the mlss W of mlss-sep 1 receive a value AND W < the average value of the mlss-sepl during the last 60 WHEN seconds conclude the mlss-status is increase THEN
R17
R 18
R 19
Table 4-1. Rules for the control the sludge recycle flow rate. Mlss-at 1 and bod-at 1 are the MLSS and BOD sensors connection with the aeration tank (atl). Mlss-sepl is the MLSS sensor of the separator (sepl) for waste sludge solids concentration (WSSC).
4.2
Development Hybrid A1 System Controlling Sludge Recycle Rate
The project uses two neural network models: one for predicting the condition of
the aeration tank and another for finding the optimum sludge recycle rate. The inputs of the neural network for prediction are the current condition on aeration tank, inflow, and recycle. The target of the neural network is the sludge recycle rate. When the neural network is trained, using a desired value of the BOD or the MLSS and the present and
67
past inflow condition as inputs, the recycle rate can be found from the neural network output.
Neural Network Model for Aeration Tank
This model is using Ungar's bioreactor model [25]. The neural network for simulation has inputs of substrate (BOD), flow rate, and SS. The outputs are substrate (BOD), flow rate, and SS. The inputs are from the influent and recycling. The simulation model is shown in Figure 4.1. The aeration tank is to digest the substrata (nutrient) contained in wastewater into insert mass. Figure 4.2 shows the inputs and outputs of the neural network for prediction. The inputs of the neural network use the previous condition of the aeration and
Substrate (nutrient), Flow rate Microorganisms Product & Microbes, Flow rate Product (Inset Mass)
Figure 4.1. Diagram of Aeration tank. The substrate comes into aeration tank in the flow rate R. The product and microorganism flow out from aeration tank in the flow rate R. The microbes digest the substrate into product or insert mass [ 2 5 ] .
68
the past and current value of the inflow wastewater and recycle to predict the current condition of the aeration tank. The conditions of the aeration tank are the BOD, the MLSS, and the flow rate. The condition of the inflow wastewater is the BOD, the SS, and the flow rate. The condition of the recycle sludge is the sludge recycling rate, the MLSS, the BOD, and the flow rate. The whole system only uses flow, BOD, and SS sensors for getting input data from the WWTP to the neural network (refer to Figure
4.3).
Before applying a neural network in control, it must be trained for a specific task. The data must be collected and preprocessed before training (refer to Figure 4.4). The raw data sometime are difficult to use for training neural network because the values from sensors are large but the range of the data is small. Therefore, the data pass through a filter (rescale block in Neuron-Line) that shifts and scales data to fit data from positive one to negative one value.
Past Aerator Condition Past & Current Inflow to Aerator Condition Past & Current Recycle Condition
:
Neural Network
Current Aerator Condition
Figure 4.2. The input and out models for a predicting neural network. The blocks in the left are the inputs. The current aeration condition is the outputs.
69
The second step is to select the transfer function and the learning algorithm. In this project, the neural network uses a Sigmoidal Nonlinear function (Equation (4-1) and the Figure 4.5). The neural network always uses nonlinear functions; otherwise it only remembers the training set.
Figure 4.3. Collecting data for training and testing the neural network. The first three blocks on the left are the signals from aeration tank. And the second three blocks are from the primary unit. The rest are from sludge recycle.
1. Data entry point: input data from G2 rules and procedure.
2. Temporal windows: turns time series into a vector of delay values with current value.
3. Vector splitter: separates one vector into two vectors.
4. Vector combiner: combines two vector into one vector.
There is no algorithm good enough to determine how many hidden layers are the best. If there are too few neurons in the hidden layer, the neural network may never learn all patterns; if there are too many hidden neurons, the neural network only remembers the whole training set. Neuron-Line building block (five-fold CV block) is
Figure 4.4. Training and retraining workspace for neural network. Zone 1: collect data set for training and testing. Zone 2: preprocess data for training neural network. Zone 3: train and retrain neural network by expert system or manual. Zone 4: predict the aeration tank condition.
71
used to test how many hidden neurons are appropriate (refer to Figure 4.6). The fivefold CV block implements 5-fold cross validation from the data set; that is, a data set randomizes into five data sets. Each training set (refer to Figure 4.7) has a different training set and a testing set. The output of the training error and testing error is the average of five training errors and testing error. After the number of the hidden layer and the hidden neurons are decided, the network starts to be trained to recognize the pattern of the training set (refer to Figure
4.7). The more operating data of WWTP is collected, the less precise is the prediction
of the output. Therefore, the neural network needs to be trained again. In this case, expert system triggers the training process for neural network (refer to Zone 3 in Figure
4.4).
Figure 4.5. The sigmoidal function. The x range is from from 1 to -1.
+-
to
--
but the y range is
TRAWNING.SST
Data Set
The Neurons in Hidden Layer
Figure 4.6. Test for hidden layers. The nodes on the hidden of each neural network block are from 4, 6, 8, 10, and 12. After testing, the number 10 is selected for nodes in the hidden layer. The root-mean-square errors
(RMSE) from the output of the train and test of the 10 and 12 hidden
neurons are close. But for the calculation concern, the author chose 10 neurons in the hidden layer.
73 The hybrid A1 system is a good way to make the disadvantages of each AI technique disappear. An expert system cannot handle the fuzzy value and neural network is not good at knowledge presentation. Figure 4.8 shows a real application for an A1 hybrid system to control WWTP. Figure 4.9 shows the method for building an A1 hybrid system. The AI hybrid system combines expert systems and neural networks. The expert system generates a value for the sludge recycle rate, then sends it to the neural network
Figure 4.7. Training diagram for neural network
WWTP
Modify Coefficience Neural Network Predict Expert System
Simulator Predict
Control Action
Figure 4.8. An A1 hybrid system diagram for WWTP.
to get the predict value (refer to Figure 4.10). If the predict value is not what the expert system wants, the expert system will generate another value and do it again until it gets
a suitable result.
Embedded Neural Network into Expert Systems for Controlling Sludge Recycle Rate
When the expert system receives the signals from sensors, it checks the condition and concludes a value of the sludge recycle rate (refer to Figure 4.10). Then the expert system sends the value to the neural network (refer to Figure 4.11).
/,
Control ~ c System
WWTP Simulator t i o
h
n Training u Network
Predict
Figure 4.9. An AI hybrid system applies for the control in this project.
'
(
'
)
Expert system
-Control
4
Action
x'(tt1)
b
Neural Network
Figure 4.10. Control architecture of an AI hybrid system applies in WWTP. x(t) is the current condition and x(t+l) is the future condition. x'(t+l) is the predict value of the neural network.
Flowrate BOD
MLSS
10 rmnd8 10 n d 8
Figure 4.11. The predicting of the status of the aeration tank. Recycle is generated by the expert system to the input of the neural network. The expert system change the recycle until the status is expected status is achieved.
The neural network compares the current value and the predicted value to find out if the value is increasing, decreasing, or remaining the same. The reason for using increasing or decreasing is that the output of the neural network is not the same as the actual condition of the WWTP. The expert system has to make a decision to apply this sludge recycle rate or not
by the condition of the current level of the BOD and MLSS and the predict condition in
the aeration tank. I the predict condition is not what the expert system expects, then the f expert system will generate another sludge recycle rate and test it again. Figure 4.12 shows the rules to test the predict condition from the neural network and whether to apply the sludge recycle rate or not. In second approach, the expert system gives a short-term target to neural network to get the optimum sludge recycle value. The structure of the second approach is the same as in Figure 4.10; the only difference is the input and the output from neural
if use-hybrid is not yes then start test-neural0
if use-hybrid is yes then abort test-neural
whenever test-fbwrate receives a vabe and when testb a t e > then conclude that test-fbwrate-status is O increasing whenever t e s t - M a t e receives a vahe and when testb a t e <=O then conclude that test-flowrate-status is
whenever test-recycle receives a value then conclude that neural-recycle-rate = test-recycle
whenever test-mlss receives a value and when test-mlss <=I200 then conclude that the dp-out of recycle -min(l.the dp-out of recycle "1.1)
test-bod receives a value and when test-bod <=O then conclude that test-bod-status is decreasing
whenever the bod B of bod-aH receives a value and when B > set-high-bod and use-hybrid is yes then conclude that the dp-out of bod-nn = set-high-bod
whenever test-mlss receives a value and A e n testmlss>O then conclude that test-mlss-status is increasing whenever test-mlas receives a value and when test-mlss <-0 then conclude lhat test-mlss-status is decreasing
when M > set-high-mlss and status-bod is nonnal and use-hybrid is yes then conclude that the dp-out of
when M< set-lav-mlss and status-bod is normal and use-hybrid is yes then conclude that the dp-out of mlss-nn = set-bw-mlss
Figure 4.12. The rules for combining expert system and neural network.
network. If the expert system want to increase the concentration of the BOD in aeration tank, it sends a current concentration value of the BOD plus a small value such as 0.05
as a target. The neural network will predict a sludge recycle value and send it to the
expert system. RULE 20 shows that the expert system triggers the neural network when
"the BOD-status is decrease AND level-MLSS is normal AND level- WSCC is normal" is
true (refer to Table 4-2). RULE 21 is to send the value generated by neural network to the WWTP.
Rule 20
IF
BOD-status is decrease level-MLSS is normal level-WSCC is normal
AND AND
THEN AND Rule 21 THEN
conclude that target-BOD = the BOD of bod-at1 + 0.05 conclude that the dp-out of BOD-nn = target-BOD recycel-bod-nn receive a value conclude that the sludge-recycle-rate = recycel-bod-nn
WHENEVER
Table 4-2. The Rules is used to communicate the expert system with neural network.
CHAPTER 5
RESULTS
In this chapter, the author will discuss the results from the preliminary unit to the
secondary unit and different control methods applying in the secondary unit. The results were generated by two different control algorithms with the typical inflow wastewater of one day to help the evaluation of the advantages and disadvantages of each algorithm. The control system maintains the concentration of the microorganisms in the aeration tank to digest the dynamic concentration of the BOD flowing from the primary unit. The results were compared in order to demonstrate which system better handles the critical states such as the high concentration of the BOD at the aeration tank. The results are shown from the simulation first controlled by the expert system and second by the neural networks that learn the pattern of the plant's conditions. Figure 5.1 shows that the treatment process data collect from which point in the WWTP. Point A is the influent wastewater flowing to the WWTP. Point B is the wastewater treated by the physical treatment (the preliminary unit and the primary unit). Point C is the condition of the condition of the complete-mixed aeration tank. Point D is the sludge recycle rate. Point E is the characteristics of the effluent wastewater.
P
Equalization Tank
Primary Unit
Aeration Tank
9
Secondary Clarifier
River
-
A
0
-Recycle
Sludge--
Figure 5.1. The five sample points (A, B, C, D, and E) are to monitor the wastewater treatment process.
5.1
The WWTP Simulation Result. Before Flow into Aeration Tank
The simulation results from a sewage system are discussed after physical
treatment. The simulation functions of the inflow wastewater are based on Figure 1.1 and Figure 1.2 and assumed periodic simulation with a period of one day. The daily loading, inflow rate, BOD, and SS, dynamically change from time to time. The flow rate of the domestic wastewater from the sewage system to the WWTP changes with time based on the water consumption with a lag of several hours. The concentration of the biochemical oxygen demand and the suspended solids change from time to time, and their peak values do not appear at the same time. The A1 hybrid control system is based on the average flow rate of one day. However, the average of the flow rate, the concentration of the BOD, and the concentration of the MLSS are different every day of a week. If the A1 hybrid control system were applied to a system for an entire week of the simulation wastewater, the
81
only thing that needs to be changed would be the average flow rate. The neural network simulating the reaction in the aeration tank is based on the inflow condition and the aeration tank condition; therefore, the A1 hybrid system can operate within the range of the historical data that is used to train the neural network. The only concern in applying the A1 hybrid system in control is whether the condition of the process is within the data sets available to train neural network or not. Another reason to use simulation influent wastewater with a period of one day compares easily the control results in the expert system and the A1 hybrid system. Figure 5.2 shows the influent (bold line) and effluent wastewater of the treatment plant on a two-day fluctuation. The range of the inflow rate of the wastewater is from 1.5 to 7 MgaVday and the average flow rate is 4 MgaVday. Therefore, the water pump connected to the primary unit pump the wastewater at 4 Mgal/day to the primary unit. The effluent wastewater of the primary unit is the average flow rate minus the flow rate of the primary sludge removed to the sludge treatment unit. Figure 5.3 shows the simulation value of the concentration of the BOD (bold line) and the SS inflow to the WWTP on a two-day fluctuation as well. The range of the concentration of the SS and the BOD fluctuates from a value higher than 700 mg/L to around 100 mg/L. The flow rate of the domestic wastewater from the sewage system to the WWTP changes from hour to hour based on the water consumption with a lag of several hours which is the wastewater flowing from residence to the treatment plant.
82 Figure 5.4 shows the concentration of the BOD (bold line) and the SS inflow into aeration tank on two-day fluctuation. After equalized and physically treated, the wastewater flowing to the secondary unit has a fixed flow rate and a smaller range of the BOD and SS. The range of the concentration of the BOD is from 259 to 278 mg/L and for the SS is from 101 to 116 mg/L after wastewater was equalized by the preliminary unit and treated by the primary unit. Comparing the peaks of BOD and SS in Figure 5.3 and Figure 5.4, the delay time of Figure 5.4 is the hydroid retention time of the equalization tank plus the hydroid retention time of the primary clarifier. Comparing the BOD peaks in Figure 5.4 from the first day to the secondary we notice lower peak on the second day due to equalization.
lnluent and Eiluent Flow Reto
MgaVday
7.0
6.0
5.0
4.0
3.0
2.0 1.o 1200OOam
120000 a m. the lowate of wl-inFLOW the flowate of imate-2
A
Figure 5.2.
The influent flow rate (bold line) and effluence flow rate of the simulation wastewater in the WWTP (collect data form Point A and Point E at Figure 5.1).
s,..s
Inflow of SS and BOD
..
mg/L
...... . .....-.............. . ..
................................................. . ... ................... ......................................... .....
8 .OOe2
,
12aO:OOam. the bod of wpl-bod the tss of vql-tss 12:00.00am.
Figure 5.3. The simulation value of the concentration of the SS and the BOD (bold line) inflow to the WWTP (collect data form Point A at Figure 5.1).
5.2
The Simulation of WWTP Controlled by the Expert System
The expert system approach is based on setting BOD and MISS at a certain
level that is controlled by an operator. The sludge recycle rate is changed whenever the expert system finds a value for BOD, MLSS, or WSSC (refer to RULE 1 to RULE 19 in Table &I), which is not within the acceptable regions that were set at the control panel (refer to the upper part of Figure 5.5).
The concentration of SS and BOD lnluent t to Aeration Tank 2.8082
2.75 82
2.7082
2.6582
2.6082
2/18 0.00 the bod of TOAR-BOD the tss of TSS-1
2/19 0 a 0
mg/L
Figure 5.4. The concentration of the BOD (bold line) and the SS flow to the aeration tank without the recycled sludge (collect data form Point B at Figure
5.1).
The control actions from the expert system will decrease or increase the sludge recycle rate in order to reach the value of the BOD, the MLSS, or the WSSC set by an operator. If the level of the BOD or the MLSS is increasing or decreasing from the desired value, the expert system would not make any change in the sludge recycle rate. Furthermore, when the inflow wastewater changes, the expert system could not respond immediately to change the sludge recycle rate. Because the expert system increases or decreases 5% of the recycle rate every time a procedure is called to change the recycle rate. I the expert system wants to f
85 increase the recycle rate from 0.5 to 0.8, it will need to fire the rules 10 times. Each time the rules fire the recycle rate is increased by a small amount (5%) because (0.5)(1.05)" = 0.8 a x = 10. That is the reason for the delay. Figure 5.5 is the control panel for monitoring and controlling the treatment process. The control panel has four components: choosing control methods, the
condition of the treatment process, the normal operation range, and the plant condition within 6 hours. An operator can set the range of the concentration of the MLSS, the BOD, and the WSSC to make the effluent wastewater reach the effluent permissions as well as the control methods: a manually, by an expert system, or by a neural network. The seven figures under the set point for the BOD, the MLSS, and the WSSC are as a reference for the operator to monitor the treatment process. The condition of the treatment process shows the status of the pumps, the food to microorganisms (FM), and the current and predicted condition of the aeration tank. Figure 5.6 shows the concentration of the BOD at aeration and the sludge recycle rate controlled by the expert system. The range of the concentration of the BOD is from 23 to 26 mgL.
HlsIomd daawlthln 2 days
System mwrce
~orkspace 2
1 ~ 0
p 07 r
734% am Ocycle Sludge W s
0 Menud Control
00 10
@ Conventlona
Control
0 Neurd Network Contro! - 1 1 0 USE RULES
@ Without
RULES
1-1
1-
n v h m e r w ~ s z ~ ~ ~ ~ /lmw~~rm~m1*61.11
1
The set value to Control the Fecycle
M ..I
n r n M l8lllSD
WO n .0m*lr124017 Hqh BOD ~nAernlion 00 50 0
H q h MLSS m Aernllon
600
1500
5000
Hlgh MCSS ln m c y cte
1100
8030
5000 Low MLSS in k y c l e m o
10300
800
LOWMLSS ~nAsrnllon 850
-
25 0
.
10000
Fbcys*
Pdp.
mu
10
I
I V
I
00
;
IZWWO~
400m0m
l00OO~m s w - r c * ns Aeration Tmn Condltlon
120000.m
40000.m Etluent To The PNer
80000 am
Inflow Waslewder Character
h a bod 01w
4OOWam lk d
12Wm.m
6woonm
12mm.m
6moa.m
h bod 01 WC-2 .
Figure 5.5. The control panel to set the desired values of the concentration of the BOD, the MLSS, and the WSSC. The bottom figures show the operation and condition charts.
87 The curse of the sludge recycle rate is classified into two patterns: dynamic and stable. When the concentration of the BOD inflow to aeration tank is less than the average of the concentration of the BOD inflow to the aeration tank, the sludge recycle rate is almost constant. When the time is close to midnight, the expert system detects that the concentration of the BOD in the aeration tank is increasing. Then the expert system increases the sludge recycle rate to decrease the concentration of the BOD at the aeration tank. Figure 5.7 shows the concentration of the MLSS at the aeration tank. The range of values for the concentration of the MLSS is from 805 to 970 mg/L.
s+~rgrb-
BOD
in Areation Tank and Sludge Recycle Rate
BOD
35.0 33.0 31 .O
4.0
3.0
29.0 27.0 2.0 25.0 23.0
1.o
21.0
19.0
17.0 0.0 12:00:00 a.m.
the bod of bod-at1 sludge-recycle-rate
15.0 12:OOQO a.m mg/L
-
Figure 5.6. The sludge recycle rate controlled by the expert system and the concentration of the BOD at aeration tank (collect data form Point C and Point D at Figure 5.1).
M LSS in A eration
9.7582
12.90:00 am. the miss of dss-at1
1 2:00:00 a.m.
m@L
Figure 5.7. The concentration of the mixed-liquid suspended solids (MLSS) at the aeration tank (recycle sludge rate controlled by the expert).
he points A to F in Figure 5.6 and Figure 5.7 are identical and are used to explain the action of the expert system. Point A to Point B represent the time the expert system wanted to get the minimum value of the MLSS, 850 mg/L (refer to RULE 2 in
-) Table 4 I ,in the aeration tank. The MLSS was increasing on the sludge recycle rate,
0.676; therefore, the expert system did not change the sludge recycle rate. At Point B,
the MLSS reached 850 mg/L but the BOD was increasing and below 25 m a . The expert system did not change the sludge recycle rate. At Point C, the BOD was below
25 mg/L and decreasing.
89 The expert system decreased the sludge recycle rate to make the BOD increase. From Point D to Point E,the expert system wanted to keep the MLSS at the minimum value, 850 mg/L (refer to RULE 2 in Table 4-1). From Point E to Point F, the BOD was increasing and below 25 mg/L as well as the MLSS was higher than 850 mg/L and increasing; the expert system did not need to change the sludge recycle rate. The expert system is still in control after Point F (refer to Figure 5.8 that zooms from Figure 5.6 and Figure 5.7 after Point F). The reason for the recycle rate instability is that the expert system increases the recycle rate @ to increase the concentration of
MLSS O in the aeration tank to digest the increasing BOD O flowing to the aeration
tank when the BOD influent to aeration increases. When BOD increases faster than the microorganisms can digest, the expert system keeps increasing the recycle rate to make the microorganisms able to digest the extra amount of the BOD. When the BOD stops increasing Q or when the recycle rate reaches to first peak after Point F, the expert system stops controlling the recycle rate @. However, the MLSS may increase too much Owhen BOD starts decreasing. When BOD decreases below 25 mg/L 0 , the expert system starts decreasing the recycle rate Q to make MLSS decrease @ that will make BOD increase. Eventually, the recycle rate will decrease to about 0.3 (see flat
D valley) C to make the aeration tank BOD increase forward to 25 mg/L @. That is why
the system becomes unstable when the BOD is increasing. Figure 5.9 shows the condition of the effluent wastewater to the river. The range of the concentration of the BOD is from 20.05 to 21.3 mg/L and the SS is from 7.4 to 9.7 mg/L. This figure will be used for comparing with the A1 hybrid system.
Figure 5.8. This figure is zoom from Figure 5.6 and Figure 5.7 to show the expert system is still in control after Point F and why every thing become unstable.
53 .
WWTP Controlled by the A1 Hybrid System
The first approach of the A1 hybrid system (refer to pp. 75) did not work since
the response of the A1 hybrid system was faster than the biological reaction. When the
91
OuHow of SS and BOD
--- -
20.0
17.5
15.0
12.5
10.0
7.5
12:00:00 a.m. 1200:OO am.
the bod of bod-2 the tss of tss-2
mg/L
Figure 5.9. The concentration of the BOD and the SS (bold line) in the effluent wastewater to the river (from Point E at Figure 5.1).
A1 hybrid system applied a new sludge recycle rate in the treatment process, the
condition of the aeration tank could not respond immediately. Therefore, the expert system will keep increasing or decreasing until the sludge recycle rate is 1 or 0. The neural network control is active whenever the neural network is selected in the control panel (refer to upper part of Figure 5.5). I the levels of concentration of the f BOD and the MLSS in the aeration tank are normal such as BOD under 25 m a and
MLSS between 850 to 1100 m a , the scope of the neural network is to make the
concentration of the BOD increase to the set-point (25 m a ) . Otherwise the job of the neural network is to make the concentration of the BOD decrease to the set-point. The
A1 hybrid system activates the neural network when the expert system finds the level of
92 the BOD or the MLSS is going outside the range. The neural network will produce a sludge recycle rate based on which status (BOD or MLSS) is not normal since the neural network does not know what critical state will occur such as MLSS under 850 mg/L or BOD greater than 25 mg/L. Figure 5.10 and Figure 5.11 are used to compare the control system using the expert system and the A1 hybrid system. Figure 5.10 shows the behavior of the sludge rate as different control systems are used. The operation switches to the neural network at Point E. Figure 5.11 continuous of Figure 5.10 shows the fluctuation of the sludge recycle rate controlled by the A1 hybrid system. These two figures are to show that the hybrid system has a quick response to the dynamic change of the BOD inflow to aeration tank. The cost effective is to compare the WWTP controlled by A1 or without AI. Since most of the treatment plants use fixed recycle rates, it means they are using a large
Figure 5.10. The control system for the sludge recycle rate is switched from the expert system to the A1 hybrid system. Before Point D, the expert system controlled the sludge recycle rate. Between Point D and Point E, the control system mixed the expert system control with manual control. After Point E, the control system for the sludge recycle rate is the A1 hybrid system.
Figure 5.11. The sludge recycle rate as it is controlled by the A1 hybrid system. Points
F on both Figure 5.10 and Figure 5.11 are identical. Figure 5.11 is a
continuation of Figure 5.10.
MLSS to digest the maximum BOD. When the BOD in the aeration tank is decreased, the system still maintains the high concentration of the microorganism. Therefore, the fixed recycle rate is wasting energy in maintaining a high concentration. Point A to Point B (refer to Figure 5.10) and Point G to Point H (refer to Figure 5.11) shows the sludge recycle rate controlled by the expert system first and the neural network next. After the WSSC was normal, the expert system of the hybrid system found that the BOD was normal and decreasing. Then the control system decreased the sludge recycle rate to make the BOD increase. In the case where the sludge recycle rate was controlled by the neural network, there are several step changes because the expert system activates different neural network controls from BOD to MLSS or from MLSS to BOD.
In Figure 5.12, Point X shows when the control system is switched to the hybrid
system. Comparing the expert system (Point W to Point X) and the A1 hybrid system
94
(Point Y to Point Z) that shows the AI hybrid system has the ability to release the critical condition in a shorter time. Since the expert system can not predict or know how much sludge recycle rate will be enough when the control system wants BOD from increasing to decreasing. The expert system increases the sludge recycle rate until the condition of the aeration tank is increasing or decreasing to the desired values set at the control panel (refer to upper part of Figure 5.5). On the other hand, the neural network
can get the closest value of the sludge recycle rate based on the desired value which is
the input from the expert system although the condition of the aeration tank is not suitable at that time. Such as the BOD is still less than 25 mg/L and decreasing (refer to Point K in Figure 5.1 1 and Figure 5.12). The AI hybrid system relies mainly on the neural network to find the optimum sludge recycle rate. However, the neural network needs the expert system to input the various data and to present various outputs. Comparing the range of the BOD in the effluent wastewater when different control systems were used, it was found that the range of the BOD controlled by the expert system is 20.05 to 21.3 m g L m d for the A1 hybrid system is 20.6 to 21.5 mg/L (refer to Figure 5.13). The ranges of the SS in the two control systems are almost identical. On the other hand, the A1 hybrid system can get more exact sludge recycle rates to release the critical conditions. Therefore, the concentration of the BOD in the effluent wastewater has a smaller range (the expert system is 1.25 mg/L and the A1 hybrid system is 0.9 mg/L). Both the A1 hybrid system and the expert system are a good controls; however, Other factors such as knowledge
95
acquisition not required in the hybrid system make it much more attractive than the expert system. Point A to Point B (refer to Figure 5.10) and Point G to Point H (refer to Figure 5.11) shows the simulation control pattern where the time from Point W to Point P is longer than the time from Point Y to Point Q (refer to Figure 5.12). The effluent BOD controlled by the expert system dropped down to 20.05 mg/L (refer to left part of Figure 5.13) and only dropped down to 20.6 mg/L by A1 hybrid system. The range of the effluent BOD controlled by the expert system and the A1 hybrid system (refer to Figure 5.13) proves the neural network as having better control over the
Figure 5.12. The chart of the BOD at aeration tank and the sludge recycle rate (from Point C at Figure 5.1). At Point X, the control system switches to the
A1 hybrid system. The time from Point W to Point X is longer than
the Point Y to Point Z.
96 sludge recycle rate. Since the A1 hybrid system can rapidly increase the recycle rate to release the critical condition (WSSC is low) quicker than the expert system did, the A1 hybrid system makes the range of the effluent BOD smaller. In order to make the process operate normally, the expert system for controlling the WWTP relies on both monitoring the condition of the treatment process and adjusting the sludge recycle rate. However, it can not immediately find an optimum sludge recycle rate. Therefore, the expert system changes the recycle rate by a small amount every time the rules fire until the condition of the treatment process is normal. To overcome the weakness of the expert system in controlling the sludge recycle rate, the hybrid system uses the neural network to get an optimum sludge recycle rate from the beginning of the process. Therefore, the condition of effluent wastewater controlled by the A1 hybrid system has a smaller range of concentration of the BOD. On the other hand, any manual control needs a well-trained operator to operate the treatment process and uses more energy to reach the effluent permission. Aeration Tank Unit (mg/L) Highest Expert system 25.9 23.2 1.7
A1 Hybrid
Effluent Wastewater Expert system 2 1.30 20.05 1.25
A1 Hybrid System 21.5
System 26.0 23.2
1.8
BOD
Lowest Range
20.6 0.9
Table 5-1.
Comparing the range of the BOD in aeration tank and in the effluent wastewater control by the expert system and the A1 hybrid system.
ss
Oublow of SS and 80D
9
12BO:00 am. the bod of b d - 2 !4le tss of tss-2
12S10!JOa.m
mg/~
Figure 5.13. Comparing different control systems with the range of the BOD (from Point E at Figure 5.1). After Point I, the treatment process was control by the AI hybrid system. The range of the BOD controlled by the expert system is 1.25 m g L and by the AI hybrid system is 0.9 mg/L.
5.4
Apply A1 Hybrid System with a Peak Loading
The simulation of the sewage source was modified from 4:00PM to 8:00PM, to
follow the activities of a football game that starts at 4:00PM and stops at 8:OOPM. At time 6:00PM, flow rate, SS, and BOD have maximum values due to the half-time increasing activities. Figure 5.14 and Figure 5.15 show the changes of the wastewater source. Figure
5.16 shows the concentration of BOD and SS flow to aeration tank. Figure 5.17 shows
the concentration of the MLSS in aeration tank. Figure 5.18 shows the sludge recycle
98
rate and the concentration BOD. After 4:00PM, the system is very sensetive and it changes very often. Although there is a peak loading from the sewage system, the equalization tank and the primary unit equalize BOD and SS. Figure 5.19 shows the concentration of BOD and SS flow to river. The input of the neural network is from the output of the primary unit. To conclude, The A1 hybrid system takes the benefits of both the expert system to monitor and the advantage of the neural network to control. The A1 hybrid system uses the advantage of the expert system to monitor the process and the advantage of the neural network to get the optimum sludge recycle rate for control the MLSS and the
BOD in the aeration tank.
Figure 5.14. Influent (Point A at Figure 5.1) and effluent wastewater (data from Point D at Figure 5.1). Comparing with Figure 5.2, there is a peak loading at 6:OOPM.
Figure 5.15. The concentration of BOD and SS in effluent wastewater (data from Point A at Figure 5.1). peak loading at 6:00PM. Comparing Figure 5.3, both BOD and SS have a
ss
m*
110.2
T. h
0aonb.M
d SS n d 800 lnlunl t l o A e n b n T n L Boo
mon
200.2 2.
ls .. t2
2.8-2
1.10.2 27105.2 270.1
1.0.2
2 2.80.2
950 2 Ul7000 UIBWO
Figure 5.16. The concentration of the BOD and the SS collected from Point B (refer to Figure 5.1). Comparing with Figure 5.4, both at BOD and SS have peak values at around 7:OOPM.
Figure 5.17. The concentration of the MLSS at aeration tank (data from Point C at Figure 5.1). After 5:00PM, the value of MLSS dynamically changed.
800 n A - r a
40
Tmk md Sudp R s y s h R b
BOD
30
20
19
00 1 2 m W am
Figure 5.18.
The recycle rate (from
Figure 5.19. The effluent of the SS and the BOD (data from Point E at Figure 5.1).
Point D) and the concentration of the BOD at aeration tank (data from Point C at Figure 5.1).
CHAPTER 6 CONCLUSIONS
The main propose of this thesis is to apply an A1 hybrid system to a wastewater treatment plant, a prototype simulation model for testing, and build an on-line automatic control strategy. G2, an expert system shell for developing and running real-time expert systems for complex applications requiring continuous and intelligent monitoring, diagnosis, and control was used for the implementation. The control techniques, such as expert systems, neural networks, and A1 hybrid systems (expert systems combined with neural networks), are powerful tools. They can be applied to control treatment
processes that are poorly understood or difficult to model with traditional control methods. This thesis extends Chapman's [26] idea for applying a real-time expert system shell to monitor and operate WWTP processes. The next generation of A1 hybrid techniques for wastewater treatment will have the ability of on-line learning and reduce the operators' works in the wastewater treatment plants. However, if no real-time expert system like G2 were available, it would have been impossible to perform a control action in real time with either an expert system or a neural network. The current knowledge base on wastewater treatment is still limited, and therefore A1 hybrid
101
architecture, for diagnosis, prediction, and control of a wastewater treatment process could be employed to improve the operation of the treatment process. An expert system presents knowledge from sources that can be understood and applied, but neural networks can derive the hidden information and knowledge from data records that no available model can use. To have the expert perfect automatic control, the developer would need to get all features that cause abnormalities in the process. If the developer builds a knowledge base for an individual WWTP, that knowledge base could not apply in a different WWTP. The simulation in this thesis is a prototype model simulating physical and aerobic treatment not including chemical and nitrate treatment. With the assistance of the simulation, control actions can be evaluated and refined in real plant operation. The manual control of the simulation in this program could be also used as a tool for training the operator of WWTP. For the automatic control, the expert system monitors on-line the condition of each piece of treatment equipment, such as pumps and tanks, and restores the aeration tank's normal performance after overloading or underloading with microorganisms. Although the A1 hybrid models presented are derived from the simulation data, and are somewhat different from a real treatment plant, these techniques can be applied readily for any treatment plant. What is different in applying an A1 hybrid technique for a different WWTP is the historical data for training the neural network to predict and control in that different WWTP. However, lack of historical operation data may cause a failure of the neural network to learn the pattern of the process.
102
For future research, the wastewater treatment system should apply A1 techniques to the design or redesign of wastewater treatment plants and add automatic diagnosis of the influent wastewater to adjust the operation in different kinds of wastewater treat plants. For future A hybrid systems applying in the WWTP, there should be a I
prediction capacity NN for predicting the character of inflow water; and the expert system adjust the concentration of the microorganisms in aeration to reach the concentration of the influent substrate. The A1 hybrid system will be a necessary tool wherever the operator is not available or is off duty.
REFERENCES
[I] A. R. Witt, "Steady-state And Dynamic Modeling And Simulation of an Treatment Plant," Ph.D. Dissertation, Vanderbilt University, Nashville, Tennessee, 1995. [2] B. J. Kim, J. T. Bandy, K. K. Gidwam, and S. P. Sheiton, "Artificial intelligence for U.S. Army Wastewater Treatment Plant Operation and Maintenance,"
USA-CERL technical report; N-88/26, Champaign, Ill.: US Army Corps of
Engineers, 1988.
[3] G. Tchobanoglous, Wastewater Engineering: treatment, disposal, and reuse, 3rd
ed., Metcalf & Eddy, 1991. [4] S. Haykin, Neural Network, MacMillan College Publishing Company, 1994. [5] J. J. Geselbracht, "Issues in Rule Base Development," Journal of Water Resources Planning and Management, American Society of Civil Engineers, New York, N.Y., July 1988. [6] C. D. Perman and L. Ortolano, "Testing a prototype expert system for diagnosing wastewater treatment plant operating problems," Expert Systems in Environmental Planning, Springer-Verlag Berlin Heidelberg, New York, 1993.
[7] W. Tanthapanichakoon, D. M. HirnmelBalu, "Simulation of A Time Dependent
Activated Sludge Wastewater Treatment Plant," Water Research, Vol. 15, pp. 1185-1 195, Pergamon Press, Great Britain, 1981. [8] S. Krovvidy and W. G. Wee,
"
An Intelligent Hybrid System for Wastewater
Treatment," Hybrid Architectures For Intelligent Systems, Chapter 17, PP.
357-377, CRC Press, Boca Raton, FL, 1992. 191 Z. Boger, "Application of Neural network to Water and Wastewater Treatment Plant Operation," ISA Transactions, Vol. 3 1, Number 1, 1992. [lo] M. CBtC, B. P. A. Grandjean, P. Lessard, and P. Thibault, "Dynamic Modeling Of the active sludge process: Improving Prediction Using Neural Network," Water Resource, Vol. 29, No. 4, pp. 995-1004, Elsevier Science, Great Britain, 1995. [ l l ] A. G. Capodglio, H. V. Jones, V. Novotny, and X. Feng, "Sludge Bulking Analysis And Forecasting: Application Of System Identification And Artificial Neural Computing Technologies," Water Resource, Vol. 25, No. 10, pp. 1217-1224, Pergamon Press, Great Britain, 1991. [12] S. J. Wilcox, D. L. Hawkes, F. R. Hawkes, and A. J. Guwy, " A Neural Network, Based On Bicarbonate Monitoring, To Control Anaerobic Digestion," Water Resource, Vol. 29, No. 6, PP. 1465-1470, Elsevier Science, Great Britain, 1995. [13] S. Shiba and Y. Inoue, "Dynamic Response of Settling basins," Journal O The f Environmental Engineering Division, ASCE, Vol.101, No. EE5, October 1975. [14] A. Holmberg, "Modeling of the Activated Sludge Process for MicroprocessorBased State Estimation and Control," Water Resource, Vol. 16, pp. 1233-1246, 1982. [15] D. P. Chynoweth, S. A. Svoronos, G. Lyberatos, J. L. Harman, P. Pullarnrnanappallil, J. M. Owens, and M. J. Peck, "Real-time expert system control of anaerobic digestion," Water Science Technology, 30 (12), pp. 2 129, 1994.
[16] R. Laukkanen and J. Pursiainen, "Rule-based expert systems in the control of wastewater treatment systems," Water Science Technology, 24 (6), pp. 299306, 1991. [I71 W. Lai and P. M. Berthoues, "Testing expert system for activated sludge process control," Journal of Environmental Engineering, 116(5), September 1990. [18] P. M. Berthouex, W. Lai, and A. Darjatmoko, "Statistics-Based Approach to Wastewater Treatment plant Operation," Journal of Environment
Engineering, Vol. 115, No. 3, June 1989. [I91 T. M. Yin, W. Yaun, M. K. Stenstrom, and D. Okrent, "A simulator-~nhanced Expert System for the High-purity Oxygen Activated Sludge Process. " Water Environment Federation, Alexandria, VA, 1994. [20] P. M. Berthouex, W. Lai, and A. Darjatmoko, "Statistics-based approach to wastewater treatment plant operations," Journal of Environmental
Engineering, 115 3, June 1989. [21] G2 Reference Manual, Version 4.0, Gensym, MA, 1995. [22] J. C. Giarratano and G. Riley, Expert Systems: principle and programming, International Thomson Publishing, 1993. [23] R. Laukkanen and J. Puriainen, "Rule-based Expert Systems In the Control of Wastewater Treatment Systems," Water Science Technical, Vol. 24, No. 6, pp. 299-306, LAWPRC, Great Britain, 1991. [24] A. Kandel and G. Langholz, Hybrid Architectures for Intelligent Systems, CRC Press, Boca Raton, FL, 1992. [25] L. H. Ungar, "A Bioreactor Benchmark for Adaptive Network-based Control" in
Proceedings of the 1988 NSF Workshop on Neural Networks for Robotics MIT Press, 1990.
[26] D. Chapman, G.G. Patry, Dynamic Modeling and E x ~ e r Svstems in Wastewater t
Engineering, Lewis Publishers, Chelsea, Michigan, 1989.