Open Access Research Article

EKF vs. UKF: Important Aspects in the Observation of Bioprocesses

Francisco Caballero1*, Gabriel Ramirez-Dámaso2, Luis Vicente3 and Alexis MA Romero4

1Carrera de Ingeniería Química, Facultad de Estudios Superiores Zaragoza UNAM, Ejército de Oriente Zona Peñón, Iztapalapa, Mexico

2Escuela Superior de Física y Matemáticas, Instituto Politécnico Nacional, Mexico

3Facultad de Química, Universidad Nacional Autónoma de México, Mexico

4Carrera de Ingeniería Química, Facultad de Estudios Superiores Zaragoza UNAM, Mexico

Corresponding Author

Received Date: July 26, 2024;  Published Date: August 13, 2024

Abstract

In this work, a comparison between the extended Kalman filter (EKF) and the unscented Kalman filter (UKF) was made to determine the states of a lactic acid fermentation process in a bioreactor that operates continuously. The model proposed by Lombardi in 1999 was used. To compare the filters, 2 strategies were established [1]. Measure biomass concentration and estimate substrate and lactic acid; and [2]. Measure the concentration of lactic acid to estimate biomass and substrate. Both proposals satisfy the observability and the simulations carried out show similar behaviors, even; on some ranges EKF performs better than UKF. This result had already been reported. Finally, strategy (1) yielded more precise observations than strategy (2). However, acquiring a biomass probe requires a high investment. For this reason, opting for a pH meter (strategy 2) does not sound unreasonable, especially since it offers substantial savings.

Keywords:Bioprocess observation; bioreactor; extended kalman filter EKF; unscented kalman filter UKF; software sensor

Introduction

Measuring crucial variables online is a complex and important activity. Monitoring and controlling processes are required to characterize their behavior and maintain them under satisfactory conditions. However, continuous readings are not always possible due to the lack of instruments. This issue arises in various engineering fields, particularly in monitoring biotechnological processes, where variables such as substrate and product concentrations are typically measured offline through laboratory analyses. These procedures are slow and consume reagents, making it challenging to propose effective controls for such measurements. In this context, the use of software sensors allows for the real-time reconstruction of component con centration. This estimation relies on a procedure that combines a mathematical model of microbial cultivation with hardware measurements. As a result, software sensors provide continues estimates of signals that are difficult to measure directly due to various circumstances. Process models play a key role in software sensors which are based on the theory of state observations.

Many types of the state observers have been proposed since the 1960s. It was not until this century that the term software sensor emerged and was consolidated in Bioprocess [3]. However, one of the firs antecedents of the term was established by [4] those who state the advantages of developing the software sensor compared to the hardware sensor (or inline), and the advantages it would have in the area of polymerization. The reviews aimed at describing the various observers towards the areas of chemical and biochemicals processes have been limited, however, the [5] stands out, which describes the theoretical aspects that give rise to state observers, also stating the advantages and limitations who currently has this tool. In the same context, the state estimator that performs its action in present time is called a filter, that is, an online probe measures and feeds the filter, which predicts the state values, while measurement is carried out [6]. In bioprocesses field, two types of state estimators have been applied: linear and nonlinear filters [7,8]. Despite the many advantages of nonlinear filters, there are several drawbacks, for example, the complexity increases when the state dimension (n) is greater than three [9].

To avoid this problem, the Extended Kalman Filter (EKF) has been applied, especially because improvements to this estimation scheme emerged [10,11]; Furthermore, its characteristics of easy application, convergence and a quick way to establish observability keep it current and remain the first alternative at least to observe novel or complex processes. Unfortunately, implementing the EKF in a highly nonlinear system gets some problems, for example, linearization at each time step can introduce large errors and even cause filter divergence. Furthermore, computing the Jacobian matrices of a higher-order system is a heavy lift for continuous online estimation. This observation is of utmost importance since it is well known that there are currently probes to measure biomass, however, the cost prohibits their extensive implementation. Regarding this aspect, [12] mention that, this is not the only requirement for a successful application; The probes must also be robust in determinations made online; this characteristic is rarely met, especially in sensors with new technology that has just been launched on the market.

State Estimators in Bioprocesses

