You are on page 1of 4

MATLAB Toolbox for Biogas Plant Modelling and Optimization

MATLAB Toolbox for Biogas Plant Modelling and


Optimization
Daniel GAIDA1,2, Christian WOLF1, Michael BONGARDS1, Thomas BÄCK2
1
Cologne University of Applied Sciences, 2Leiden University (the Netherlands)
1
Steinmüllerallee 1, 51643 Gummersbach, Germany
Phone: 0049 (0)2261 8196 6671, Fax: 0049 (0)2261 8196 6666
daniel.gaida@fh-koeln.de

Introduction

Optimization, stability analysis and control of agricultural and industrial biogas plants become
more and more important to achieve and guarantee sustainable efficient plant operation. One
possible approach to address these challenging tasks is to develop detailed mathematical
models as an approximation of real-world full-scale biogas plants. A combination of these
models and sophisticated algorithms has proven to provide good solutions to the challenge
of optimal plant monitoring, operation and control. To be able to do this in a well-structured
manner a MATLAB® [1] toolbox has been developed for these purposes in particular. The
models of the biogas plants as well as necessary optimization and control algorithms are
developed in MATLAB/Simulink. Furthermore, graphical user interfaces (GUIs) for the user
are created using MATLAB’s GUI designer to offer best availability and useability to the user.

The Toolbox

The key idea of the toolbox is to treat algorithms for optimization and control and biogas plant
simulation models separately. The advantage is that all algorithms can be easily applied to
different tasks as well as different biogas plant models. As prerequisite all models have to be
designed following the same guidelines, which are facilitated by using well-developed
graphical user interfaces implemented in the toolbox. With these GUIs the user can e.g.
specify the setup of a plant, like the number and properties of the fermenters as well as those
for the cogeneration units available on the plant. Furthermore, physical and chemical
characteristics of the substrate feed can be specified, which makes detailed simulations of
various substrate mixtures possible. The toolbox then uses this information to semi-
automatically generate a MATLAB/Simulink model of the specified biogas plant, which by
default satisfies the required guidelines (see figure 1 for an example). The fermenters are
modelled using the well-known Anaerobic Digestion Model No. 1 (ADM1) [2], which is used
to model the anaerobic digestion process of agricultural biogas plants, as it is done in [3, 4]
respectively. The ADM1 is a structured model with disintegration and hydrolysis,
acidogenesis, acetogenesis and methanogenesis steps, which is implemented in MATLAB in
form of a differential equation system [2].
Having generated a model, the toolbox helps the user to calibrate and validate it. Since
ADM1 is a white-box model it is very easy to implement virtual sensors inside the model to
measure important physical and chemical process parameters which can also be measured
in practice. Examples are pH value, biogas flow, methane and carbon dioxide concentration
as well as organic acid concentrations, FOS/TAC value [5], ammonia and ammonium
concentration and energy production and consumption [6] to just name a few values. By
comparing virtual and real measurements over a given time period the model can be
calibrated and validated to obtain a reasonable model of the original biogas plant. Since
calibration is an optimization problem with the parameters of the ADM1 being the
optimization variables this problem can easily be solved using the generic optimization
scheme described below.

1
Progress in Biogas Stuttgart-Hohenheim 2011
MATLAB Toolbox for Biogas Plant Modelling and Optimization

Figure 1: Example of a biogas plant simulation model containing two fermenters

Using calibrated simulation models, different algorithms can be applied to solve all kinds of
tasks the user may be interested in. In this paper the focus will be on optimization and
optimal control algorithms.
The toolbox uses a generic optimization scheme to easily apply and adapt various
optimization algorithms. Many different optimization algorithms can be used, where as this
list can be extended easily using a well-defined interface.

 Genetic Algorithm, Simulated Annealing and Pattern Search (MATLAB’s Genetic


Algorithm and Direct Search Toolbox [1])
 Particle Swarm Optimization (toolbox by Brian Birge [7])
 Covariance Matrix Adaptation Evolution Strategy (by Nikolaus Hansen [8])
 Differential Evolution (by Kenneth Price and Rainer Storn [9])
 “Improved” Evolution Strategy using Stochastic Ranking (by Thomas Philip
Runarsson [10])

Solvable optimization and optimal control problems using the toolbox are:

 Calibration of biogas plant models.


 Finding a constant substrate mixture leading to an optimal and stable long-term
stationary operation of the plant.
 Finding an optimal operating point satisfying various constraints, such as pH value,
FOS/TAC value, biogas production, methane content, etc.
 Determining an optimal control strategy leading to the obtained optimal operating
point above or to find a better operating point as the current one using Nonlinear
Model Predictive Control (NMPC).

