You are on page 1of 8

Simulation and Optimisation

of an Anaerobic Digester for

Wastewater Treatment and Methane Production
Kamran Khammadov [00859689], Yue Zheng Neo [00636426], Jun Hui Lee [00876672]

Abstract: This paper deals with the optimisation and cal- dynamics of the process components, and thus is adopted as
ibration of a two-reaction model of anaerobic digestion. A the primary operational strategy. To overcome the inherent
steady-state optimisation of the digester dilution rate was problem of instability, it is necessary to model, simulate and
carried out to obtain optimum values for bacteria concen- optimise such anaerobic digesters.
trations, which were used in the dynamic optimisation of The paper is organised as follows. The first section in-
the digester start-up process. Additional control of the volves modelling, simulation and dynamic optimisation of
digester alkalinity and a constraint on the methane frac- the process with the aid of GAMS and gPROMS. The sec-
tion were then added to refine the optimisation. The re- ond section focuses on enhancing the calibration of the
sults of 4 days of experiments in a 1-m3 digester were
model proposed by [1].
then used to improve the calibration of the model through
the conduct of a general sensitivity analysis to identify the
model parameters to be refined. MODELLING, SIMULATION AND OPTIMISATION OF
Keywords: dynamic optimisation; sensitivity analysis; AN ANAEROBIC DIGESTER
parameter estimation
Equations of a Dynamic Mass-Balance Model

INTRODUCTION Based on the paper [1], the dynamic mass-balance model of

an anaerobic digester is represented by Eqs. (1) to (6):
The anaerobic wastewater treatment, despite many of its
advantages over conventional aerobic wastewater treatment, dX 1
1 D X 1 (1)
has some potential limitations. One of them is the problem dt
of stability, or lack thereof, which makes it particularly im- dX 2
portant to implement an efficient control strategy. 2 D X 2 (2)
Based on the work of Bernard et al. [1], the anaerobic di- dZ
gestion process consists of two reactions involving acido- D Z in Z (3)
genic bacteria X1 and methanogenic bacteria X2: dS1
D S1in S1 k1 1 X 1 (4)
Acidogenesis k1S1 X1 + k2S2 + k4CO2 (r1 = 1 X1)
D S2in S 2 k2 1 X 1 k3 2 X 2 (5)
Methanisation k3S2 X1 + k5CO2 + k6CH4 (r2 = 2 X2) dt
We considered an upflow anaerobic fixed-bed digester fed D Cin C qC k4 1 X 1 k5 2 X 2 (6)
with industrial wine distillery wastewater similar to the one
described in [1]. It is assumed to be a continuous stirred-
tank reactor such that the biomass is uniformly distributed.
First, X1 consumes the organic substrate S1 and produces 1 1max (7)
CO2 and volatile fatty acid S2. S2 is mainly composed of S1 K S 1
acetate and is assumed to behave as pure acetate. Then, X2 S2
2 2 max (8)
consumes S2, forming CO2 and methane. Both gases are the S2
S2 K S 2 2
main components of the outlet gas and their flow rates are KI 2
denoted by qC and qM respectively. 1 and 2 are the specific qC k L a C S 2 Z K H PC (9)
growth rates respectively. The total alkalinity Z, or the sum
of dissociated acids in the medium, can be used for monitor- 2 4 K H PT C S2 Z
PC (10)
ing or even as a control strategy for the plant. The dilution 2K H
rate of the reactor D, which represents the ratio of the influ- k6
C S2 Z K H PT 2 X 2 (11)
ent flow rate to the reactor volume, directly influences the kL a