The purpose of a state estimator is to provide signals that emulate measurements and that, fed to a control system, would allow the bioprocess to be maintained in the required operating conditions. State estimation requires knowledge of part of the values of the outputs (measurements) and all the inputs. In this way, the information fed to the estimator will allow it to generate a unique estimated state, that is, the observability of the process. Sequential estimation is mainly associated with a prediction (future time) or filtering (present time), the latter being of interest in the present work. Signals from the probes are taken to emulate the remaining state in present time.

Let be a process formed by a set of Mreactions involving N macroscopic components ξiandξjwhere i represents r reactivess (r) and j to consider p products (p) :

irispublishers-openaccess-biostatistics-biometric-applications

By establishing mass balance by components into the quimiostat (continuous stirring tank bioreactor)

irispublishers-openaccess-biostatistics-biometric-applications

Vectorial equation (2) contains: Yyield coefficient matrix, Wdilution rate, u(t)input vector and r(ξ) reaction rate vector. This last, element contains fermentation terms, most of the times, the elements are non-linear, for this reason, a general model in state space is the following:

irispublishers-openaccess-biostatistics-biometric-applications

Where x(t)is the vector of states, yis the vector of measurements, w is the process noise vector, v is the measurement noise vector, f (x(t),u(t)) is the vector of functions that represent the process modeling and C is the row of the measurement model, respectively. For subsequent equation developments, it is assumed that the process and measurement noises, w and v respectively, are Gaussian and uncorrelated in time (white noise) as with the initial state. It is important to mention that neither x nor y present any type of accent, because they are the variables that represent the measurement and so it is represented in a general way, when such variables present some type of accent it is because these variables are thrown by the filters or the observers and represent the variables that could not be measured, in fact, this is the task of the observer.

Extended Kalman Filter (EKF)

On this framework, the EKF is an optimal state estimator that infers the state vector (the circumflex accent represents the state estimate), which consists of a process model. In addition, it demands at least one in-line measurement (y) . Equations (3) and (4) are added to the agreement filter based on y:

irispublishers-openaccess-biostatistics-biometric-applications

Where K = PCQ, represents the filter gain, which proportionally modifies the error generated between the physical measurements established by a measurement (y) in addition to the state estimate (y −C(xˆ(t))) . Where C(xˆ(t)) is the virtual measurement returned by the software sensor, P is the covariance matrix of the error in the initial state and Q is the covariance matrix of the system noise. The procedure is systematically described in Appendix 1. Among the criticisms that the EKF has received for years is the use of the linear approximation to the equations that represent the dynamics of the system, creating low precision and reduced estimation performance that can lead to instability in the filtering.

Unscented Kalman filter

To avoid the drawbacks of the EKF due to linearization and the calculation of the Jacobian matrix. At the end of the last century, Unscented Kalman filter (UKF) proposed by [13] began to be used. The UKF is based on an unscented transformation and is more efficient, simpler and easier to implement in the dynamic state estimation (DSE) process.

irispublishers-openaccess-biostatistics-biometric-applications

The main idea of the unscented transform (UT) is to obtain a set of deterministically chosen sigma points irispublishers-openaccess-biostatistics-biometric-applications which capture the means irispublishers-openaccess-biostatistics-biometric-applicationsand covariances irispublishers-openaccess-biostatistics-biometric-applicationsto compute irispublishers-openaccess-biostatistics-biometric-applications The procedure, nomenclature and considerations that are carried out are shown in Appendix 2.

According to what was previously reviewed and based on a bibliographic search, there is a vast field of application of observers and sensor software; however, in the biotechnology branch, there are few contributions related to the differentiation of observers or filters. For this reason, the purpose of this work is to design a UKF that will be applied to determine the states of a lactic fermentation process. The UKF will be compared with an EKF under two scenarios: 1. Measure biomass. Currently, the acquisition of an online biomass probe is viable; its implementation will allow estimating the concentration of the substrate and product; and 2. measure lactic acid to estimate biomass and substrate.

Methodology

In line with equation 3; For this work, f (xˆ(t),u(t)) is based on the model of where a biomass generation rate (X ) is established using the Monod model, limited by substrate (S) and inhibited by the product concentration (P) , in addition to a mortality rate (kd ) [14 ]:

irispublishers-openaccess-biostatistics-biometric-applications
.

