Applied Microbiology Biotechnology
Appl Microbiol Biotechnol (1988) 28:128-- 134
© Springer-Verlag 1988
On-line parameter and state estimation of continuous cultivation by extended Kalman filter Jan N~hlik and Zden~k Burianec Prague Institute of Chemical Technology, Suchbfitarova 5, 166 28 Praha 6, Czechoslovakia
Summary. The on-line estimation of biomass concentration and of three variable parameters of the non-linear model of continuous cultivation by an extended Kalman filter is demonstrated. Yeast growth in aerobic conditions on an ethanol substrate is represented by an unstructured non-linear stochastic t-variant dynamic model. The filter algorithm uses easily accessible data concerning the input substrate concentration, its concentration in the fermentor and dilution rate, and estimates the biomass concentration, maximum specific growth rate, saturation constant and substrate yield coefficient. The microorganism Candida utilis, strain Vratimov, was cultivated on the ethanol substrate. The filter results obtained with the real data from one cultivation experiment are presented. The practical possibility of using this method for on-line estimation of biomass concentration, which is difficult to measure, is discussed.
Introduction Biotechnological processes are characterized by a number of typical peculiarities, one of them being the slow variation of the physiological characteristics, and consequently the behaviour, of cultivated microorganisms during growth. These variations in characteristics can be understood as changes in the parameters of a mathematical model of the nonlinear fermentation process. However, the lack of reliable on-line instruments means that not all the necessary state variables needed for control can be measured on-line. Most Offprint requests to: J. N~hlik
frequently, these variables are the biomass and the substrate concentration. To overcome these difficulties in fermentation control, some of the non-linear filtration methods can be used. These methods permit not only the estimation of on-line state variables but also simultaneous estimation of the slowly varying parameters of the employed dynamic model of the fermentation process.
Basic deterministic model of continuous fermentation For control purposes the unstructured model for biomass growth based on Monod's equation is usually used. The following assumptions were accepted: 1. The deathrate of the microorganisms is minimal, and can therefore be neglected, 2. The electronic control facility ensures that the value of the dissolved oxygen concentration remains constant, and therefore oxygen need not be balanced. 3. During fermentation there is no substrate inhibition, due to its low concentration. Assuming this, the dynamic model of this fermentation process can be written as follows:
dX dt
- #X-
dS -~
= D(S, - S) - ~
(1)
DX
1
#X
(2)
S
It =It~t Ks + S '
(3)
where X and S denote the concentration of biomass and substrate in fermentor, respectively; S;
J. N~ihlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
is the concentration of input substrate; D is the dilution rate;/z and #M are the specific and maximum specific growth rate, respectively; K s is the saturation constant and Yxls is the substrate yield coefficient.
Methods of parameter and state estimation of continuous fermentation
Determining the parameters of the given model, however, is very difficult, since the living cells are extremely sensitive to changes in environmental conditions. Changes in behaviour of the culture are manifested in changes in the model parameters. Thus fermentation can be regarded as a t-variant system. Nevertheless, numerous authors start from the assumption that the parameters of the model are constant (Naito et al. 1969; Holmberg and Ranta 1979; Nihtil~i and Virkkunen 1977). Assuming that all the state variables are measurable on-line (i. e. the biomass and substrate concentrations) and the parameters of the model are constant, they most frequently solve the problem of parameters of a non-linear unstructural model estimation by using some of the methods of nonlinear programming. Another possible approach is parameter estimation with the aid of sensitivity functions. This method was originally applied to the fermentation processes by D'Ans et al. (1972) and successfully used in practice (Holmberg and Ranta 1979, 1982; Halme et al. 1977). From the more realistic point of view, however, it is necessary to consider the fermentation processes as being actually time-variant, non-linear, dynamic systems. For the on-line tracking of the varying model parameters from the know online measurements of both the state variables, biomass and substrate concentrations, the recursive least-squares method can be used, as the model can be transformed into a linear parameter model. This approach as also been applied by Dochain and Bastin (1984) and Lozano and Carrilo (1984) for the purposes of adaptive control. Another possible approach is the application of the so-called extended Kalman filter. A successful application of Kalman filtration ,to on-line parameter estimation of the model of biomass growth for biological treatment of waste water has been reported by Howell (1981), who implemented the relevant program on a PET microcomputer. Halme et al. (1977) also proposed the implementation of this method in their digital control system.
129
From the practical point of view, the assumption that the state variables are both measurable on-line is usually unrealistic. If only one of them is measurable, it is necessary to solve the problems arising from simultaneous tracking of both the state- and time-varying parameters of the nonlinear dynamic system by some of the non-linear filtration methods. This general, and at present also most realistic, practice has been studied by Svrcek et al. (1974). This group, when investigating the algorithm of the extended Kalman filter, dealt also with the behaviour of the filter in tracking the substrate concentration and the varying parameters of the model, on the basis of experimental data of the biomass and input substrate concentrations. The extended Kalman filter has also been used by Bellgardt et al. (1984) for the recursive estimation of biomass concentration and of two varying biological parameters, using on-line measurements of the volumetric percentage of oxygen and carbon dioxide in the exit gas, and from glucose and ethanol concentrations in the broth during cultivation of Saccharomyces cerevisiae. Likewise Nihtil~i et al. (1984) tested five different methods of non-linear filtering, including the extended Kalman filter, for on-line estimation of biomass concentration and of the specific growth rate during batch cultivation. The experimental data of oxygen and carbon dioxide concentrations in the inlet and exit gas were used. The authors concluded that the best results were obtained with the original method of the extended Kalman filter. In the present investigation we have used the extended Kalman filter (Jazwinski 1970) with Aioki's modification for calculating the co-variance matrix of the estimation error.
Materials and methods The extended K a l m a n filter For application of the extended Kalman filter, the continuous process has to be desdribed in terms of a stochastic vector non-linear differential equation
dx(t) dt
= g(x(t), u(t), t) + w(t), t > O,
(4)
where x(t) is the state vector, u(t) is the input vector, X(to) is the initial state with normal probability distribution N[£(to), P(to)], and {w(t)} is the white Gaussian random process with zero expectation and co-variance matrix Q. The output stochastic difference equation of this system (measurement equation) is
y(t~) =h(x(t~), t~) + ~(t~),
(5)
130
J. Nfihlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
where index k = 0, 1, 2, . . . , y(tk) is the output vector, and {v(tk)} is the white Gaussian sequence with N(O, R), R positively definite. We further assume that {w(t)}, {V(tk)} and X(to) are mutually independent. G and h are non-linear functions. The extended Kalman filter in equidistant time instants calculates, from the former estimate and from the newly measured values, the new estimation .of the state of the non-linear system, and at the same time also the co-variance matrix of the estimation error, which characterizes its precision. The extended Kalman filter applied is constituted by the following Eqs. (6)--(10). The one-step ahead prediction of the state ~(tk + lit,) at time tk + 1, when the measurements are known to the time instant tk, is calculated at each estimation step by numerical integration of equation d~(tltk) - = g(2(tltk), u(t), t) dt
(6)
on the interval (tk, tk+l) with the initial condition ~(tkl&). For the numerical integration of Eq. (6), the fourth-order RungeKutta integration method with Merson's modification was used. The co-variance matrix of the error in 2(tk + l ltk) stating the precision of the state prediction is:
For the numerical calculation matrix ~b is approximated by the first and second terms of the matrix exponential function expansion (12): (14)
~ ( a r g l ) = E + F(2(tkltk), u(tk), tk)(tk + , -- tk).
Stochastic model o f fermentation f o r on-line estimation The task of the filtration algorithm is to estimate the biomass concentration and the varying model parameters continuously. The unknown parameters can be considered as additional states of the system and thus estimated simultaneously with the original state in the thus created so-called generalized state vector. In our fermentation model (1)-(3) for two state variables (the biomass concentration X and the ethanol concentration S in the fermentor) the dilution rate D and the input ethanol concentration Si are the input variables, and #M, Ks and Yx,s are the model parameters. Then the generalized state vector is: x(t) = [X(t), S(t), tiM(t), Ks(t), Yxls(t)] T,
(15)
the known input vector: P(tk + dtk)=~(argl ) P(tkltk)(~r(argl) + Q,
(7)
where argl = (:~(tk Itk), U(tk), tk + 1, tk). The Kalman filter gain matrix: K(arg2) = P(tk + l ltk) Mr(arg2) [M(arg2) P(tk + dtk) MT(arg2) + R] - 1,
y(t) = [S(t)] T. (8)
(9)
The co-variance matrix of the error in 2(tk+lltk+l) stating the precision of the state estimate is: P(tk + 1Ilk + 1) = [E -- K(arg2) M(arg2)] P(tk + 1[tk) [ E - K(arg2) M(arg2)] r + K(arg2)RKr(arg2).
(16)
the known output vector:
where arg2 = (~(tk + l ltk), tk + I ). The state estimate 2(tk + dtk + 1) is calculated as a sum of the state prediction and the difference of the measured and estimated values of the output variables (the so-called predicted measurement residual error) multiplied by the filter gain matrix K. YC(tk+ 11tk+ 1) = £C(tk+ 11tk) + K(arg2) [y(tk + ,) --h(~(tk + lltk), tk+l)]-
u(t) = [D(t), Si(t)] r,
(10)
(17)
Thus the general stochastic state model of fermentation (4)-(5) will actually be dX(t) dt
ltMSX S + Ks
(18)
DX+ w,(O
dS(t) = D(S,-S) dt
#MSX + wz(t) Yx,s(S + Ks)
(19)
dpM(t) = 0 + w3(t)
(20)
- -
dKs(t) = 0 "~ w 4 ( t ) dt
(21)
dYx,s(t) = 0 + ws (t) dt
(22)
dt
and the measurement equation
In these equations matrix M(g(tk+lltk),tk+l) is defined by the relation
y(tk) = S(tk) + V(tk).
[~h~(~(tltk), t) ] M(Sc(tg+lltk), tk+j) = [ 8xj(t) ...... '
The Jacobi matrix of the deterministic part of the system Eqs. (18) to (22) is
(11)
(23)
F= i = 1, 2, ..., m; j = 1, 2, ..., n and matrix ~b is the state transition matrix ¢(2(t~ltk), u(tk), tk + l, tk)
= exp [F(2(tkltk), u(tk), tk) (tk +1 -- tk)],
(12)
where Jacobi matrix F is F(2(tkltk)'U(tk)'tk)=l i,j=l,
2,...,n.
[ Og,(:~(tltk), u(tk), t) Oxj(t) [ .].'. .
(13)
• #MS X#MKs XS S ~ K s s - D, (S + Ks)-~, S + Ks' --ItMS -- XltMKs - XS Y x , s ( S + K s ) , Y x , s ( S + K s ) 2 D, Y x , s ( S + K s ) ' 0 0
, ,
0 0
and matrix M=[01000].
, ,
#MSX (S + Ks) 2 lzMSX Yxls(S+Ks) 2
0
,
0
,
0
,
0
,
J. Nfihlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
Laboratory experiments Candida utilis (strain Vratimov) was cultivated in an LF-2 fermentor (product of the Czechoslovak Academy of Sciences) with a working volume of 3 1, equipped with an analog control unit. The synthetic medium was prepared with the following nutrients per litre: 1.04g (NH4)2HPO4, 4.25g (NH4)2SO4, 0.43 g MgSO4-7H20, 0.78 g K2SO4, 0.7 g yeast autolysate. l'he pH was adjusted with sulphuric acid to 4.5. Synthetic ethanol was added to the prepared medium immediately before being supplied to the fermentor. An analog control unit was used to stabilize the environmental conditions: fermentor temperature = 30.3 ° C, pH of the medium=4.5, frequency of the stirrer revolutions=15s -1 and the flow of air=3.34 • l0 -s m3/s. For supplying cultivation medium to the fermentor a Zalimp peristaltic pump (type 315, product of Poland) was used. The substrate concentration in the fermentor was measured continuously by a Metrex instrument (constructed by the Prague Institute of Chemical Technology). In order to check the correct operation of the filter, the biomass concentration was also measured continuously using a continuous analyser consisting of a Spekol instrument (produced by Carl Zeiss, Jena, GDR), a Spekol-ZV amplifier, and a EK-5 nephelometric adaptor. The biomass concentration values, however, were not used in the extended Kalman filter. The measured values of the input substrate concentration and the dilution rates were loaded in the computer by means of a manually operated transmitter. Data processing and state estimation were performed by an SM 3 minicomputer.
Results
The extended Kalman filter algorithm was applied to the tracking of biomass concentration and of three model parameters during continuous cultivation lasting for 38 h. The sampling intervals and the computational period of the filter were 10 min. The co-variance matrices of the state and output noise and the initial values of the state and its initial co-variance matrix were chosen as "2.0 0.03
Q=
0.0036 0.001 0.01
R = [0.0064],
X(to)=[2.5
0.64
0.36
0.4
0.3] T,
"1.6 0.1 t'(to)
=
0.06 0.18 0.022
131
The co-variance matrices P(to), Q and R were chosen in a diagonal form, according to the usual assumption that the individual components of the initial state estimation, state noise and output noise are uncorrelated. According to Sargent (1975) the co-variance matrix of the initial state estimation error P(to) has no influence on the steady-state behaviour of the filter as long as its values are sufficiently large. The variances in the covariance matrix of the input noise R can be determined on the basis of the standard deviations corresponding to the errors of the instruments employed, expressed as a percentage of their measuring range. On the other hand, the variances of the state noise in matrix Q are based on subjective estimates of the average changes of the generalized state variables between two sampling instants. At the same time, the correct function of the filter depends to a large extent on whether the optimum value of matrix Q is found. For the initial estimation of X(to) and S(to), their instantaneous values were used, while the initial estimates of the parameters flu(to), I~s(to) and Yxjs(to) were determined by static optimization from the measured values of steady-state fermentation. The filter results are presented in Figs. 1 and 2. F i g u r e 1 shows the biomass concentration estimation X. It also includes the courses of input variables D and Sg, and on-line measurements of the substrate concentration S. To demonstrate the quality of the biomass concentration estimation, the on-line measurement of this variable is also shown. The irregular dilution rate during fermentation (see Fig. 1) was caused by the working characteristics of the relatively small laboratory fermentor. Even though the inlet flow of the medium was relatively constant (relative error +3%), the random fluctuations of the broth level result in changes in the working volume of the fermentor and consequently in changes in the dilution rate of the outlet flow of the medium. The hour-average values of the dilution rate are also shown in Fig. 1. Figure 2 shows the courses of the estimated parameters tiM, I£s and Yxrs during cultivation. For calculation of the estimated initial parameter values, Rosenbrock's optimization method and the measurements from the first 10 h of the experiment were used. To check the correct operation of the extended Kalman filter, the parameter values at the end of the fermentation experiment were also calculated in the same manner and are demonstrated in Fig. 2 as segments of horizontal full lines in parentheses. In addition to this, the
J. Nfihlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
132
5
20
0.5
4
16
0,4
p o r t f. 100
~3 .~
D r. . . . --[ si
E12
to2.~ 8
L
r i _
i0, .p 3 80
t
60
0,2~
A
DO2 I.
0
o
4
o
40 0
o
0
o.
0
20
S
o
20 p.qrt 2 ."
5
1
0
~
D
t(~)
0
~o
S
16
E
12~
~8
o
~'2
010 20
A
1~
DO 2
1'8 ,lh) 2%
0
0
0
e2
i
2,
~grt 3: Si
16 ~
X
..... ,~
./'~_ ,,/%
~
4e
&e
L--2 .
.
.
.
.
.
...+.,t. 4; 024
'~ " - - ~
*" "'~--+" 0
--t__r---t ....
0 i
25
+ ~ ' * " " / "* ~ - ~ 0
0 I
28
0
j
s
DOe 0 i
30
0
L_
o 0 0
32
t(h)
0 I
0
34
0 I
36
38
Fig. 1. Measured variables and estimation of biomass concentration: × × × , measured biomass concentration X ; + + + , measured substrate concentration S ; - . - . - , measured input substrate concentration Si; - - - , dilution rate D ; . . . , estimated biomass concentration )(; O O O , dissolved oxygen concentration DO2
hour averages of the substrate yield coefficient Yxts were calculated to check the values estimated by the filter. These are also shown in Fig. 2. At the beginning, the fermentation process was in a steady state but after 10 h of cultivation a step change increased the input substrate concentration from 50% to 75% of its range. The yeasts responded to this change by increasing their growth, and, after a transition response, a new steady state occurred after approximately 30 h. During the experiment the filter tracked the bio-
mass concentration with considerable accuracy. The relative error of its estimate was not greater than + 7% in the time periods from 0 to 10, from 16 to 22, and from 29 to 38 h of the fermentation. In both remaining time intervals, i.e. immediately after the step Si and from hour 22 to hour 29 of the experiment, the filter worked with a maximum relative error of +30%. This increased error was evidently due to the fact that the dissolved oxygen concentration (DO2) in the medium was not maintained at a constant level during fermentation.
J. N&hlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
133
1,0 part 1: 0, atO
<~ _..0,6 ¸ Ks{O)= 0,4
E 0.4
0
to
I
4::
O,
YXlS (0)=0,3
o
0
~ . {02 = 0,36
~
~
~ t(hj~----#
~o
part
&: ~'°F 20,8 I ?
o,6~ ,/~
<~
o,~ i ~*-J~
",,
o
~kW" ~ 14C
0
0,2
5'o
port 3.
........
o
o
o
.
.
.
.
.
o
o ..~ ~
;u-~.x_~_,p,-.~_~.~p,-
o
1'2
1'4
1'6
1'8 t ( h ) " 2~
2'2
24
1,0
o
o
to 0,8-
~" 0,6
,, ~ "
, 01'1
Yms (
0 0
0
._~..+.-~.+.~.~...~+- ~
( ~ 0,4 ~
o
,.,7 ~ ' ~
~
~_~,~"~
0
) 0
"~'-~" 0
0
Ks
~ ~/
-~
x~ . . . . .
,~,c
...... ~
\
0,2 0
24
2'6
2'8
30
3'2 t fh)
3'~
- J6
3e
Fig. 2. Estimated model parameters: x x x , estimated maximum specific growth rate tiM; + + + , estimated saturation constant Ks; .... estimated substrate yield coefficient Yxls; 0 0 O, substrate yield coefficient Yx~s computed from measured data
This violated the validity of one of the assumptions of the fermentation model used (1)--(3). For that reason the mathematical model was not able to accurately represent the behaviour of the fermentation. The real values of DO2 are also plotted in Fig. 1 showing that the time periods of inconsistency between the measured and the estimated biomass concentrations were the intervals when the DO2 concentration exceeded 40% in the first case, and was less than 5% in the other case. In the first time interval, the validity of the model was violated by the large increase in the inlet sub-
strate concentration and the high level of DO2, and in the other one by 02 limitation. In all the other time intervals, when the DO2 value was within 5%--40%, the filter produced very satisfactory estimations of the biomass concentration.
Discussion
In the present paper a practical possibility of using the extended Kalman filter is shown for the continuous estimation of biomass concentration,
134
J. N~thlik and Z. Burianec: C. utilis yeasts growing on ethanol substrate
which is difficult to measure in practice. From the measurements of two input variables and one output variable, the filter estimated the biomass concentration and three model parameters. To increase the reliability of the filter it will obviously be useful also to utilize other easily measurable quantities such as the DO2 concentration and the 02 and CO2 concentrations in the exit gas. Before a more complicated model with more parameters is used, it will be necessary to discover which of them are constant and can be estimated once at the beginning of the fermentation, and which must really be estimated on-line. In order to increase the precision and reliability of the filter, it may prove advantageous to use one of the existing modifications of the extended Kalman filter.
Nomenclature D, DO2,
dilution rate (h -1) dissolved oxygen concentration (%) identity matrix E, Jacobi matrix of the deterministic part of the sysF, tem equations g continuous n-vector non-linear real function g, m-vector non-linear real function h, Kalman filter gain matrix K, saturation constant (kgm -3) Ks, expectation of the saturation constant estimate M, Jacobi matrix of the deterministic part of the measurement equations h co-variance matrix of the initial values of the state e(t0), c-variance matrix of the error in :f(<k) e(t~ltk), P(tk + 11tk), co-variance matrix of the error in :f(tk + l ltk) Q, co-variance matrix of the state noise co-variance matrix of the output noise R, substrate concentration (kgm -3) S, input substrate concentration Si, t, time discrete time instant with index k = 0, 1, 2, ... tk, input vector u(t), measurement (output) noise sequence v(t~), n-vector white Gaussian random process w(t), initial state of the system X(to), expectation of the initial state values ~(to), n-dimensional state vector x(t), state vector at the time instant tk x(tk), expectation of the state estimate at time & when -f(tkltk), measurements are known to the time tk ~(tk+lltk), expectation of the state prediction biomass concentration (kgm -3) X, expectation of the biomass concentration estimate L m-dimensional output vector at the time instant tk y(tk), substrate yield coefficient YxIs expectation of the substrate yield coefficient estirXIS mate
#M, tiM,
specific growth rate (h-1) maximum specific growth rate (h-1) expectation of the maximum specific growth rate estimate state transition matrix
References Bellgardt KH, Meyer HD, Kuhlmann W, Schiigerl K, Thoma M (1984) On line estimation of biomass and fermentation parameters by a Kalman-filter during a cultivation of Saccharomyces cerevisiae. In: III. European Congress on Biotechnology, Munich 1984, pp 11607--11615 D'Ans G, Gottlieb D, Kokotovic P (1972) Optimal control of bacterial growth. Automatica 8:729--736 Dochain D, Bastin G (1984) Adaptive identification and control algorithms for nonlinear bacterial growth systems. Automatica 20:621--634 Halme A, Kiviranta H, Kiviranta M (1977) Study of a single cell protein fermentation process for computer control. In: Van Nauta Lemke (ed) Digital computer applications to process control. IFAC and North-Holland Publishing Company, The Hague, pp 407--415 Holmberg A, Ranta J (1979) Experiences on parameter and state estimation of microbial growth processes. In: IFAC Symposium on Identification and System Parameter Estimation, 5, Darmstadt, pp 835--842 Holmberg A, Ranta J (1982) Procedures for parameter and state estimation of microbial growth process models. Automatica 18 : 181-- 194 Howell JA (1981) Parameter estimation for biological waste treatment dynamic models. In: Third International Conference on Computer Applications in Fermentation Technology, UMIST Manchester, England Jazwinski AH (1970) Stochastic processes and filtering theory. Academic Press, New York, p 376 Lozano RL, Carrillo JR (1984) Adaptive control of a fermentation process. In: Gertler, Keviczky (eds) 9th World Congress IFAC, Akad+miai Kiad6 ~s Nyomda, Budapest, vol 3, pp 279--283 Naito M, Takamatsu T, Fan LT, Lee ES (1969) Model identification of the biochemical oxidation process. Biotechnol Bioeng 11:731--744 Nihtil~i M, Virkkunen J (1977) Modelling, identification and program development for a pilot-scale fermentor. In: Van Nauta Lemke (ed) Digital computer applications to process control. IFAC and North-Holland Publishing Company, The Hague, pp 423--429 Nihtil~ M, Harmo P, Perttula M (1984) Real-time growth estimation in batch fermentation. In: Gertler, Keviczky (eds) 9th World Congress IFAC, Akad6miai Kiad6 6s Nyomda, Budapest, vol 3, pp 225--230 Sargent RWH (1975) Optimal process control. In: Proceedings of the Sixth Triennial World Congress IFAC, Boston Svrcek WY, Elliott RF, Zajic JE (1974) The extended Kalman filter applied to a continuous culture model. Biotechnol Bioeng 16:827--846 Received March 16, 1987/Accepted September 21, 1987