This model can exhibit multiple steady states. Based on Digester Dilution Rate for Optimal Start-Up via
the paper [1], the system of Eqs. (1) and (4) corresponds to Piecewise-Constant Control Parameterisation
a classical chemostat model with Monod-type kinetics,
which has two steady states: a trivial washout steady state A dynamic optimisation problem was formulated to deter-
mine the optimal digester dilution rate in order for the two
( X1 0 and S1 S1in ) which is unstable, and a non-trivial
biomass concentrations to reach 0.196 g/L and 0.0702 g/L
steady state which is stable. The system composed of Eqs. respectively (as determined earlier for the case of 80% min-
(2) and (5) is a chemostat model with Haldane-type kinetics, imum COD abatement) in minimal time, using the same
which has three steady states: one non-trivial and locally nomenclature used by Bernard et al. [1]:
stable, one non-trivial and unstable, and one trivial and sta-
ble washout state ( X 2 0 and S2 S2in ). min tf
D ( t ), 0 t tf
The existence of multiple steady states have several prac-
tical implications. For instance, the presence of washout 0.01
arising from multiplicity imposes constraints on the start-up
and control strategies required to maintain the system at a 40
s.t. Kr D Q F, (0)
desired state [2]. The start-up conditions will affect the yield 0
or selectivity of the desired product [2]. Different initial 0
conditions could lead to different steady states [2]. Hence,
the initial guesses for the variables must be informed and
X 1 (tf ) 0.196
realistic to obtain a non-trivial steady state which will gen-
X 2 (tf ) 0.0702
erate values that can be used in the subsequent dynamic
optimisations. 0 D (t ) 1

The problem was implemented in gPROMS using a

Optimal Dilution Rate to Maximise Methane Produc- piecewise-constant control parameterisation over 10 equi-
tion Under Steady-State Conditions distant stages. The solution (Fig. 1) is as follows, each stage
lasting 2.65 days for a total duration of 26.5 days:
Here, we considered a digester fed with industrial wine dis-
tillery wastewater with the following average compositions: 0.775/day 0/day 0.0553/day 0.248/day
0.256/day 0.2555/day 0.250/day 0.229/day
S1in 5 g L1 S2in 0 mmol L1 0.247/day 0/day
Cin 50 mmol L1 Z in 40 mmol L1
An unconstrained optimisation was performed using
GAMS to obtain the optimal dilution rate of 0.347/day in 0.6
order to maximise methane production. This produced a
D (d1)

constant 4.489 mmol/L per day of methane, a steady-state

acidogenic bacteria concentration of 0.180 g/L, a steady- 0.4
state methanogenic bacteria concentration of 0.0570 g/L and
a corresponding COD abatement of 72.3%.
A repeated optimisation with the imposed constraint of
80% minimum COD abatement was carried out, giving an
optimal dilution rate of 0.262/day, a steady-state acidogenic 0.0
bacteria concentration of 0.196 g/L, a steady-state methano- 0 10 20 30
t (days)
genic bacteria concentration of 0.0702 g/L and a methane Figure 1. Optimal solution for minimum-time start-up of the
output of 4.174 mmol/L per day. digester using the initial control parameterisation.
The lower dilution rate and methane production show that
a trade-off has to be made in order to meet the stricter COD
abatement condition. Refining Control Parameterisation

The control formulation was refined by changing the piece-

wise-constant control parameterisation over 10 equidistant
stages to a piecewise-linear control parameterisation over
100 stages. The optimal solution is shown in Fig. 2, with a
new minimum time of 26.4 days.
This is because a fine grid for the discretisation of the the optimal solution is to such modelling inaccuracies. To
control vector in time enhances the quality of the control assess the sensitivity of the optimal solution obtained to the
strategy. However, a fine grid also has adverse impact on uncertainties associated with 1max , 2max , X 1 (0) and
the computational effort [3]. Hence, to limit the computa- X 2 (0) , we re-determined the optimal digester dilution rate,
tional effort, the optimisation was solved using a piecewise-
with each parameter or initial condition adjusted upwards
linear control parameterisation over 10 equidistant stages
by 10% from its nominal value one by one. As the optimal
(coarse grid) first. When this optimisation has reached a
solution is a variation of dilution rate with time which
plateau, then a fine grid refinement is applied to achieve
makes it difficult to directly compare the change in dilution
better performance in terms of smoother control arcs and an
rate profile following a 10% increment in the value of the
improved performance index [3].
parameter or initial condition, we decided to use the objec-
1.0 tive function, i.e. the time horizon, as the basis for compari-
D (d1) or X1 (g/L) or X2 (g/L) or yM

6 son instead. For each parameter or initial condition, the sen-

sitivity index, SI, was computed as follows:

