A data-driven model for maximization of methane production in a wastewater treatment plant
Transcript of A data-driven model for maximization of methane production in a wastewater treatment plant
Provided for non-commercial research and educational use only. Not for reproduction or distribution or commercial use.
This article was originally published by IWA Publishing. IWA Publishing recognizes the retention of the right by the author(s) to photocopy or make single electronic
copies of the paper for their own personal use, including for their own classroom use, or the personal use of colleagues, provided the copies are not offered for sale and
are not distributed in a systematic way outside of their employing institution.
Please note that you are not permitted to post the IWA Publishing PDF version of your paper on your own website or your institution’s website or repository.
Please direct any queries regarding use or permissions to [email protected]
1116 © IWA Publishing 2012 Water Science & Technology | 65.6 | 2012
A data-driven model for maximization of methane
production in a wastewater treatment plant
Andrew Kusiak and Xiupeng Wei
ABSTRACT
A data-driven approach for maximization of methane production in a wastewater treatment plant is
presented. Industrial data collected on a daily basis was used to build the model. Temperature, total
solids, volatile solids, detention time and pH value were selected as parameters for the model
construction. First, a prediction model of methane production was built by a multi-layer perceptron
neural network. Then a particle swarm optimization algorithm was used to maximize methane
production based on the model developed in this research. The model resulted in a 5.5% increase in
methane production.
doi: 10.2166/wst.2012.953
Andrew Kusiak (corresponding author)Department of Mechanical and Industrial
Engineering,2139 Seamans Center,The University of Iowa,Iowa City, IA 52242,USAE-mail: [email protected]
Xiupeng WeiDepartment of Mechanical and Industrial
Engineering,3131 Seamans Center,The University of Iowa,Iowa City, IA 52242,USA
Key words | data-mining algorithms, methane production maximization, neural networks, particle
swarm optimization, wastewater treatment plant
INTRODUCTION
Anaerobic digestion is widely used to treat sludge in manymunicipal wastewater treatment plants around the world.It involves a process in which microorganisms break
down biodegradable waste in the absence of oxygen(Marchaim ; Lettinga ). As a result of anaerobicdigestion, methane and carbon dioxide rich biogas areproduced. The biogas can then be used to generate electri-
city or heat.Biological, chemical, and physical reactions are
involved in the anaerobic digestion process (Batstone et al.). Owing to the complexity of the anaerobic process,building formal models is a challenge. The models presentedin the literature are usually non-linear and non-stationary
with restrictive assumptions that may not hold in practice(Mailleret et al. ).
Numerical studies on comprehensive anaerobic diges-
tion models for prediction and optimization (Schubertet al. ; Tay & Zhang ; Sotemann et al. )have been reported in the literature. Data-mining algor-ithms such as neural networks have shown success in
building models of the anaerobic digestion process. Anadaptive neuro-fuzzy inference system was applied formodeling anaerobic digestion of primary sludge in a
wastewater treatment plant (Cakmakci ). The model
satisfactorily predicted effluent volatile solid and methaneyield. Holubar et al. () applied several feed-forwardback propagation neural networks to model and sub-
sequently control methane production in anaerobicdigesters. Gas composition, methane production rate,pH, volatile suspended solids and other parameters weremeasured and simulated to determine the best feeding
profile.Data mining is a powerful tool to analyze data in scien-
tific and engineering applications, such as bioinformatics,
manufacturing, and wind energy (Braha ; Frank et al.; Kusiak et al. ; Seckin ). Evolutionarycomputation algorithms are widely used to solve complex,
linear and non-linear optimization problems. Successfulapplications of evolutionary computation algorithms havebeen reported in engineering, marketing and science
(Dasgupta &Michalewicz ; Rud ; Thiele et al. ).In this paper, methane production is maximized with a
data-driven model derived by a multi-layer perceptron(MLP) neural network. To maximize methane production,
particle swarm optimization (PSO) is employed to find opti-mal solutions for control variables and other uncontrollablevariables. The model and the maximization results are then
discussed in detail.
Figure 1 | Flow chart of anaerobic digestion.
Table 1 | Data description
Dataset Description No. of instances
1 Training dataset: building predictionmodel
576 observations
2 Test dataset: testing prediction model 148 observations
Total dataset: 724 data points 724 observations
1117 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
METHODS
Data and parameter description
The data used in this research was collected at theDes Moines Wastewater Reclamation Facility (WRA),located in Des Moines, Iowa. WRA is designed to recycle
wastewater from 16 municipalities, counties, and sewerdistricts.
The WRA includes three complexes to process sludge
and produce methane. Each of the complexes has twoanaerobic digesters that are 115 ft (35.05 m) in diameter,29.5 ft (8.99 m) for side water depth and 15 ft (4.57 m) for
cone depth. The sludge is delivered to the digesters afterbeing mixed in sludge-blending tanks. The temperature inthe digester is kept in a range from 90 WF (32.22 WC) to
105 WF (40.56 WC) and is controlled by a sludge heat exchan-ger. The temperature is generally maintained at 100 WF(37.78 WC). In the absence of oxygen, microorganismsbreak down sludge and produce methane and carbon diox-
ide, which is first stored in a gas sphere with 141,260cubic feet (4,000 m3) of capacity to meet peak usagedemand, and then are delivered to gas generators to produce
electricity. The heat generated in the gas combustion is usedto maintain the temperature of the sludge heat exchangersand also heat plant buildings in the winter season. A flow
chart diagram of the anaerobic digestion at WRA is shownin Figure 1.
The methane production data used in this paper wasfrom daily samples taken over the period from 1/2/2008
to 12/31/2010. As some data points involved errors, e.g.out of range values, the dataset was preprocessed. The pro-cessed dataset included 724 data points and it was divided
into training and test sets. The training set was from 1/2/2008 to 3/31/2010, and it included 576 data points tobuild the prediction model. The test set from 4/1/2010
to 12/31/2010 contained 148 data points and it was usedto test the developed model. The dataset descriptions areprovided in Table 1.
Although the original dataset included 11 parameters,some of them were removed as they did not have obviousinfluence on the methane production. In this research,digester temperature, volatile solids, total solids, detention
time of sludge, pH value and methane production wereselected to build a prediction model. At WRA, digester temp-erature and volatile solids fraction are controllable, and
other parameters are uncontrollable variables. The list ofparameters with their ranges is shown in Table 2.
The methane production model involving the selectedparameters is expressed in Equation (1).
y ¼ f(x1, x2, v1, v2, v3) (1)
Temperature is the most important variable affectingthe rate of digestion and methane production. Eventhough anaerobic microorganism communities can
endure temperature ranging from below freezing to above135 WF (57.22 WC), they thrive best at temperatures from68 WF (20 WC) to 105 WF (40.56 WC) for mesophilic and
113 WF (45 WC) to 135 WF (57.22 WC) for thermophilic diges-ters. To increase methane production, the digester mustbe kept at a consistent temperature, as rapid changes will
disturb bacterial activities. This is also the reason whymost anaerobic digesters require some level of insulationor heating which will generally increase methane pro-
duction in cold seasons.The total solids in wastewater is another variable influ-
encing methane production. The concentration of total
Table 2 | List of parameters
Parameter Description Minimum Maximum
x1 Digester temperature, WF (WC) 90 (32.22) 105 (40.56)
x2 Volatile solids, % 65 85
v1 Total solids, % 2 12
v2 Detention time, day 10 50
v3 pH 6.7 7.8
Methane production, scf/day (m3/day) 72,000 (2,038) 1,032,000 (29,223)
1118 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
solids has an impact on the effectiveness of the microorgan-isms in the decomposition process during anaerobicdigestion. Igoni et al. () found that methane production
increased when the percentage total solids of wasteincreased. A statistical analysis showed that the formerwas a power function of the latter, and there was a point
where no further increase in the methane productionwould be obtained when the percentage of total solidskept increasing.
The volatile solids in wastewater are measured as thetotal solids, excluding the ash content, as obtained by com-plete combustion of the feeding waste. They contain the
biodegradable volatile solids and refractory volatile solids.The former is useful in estimation of the biodegradabilityof the waste and the latter is not easily degraded by microor-ganisms, so volatile solids concentration affects both
methane production and the composition quality.Detention time is a critical element in control of the
anaerobic process. As the methane formers are slower to
grow and are sensitive to changes in the operation con-ditions, a short detention time results in sludge beingwashed out of the digester. A longer detention time allows
the creation of a buffering alkalinity to form and stabiliz-ation of the microorganism environment.
Anaerobic microorganisms, especially methanogens, are
sensitive to pH in the digester and their growth can be inhib-ited by acidic conditions. The pH value for anaerobicdigestion usually varies between 5.5 and 8.5. At an earlystage of digestion, acetogenesis can lead to accumulation
of large amounts of organic acids resulting in an acidicenvironment with a low pH value. When digestion reachesthe late methanogenesis stage, the concentration of ammo-
nia rises and the pH value may exceed 8.The prediction accuracy of the model built by the
multi-layer perceptron neural network is measured with
five metrics, the mean absolute percentage error (MAPE),the fractional bias (FB), the root mean square error(RMSE), the normalized mean square error (NMSE), and
the coefficient of determination (R2) shown in Equations(2)–(6).
MAPE ¼ 1N
XNi¼1
jy⌢i � yijyi
(2)
FB ¼ y⌢
m � ym0:2ðy⌢m þ ymÞ
(3)
RMSE ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi1N
XNi¼1
ðyi � y⌢
iÞ2vuut (4)
NMSE ¼PN
i¼1 (yi � y⌢
i)2
PNi¼1 (y
⌢
i)2
(5)
R2 ¼ 1�PN
i¼1 (yi � y⌢
i)2
PNi¼1 (yi � ym)
2 (6)
where y⌢
i is the predicted value obtained from the model,
and yi is the actual value measured at the WRA. y⌢
m andym are the mean of predicted and observed values respect-ively, and N is the number of test data points.
Development and validation of the prediction model
The multi-layer perceptron (MLP) neural network involves
multiple fully connected layers. Except for the inputnodes, each node is a neuron with a non-linear activationfunction. MLP utilizes a supervised learning mechanism,called back propagation, for training. MLP is a modification
of the standard linear perceptron able to distinguish datathat is not linearly separable (Cybenko ).
Dataset 1 and dataset 2 of Table 1 were used to train and
test the MLP neural network model. In all, 2000 singlehidden-layer neural networks were trained. The number of
Table 3 | MLP neural networks
MLP structure Validation error Training algorithm Error function Hidden activation Output activation
MLP 5-4-1 0.0055 BFGS 44 SSE Tanh Logistic
MLP 5-3-1 0.0057 BFGS 32 SSE Tanh Logistic
MLP 5-10-1 0.0058 BFGS 83 SSE Tanh Identify
MLP 5-11-1 0.0059 BFGS 18 SSE Logistic Logistic
MLP 5-22-1 0.0058 BFGS 44 SSE Tanh Sine
1119 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
neurons in the hidden layer varied from 3 to 22. Table 3
summarizes the best performing neural networks. Tomeasure the model accuracy, the sum of squared error(SSE) is used in this paper. The SSE is the sum of the
squared difference between the target and actual outputvalues on each output unit (Braha ). The Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm (Bonnans
et al. ) was used to minimize SSE while building eachneural network model. The iteration number of the BFGSalgorithm ranged between 18 and 83 as shown in the third
column in Table 3. Multiple non-linear hidden and outputactivation functions, including identity, logistic, tanh, andexponential, were used for the neurons. The activation func-tions used in the models are listed in Table 3. The MLP
neural networks successfully identify the non-linear relation-ship between the process variables as demonstrated with thelow validation errors shown in Table 3.
Figure 2 shows the observed and MLP 5-4-1 predictedvalues of methane production. Most methane productionpatterns and peaks were clearly recognized by the model
with a few exceptions of extreme high and low observedvalues, such as high point 110, and extreme low points 17,
Figure 2 | Observed and MLP neural network predicted methane production.
70, 121 and 147. A reason for the discrepancy may have
been because of noise in the data sampled.Performance of the MLP neural network derived model
has been compared with the adaptive neuro-fuzzy inference
system (ANFIS), multiple linear regression, and multiplenon-linear regression models. The comparative results inTable 4 demonstrate that the prediction model built by the
MLP neural network offers better prediction accuracythan the other models. Specifically, the mean absolute per-centage error of the constructed model is 0.1. This error
expresses the relative accuracy of the model. Fractionalbias at 0.01 indicates a satisfactory agreement between thepredicted and the observed value. The root mean squareerror of the model is 92120, which is a large number, how-
ever, the value of the methane production could be largerthan 1,000,000 scf/day (28,317 m3). A relatively small differ-ence between predicted and observed value causes a large
root mean square error. Normalized mean square errorexpressing the normalized average of the square error is0.01 for the built model. The coefficient of determination
value 0.98 indicates a high correlation between the pre-dicted and observed values.
Table 4 | Prediction accuracy
MAPE FB RMSE NMSE R2
MLP 5-4-1 0.10 0.01 92,120 0.01 0.98
ANFIS 0.11 0.01 93,824 0.02 0.95
Multiple linear regression 0.17 0.13 135,459 0.03 0.83
Multiple non-linearregression
0.15 0.01 130,454 0.03 0.88
Figure 3 | Flow chart diagram of the PSO algorithm.
1120 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
Maximization of methane production
The MLP neural network model is used to maximizemethane production. Since only temperature and volatile
solid fraction can be controlled at the WRA, they are usedas the decision variables. The digester temperature is con-strained in the range 90 WF (32.22 WC) to 105 WF (40.56 WC),
and the volatile solid fraction varies from 65 to 85%. Thedigester temperature and the volatile solid fraction rangesare decided based on the operating practice at WRA. Thesingle objective model maximizing methane production is
expressed in model (7).
maxx1,x2
f(x1, x2, v1, v2, v3)
subject to:
90 ≤ x1 ≤ 105
65% ≤ x2 ≤ 85% (7)
where f is the objective function represented by the model
built in Section 3. The description of the five input variablesused in model (7) is included in Table 2.
Solving the methane production model is a challenge.Heuristic search algorithms like greedy search (Feo &
Resende ) and evolutionary computation algorithmssuch as genetic algorithms (Deb et al. ) are the availablechoices. Particle swarm optimization (PSO) is a stochastic
optimization algorithm (Kennedy & Eberhart ). Thedevelopment of PSO was inspired by the social behaviorof birds flocking or fish schooling. PSO has been success-
fully applied in many research and application areas. Ithas been demonstrated that PSO produces better results inlower computational time compared with other algorithms.Therefore, PSO algorithm was applied in this paper to solve
model (7).The standard PSO algorithm shown in Figure 3 is pre-
sented next.
Step 1: Randomly initialize n particle positions xi∈Rn
and velocities si∈Rn.Step 2: Evaluate fitness value fi using current particle
positions; fbi is the best fitness value for particle i, and fg is
the global best value for all particles. Parameter pbi is thebest individual particle position, and pg is the global bestposition for all particles.
If fi ≤ fbi , then fbi ¼ fi, pbi ¼ xi
If fi ≤ fg, then fg ¼ fi, pg ¼ xi
Step 3: Update all particle velocities si
si ¼ si þ c1r1(pi � xi)þ c2r2(pg � xi)
Step 4: Update all particle positions xi
xi ¼ xi þ si
Step 5: Update fitness value fbi and fg
Step 6: If the stopping condition is satisfied, then fg is thefinal optimal solution with the particle position pg. Other-wise, return to step 3 to start next iteration.
Here, the dimension for each particle’s position xi andvelocity si is 2. The first element of xi refers to the decision
1121 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
variable of the digester temperature and is drawn from uni-
form distribution U (90, 105). The second element of xirefers to the decision variable of volatile solids and isdrawn from uniform distribution U (65%, 85%). At the
beginning, si is initialized as 0; c1 and c2 are cognitive andsocial parameters, they are set as 2 in this paper; r1 and r2are random numbers between 0 and 1.
RESULTS AND DISCUSSION
The dataset 2 in Table 1 was used to solve model (7) with thePSO algorithm. In each iteration, the trained MLP neural
network is used to predict the methane production basedon controllable and uncontrollable variables. Then thePSO algorithm determines the best fitness value (heremethane production) by determining the settings of control-
lable variables (here digester temperature and volatile solidsfraction). The initial parameters of the PSO algorithm are asfollows: the population size is 50 and the maximum number
of iterations is set at 20.To obtain a stable production of methane, unchanged
operational conditions for a period of time are preferable,
e.g. a full season; see Figure 4 for the optimization results.Under the operational conditions in which digester temper-ate is set to 102.5 WF (39.12 WC) and volatile solids fraction is
set to 80%, the methane production can be improved by5.5%. The increased methane production is due to theoptimization of controllable settings based on the predictionmodel in Equation (1). It can be seen that the computed
methane production is usually larger than the observedvalues. Moreover, the production for the test period showsless variability than the actual values, which have very
Figure 4 | Observed and maximized methane production.
large differences on a daily basis. The stable output is ben-
eficial for the anaerobic digestion process and plantoperations.
An increase in the digester temperature results in more
complete destruction and decomposition of sludge, thusincreasing methane production. However, since therequired temperature has to be maintained during cold sea-sons by burning part of the methane produced to heat the
digester, a tradeoff between the energy for heating and thetemperature maintenance of the digester leads to maximiza-tion of the methane production. This multi-objective model
deserves investigation to produce optimal operationalconditions.
The concentration of volatile solids is also a factor
impacting methane production. It has been observed thata higher volatility of solids results in higher methane pro-duction if the temperature remains stable. Since thevolatile solids concentration at WRA is high (up to 85%),
it is expected that such a concentration should increasemethane production. Further studies and experiments arerecommended to investigate if there is an upper limit at
which methane production will not increase even if the vola-tile solids concentration keeps increasing.
CONCLUSION
In this paper, a data-driven approach to maximize methaneproduction in a wastewater treatment plant was presented.Controllable variables, temperature, volatile solids, and
uncontrollable variables, total solids, detention days, andpH value were selected to build a prediction model formethane production with a multi-layer perceptron neural
1122 A. Kusiak & Xiupeng Wei | Data-driven model for optimization of methane production Water Science & Technology | 65.6 | 2012
network approach. To maximize methane production, a
single-objective maximization model was formulatedand solved with a particle swarm optimization algorithm.Optimal operational conditions were obtained in response
to uncontrollable variables. The maximization resultsdemonstrated that methane production increased by 5.5%.with the values of the optimized variables being the digestertemperature of 102.5 WF (39.12 WC) and the volatile solids
fraction of 80%.It is recommended that further study should focus on
optimizing trade-offs between digester temperature and the
energy used to heat it. Examining the upper limit for volatilesolid concentration is another area to be investigated. Theoptimal operational conditions obtained from this research
were recommended for testing and validation in a waste-water treatment plant.
ACKNOWLEDGEMENT
This research was supported by funding from Iowa EnergyCenter Grant No. 10-1.
REFERENCES
Batstone, D. J., Keller, J., Angelidaki, I., Kalyuzhnyi, S. V.,Pavlostathis, S. G., Rozzi, A., Sanders, W. T., Siegrist, H. &Vavilin, V. A. The IWA anaerobic digestion model No1(ADM1). Water Science and Technology 45 (10), 65–73.
Bonnans, J. F., Gilbert, J. C., Lemarechal, C. & Sagastizábal, C. A. Numerical Optimization: Theoretical and PracticalAspects. Springer, New York.
Braha, D. Data Mining for Design and Manufacturing:Methods and Applications. Kluwer Academic Publishers,The Netherlands.
Cakmakci, M. Adaptive neuro-fuzzy modeling of anaerobicdigestion of primary sedimentation sludge. Bioprocess andBiosystems Engineering 30 (5), 349–357.
Cybenko, G. Approximation by superpositions of a sigmoidalfunction. Mathematics of Control, Signals, and Systems 2 (4),303–314.
Dasgupta, D. & Michalewicz, Z. Evolutionary Algorithms inEngineering Applications. Springer, New York.
Deb, K., Pratap, A., Agarwal, S. & Meyarivan, T. A fast andelitist multiobjective genetic algorithm: NSGA-II. IEEETransactions on Evolutionary Computation 6 (2), 182–197.
Feo, T. A. & Resende, M. G. C. Greedy randomized adaptivesearch procedures. Journal of Global Optimization 6 (2),109–133.
Frank, E., Hall, M., Trigg, L., Holmes, G. & Witten, I. H. Data mining in bioinformatics using Weka. Bioinformatics20 (15), 2479–2481.
Holubar, P., Zani, L., Hagar, M., Froschl, W., Radak, Z. & Braun,R. Advanced controlling of anaerobic digestion bymeans of hierarchical neural networks. Water Research 36(10), 2582–2588.
Igoni, A. H., Abowei, M. F. N., Ayotamuno, J. M. & Eze, C. L. Effect of total solids concentration of municipal solid wastein anaerobic batch digestion on the biogas produced.International Journal of Food, Agriculture and Environment5 (2), 333–337.
Kennedy, J. & Eberhart, R. C. Particle swarm optimization.Proceedings of IEEE International Conference on NeuralNetworks 4, 1942–1948.
Kusiak, A., Zheng, H. Y. & Song, Z. Wind farm powerprediction: a data-mining approach. Wind Energy 12 (3),275–293.
Lettinga, G. Anaerobic digestion and wastewater treatmentsystems. Biomedical and Life Sciences 67 (1), 3–28.
Mailleret, L., Bernard, O. & Steyer, J. P. Robust regulation ofanaerobic digestion processes.Water Science and Technology48 (6), 87–94.
Marchaim,U. BiogasProcess forSustainableDevelopment. Foodand Agriculture Organization of the United Nations, Rome.
Rud, O. C. Data Mining Cookbook: Modeling Data forMarketing, Risk and Customer Relationship Management.John Wiley & Sons, New York.
Schubert, J., Simutis, R., Dors, M., Havlik, I. & Lubbert, A. Bioprocess optimization and control: application of hybridmodeling. Journal of Biotechnology 35 (1), 51–68.
Seckin, N. Modeling flood discharge at ungauged sites acrossTurkey using neuro-fuzzy and neural networks. Journal ofHydroinformatics 13 (4), 842–849.
Sotemann, S. W., Ristow, N. E., Wentzel, M. C. & Ekama, G. A. A steady state model for anaerobic digestion of sewagesludge. Water SA 31 (4), 511–527.
Tay, J. H. & Zhang, X. Neural fuzzy modeling of anaerobicbiological wastewater treatment systems. ASCE Journal ofEnvironmental Engineering 125 (12), 149–1159.
Thiele, L., Miettine, K., Korhonen, P. J. & Molina, J. Apreference-based evolutionary algorithm for multi-objectiveoptimization. Evolutionary Computation 17 (3), 411–436.
First received 2 September 2011; accepted in revised form 7 November 2011