The meaning of optimality can be defined by the user. Therefore the toolbox provides a GUI
to support the user to define some optimality criteria, which can be combined together.
Example criteria are cost vs. benefit (with respect to the new Renewable Energy Sources Act
(EEG 2009) in Germany), stability of operation and substrate degradation criteria as well as
various constraints, like upper and lower pH value, maximal FOS/TAC value, maximal total
solids content of the substrate feed, minimal methane concentration of the biogas, manure
bonus, etc.

2
Progress in Biogas Stuttgart-Hohenheim 2011
MATLAB Toolbox for Biogas Plant Modelling and Optimization

Case Study

End of 2010 one national project [11] was successfully realized using this toolbox. One goal
of this project was to optimize the substrate feed of two agricultural biogas plants for a long-
term stationary operation of the plants. To accomplish this, a detailed model for each plant
was developed, calibrated and successfully validated using measurement data from the
plants. For each of the two models an optimization problem was started, searching for the
optimal substrate mix out of the available substrates. In such an optimization problem many
simulations, all with different substrate mixes are run and evaluated, until the evaluations do
not improve anymore and the best, i.e. the minimal, evaluated substrate mix is returned.
Figure 2 and 4 show the results of these simulations with respect to a cost vs. benefit
analysis (Figure 2) and with respect to the overall fitness (goodness) of the substrate mix
(Figure 4). The solution of this optimization problem comes up with an improved substrate
mix for one of the plants, which has a better cost vs. benefit result (see Figure 3).

Figure 2: Cost vs. benefit analysis of the evaluated substrate mixes (the smaller the value (the
cooler the color), the better the result)

Figure 3: Comparison of the original and the optimal substrate mix for one plant

3
Progress in Biogas Stuttgart-Hohenheim 2011
MATLAB Toolbox for Biogas Plant Modelling and Optimization

Figure 4: Overall fitness of the evaluated substrate mixes (the smaller the value (the cooler the
color), the better the result)

Conclusion

The goal of this toolbox is to optimize the operation of full-scale agricultural and industrial
biogas plants and to analyse their operating point with respect to optimality and stability.
Achieving this goal could lead to more profitable and therefore competitive operation of
biogas plants, which will promote the role of biogas plants as energy source in the future.
The result of the national research project MOBIO [11] demonstrates the applicability of this
toolbox.

References
[1] MATLAB, http://www.mathworks.com/, last accessed: 31.01.2011.
[2] D.J. Batstone, J. Keller, I. Angelidaki, S.V. Kalyuzhnyi, S.G. Pavlostathis, A. Rozzi, W.T.M. Sanders, H.
Siegrist, and V.A. Vavilin, Anaerobic Digestion Model No.1 (ADM1). London: IWA Task Group for
Mathematical Modelling of Anaerobic Digestion Processes, IWA Publishing, 2002.
[3] K. Koch, M. Lübken, T. Gehring, M. Wichern, and H. Horn, “Biogas from grass silage ‐ Measurements and
modeling with ADM1,” Bioresource Technology, vol. 101, no. 21, pp. 8158‐8165, 2010.
[4] D.I. Page, K.L. Hickey, R. Narula, A.L. Main, and S.J. Grimberg, “Modeling anaerobic digestion of dairy
manure using the IWA Anaerobic Digestion Model no. 1 (ADM1),” Water Science and Technology, vol. 58,
no. 3, pp. 689‐695, 2008.
[5] M.A. Schoen, D. Sperl, M. Gadermaier, M. Goberna, I. Franke-Whittle, H. Insam, J. Ablinger, and B. Wett,
“Population dynamics at digester overload conditions,” Bioresource Technology, vol. 100, no. 23, pp.
5648‐5655, 2009.
[6] M. Lübken, M. Wichern, M. Schlattmann, A. Gronauer, and H. Horn, “Modelling the energy balance of an
anaerobic digester fed with cattle manure and renewable energy crops,” Water Research, vol. 41, no. 18,
pp. 4085‐4096, 2007.
[7] Brian Birge, Particle Swarm Optimization Toolbox,
http://www.mathworks.com/matlabcentral/fileexchange/7506-particle-swarm-optimization-toolbox, last
accessed: 31.01.2011.
[8] Nikolaus Hansen, Covariance Matrix Adaptation Evolution Strategy,
http://www.lri.fr/~hansen/cmaes_inmatlab.html, last accessed: 31.01.2011.
[9] Kenneth Price and Rainer Storn, Differential Evolution, http://www.icsi.berkeley.edu/~storn/code.html, last
accessed: 31.01.2011.
[10] Thomas Philip Runarsson, “Improved” Evolution Strategy using Stochastic Ranking,
http://www3.hi.is/~tpr/index.php?page=software/sres/sres, last accessed: 31.01.2011.
[11] MOBIO final report, Cologne University of Applied Sciences & PlanET GmbH, government-funded by AiF,
no. KA0607901WD8, 2010.

4
Progress in Biogas Stuttgart-Hohenheim 2011

You might also like