S1 (g/L) or S2 (mmol/L)
tf t
SI f 10tf
0.6 4 p p 0.1

3 The results are presented in Fig. 3. Note that the sensitivi-

ty indices are actually negative, i.e. an increase in the value
of the parameters or initial conditions results in a corre-
0.2 sponding decrease in minimal time required for start-up.
However, for comparison purposes, the absolute values
0.0 0 have been used in the plot instead. It is evident that the key
0 10 20 30 parameter influencing D and hence tf the most is 1max . On
t (days)
D X1 X2 the other hand, the optimal strategy is relatively insensitive
yM S1 S2 to uncertainties in the other three parameters.
This means that it is important to determine 1max as pre-
Figure 2. Optimal solution for minimum-time start-up of the
cisely as possible, minimising its uncertainty as far as pos-
digester using the refined control parameterisation.
sible, to ensure that the optimal strategy is robust. This is
The optimal solution consists of three arcs. In the first arc, because a mere 10% increase in 1max would result in a sig-
the dilution rate remained constant at 1/day. In the second nificant reduction in minimal time required, which means
arc, the dilution rate decreased to 0.043/day, and increased that the existing control structure is no longer the most effi-
thereafter to 0.276/day, and then decreased gradually to cient and cost-effective strategy if the actual value of 1max
0.17/day. Finally, in the third arc, the dilution rate decreased
is indeed 10% higher than its current estimated value.
sharply to a constant 0/day.
The optimal control strategy can be interpreted as follows.
In the first reaction of the process, S1 was consumed to pro-
duce X1 and S2. Therefore, the dilution rate took its highest 14
value in the first arc to supply S1. However, since the high 12
dilution rate caused X2 to decrease, the dilution rate had to 10
be reduced in the second arc to ensure that X2 was able to

reach its desired steady-state value at the end of the time
horizon. The fluctuations observed in the second arc en- 6
sured that X1 and X2 increased gradually towards their de- 4
sired values at the end. In the last arc, the dilution rate was
zero since S1 and S2 had reached sufficient values to in-
crease X1 and X2 to their steady-state values. 0
1max 2max X1 X2
Sensitivity Analysis
Figure 3. Sensitivity index of the optimal solution to uncer-
As a large degree of uncertainty is typically associated with tainties (+10%) in the parameters/initial conditions.
bioprocess models, it is important to check how sensitive


Nevertheless, a comparison of the control trajectories for mal digester alkalinity for the two biomass concentrations to
the cases where 1max was at its nominal value and when reach their target values in minimal time, while keeping the
1max was 10% higher (Fig. 3) indicates very little differ- methane fraction in the biogas above 50% vol at all times:

ence between the two in terms of control values and control min tf
D ( t ), 0 t tf
structure, except the minimal time required, as evidenced by Z (t )
the close overlap between both profiles for most part of the
time horizon. This means that only slight changes need to be 0.01
made towards the end of the time horizon to further opti-
mise the control strategy in response to the uncertainty as- 40
s.t. Kr D Q F, (0)
sociated with 1max . This should not incur too significant a 0
cost in practice.
1.0 X 1 (tf ) 0.196
X 2 (tf ) 0.0702
0 D (t ) 1
0 Z (t ) 100
D (d1)

PC (t )
0.5 for all t , except t 0
PT (t )
The optimal solutions of the two controls, namely the di-
0.2 lution rate and alkalinity feed concentration, are shown in
Fig. 5, while the responses of the key variables, biomass
0.0 concentrations and methane fraction, are shown in Fig. 6.
0 10 20 30
t (days)
1.0 70
1max = 1.2 1max = 1.32
Figure 4. Optimal control strategy for 1max at nominal value
and 10% higher. 60

Zin (mmol/L)
D (d1)

Methane Composition of Biogas during Optimal
Start-Up 50

The methane composition of the biogas produced during 0.2

