Copyright © IfAC Computer Applil:ations in Biotel:hnology, Osaka, Japan, 1998
A FAST GENETIC OPTIMIZATION FOR BATCH FERMENT ATION PROCESSES
B. de Andres-Toro, J.M. Giron-Sierra, J.A. Lopez-Orozco, C. FerDlindez-Conde, P. FerDlindez Blanco
Departamento de Arquitectura de Computadores y Automatica Universidad Complutense de Madrid, 28040 Madrid, £Spalia E-mail.
[email protected] .ucm.es, Tf. +3413944384, Fax.: +34 I 3944387
Abstract. The paper considers the dynamic optimization of the beer batch fermentation process as a representative case. That means a multiobjective optimization problem, the solution being a temperature profile that it is imposed on the process, to get the desired product characteristics in a short time. The temperature profiles are described by chromosomes, through a piecewise approximation. Genetic Algorithms are then applied with successful results, requiring moderate computational efforts. Since there is interest for a fast optimization, a study was done about the better specifications of the algorithm, to get quickly an optimal profile. Promising results are obtained. Copyright © 1998lFAC Keywords : Batch Fermentations, Genetic Algorithms, Process Optimization.
1. INTRODUCTION
UJ
Biotechnological processes offer an interesting and important field for the application of advanced optimization and control methods. Following the tradition of our Department, that is to always have an experimental reference, beer fermentation (Pollock, 1979) was selected as a typical batch fermentation case, easy to be studied at laboratory scale. Two laboratory systems were built: an isothermal multiple fermenter device, for up to 36 simultaneous fermentations in 1 It. flasks , and a pilot plant for 80 It. Both of the systems under computer control, using a set of sensors (pH, C02, pressure, temperature, turbidity), a warm-cold water circuit for temperature control, and interface electronics of our own design .
14
III
10
!So
lOO
I~O
Fig. 1. Industrial temperature profile. Industry wants to both accelerate the process, and increase ethanol efficiency. Quality must be preserved, so final undesirable byproducts must appear under prescribes concentration limits. A new temperature profile should be found to attain these objectives.
From the start of the conventional process, when yeast is added to the wort, a temperature profile is imposed to the fermentation . This profile should drive the fermentation to the desired final product. Figure 1 shows the actual profile applied by an important commercial brewery. Let us mention that this brewery helped to this research, giving industrial yeast and wort for our studies in laboratory.
In order to get a better temperature profile, it is important to consider what experts say: for each 1°C increase over 16°C, the risk of spoilage multiplies by ten (Lactobacillus Plantarum is the most feared spoilage agent in this case) (Simpson and Femandez, 1992).
61
So there is a multiobjective constrained optimization problem, that can be representative of many other batch fermentation processes.
By using Genetic Algorithms (Goldberg, 1989; Davis, 1991 ; Michalewicz, 1996), a promising way to quickly get optimal solutions was found . Moreover, it makes possible to consider fine approximations of the optimal profile. And there is no need of mainframes to get the solutions in a short time.
Computational approaches to solve this kind of problems, usually start by considering a piecewise approximation of the temperature profile. For instance, the total time can be divided into equal intervals, defming a sequence of instants. The profile temperatures at these instants are considered as breakpoints of the approximation. A search for the best sequence of breakpoints could be applied.
In the following the paper gives the mathematical details of the problem: the model of the fermentation, the function to be optimized, the statement in genetic terms. Then, an experimental methodological study to get the better genetic algorithm parameters, for a fast calculation, is presented.
First attempts with conventional optmuzation methods (such dynamic programming), showed great computational difficulties. Because the search space is large, memory and disk resources should be generous, and calculation speed is really a need . Scientific literature (Luus, 1990; Bojkov, 1994; Dadebo and McAuley, 1995; Gupta, 1995) mention the use of Cray computers, for somewhat coarse piecewise approximations of the temperature profile (for instance, dividing the total time into ten intervals). In our case, for a total fermentation time of 150 hours, and intervals of 10 hours, a first attempt with an Intel based computer (a 486 at 100 Mz.) required 3 months to get a solution.
2. A MODEL OF BEER FERMENTATION To get realistic results, industrial materials (wort and yeast) and conditions (no stirring) were applied during the experimental studies. So biomass sedimentation is important, as well as the agitation effect of the bubbles. The initial biomass is mainly in a latent state. After a lag phase of several hours, latent cells become active . During activity, cells reproduce, and some die. The main responsible of the fermentation is the active suspended biomass. After three years of experiments, the following model was found:
Conversations with experts (from industry and from Departments of Microbiology and of Bromatology) about the initial conditions of the fermentations, showed that there are important differences between winter and summer wort, and between young and aged yeast. A long optimization procedure will need to consider only one standard case; but it seems useful for industry to have the possibility of a fast procedure, to adapt the profile to each particular case. A good scenario could be that before starting the batch process, the initial conditions of the fermentation could be measured and considered in the calculation of a specific optimal temperature profile, to be applied as soon as possible (initial wort quality degrades quickly) .
Lag phase:
= constant = 0.48· xiniliaf
(1)
dXaclive - - = Illag·(0 .48 . xinilial ~ xaclive )
(2)
Xaclive + x lag dt
dX
.
lag Tt = xaclive = -Illag· xlag
(3)
Fermentation phase: dXaclive . k . . -d-t- - Ilx xaclive - m xaclive + III Xlag
As a fermentation takes place, some deviations from the predicted behaviour could happen. Perhaps some countermeasures to recover optimal characteristics could be applied. This requires a step further in optimization speed. if it is possible, it would enter into the domain of real-time optimization: a very topical scientific subject.
Ilx
IlxoS = ---'--"-"---
(5) (6)
0.5 sinilial + e
dXbottom dt
= !lo· X+
(7)
cons --;it = Ils· Xaclive
(8)
Ilsos Ils = - ks +s
(9)
ds
As our Department tradition promotes the use of computer for real-time control tasks, the desire is to make the equipment requirements obey to realistic industrial economical and operational criteria. The most recognised solutions are in the form of Intelbased industrial computers, with interface electronics. It would be appreciated that the same computer that is employed for control, could be used for the optimization.
de
cl! = 11 .. f- x aClive
(10)
f = 1___e__ 0.5 sinilial
(11 ) (12)
62
d(ea)
ds
dt = Yeas dt = Yeas' Ils' Xaclive
15
(13)
O.lppm
d(vdk)
- - - = k dc' S Xaclive dt
k dm·( vdk)' e
(14)
10
This model has been presented in detail in (AndresToro, et al., 1997a). The main phenomenon is the conversion of sugars to ethanol. The model also includes the concentration dynamics of the preponderant undesirable by-products: diacetyl (Figure 2) and ethyl acetate (Figure 3).
. HoulS
Temperature influences the fermentation pace: at 8 °C it takes 12 days to complete, at 12°C only 3 days. As temperature is the variable we can manipulate, the main effort of the experimental research was directed (using the isothermal system) to establish how it affects the model parameters:
Il
-63720 = 1.09S1 0 47. e 199536(T +27315)
xo
!
100
150
Fig. 3. Evolution of ethyl acetate .
3. THE OPTIMIZATION PROBLEM Taking into account the main goals of the optimization, an objective function was formed adding four weighted terms:
(1S)
-76450 km
= 3.37310 56. eI99536(T+273 15)
( 16)
-53056
11 = + 10 ethanol end 12 = _S .73e(95diacelhyl-II5I)
(23) (24)
cas
= 1. 11291039. eI99536(T+273 15)
( 17)
J 3 = -1.16 e( 460 acetale-66. 77)
(2S)
IlDO
-20020 = 4.88910 14. eI99536(T+273 15)
( 18)
14 = + 11lLB·dt
(26)
23254 Ilso = 6.23210- 19. eI99536(T+273.15)
( 19)
Note how the exponential terms will forbid any limit violation in the final by-product concentrations.
= 26 386SeI99536(T+273.15)
(20)
- 76450 = 2.204} 1013'eI99536(T+273 15)
(21 )
-76450 k a = 1. 108} 10- 52. eI99536(T+273 15)
(22)
The strategy to be applied starts allowing ISO hours to complete the fermentation . An optimal temperature profile must be found, that maximizes the objective function. Then, the time allowed for the fermentation is shortened, and a new optimal profile is found. This is repeated until the profile obtained does not fit with the quality and spoilage risk limits.
Y
-2528.6 I1
r-ao
Ill
ag
.
The use of one objective function grouping all the aspects of the problem, facilitates the application of Genetic Algorithms. It is immediate to employ it as the fitting function.
2 ppm
1.5
4. CHROMOSOMES The first step to apply Genetic Algorithms is to represent the problem in terms of chromosomes. A simple way for our problem is to use a piecewise approximation of the temperature profile (figure 4), recording the temperatures at the breakpoints (from left to right). The sequence of numbers so obtained can be considered as chromosome.
0.5
f 50
100
150
Fig. 2. Evolution of diacethyl.
In our case, integer numbers between 10°C and 18°C were taken for the piecewise approximation. For example: Chromosome
63
= {10,
10, 13, 12, 11, .... .. }
,.
'C
hours to 130 hours. The value of the objective function for this optimal profile is:
~Jv-------------~
"
." ",a
J = 556.73
6. OPTIMIZATION REFINEMENTS Obviously the temperature profile obtained is so jagged, that cannot be directly applied. Some ways to smooth the profile were devised (for instance, to use real-time values in the chromosomes, instead of integer values, or hill-climbing procedures (AndresToro, et aI., 1997b), with good results, but, anyway, a change of the objective function should be done, including a new factor that tends to minimise abrupt changes of temperature:
o~--__- - - -___________________________
a
'"
.. .. .
-.
,Cl)
,,.
.
,
Fig. 4 Chromosomes.
To ease computations, these numbers were directly handled by the genetic operators, instead of the binary representation commonly used in the genetic algorithms context.
130
15 = Iabs(Ti +1 - Ti ) i=1
5. BEGINNING WITH GENETIC ALGORlTHMS
(27)
This addition induces a significant improvement of the profiles, as shown in Figure 6 for the 130 optimal solution.
Each chromosome describes a temperature profile, which has an effect on the fermentation results . Using the model, a complete simulation of the fermentation is run for each chromosome, to calculate the corresponding value of the objective function. The values obtained are used as fitting function to select good chromosomes.
Optimal prohle
12
To start our application of Genetic Algorithms, the following parameters and specifications were chosen. An initial population of 1200 chromosomes was created at random. Each new generation originates 400 new chromosomes, and substitutes the worst 400 old ones. Parent selection is made by roulette-wheel. The crossover probability is 0.8, and the mutation probability is 0.008 (as recommended by literature).
~10 .9!
1! ~
8
" 2
°O~--~2~O----4~O~--~50~--~OO~---1~OO~--1~~~ Ho....s
Fig. 6. Optimal smoothed solution for 130 h. The initial population of 1200 chromosomes was decided in order to have a good degree of population diversity. However, during a Conference on Computational Intelligence, we received an interesting advice from Prof. Michalewicz: to reduce the initial population, to quickly obtain the results. In response to this advice, an experimental study was started, to determine better specifications of the genetic algorithm.
12
10~
o
______~~________________~ 50 100 150
Fig. 5. Optimal chromosome for 130 h.
7. GETIING A FAST OPTIMIZATION METHOD
Using MATLAB, it was easy to develop the code. The first results were encouraging, so a fine discretization of the temperature profile, taking equal intervals of 1 hour, was decided. The evolution converges to an optimal profile in less than 250 generations, taking less than 2 hours in our Intelbased computer. Figure 5 shows an optimal profile that can shorten the fermentation time from 150
With the objective of approaching to real-time optimization, a systematic study was accomplished about the effect of different parameters on the time to get the optimal solution. As there are many calculations involved in this research, a version of our procedures was developed in C language, in order to use a Silicon Graphics O2 Workstation.
64
First, we studied the influence of the total number of individuals in the population, and the number of individuals to be substituted in each generation. A matrix of different cases was formed, combining in a proper way populations of 1200, 1000, 800, 600, 400, 200. 100, 50 individuals, and substitutions of 20%, 40%, 60% individuals. Figure 7 shows the results concerning the time invested to get the optimal solution. Clearly, to get a faster optimization, it is better to specify a small initial population, and few substitutions.
corresponding algorithm can get the optimal solution in around 3 minutes, on a Silicon Graphics O2 Workstation, that means 30 min. on our Intel-based computer. Next targets for research are the study of the influence of initial conditions, and process deviations, on the optimal profiles; and adapting the algorithm code to an Intel-based computer for quick computation. Then, real-time optimization will be tested on experimental settings. M.taIion probability = 0 .008 9r-------~------~------~------_,
llME (0)
.....
8
6000 5000 4000 3000
2000 1000
o
60
1500
SUbstlllllOlll ('110)
20
0
0.8
N 01 illd-Adu ..s
0 .65
0 .7
0 .75
Crossover probability
Fig. 7. Influence of die number of individuals and substitutions on evolution time.
Fig. 8. Influence of crossover probability on evolution time (mutation probability 0.006).
In addition, it was observed that double-point crossover renders better convergence rates .
9r-------~------~------~------_.
MutoIllon prOl>ablNly
=0 .007
8
Taking a population of 10 individuals, and 40% substitutions, the research focused on the crossover and mutation probabilities. A matrix of combinations was formed , for crossover probabilities of 0.4, 0.5, 0.6,0.7,0.8, 0.9, and mutation probabilities of 0.005 , 0.006, 0.007, 0.008, 0.009. Usually each evolution converges to the optimal profile in around 3 minutes. But it was noticed that some times an evolution takes longer to converge. This seems to depend on die characteristics of the initial population (for instance, its diversity degree). For the same specifications, each evolution run can take more or less time to converge. This sensitivity is more pronounced for small initial populations.
0.6
0 .85
0 .7 Crossover probebiNty
0 .75
0 .8
Fig. 9. Influence of crossover probability on evolution time (mutation probability 0.007). Mul8lion probability K 0 .008
To determine how disperse the convergence times can be, a series of 50 evolution runs were computed, for the better cases of the probabilities matrix. Figures 8, 9 and 10 show the results .
8. CONCLUSIONS
06
Genetic Algorithms prove to be useful for the kind of multiobjective optimization problems considered in this research, related to batch fermentations . It seems that the new methodology paves the way to a fast and easy optimization.
0 .65
0 .7
08
Crossover probability
Fig. 10. Influence of crossover probability on evolution time (mutation probability 0.008) .
An important part of our latest research is devoted to find specifications for a quick procedure, in view of real-time optimization. With the results obtained, the
65
Goldberg, D.E. (1989). Genetic Algorithm in Search, Optimization, and Machine Learning. (Addison Wesley).
Acknowledgement: The authors wish to acknowledge support of this work by the Multidisciplinar Research Projects of the University Complutense of Madrid, ref. PRl60193# . We also thank the Cruzcampo's brewery for its collaboration.
Gupta, Y.P. (1995). Semiexhaustive Search for Solving Nonlinear Optimal Control Problems . 3878-3884. Ind. Eng. Chem. Res., vo!. 34. Luus, R. (1990). Optimal Control by Dynamic Programming Using Systematic Reduction in Grid Size. 995-1013, Int. J. Control, vo!. 51.
REFERENCES Andres-Toro, B., Giron-Sierra, J.M., FemandezConde, c., Peinado, J.M., and Garcia-Ochoa, F. (1997 8 ) . A Kinetic Model for Beer Fermentation under Industrial Operational Conditions. 203208 . Proc. IMACS/IFAC 2th. Int. Symp. Mathematical Modelling and Simulation in Agricultural and Bio-Industries, Budapest, Hungary.
Michalewicz, Z. (1996). Genetic Algorithms + Data Structures Evolution Programs. (SpringerVerlag). Pollock, J.R.A. (1979). Brewing Science. (Academic Press). Simpson, WJ., and Femandez, J.L. (1992). Selection of Beer-Spoilage Lactic Acid Bacteria and Induction of their Ability to Grow in Beer. 1316. Lett. Appl. Microbiol., no. 14.
Andres-Toro, B., Giron-Sierra, J.M., Lopez-Orozco, J.A., and Femandez-Conde, C. (1997b) Optimization of a Batch Fermentation Process by Genetic Algorithms. 183-188. Proc. IFAC ADCHEM 97, Int. Symp. Adv . Control of Chemical Processes, Banff, Canada.
NOMENCLATURE Bojkov, B., and Luus, R. (1994). Application of Iterative Dynamic Programming for Time Optimal Control. 72-80. Chem. Eng. Res. Dev., vol. 72. Xactive
x.-
Dadebo, S.A., and McAuley, K.B. (1995). A Simultaneous Iterative Solution Technique for Time-Optimal Control Using Dynamic Programming. 2077-2083. Ind. Eng. Chem. Res ., vol. 34 .
x X bonom Sinicial
s e (vdk) (ea)
Davis, L. (1991). Handbook of Genetic Algorithms (Van Nostrand).
66
is the initial concentration of biomass is the concentration of suspended latent biomass idem of suspended active biomass idem of suspended dead biomass idem of total suspended biomass idem of biomass at the bottom is the initial concentration of sugars is the present concentration of sugar is the present concentration of ethanol is the concentration of diacethyl is the concentration of ethyl acetate