In equation 8 the microbial growth rate (first term on the right) has the complete state [X , S, P] . Where u max M max and kdhave the following values [0.455, 0.388, 0.021] in h-1 respectively; also, Ks = 30 (g/l) and Ki=0.051 (l/g). On the other hand, a substrate consumption rate is proposed according to the Pirt model, adding a substrate consumption term used for another purpose other than biomass production, called maintenance, the bioprocess becomes in Fed Batch where dilution rate value D is 0.105 h-1

irispublishers-openaccess-biostatistics-biometric-applications

For this reason, mmax is the maximum specific consumption rate for maintenance and Yx/s=2.43(g/g) is the substrate to biomass performance coefficient respectively.

irispublishers-openaccess-biostatistics-biometric-applications

Where Yp = 0.87 is the product to substrate performance coefficient. The initial conditions of [X , S, P] . are [0.5,83.0, 2.9] g / l respectively. Parameter values were also taken from [1]. The parameter K (see equation 5-7) is the gain of the Kalman filter and will be calculated using the algorithm shown in the UKF implementation and will be compared with a reference such as the EKF, both programs were coded in MATLAB 2021b (The MathWorks Inc.). The algorithms used are shown in (Tables 1&2).

Table 1: Calculation algorithm for implementation of the Extended Kalman Filter (EKF).

irispublishers-openaccess-biostatistics-biometric-applications

Table 1: Calculation algorithm for the generation of sigma points in the implementation of the Unscented Kalman filter (UKF).

irispublishers-openaccess-biostatistics-biometric-applications

Results and discussion

Observability matrix for both proposals

Before carrying out the discussion, is important to differentiate between p (covariances) and P (product, in this case lactic acid), the same care between x (variable vector, state, estimate variable) and X (biomass concentration) made the warning, in first place let’s start with the calculation of the Observability matrix was carried out: [CT , J TCT .(J T )2CT ] ,where C = [1 0 0] means measuring biomass (X ), J is the Jacobian of the nonlinear function. With this information, it was verified that the rank of the matrix remained at 3, which represents the number of states of the system. The same answer was obtained for the second case studied in this work, where C = [0 0 1] which means using the measurement of lactic acid (P , remember the position of the states in the vector [X , S, P]) , this situation was expected, since the first right term of equations (8-10) shows that the microbial growth term has the functionality of the three variables in a coupled way; This situation helps to satisfy the desired observability. Once this situation was established, simulations were carried out; but not before considering the same initial condition [Xˆ (0) = 0.1, Sˆ(0) = 70, Pˆ(0) = 0] for both cases; Further covariance matrix (R) is obtained by standard deviation corresponding to noise instruments, as is going to use a pH probe, the measure has probably a gaussian noise ca of 3% i.e. R=[Va(P)]=0.01.

A random function affects R to provoke noise in the system. The covariance matrix due to system noise (Q) is established as function of the variance of the model uncertainty for each case. For the bioreactor subject to this study, Q was chosen as diag[0.0052 / 0.5, 0.001] where the diagonal form is for the absence of correlation between components. Finally, these values are in choose values span reported in [15] where the employed them in algal photobioreactor while [16] used the values in nonlinear kinetics. For the initial estimation error covariance matrix, P0a set of diagonal values was initially assumed. The initial value of the states was estimated based on offline measurements. The values of the diagonal elements in the P0matrix should be set close to the variance of the initial state estimation errors. So, based on this rule, P0 was chosen as diag

irispublishers-openaccess-biostatistics-biometric-applications
The choice of covariance matrices is important for state estimation. If fast tracking is required, a larger weight factor should be put on the error term (see start step in Tables 1&2 respectively).

Proposal 1. Measure the biomass concentration and estimate the substrate and lactic acid

The first proposal to analyze the behavior of the EKF and UKF estimators starts from establishing only measurement of the biomass concentration (X ) to estimate the consumption of the substrate (S) and the production of lactic acid (P) , although the Biomass probes began to be marketed in the 90’s, problems such as robustness, precision and the effects of noise; coupled with high costs have eclipsed its implementation. Independent of this background, the objective is to consider this device as the measuring element, for this reason the vector C takes the value [1 0 0] due to the established order of the states of the form [X , S, P] . Figure 1a shows the simulation of equations (8-10) that represent the process model, whose concentration is separated individually by colors where biomass is plotted in yellow, substrate in magenta and lactic acid in cyan. To compare it against other figures where the EKF estimate (tick red dotted line) and the UKF estimate (thin black dotted line) are shown.