optimal start-up as determined earlier using a piecewise-
linear control parameterisation over 100 equidistant stages 0.0 40
is shown in Fig. 2. 0 10 20 30
Given that a typical methane composition for the biogas t (days)
of a healthy digester is between 40% and 60% vol, under D Zin
the current control, the biogas reached a healthy methane Figure 5. Optimal solution with dynamic adjustment of dilu-
composition only after 15.92 days, or after about 60% of tion rate and digester alkalinity.
minimum-time start-up of the digester. The time elapsed
before the desired methane fraction was achieved was
deemed too long and the control strategy was inefficient.

Digester Dilution Rate and Alkalinity for Optimal

Start-Up While Maintaining Healthy Methane Com-

The dynamic optimisation formulation earlier was modified

to determine the optimal digester dilution rate and the opti-


Table I. Influent flow rate and composition.
0.20 1.0
Period (day) 0.000 0.266 1.266 2.362 4.000
Flow rate (L/h) 8.0 47.0 47.0 9.0
0.16 0.8
CODin (g/L) 18.5 18.5 37.0 18.5
X1 (g/L) or X2 (g/L)

VFAin (mmol/L) 103 103 206 103

TICin (mmol/L) 9 9 18 9
0.12 0.6 Zin (mmol/L) 98 98 195 98

0.08 0.4
Simulation of Experiment and Comparison with
Available Measurements
0.04 0.2
The model was simulated based on the influent conditions
0.00 0.0 reported in Table I and using the parameter values estimated
0 10 20 30 in [1]. The initial measurement values of S1, S2, C and Z
t (days) were used as initial conditions for the simulation, providing
X1 X2 yM four of the six initial conditions required by the model. The
Figure 6. System response to dynamic optimisation of dilu- remaining two initial conditions have been estimated by
tion rate and digester alkalinity. calculating the values of X1 and X2 that would produce re-
sponse trajectories most similar to those of the experimental
A comparison of these results with those obtained in Fig.
measurements. Fig. 7 represents the simulation results
2 indicates a slight difference in the behaviour of dilution
alongside the experimental data.
rate, due to the introduction of one new control and the me-
thane fraction constraint. The control arc had a similar over- 12 150

all shape, but the dilution rate took on the extreme values of 8 100

S2 (mmol/L)
S1 (g/L)

0 and 1 within the first 6 days as a result of the variation of

4 50
alkalinity. Between days 10 and 12, the maintenance of the
constraint on methane fraction caused the dilution rate to 0 0
0 1 2 3 4 0 1 2 3 4
deviate significantly from the stable value of around 0.2 to t (days) t (days)
180 180
again take on extreme values.
140 160
The methane fraction in the biogas however displays an Z (mmol/L)
C (mmol/L)

entirely different behaviour from that in Fig. 2, with a sharp 120
60 100
initial increase followed by a steady drop to reach the min-
20 80
imum value dictated by the imposed constraint. Apart from 0 1 2 3 4 0 1 2 3 4
t (days) t (days)
a sharp deviation between days 10 and 12, the methane frac-
tion was then maintained at this minimum value of 0.5 until 7.4
it increased slightly to 0.6 at the end of the time period. This

is in contrast with the behaviour seen in Fig. 2, where the
methane fraction decreased to a minimum value of around 6.6
0 1 2 3 4
0.2 before increasing gradually to reach a maximum value t (days)

that did not exceed 0.6.

Figure 7. Comparison between simulation results and meas-
urements for S1, S2, C, Z and pH.
The model correctly reproduces the general trend of the
response trajectories, with particularly good agreement seen
In the second part of the project, we wished to improve the for digester alkalinity, Z. Although the agreement is less
calibration of the model of anaerobic digestion proposed by close for predictions of S1 and S2, their maximum and min-
[1]. We considered a set of real experimental data generated imum values obtained from the simulation correspond well
on the same 1,000 L up-flow anaerobic fixed-bed digester with those in the experimental data. On the other hand, the
as in [1]. Due to the packing and the biomass colonisation simulated minimum values of C and pH differ from experi-
inside the digester, the effective liquid volume was estimat- mental measurements significantly, displaying inadequacies
ed to be about 720 L for this experiment. in the model. This can be attributed to insufficient refine-
The influent flow rate and composition during this 4-day ment of the parameter values or inaccurate specification of
experiment are summarised in Table I. initial conditions.


1.5 7

