pai2007
pai2007
Received 6 July 2006; received in revised form 15 October 2006; accepted 23 October 2006
Available online 28 November 2006
Abstract
Grey model (GM) and artificial neural network (ANN) was employed to predict suspended solids (SS) and chemical oxygen demand (COD)
in the effluent from sequence batch reactors of a hospital wastewater treatment plant (HWWTP). The results indicated that the minimum mean
absolute percentage errors (MAPEs) of 23.14% and 51.73% for SS and COD could be achieved using genetic algorithm ANN (GAANN). The
minimum prediction accuracy of 23.14% and 55.11% for SS and COD could be achieved. Contrarily, GM only required a small amount of data
and the prediction accuracy was analogous to that of GAANN. In the first type of application, the MAPE values of SS for model prediction using
GM (1, N) and GM (1, 2) lay between 23.14% and 26.67%. The MAPE values of COD using GM (1, N) were smaller than those of GM (1, 2). The
results showed that the fitness was good for both GM (1, N) and GM (1, 2) to predict SS. However, only GM (1, N) was better for COD prediction
as comparing to GM (1, 2). In the second type application, the MAPE values of SS and COD prediction using GM (1, 1) and rolling GM (1, 1)
(RGM, i.e., 8 data before the point at which was considered to be predicted were used to construct model) lay between 24–28% and 37–52%,
respectively. Furthermore, it was observed that influent pH has affected effluent SS and COD significantly. It suggested that if the influent pH could
be adjusted appropriately, a better effluent SS and COD could be obtained.
© 2006 Elsevier Ltd. All rights reserved.
Keywords: Grey model; Artificial neural network; Hospital wastewater treatment plant; Continuous sequence batch reactor
0098-1354/$ – see front matter © 2006 Elsevier Ltd. All rights reserved.
doi:10.1016/j.compchemeng.2006.10.012
T.Y. Pai et al. / Computers and Chemical Engineering 31 (2007) 1272–1281 1273
data. In order to gain consistent results from the monitoring Solving the differential equation will yield a time response solu-
data and predict the complete wastewater effluent trend, the grey tion for prediction. Through inverse accumulated generating
system theory (GST) is an appropriate method. operation (IAGO), the forecast can be transformed back to the
The GST proposed by Deng (1989) can resolve the problem sequence of original series. A grey modeling process is described
of incomplete information and data and has gained many signif- as follows.
icant and effective results. Overall speaking, system behavioral Assume that the original series of data with n sam-
data often does not follow a particular pattern and it changes ples is expressed as: X(0) = (x(0) (1), x(0) (2), . . ., x(0) (n)), where
unpredictably according to its circumstances. For this kind of the superscription (0) of X(0) represents the original series.
dispersed data, regression analysis or mathematical statistics Let X(1) be the first-order AGO of X(0) , whose elements
are most commonly used to analyze them. The downside of are generated from (0) (1) (1) (1) (1)
k X(0) : X = (x (1), x (2), . . ., x (n)),
this method is that it requires a very large sum of data. If there where x (k) = i=1 x (i), for k = 1, 2, . . . , n. Further oper-
(1)
is not sufficient amount of data, functions will not be correctly ation of AGO can be conducted to reach the r-order AGO
calculated and this statistical summary will not lead to a good series, X(r) : X{r} = (x(r) (1), x(r) (2), . . ., x(r) (n)), where x(r) (k) =
k (r−1) (i), for k = 1, 2, . . . , n. The IAGO is the inverse
result. On the contrary, GST focuses on the relational analysis, i=1 x
model construction, and prediction of the indefinite and incom- operation of AGO. It transforms the AGO-operational series
plete information. It requires only a small amount of data and back to the one with a lower order. The operation of IAGO
the better prediction results can be obtained. for the first-order series is defined as follows: x(0) (1) = x(1) (1)
There are many analysis methods in GST. Grey model and x(0) (k) = x(1) (k) − x(1) (k − 1) for k = 2, 3, . . ., n. After extend-
(GM) can be used to establish the relationship between many ing this representation to the IAGO of r-order series, we have
sequences of data and its coefficients can be used to evaluate x(r−1) (k) = xr (k) − xr (k−1) for k = 2, 3, . . ., n. The tendency of
which sequence of data affects system significantly. In environ- AGO can be approximated by an exponential function. Its
mental management, there were many environmental indices dynamic behavior is like a form of differential equation. The
and monitoring data. If the significant variation trend could be grey model GM (h, N) thus adopts an n-order differential equa-
evaluated, a better control strategy could be sought. Chang and tion to fit the AGO-operational series. The parameters h and N
Wang (1995) used the grey nonlinear programming approach in GM (h, N) denotes the order and the number of variables con-
to plan coastal wastewater treatment and disposal systems. Wu cerned in the differential equation, respectively. The GM (h, N)
and Chang (2003a, 2003b, 2004) adopted GST and applied it on can be generally expressed as
environmental optimization. However, few studies using GM
have been done on effluent quality prediction in HWWTPs. The
h (1)
d (i) x1
N
objective of this study is to use GST to establish the effluent SS ai =
(1)
bj xj (k) (1)
and COD characteristics of a HWWTP in which the continuous dt (i)
i=0 j=2
sequence batch reactor (CSBR) process was applied, and then
the effluent quality was predicted. For comparison, ANN was
also employed to predict the effluent in this study. where the parameter a is the developing coefficient and b is
the grey input. In this study, four different types of GM were
2. Materials and methods adopted, i.e. GM (1, N), GM (1, 2), GM (1, 1) and rolling GM
(1, 1) (RGM (1, 1)).
2.1. Treatment process GM (1, N). According to the definition of GM (h, N), GM (1,
N) is that the order in grey differential equation is equal to 1 and
The CSBR ASP was adopted in this HWWTP. The flow rate defined as follows:
was 200 cubic meters per day (CMD) and the effective volume
of aeration tank was 190 m3 . The influent and effluent quality
N
(0) (1) (1) (1)
from 3rd of June 2002 to 27th of June 2003 was investigated. x1 (k) + az1 (k) = bj xj (k) = b2 x2 (k)
They were sampled and investigated every 2–3 days. The influent j=2
quality items included pH, temperature, SS and COD. The efflu- (1) (1)
ent quality items included SS and COD. All analytical methods + b3 x3 (k) + · · · + bN xN (k) (2)
used in this study were according to standard method (APHA,
1995). (1) (1) (1)
where z1 (k) = 0.5x1 (k − 1) + 0.5x1 (k), k = 2, 3, 4, . . ., n.
Expanding Eq. (2), we have
2.2. Grey modeling process
Transforming Eq. (3) into matrix form, we have used for prediction and described as
⎡ (0) ⎤ ⎡ (1) (1) (1) ⎤⎡ ⎤
x1 (2) −z1 (2) x2 (2) · · · xN (2) a
N
⎢ (0) ⎥ ⎢ (1) ⎥⎢ ⎥ (0)
x̂1 (k) =
(1) (1)
βi xi (k) − αx1 (k − 1)
⎢ x1 (3) ⎥ ⎢ −z1 (3) x2 (3) · · · xN (3) ⎥ ⎢ b2
(1) (1) ⎥ (5)
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢ . ⎥=⎢ .. .. ⎥⎢ . ⎥ (4) i=2
⎢ . ⎥ ⎢ ⎥⎢ . ⎥
⎣ . ⎦ ⎣ . . ⎦⎣ . ⎦ where
(0) (1) (1) (1)
x1 (n) −z1 (n) x2 (n) ··· xN (n) bN a bi
α= , βi =
1 + 0.5a 1 + 0.5a
Then the coefficients can be estimated by solving matrix, θ̂ =
−1
(BT B) BT Y : When adopting GM (1, N), the influent pH, temperature, SS and
⎡ ⎤ ⎡ (0) ⎤ COD were taken as the comparative series, thus, N was equal
a x1 (2)
⎢b ⎥ ⎢ (0) ⎥ to 5. The GM (1, N) constructed in this study represented the
⎢ 2⎥ ⎢ x1 (3) ⎥
⎢ ⎥ relationship between single effluent water quality index and all
where θ̂ = ⎢
⎢ .. ⎥
⎥, Y = ⎢ . ⎥,
⎣ . ⎦ ⎢ . ⎥ other influent indices, as shown in Fig. 1.
⎣ . ⎦ GM (1, 2). According to the definition of GM (1, N) (Eq. (2)),
bN (0)
x1 (n) if the numbers of comparative series were reduced to 2 (N = 2),
⎡ (1) (1) (1) ⎤ the model was GM (1, 2). The utilization of GM (1, 2) was
−z1 (2) x2 (2) · · · xN (2) analogous to that of GM (1, N). It also correlated the effluent
⎢ (1) ⎥
⎢ −z1 (3) x2(1) (3) · · · xN (1)
(3) ⎥ and influent indices. But in GM (1, 2), the adopted comparative
⎢ ⎥
B=⎢ .. .. ⎥ series was the same as the influent. The structure diagram of GM
⎢ ⎥
⎣ . . ⎦ (1, 2) was shown in Fig. 1.
(1) (1) (1) GM (1, 1). If the numbers of comparative series were reduced
−z1 (n) x2 (n) · · · xN (n)
further, the model was GM (1, 1). All time series values of one
The θ̂ values represent the weight of comparative series to the specific effluent water quality index were used to establish GM
referential series. Additionally, the GM (1, N) model could be (1, 1). Then the constructed GM (1, 1) was used for prediction.
Fig. 1 depicted the relationship between the input and output 2.3. ANN and genetic algorithm ANN
variables of GM (1, 1).
RGM (1, 1). In GM (1, 1), all time series values of one specific The ANN modeling approach in which the important opera-
index were used to establish GM (1, 1). While in RGM (1, 1), tion features of human nervous system is simulated attempts to
traditionally the time series data of specific effluent water quality solve problems by using information gained from past experi-
index used to construct model were the 4 data before the point ence to new problems. In order to operate analogous to a human
which was considered to be predicted. That is, the model had brain, many simple computational elements called artificial neu-
to be constructed every time step and only 4 data were used for rons that are connected by variable weights are used in the ANN.
model construction. In this study, 8 data were used for model With the hierarchical structure of a network of interconnected
construction, as shown in Fig. 1. In both GM (1, 1) and RGM neurons, an ANN is capable of performing complex compu-
(1, 1), the influent data was ignored. tations, although each neuron, alone, can only perform simple
work. The multi-layer perceptron structure is commonly used mean square difference between the desired and the actual net-
for prediction among the many different types of structures. A work outputs. But sometimes, this search technique will find
typical neural network model consisting of three independent out a local optimum, not a global optimum. This defect can be
layers: input, hidden, and output layers. Each layer is comprised solved by adopting some techniques, such as genetic algorithms
of several operating neurons. Input neurons receive the values (GAs).
of input parameters that are fed to the network and store the GAs which emulate the evolutionary theory are procedures
scaled input values, while the calculated results in output layer based on the mimetics of mechanics of natural selection and
are assigned by the output neurons. The hidden layer performs genetics to solve optimization problems (Holland, 1975). GA
an interface to fully interconnect input and output layers. The computes a population of individuals evolving through a set of
pattern of hidden layer to be applied in the hierarchical net- operators constituting the reproduction scheme by which new
work can be either multiple layers or a single layer. Each neuron individuals are generated from parents. If the elements are the
is connected to every neuron in adjacent layers before being most suited in a population, they can survive, generate off-
introduced as input to the neuron in the next layer by a connec- spring and transmit their biological heredity to new generations
tion weight, which determines the strength of the relationship based on the evolutionary theory. The chromosomes of indi-
between two connected neurons. Each neuron sums all of the viduals represented in an optimization problem by a specific
inputs that it receives and the sum is converted to an output binary code contain the heredity. The suitability of each ele-
value based on a predefined activation, or transfer, function. For ment is evaluated using a fitness value directly derived from
prediction problems, a supervised learning algorithm is often the objective function based on the optimization problem under
adopted for training the network how to relate input data to consideration. The evolution mechanisms are consisted of three
output data. In recent years, the back-propagation algorithm is specific reproduction procedures including selection, cross-over
widely used for teaching multi-layer neural networks. Tradition- and mutation. The computing loop of evolution is continuously
ally, the algorithm uses a gradient search technique (the steepest repeated until the generation limit is exceeded. The GA proce-
gradient descent method) to minimize a function equal to the dures are described as follows. (1) generate an initial population
Fig. 4. (Continued ).
of random genomes; (2) loop through the GA, which produces described:
a new generation every iteration; (3) estimate the fitness of each
x(0) (k) − x̂(0) (k)
genome, stopping if a solution is found; (4) generate the next e(k) = × 100% (6)
generation through natural selection and reproduction; (5) select x(0) (k)
two random genomes according to fitness; (6) cross the genomes
where e(k) is the MAPE, x(0) (k) the investigation value, and
or leave them unchanged; (7) mutate genes if necessary; (8)
x̂(0) (k) is the prediction value.
delete the old generation and set the new generation to the cur-
rent population; (9) when a solution is found or the previously
defined number of generations is reached, the loop stops and the 3. Results and discussion
GA is completed.
In this study, the ANN and genetic algorithm artificial neu- 3.1. Variation trend of water quality
ral network (GAANN) were adopted. They both consisted of
three independent layers: input, hidden, and output layers. The The numbers of data investigated from December 1997 to
influent pH, temperature, SS and COD were taken as the input June 2002 were totally 146, as shown in Fig. 3. In Taiwan, the
layer variables, meanwhile SS and COD were the output layer effluent regulation limits of SS and COD were both 100 mg L−1 .
variables. The hidden layer was comprised of six operating neu- The effluent quality from this HWWTP met the Effluent Stan-
rons. The structure diagram of ANN and GAANN are shown in dard of Taiwan.
Fig. 2. Their calculation was carried out using MATLAB.
3.2. Simulation of SS
2.4. Error analysis
Fig. 4(a)–(f) depicts the prediction results of SS using GM
In order to evaluate the prediction accuracy of GM and ANN, (1, N), GM (1, 2), GM (1, 1), RGM (1, 1), ANN and GAANN.
the mean absolute percentage error (MAPE) was employed and The 1st to 100th values were used for model construction, 101st
1278 T.Y. Pai et al. / Computers and Chemical Engineering 31 (2007) 1272–1281
Fig. 5. (Continued )
This value was higher than those of ANN and GAANN only by In the second type, the MAPE values of SS using GM (1, 1)
3.51% and 6.69%, respectively. was analogous to those of RGM (1, 1), the values lay between
Four GMs were adopted to predict the effluent from the 24% and 28%. When predicting COD, the values were also anal-
HWWTP in this study. The application could be divided into ogous using both GM (1, 1) and RGM (1, 1), the values lay
two types. GM (1, N) and GM (1, 2) belonged to the first type between 37% and 52%. It indicated that the values predicted by
of application, GM (1, 1) and RGM (1, 1) belonged to the sec- both GM (1, 1) and RGM (1, 1) have the similar level of error.
ond type. In the first type of application, the relationship of time Two types of ANN were also employed in this study. When
series between effluent and influent values was constructed, and constructing models, the MAPE values of ANN (25.43% for
the influent indices were taken as the input parameters to predict SS and 38.88% for COD) were lower than those of GAANN
effluent quality. In the second type of application, only effluent (35.05 for SS and 41.97% for COD) by 9.62% and 6.09% for
values were used to construct GMs. SS and COD, respectively. When predicting, the MAPE values
In the first type of application, the MAPE values of SS using of GAANN (18.14% for SS and 45.04% for COD) were lower
GM (1, N) (68.98% for construction and 26.67% for prediction) than those of ANN (19.81 for SS and 48.22% for COD) by 1.67%
were higher than those of GM (1, 2) (44.28% for construction and 3.18% for SS and COD, respectively.
and 23.14% for prediction), but the values of model predic- Comparable observations were similarly made by Cote et al.
tion lay between 23.14% and 26.67%. The MAPE values of (1995). Cote et al. (1995) compared different types of model
COD using GM (1, N) (40.63% for construction and 55.38% by which the effluent from an industrial WWTP was predicted.
for prediction) were lower than those of GM (1, 2) (50.05% They found that the MAPEs lay between 37.1% and 260% using
for construction and 126.22% for prediction). It revealed that mechanistic model and 31–69% even using mechanistic model
the fitness was higher using both GM (1, N) and GM (1, 2) with optimized parameters. When they adopted hybrid model,
to predict SS but only GM (1, N) was higher when predicting the MAPEs decreased to 16.3–46% significantly. In the study
COD. proposed by Gontarski et al. (2000), ANN was used to pre-
1280 T.Y. Pai et al. / Computers and Chemical Engineering 31 (2007) 1272–1281
Table 2 The MAPE values of COD using GM (1, N) was smaller than
Parameters of GM (1, N) those of GM (1, 2). It revealed that the fitness was good using
Input parameters Output parameters both GM (1, N) and GM (1, 2) for predicting SS but only
Effluent SS Effluent COD
GM (1, N) was better for predicting COD. In the second type,
the MAPE values of SS using GM (1, 1) was analogous to
Influent pH (b2 ) 0.0810 0.2759 those of RGM (1, 1), the values lay between 24% and 28%.
Influent temperature (b3 ) 0.0041 0.1832
Influent SS (b4 ) 0.0051 0.0699
When predicting COD, the values were also analogous using
Influent COD (b5 ) 0.0029 0.0340 both GM (1, 1) and RGM (1, 1), the values lay between 37%
and 52%. It indicated that the values predicted by both GM
(1, 1) and RGM (1, 1) have an analogous degree of error.
dict the effluent total organic carbon (TOC) from an industrial In our study, the minimum prediction accuracy of 23.14%
wastewater treatment plant. Since TOC was the single output and 55.11% for SS and COD could be achieved when using
layer variable, high fitness was achieved. GMs.
In this study, the minimum MAPEs of 23.14% and 51.73% • Influent pH affected effluent SS and COD significantly. It sug-
for SS and COD could be achieved. The fitness was higher when gested that if the influent pH could be adjusted appropriately,
using ANN and GAANN, but they required a large quantity of the better effluent quality would be obtained.
data for constructing model. Contrarily, GM only required a • GM could predict the hospital effluent variation as its effluent
small amount of data (at least 4 data) and the prediction results data was insufficient.
that were analogous to ANN and GAANN can be obtained.
Therefore, GM could be applied successfully in predicting efflu- Acknowledgement
ent when the information was not sufficient.
The authors are grateful to the National Science Council of
3.4. Effect of input parameters on effluent Taiwan, R.O.C. for financial support under the grant number
NSC94-2211-E-324-007.
In the aspect of GM (1, N), the influent pH, temperature, SS
and COD were taken as the input parameters to predict effluent
SS and COD, respectively. The parameters |b2 |, |b3 |, |b4 | and References
|b5 | represented the effects of influent pH, temperature, SS and
COD on effluent. APHA, AWWA, WEF. (1995). Standard methods for the examination of water
and wastewater (19th ed.). Washington, DC: American Public Health Asso-
According to Table 2, in the aspect of SS, the values of ciation/American Water Works Association/Water Environment Federation.
parameter b2 to b5 were 0.0810, 0.0041, 0.0051 and 0.0029, Chang, N. B., & Wang, S. F. (1995). A grey nonlinear programming approach for
respectively. The effect of influent indices was in the order: planning coastal wastewater treatment and disposal systems. Water Science
|b2 | > |b4 | > |b3 | > |b5 |. It indicated that influent pH affected and Technology, 32(2), 19–29.
effluent SS significantly. Choi, D. J., & Park, H. (2001). A hybrid artificial neural network as a soft-
ware sensor for optimal control of a wastewater treatment process. Water
In the aspect of COD, the values of parameter b2 to b5 were Research, 35(16), 3959–3967.
0.2759, 0.1832, 0.0699 and 0.0340, respectively. The effect of Cote, M., Grandjean, B. P. A., Lessard, P., & Thibault, J. (1995). Dynamic
influent indices was in the order: |b2 | > |b3 | > |b4 | > |b5 |. It indi- modeling of activated sludge process: Improving prediction using neural
cated that influent pH affected effluent COD significantly. networks. Water Research, 29(4), 995–1004.
Among different influent indices, pH value affected effluent Deng, J. (1989). Introduction to grey system theory. The Journal of Grey System,
1(1), 1–24.
significantly. It suggested that if the influent pH could be adjusted Gontarski, C. A., Rodrigues, P. R., Mori, M., & Prenem, L. F. (2000). Simulation
appropriately, the better effluent quality could be obtained. of an industrial wastewater treatment plant using artificial neural networks.
Computers and Chemical Engineering, 24, 1719–1723.
4. Conclusions Häck, M., & Köhne, M. (1996). Estimation of wastewater process parameters
using neural networks. Water Science Technology, 33(1), 101–115.
Holland, J. H. (1975). Adaption in natural and artificial systems. Ann Harbor:
Four types of GM model including GM (1, 1), GM (1, 2), The University of Michigan Press.
GM (1, N), and RGM (1, 1) were used to predict the SS and Pai, T. Y., Ouyang, C. F., Su, J. L., & Leu, H. G. (2001a). Modeling the stable
COD effluent from a HWWTP. The ANN was also adopted for effluent qualities of the A2 O process with Activated Sludge Model 2d under
comparison. The simulation results can be drawn as follows: different return supernatant. Journal of the Chinese Institute of Engineers,
24(1), 75–84.
Pai, T. Y., Ouyang, C. F., Su, J. L., & Leu, H. G. (2001b). Modelling the steady-
• The minimum MAPEs of 23.14% and 51.73% for SS and state effluent characteristics of the TNCU process under different return
COD could be achieved using GAANN. But it required a mixed liquid. Applied Mathematical Modelling, 25(12), 1025–1038.
large quantity of data for constructing model. Contrarily, GM Pai, T. Y., Tsai, Y. P., Chou, Y. J., Chang, H. Y., Leu, H. G., & Ouyang, C. F.
only required a small amount of data and the prediction results (2004). Microbial kinetic analysis of three different types of EBNR process.
that were analogous to GAANN can be obtained. Chemosphere, 55(1), 109–118.
Pai, T. Y., Chuang, S. H., Tsai, Y. P., & Ouyang, C. F. (2004). Modelling a
• In the first type of application, the MAPE values of SS using combined A2 O and RBC process under DO variation by using an acti-
GM (1, N) was greater than those of GM (1, 2), but the MAPE vated sludge—biofilm hybrid model. Journal of Environmental Engineering,
values for model prediction lay between 23.14% and 26.67%. ASCE, 130(12), 1433–1441.
T.Y. Pai et al. / Computers and Chemical Engineering 31 (2007) 1272–1281 1281
Wu, C. C., & Chang, N. B. (2003a). Grey input–output analysis and its appli- Wu, C. C., & Chang, N. B. (2004). Corporate optimal production planning with
cation for environmental cost allocation. European Journal of Operational varying environmental costs: A grey compromise programming approach.
Research, 145(1), 175–201. European Journal of Operational Research, 155(1), 68–95.
Wu, C. C., & Chang, N. B. (2003b). Global strategy for optimizing textile dyeing Zhang, Q., & Stanley, S. J. (1999). Real-time water treatment process control
manufacturing process via GA-based grey nonlinear integer programming. with artificial neural networks. Journal of Environment Engineering, ASCE,
Computers and Chemical Engineering, 27(6), 833–854. 125(2), 153–160.