The color code described here, did not change during all the paper. Figure 1b reflects the biomass measurement, so the EKF and UKF estimates overlapping with the dynamics of X . Figure 1c shows in the initial time a mismatch of the EKF and UKF estimators with respect to the behavior of the substrate, the above is due to the bad initial estimation value 0 ˆx that was proposed since the starting of present study, the intention was prove the convergence in spite of bad initial values. By observing that both filters have a similar performance However, the result of both takes time to converge with the substrate value of the process, achieving it close to the time in which the steady state is reached. These conditions were established since before because it was necessarily check out the behavior, is well known that Kalman filters asymptotically converge and the developments made by Ray [6] to minimize the error, covariance matrix must be symmetric, and this the reason feeding only the diagonal in matrix p to test convergence. Figure 2 shows the error between the model (Figure 1a) and filters and is possible to evaluate them.

In spite that Figure 2a shows a wide error, is not correct, by examining the logarithmic scale shows that Figure 2b has more error scale the range is about 10 unities while Figure 2c its range is about some unities; backing to Figure 2a noise appear in UKF and it can conclude that random function, affects strongly R and the covariance of measurements in this case yy p (see third step in Table 2) in comparison with EKF that does not show some effects because irispublishers-openaccess-biostatistics-biometric-applications demands d (derivative of measure function) in this case is zero because the measurement function is a constant value. Another important idea is the error decreasing under over the course of time, give stability to the filters y the observation of [Sˆ, Pˆ ] . Once the EKF and UKF behaviours have been compared, this study is complemented with the analysis of the process by incorporating a disturbance 20 hours after the start of the process (see Figure 3a), where dilution rate was changed by 0.15 h−1 . Figure 3b shows a biomass estimation curve, identical to the bioprocess; while the EKF and UKF estimates of the substrate, Figure 3c; as well as of the lactic acid, Figure 3d, continue observing the process with an acceptable margin of error. The simulation lasts 80 h and the convergence appeared.

Proposal 2. Measure lactic acid concentration to estimate biomass and substrate

As a second proposal, the states of biomass and substrate concentration must be estimated, causing the matrix C to now be modified as [0 0 1] , because lactic acid will be measured. As can be seen in Figure 4, the EKF and UKF estimators adequately estimate each of the states, however, slight discrepancies can be seen in the operation of the filters, if compared with the results obtained by the first proposal. It can see in Figures 4b&4c that thin black dotted line that represents UKF does not converge only behaves asymptotically, and it can see in Figure 5a the error reaches a value but does not tend to zero, in Figure 5b the convergence is very slow in comparison with and the EKF error, (see tick red dotted line in the same Figure 5b).

irispublishers-openaccess-biostatistics-biometric-applications
irispublishers-openaccess-biostatistics-biometric-applications
irispublishers-openaccess-biostatistics-biometric-applications
irispublishers-openaccess-biostatistics-biometric-applications
irispublishers-openaccess-biostatistics-biometric-applications
irispublishers-openaccess-biostatistics-biometric-applications

Finally, is important remember that, same parameter of covariances and initial conditions were used. The last simulation was performed to proposal 2 by perturbing the bioprocess model, again a step of 20 h was used to compare with proposal 1 (where dilution rate was changed by 1 0.15 h− ). UKF does not reach the convergence, in fact, is more visible how the thin black dotted line splits from the simulation and EKF curve, this behavior is seen in Figure 6b but in Figure 6b it can see, after 40 minutes the curves remain parallel and will never come closer together again, so under these condition EKF observe the bioprocess without no difficulty, and is possible manifest that, this observer is the suitable for these operating conditions.

Conclusion

In this work a comparison between a traditional (EKF) and a modern filter (UKF) was made. It was probing the advantages of UKF, however in second proposal asymptotical behavior appeared and EKF performed in best way. This observation was reported in other papers highlighting sources such as [17,18], which state that one of the typical errors when carrying out this type of studies is the arbitrary selection of filter design parameters, such as covariance matrices, Q and R; therefore, it is convenient to use values that allow an optimal adjustment for the design of software sensors. obviously obtained from the typical errors presented by the measurement instruments.