0.0 2
-1.5 -3
0.3 0.5





-1.0 -1.0
1.0 0.5
0.6 0.0



-0.4 -1.5
-0.8 -2.0

Figure 8. Sensitivity for the model parameters. The mean changes of S1, S2, X1, X2, C and Z are represented with respect to a
10% increase in the values of the kinetic, hydrodynamic and stoichiometric parameters.

Local Sensitivity Analysis of Response Trajectories parameter must be integrated over the time horizon in order
to obtain the sensitivity indices as follows:
In order to obtain better agreement between the model and t f y p
experimental data, a refinement of the experimental parame- 0 p y dt
ters can be carried out. However, it is important to first con- SI y tf

duct a sensitivity analysis of the response trajectories to the 0 dt

model parameters as the model contains a large number of This integral can be approximated by discretising the time
parameters and not all of them can be estimated accurately horizon into N intervals and computing the average change:
from the available experimental data. y p
Sensitivity indices for the quantities S1, S2, X1, X2, C and Z N p y
were calculated with respect to small variations in the kinet- SI y
ic parameters 1max, KS1, 2max, KS2, KI2 and kLa, the hydro- This above equation was applied to the six quantities and
dynamic parameter , and the stoichiometric parameters k1, 13 parameters, and the results are presented in Fig. 8. It can
k2, k3, k4, k5 and k6. Due to the dynamic nature of the model, be seen that the parameter which plays the largest role in
the change in a quantity resulting from a small change in a influencing the model is , with the largest magnitude of


sensitivity index across all the quantities; this is because it Furthermore, a comparison with experimental data shows
affects the dynamics of the entire model. The other parame- that the new parameters only improve the agreement of the
ters that display a high sensitivity index are 1max and 2max model to experimental measurements to a limited extent, as
as they affect the rates of production and consumption of it can be seen from Fig. 9 that the new simulation results do
S1/X1 and S2/X2 respectively, and k1 and k3 which have a not fit the measurement data much better than with the orig-
strong influence on the gaseous flow rates. inal parameters.
From this sensitivity analysis, it can be concluded that the
12 150
parameters to be selected for estimation are , 1max, 2max,

S2 (mmol/L)
8 100
k1 and k3. Five parameters have been selected as there are

S1 (g/L)
five quantities of which experimental measurements are 4 50

available, and there is likely to be sufficient data to estimate 0

these five parameters 0 1 2
t (days)
3 4 0 1 2
t (days)
3 4

180 180

140 160

Z (mmol/L)
Parameter estimation and statistical analysis

C (mmol/L)
Using gPROMS, the five parameters as mentioned earlier 100
20 80
were re-estimated for the given set of experimental data. 0 1 2 3 4 0 1 2 3 4
t (days) t (days)
The results are presented in Table II.
Table II. Nominal values and new estimates of parameters.

Parameter Unit Nominal value New estimate 6.8

0.5 0.167 6.5

1max d1 1.2 0.360 0 1 2

t (days)
3 4

2max d1 0.74 0.432

42.14 155 Figure 9. Comparison between simulation results with esti-
mated parameters and measurements for S1, S2, C, Z and pH.
k3 mmol/g 268 135
An analysis of the residuals (Fig. 10) also indicates that
The new estimates of the parameters are of somewhat the the estimation of the model parameters may be inadequate
same order of magnitude as their nominal values reported in as the residuals are spread out over a wide range of values
[1]. But this is insufficient to ascertain the robustness of the and are far from zero for all the measured quantities with
parameter estimation, which requires the relevant estimation the exception of alkalinity, Z.
statistics as summarised in Table III.

Table III. Parameters and their estimation statistics. 40

Parameter Value 95% Confidence 95% t-value

interval 0
0.167 0.0208 8.02 0 1 2 3 4
1max 0.360 0.0541 6.66 -20

2max 0.432 0.0430 10.1 -40

