Development of A MATLAB Based Bioprocess Simulation Tool
Development of A MATLAB Based Bioprocess Simulation Tool
Development of A MATLAB Based Bioprocess Simulation Tool
621
Abstract A simple user friendly mathematical modelling part of them has to be replaced by such simulation prac-
tool was developed on the basis of MATLAB software. The tices. A rather simple batch fermentation run in a pilot-
program system provides the possibility of solving dif- scale bioreactor needs tens of hours of experimental time
ferential equation system with the aid of an easy-to-use and several hundreds of USD for materials and energy. At
graphical surface. It is suitable for bioprocess engineering the same time using a proper simulation program tens of
simulations to describe the dynamic behaviour of a great various ``experimental'' runs can be carried out during
series of various enzyme, fermentation and environmental several minutes with an almost negligible price, keeping
bioreaction systems. It is especially bene®cial that non- naturally in mind that real manual experimentation and
time interventions can also be modelled and graphical model based simulations together are able to effectively
representations can be realized on a wide palette. deepen our and our students' knowledge.
There have been a lot of efforts to develop math-based
List of symbols simulation tools for bioreaction engineering. One of the
ODE Ordinary differential equation best known is the MATLAB based program system de-
X, Xprey, Xpred Biomass, prey and predator biomass veloped by S-O. Enfors [1] which can be used for the
concentration simulation of a series of fermentation processes. It is
Xmax, Xmin Preset values of biomass in turbido- characteristic of this program system that
stat fermentation
S, Sfeed Concentration of C/energy source and ± In theory the whole MATLAB-served functionality can
its inlet concentration be exploited,
C, C Dissolved oxygen concentration and ± There are no clear de®nition-®le formats,
its saturation value ± In order to modify a given model, MATLAB ®les have
Yi Overall yield coef®cients to be modi®ed,
Ki Substrate saturation (MONOD) con- ± Parameter de®nition to the models is based upon
stants global variables and constants,
KLa Volumetric oxygen absorption coef®- ± The user surface is rather unfriendly and visualization
cient of results is not taylor made, functions can not be
a Luedeking±Piret proportionality con- scaled,
stant ± The user surface and visualization need individual
D Dilution rate developing work from model to model.
lmaxi Maximum speci®c growth rates
Another widely used approach is based upon the model-
ling work of Dunn et al. [2]. The earlier applied and a bit
1 cumbrous ISIM simulation language has recently been
Introduction replaced by the much more user friendly MADONNA
Nowadays mathematics based computer simulations be- software. Numerous chemical and biochemical as well as
come essential part of research and higher education environmental engineering model examples are now ac-
systems because of their cost effectiveness and time saving cessible as sharewere programs on the Web [3, 4].
features. This is of even higher importance in the case of MADONNA is an easily programmable software pro-
teaching bioengineers (one of the main educational ac- viding special modelling environment: an ``equation win-
tivity of TU Budapest, Chemical Engineering Faculty) dow'' for formulating the system de®nition ®le, a
where the necessarily many conventional laboratory ``parameter window'' to set numerical values of the equa-
courses are getting more and more expensive and at least a tion constants, and a ``graph window'' for visualization of
the simulation results, with some other bene®cial features
like possibility of multiple running with one start and
Received: 6 December 1999 statistical evaluation of the results and opportunity of
showing the results in table-format and others make this
B. Sevella, G. Bertalan (&)
Department of Agricultural Chemical Technology, approach a distinguished modelling tool. On the other
TU Budapest H-1521 Szt. GelleÂrt teÂr 4. Budapest Hungary hand an unpleasant disadvantage of the MADONNA is that
programmed changing of model parameters is possible
This work was supported by OTKA grant T-022182 and T-029882. exclusively in the function of time (as independent vari-
Bioprocess Engineering 23 (2000)
able). This does not make possible e.g. modelling those results can be graphed not only as time functions but
systems where non-time variables should regulate the bi- any of the model variables can be chosen as ``inde-
oreactions like in the case of turbidostat, varying feed rate pendent'' variable.
fed batch fermentations and so on. ± The graph axes of the functions are individually scal-
To overcome some unpleasant drawback of the known able.
simulation tools we developed a program system with ± Three dimensional graphical representations of the
which either simple unstructured and structured or more results are also possible.
sophisticated biological i.e. enzyme, microbial fermenta-
Designing of this simulation program based upon the use
tion and environmental bioreactions can be simulated with
of UML (Uni®ed Modelling Language) methodologies [5]
differential equation systems and the results can be
and the structure of the resulting system is shown in the
visualised on user-friendly graphical surfaces.
622 Fig. 1.
2
3
Designing the simulation program
Structure and use of the simulation program
Applying the built-in possibilities of the MATLAB 5.3
Starting a simulation run can be initiated on the command
software our simulation program development met a set of
window of MATLAB with the ``ODEmain'' command. The
requirements:
resulting window is empty with the only active ``Load
1. The mathematical models can be described in the ODE®le'' element which enables the loading of the de®-
ODE®le (ordinary differential equation) de®nition nition ®le of the actual mathematical model. For the sake
format of the MATLAB. of simplicity here the single limiting substrate MONOD-
2. Solution of the model equations can be performed by type model with bacterial growth, substrate consumption
the MATLAB ODEsolvers. and product formation serves as introductory example and
3. Simple use of the program: the built-in options of the the whole de®nition ®le is shown in the Appendix.
ODE®le and the proper ODEsolver can be chosen on Figure 2 shows the after-loading active picture of the
the graphic surface and the state of the running is
shown during the solution process therefore it can be
stopped at any time if the solution lasted too long.
4. Modi®cations of the initial conditions as well as the
parameters of the model differential equations are
possible on the same graphic surface.
5. Regarding the visual appearance of the simulation
results the following bene®cial features of the program
can be applied during various simulations:
± More than one result set can be shown at the same
time.
± The results can be stored in ®les and these ®les are
reloadable and are printable at any time. Fig. 2. Active picture of ODE Driver Main Window showing all
± Individual or arbitrary combinations of the resulting the intervention, changing and varying possibilities before
functions can be shown on preselected graphs and running a simulation
``Main window'' on which the ®rst column de®nes the ± In the case of step by step simulations all the consec-
variables of the model and the second refers to the model utive set of results are shown on the same graph.
parameters. Under these two columns one can give the ± Saving the actual visible set of results in the form of
required numerical value of the variables initial values and reloadable and ASCII convertible ®les is possible.
the model parameters. The ranges in which they are shif- ± Scaling arbitrarily the variable axes thus making the
table have to be given in the ODE®le. The third column very much different order of magnitude results (e.g.:
gives choices between the MATLAB ODE®le de®nition biomass and dissolved oxygen tension) visible in one
options but the value of these may also be empty (as is coordinate system is a useful option.
shown in Fig. 2). At the right lower corner of this central ± Hiding or showing discretionary variable(s) simply
panel the time interval of the simulation can be given with clicking on the chosen curve(s) helps the thorough
setting the start and end time of the simulation, while at examination of the results.
623
the upper corner the actual differential equation solving ± Hiding and showing the parameters of the chosen set of
algorithm can be chosen out of seven different built-in simulation could also be fruitful.
MATLAB methods. During the simulation the picture of ± Any of the variables can be chosen as independent
the panel changes to the one shown in Fig. 3 where all the variable not only the time that makes easier to interpret
®elds and buttons are inactive but running coloured bars the results exploring the correlations between impor-
indicate the status of solution process. If these bars are tant process variables.
moving too slow (possibly the solution method is not ef- ± More than one simulation may also be graphed in a
fective enough) the process can be interrupted by the only three dimensional form, giving a clearer overview
active stop button. When the solution has completed the among the various curves.
button ``Display'' becomes active and the simulation re-
In the following section we demonstrate the use of our
sults are to be graphed. This can be carried out with the
simulation package through some practical instances with
use of the ODE Driver Display Window (Fig. 4), with
special regards to some programming and graphic repre-
which the following manipulations can be done with the
sentation advantages of the system.
results:
% function dydt dX S c
f (t, y, mumax, Ks, Ko, Yxsl, Yps1, Yos1, Yxs2, Yps2,
lmax X ;
dt KS S KO c
Yos2; Kla; c star, X
dS 1 S C
feed, Sfeed, Pfeed, Smin, Ffinal, c lim, c band) l X ;
dt YX=S max KS S KO C
global F t lim flag;
% Variables: dP dX
a ;
x y
1; dt dt
S y
2; P y
3; dC 1 S C
l X KL a
C C :
C y
4; V y
5; dt YO max KS S KO C
624 if isempty
flag & S < Smin
flag 1; Figure 5 shows the simulation results at a given param-
t lim t; eter combination. The initial batch phase of the cultiva-
end; tion is consciously overemphasized, to demonstrate how
the system behaves when the substrate is getting
if t < t lim
exhausted.
Yxs Yxsl;
Yps Yps1;
Case 2: Simulation of turbidostat fermentation
Yos Yos1;
Turbidostat fermentation system is a useful experimental
else tool when diluted culture media and unicellular micro-
Yxs Yxs2; organisms are to be cultured. The growing cell mass in-
Yps Yps2; creases the turbidity of the culture broth (measured in the
Yos Yos2; form of optical density i.e. absorbancy of a monochro-
if c > c lim c band=2 matic light beam through a ¯ow cell) and this value as a
F F final;
measure of the cell mass can be used as control variable
for feeding of the fresh medium. When the turbidity of
elseifc < c lim c band=2
the broth reaches a preset value (Xmax) a timer system
F 0; starts a medium feeding pump and at the same time
end; culture broth is taken off the bioreactor with an other
end; pump and with the same volumetric speed. This results in
% Differential equations : a dilution of the culture broth thus the optical density
dydt F=V
Xfeed X X mumax S=
S Ks decreases. If it reaches another, arbitrarily chosen lower
c=
c Ko; . . . turbidity setpoint (Xmin) both pumps stop and a new
F=V
Sfeed S X
1=Yxs mumax S=
S Ks
growth period begins. Xmin is de®ned as a given percent
of Xmax.
c=
c Ko; . . .
The following minute detail program is a part of the
F=V
Pfeed P X
Yps=Yxs mumax S=
S Ks turbidostat simulating ODE®le and it is responsible for the
c=
c Ko; . . . de®nition of the parameters, equations and the turbidity
Kla
c star c X
Yos=Yxs mumax S=
S Ks control unit. The routine is apparently a chemostat-algo-
c=
c Ko; %Kla rithm but during the growth periods dilution rate = 0
>> F=VF; (thus it gives back a batch performance), while during the
medium addition and broth removal periods an enor-
mously high dilution rate is applied simulating a very high
speed pump operation. The variable subs determines the
amount of broth taken off during one pump operation
period.