In fact, showed how different authors placed erroneous values to favor certain works, so they corrected them and the EKF performed well despite the already known disadvantages of this filter. Even with the results obtained for the start and implementation of bioprocesses, the second proposal is the one selected because the performance of the Kalman filter was verified; in addition, the lactic acid probe (i.e. a pH meter) is a cheaper option. In addition, the UKF parameters can be improved, this time it was not done because it was preferred to keep the results without other modifications, the above will be the reason for future works that approach modifying the values with a present bioreactor.

Acknowledgement

Francisco Caballero thanks to Facultad de Estudios Superiores Zaragoza (UNAM) for the sabbatical year granted through letter No. FESZ/CT/0557/2023, which allowed the completion of this work.

Conflict of Interest

The authors declare that there is no conflict of interest.

References

  1. Lombardi M, Fiaty K, Laurent P (1999) Implementation of observer for on-line estimation of concentration in continuous-stirred membrane bioreactor: Application to the fermentation of lactose. Chemical Engineering Science 54(13-14): 2689-2696.
  2. Bogaerts P, Castillo J, Hanus R (1999) A general mathematical modelling technique for bioprocesses in engineering applications. Systems Analysis Modelling Simulation 35(2): 87-113.
  3. Bogaerts Ph Van de Wouwer A (2003) Software sensors for bioprocesses. ISA Transactions 42(4): 547-558.
  4. Mankar RB, Saraf DN and Gupta SK (1998) On-Line Optimizing Control of Bulk Polymerizations: 1. Development of a Software Sensor. Industrial & Engineering Chemistry Research 37(6): 2436-2445.
  5. Botero C, Álvarez HA, Hernán AZ (2009) A review of the most frequent methods for state estimation in chemical processes (in Spanish). DYNA 76(158): 135-146.
  6. Ray H (1989) Advanced Process Control, Butterworths.
  7. Rawlings JB, Bakshi BR (2006) Particle filtering and moving horizon estimation. Computers & Chemical Engineering 30(10-12): 1529-1541.
  8. Dochain D (2003) State and parameter estimation in chemical and biochemical processes: a tutorial. Journal of Process Control 13(8): 801-818.
  9. Obeid J, Flaus J, Adrot O, Magnin J. Willsion JC (2010) State estimation of a batch hydrogen production process using the photosynthetic bacteria Rhodobacter capsulatus. International Journal of Hydrogen Energy 35(19): 10719-10724.
  10. Leon BS, Alanis AY, Sanchez E, Ornelas F, Ruiz E (2012) Subcutaneous blood glucose neural inverse optimal control for type 1 diabetes mellitus patients. World Automation Congress 2012 Puerto Vallarta Mexico 1-6.
  11. Tayebi L, Vashaee D (2013) On the estimation of the unknown reactivity coefficients in a CANDU reactor. Annals of Nuclear Energy 53: 447-457.
  12. Guardiola C, Hoyas S, Pla B, Blanco DR (2015) Analytical solution of a stationary Kalman filter for the observation of drift in NOx emissions models in automotive diesel engines (In Spanish). Revista Iberoamericana de Automática e Informática industrial 12: 230-238.
  13. Julier SJ, Uhlmann JK (1997) A New Extension of the Kalman Filter to Nonlinear Systems, Signal Processing, Sensor Fusion, and Target Recognition VI 3068: 182-193.
  14. Bouguettoucha A, Balannec B, Amrane A (2011) Unstructured Models for Lactic Acid Fermentation- A Review. Food Technology and Biotechnology 49(1): 3-12.
  15. Li J, Xu NS, Su WW (2003) Online estimation of stirred-tank microalgal photobioreactor cultures based on dissolved oxygen measurement. Biochemical Engineering Journal 14(1): 51-65.
  16. Haseltine EL, Rawlings JB (2004) Critical Evaluation of Extended Kalman Filtering and Moving-Horizon Estimation. Industrial & Engineering Chemistry Research 44(8): 2451-2460.
  17. Valappil J, Georgakis C (2000) Systematic Estimation of state noise statics for Extended Kalman Filter. AICHE Journal 46(2): 292-308.
  18. Schneider R, Georgakis C (2013) How to NOT Make the Extended Kalman Filter Fail. Industrial & Engineering Chemistry Research 52(9): 3354-3362.
Citation
Keywords
Signup for Newsletter
Scroll to Top