k1 155 23.9 6.49
k3 135 18.6 7.25 t (days)
S1 S2 C Z pH
Reference t-value (95%): 1.65
Figure 10. Plot of residuals of the five measured quantities.
The 95% confidence intervals for all the estimated param-
eters are smaller than their estimated values. Their 95% t- Hence it can be established that it is not possible to obtain
values are larger than the reference t-value (95%) of 1.65. a significantly better estimate of the model parameters using
This implies that the amount of experimental data available the given set of experimental data, as a statistical analysis of
is sufficient to estimate the five parameters required. simulation results with newly estimated parameters does not
However, the confidence ellipsoids of all possible pairs of produce results which suggest an increase in agreement with
parameters are quite large around the estimated point, ex- the experimental data. This is due to insufficient measure-
cept for 1max and k1 . This implies that if another identical ment data, where key quantities such as X1 and X2 are not
experiment is carried out and parameter estimation repeated, available leading to significant uncertainties in the specifi-
the estimates may not be easily reproducible. cation of initial conditions.
CONCLUSION X1 concentration of acidogenic bacteria (g/L)
X2 concentration of methanogenic bacteria (g/L)
In this paper, we have tried to address the problem of insta-
yM methane fraction
bility commonly associated with the anaerobic wastewater
Z , Z in total alkalinity (mmol/L)
treatment process. In the first part of the project, we focused
Z0 anion concentration (mmol/L)
on modelling, simulation and optimisation of the process.
The optimal dilution rate profile was determined in order for
fraction of bacteria in the liquid phase
mean fraction of acidogenic bacteria
the digester to reach the desired steady-state biomass con- 1 specific growth rate of acidogenic bacteria (d1)
centrations in minimum time. The control parameterisation
1max maximum acidogenic bacteria growth rate (d1)
was further fine-tuned and the resultant optimal control
2 specific growth rate of methanogenic bacteria (d1)
strategy was interpreted from a physical process perspec-
2max maximum methanogenic bacteria growth rate (d1)
tive. The sensitivity of the optimal solution to uncertainties
vector of the process variables
in the model parameters was assessed. A new control strate-
gy which involved the dilution rate and the alkalinity was
devised to maintain the methane fraction in the biogas at REFERENCES
above 50% vol at all times.
In the second part of the project, the calibration of the [1] O. Bernard, Z. Hadj-Sadok, D. Dochain, A. Genovesi, and
model of anaerobic digestion was further improved. The J.-P. Steyer. Dynamical model development and parameter
model was simulated and compared with the available ex- identification for an anaerobic wastewater treatment pro-
cess. Biotechnology & Bioengineering, 75:424438, 2001.
perimental data. A sensitivity analysis for the response tra- [2] Y.-S. Chien. A study for multiple steady states of biochem-
jectories was performed. The five most sensitive parameters ical reactions under substrate and product inhibition. Bio-
were re-estimated to improve the robustness of the model, chemical Engineering Journal, 6:5157, 2000.
but to little avail. [3] H. Hadiyanto, D.C. Esveld, R.M. Boom, G. van Straten,
A.J.B. van Boxtel. Control vector parameterization with
sensitivity based refinement applied to baking optimization.
Food and Bioproducts Processing, 86:130141, 2008.

B bicarbonate concentration (mmol/L)

C, Cin total inorganic carbon concentration (mmol/L)
D dilution rate (d1)
d/dt time derivative
k1 yield for substrate degradation
k2 yield for VFA production (mmol/g)
k3 yield for VFA consumption (mmol/g)
k4 yield for CO2 production (mmol/g)
k5 yield for CO2 consumption (mmol/g)
k6 yield for CH4 production (mmol/g)
K a , Kb equilibrium constants (mol/L)
KH Henrys constant (mmol/L per atm)
kL a liquid-gas transfer coefficient (d1)
K I2 inhibition constant (mmol/L)
KS1 half-saturation constant (g/L)
KS2 half-saturation constant (mmol/L)
p parameter
PC CO2 partial pressure (atm)
PT total pressure (atm)
qC carbon dioxide flow rate (mmol/L per d)
qM methane flow rate (mmol/L per d)
r1 , r2 , r3 reaction rates (d1)
S1 , S1in organic substrate concentration (g/L)
S 2 , S2in volatile fatty acids concentration (mmol/L)
SI sensitivity index
t time (d)
tf final time (of time horizon) (d)