Open Access
This article is

- freely available
- re-usable

*Sustainability*
**2017**,
*9*(3),
455;
https://doi.org/10.3390/su9030455

Article

Virtual Sensors for Biodiesel Production in a Batch Reactor

^{1}

Posgrado Electrónica, Tecnológico Nacional de México-Centro Nacional de Investigación y Desarrollo Tecnológico, Interior Internado Palmira S/N, Palmira, Cuernavaca, Morelos 62490, México

^{2}

Departamento de Mecatrónica, Universidad Politécnica de Chiapas, Carretera Tuxtla-Villaflores KM. 1+500, Suchiapa, Chiapas 29150, México

^{3}

Departamento de Ingeniería Electrónica, Tecnológico Nacional de México-Centro Nacional de Investigación y Desarrollo Tecnológico, Interior Internado Palmira S/N, Palmira, Cuernavaca, Morelos 62490, México

^{4}

Catedra CONACYT-Tecnológico Nacional de México-Instituto Tecnológico de Tuxtla Gutiérrez, Carretera Panamericana Km. 1080, Tuxtla Gutiérrez, Chis 29000, México

^{5}

Departamento de Maestría en Mecatrónica, Tecnológico Nacional de México-Instituto Tecnológico de Tuxtla Gutiérrez, Carretera Panamericana km 1080, Col. Terán, Tuxtla Gutiérrez, Chis 29050, México

^{*}

Author to whom correspondence should be addressed.

Academic Editor:
Doug Arent

Received: 16 January 2017 / Accepted: 15 March 2017 / Published: 19 March 2017

## Abstract

**:**

Fossil fuel combustion produces around 98% of coal emissions. Therefore, liquid and gaseous biofuels have become more attractive due to their environmental benefits. The biodiesel production process requires measurements that help to control and supervise the variables involved in the process. The measurements provide valuable information about the operation conditions and give estimations about the critical variables of the process. The information from measurements is essential for monitoring the state of a process and verifying if it has an optimal performance. The objective of this study was the conception of a virtual sensor based on the Extended Kalman Filter (EKF) and the model of a batch biodiesel reactor for estimating concentrations of triglycerides (TG), diglycerides (DG), monoglycerides (MG), methyl ester (E), alcohol (A), and glycerol (GL) in real-time through measurement of the temperature and pH. Estimation of the TG, DG, MG, E, A, and Gl through this method eliminates the need for additional sensors and allows the use of different types of control. For the performance analysis of the virtual sensor, the data obtained from the EKF are compared with experimental data reported in the literature, with the mean square error of the estimate then being calculated. In addition, the results of this approach can be implemented in a real system, since it only uses measurements available in a reactor such as temperature and pH.

Keywords:

biodiesel; extended Kalman filter; batch biodiesel reactor## 1. Introduction

The reduction in fossil fuel reserves and growing concerns about their environmental impact has urged the search for new energy sources forward [1,2,3,4,5]. Biodiesel is an alternative to conventional diesel as a fuel source because it is biodegradable, non-toxic, and produces low emission of polluting gases, and therefore has environmental benefits [4,6]. The production of biodiesel is economically competitive and represents an alternative as an ideal substitute for conventional diesel.

Biodiesel is compounded by mono-alkyl esters obtained by transesterification of an oil or fat with a methoxide [7]. Studies have been conducted to reduce biodiesel production costs by controlling the reaction parameters that affect the speed and reaction mechanisms or optimizing their production processes [1,8]. The biodiesel production processes require measurements that aid in controlling and monitoring process variables. The measurements provide valuable information about the operating conditions and simultaneously give an estimate for critical variables by monitoring the state of a process and verifying that performance is optimal. There are methods to monitor the progress of the reaction, such as gas and liquid chromatography [9,10,11,12], Fourier transform infrared (FTIR), near-infrared (NIR), and nuclear magnetic resonance (NMR) spectroscopy methods [10,12,13,14,15,16,17], measurement of refractive index [18], and viscosity [19]. Most of these methods require samples to be taken and offline analyses to be performed which include a pre-treatment of the sample. According to the advances made in online concentration analysers, measuring these are usually expensive and difficult to maintain, in addition to possibly introducing a time delay in the control loop [20]. Therefore, the effect of an online application of a state estimation technique is to provide an estimate of the composition in real time from measurements of available sensors and the elimination of expensive sensors. This would avoid the consumption of other sensors, and being able to monitor all the online states could make the process more efficient.

Noise in processes is a common feature in chemical and biological reactors [21], and designing a nonlinear filter for a more precise estimation is necessary. The extended Kalman filter (EKF) is widely used for the estimation of states in many engineering applications for nonlinear systems and covers the problems caused by noise. In Reference [22], an extended Kalman filter was used to identify the parameters of a marine riser. In Reference [23], an implementation of a Kalman filter was performed to estimate unknown states and inputs for acceleration measurements. In Reference [20], a real-time estimation for concentrations in a distillation column was developed. In Reference [24], a Kalman filter using a Sigma point for a batch polymerization reactor was conducted. In Reference [25], extended Kalman filtering was used to estimate temperature and irradiation for maximum power point tracking of a photovoltaic module. An estimate was performed for the biomass concentration, production concentration, and substrate concentration in the fermentation process in a batch reactor by state-space modelling and usage of Kalman filters [26]. In a plug flow reactor, temperature was estimated by designing a hybrid extended Kalman filter [27]. In Reference [28], an estimate of the concentration of existing biogas in a continuously stirred reactor was performed using an extended Kalman filter.

The aim of this work was to design virtual sensors of the elements involved in the transesterification reaction in a reactor producing biodiesel in order to solve the online measuring problem for variables and also to provide tools for control systems.

## 2. Transesterification Model

The kinetic study of the transesterification reaction describes the reaction mechanisms and provides the parameters to predict the composition and concentration of the reaction at any point in time and under certain conditions. The reaction mechanism for producing esters is composed of three reversible consecutive reactions (Equations (1)–(3)). The reaction occurs from one mole of triglyceride (TG) reacting with three moles of alcohol (A) to form the intermediate products, diglycerides (DG) and monoglycerides (MG). The final product is methyl ester (E) and glycerol (GL).

$$TG+C{H}_{3}OH\underset{{k}_{1}{k}_{2}}{\iff}DG+{R}_{1}COOC{H}_{3}$$

$$DG+C{H}_{3}OH\underset{{k}_{3}{k}_{4}}{\iff}MG+{R}_{2}COOC{H}_{3}$$

$$MG+C{H}_{3}OH\underset{{k}_{5}{k}_{6}}{\iff}GL+{R}_{3}COOC{H}_{3}$$

Equation (4) shows the final balance of the process:

$$TG+3C{H}_{3}OH\underset{{k}_{7}{k}_{8}}{\iff}3RCOOC{H}_{3}+GL$$

The reaction mechanism of biodiesel production is common, regardless of the source of fatty acids. The general form of the set of differential equations governing the kinetics of the transesterification reaction of triglycerides is as follows (Equations (5)–(10)) [29]:
where $\text{}{k}_{1},{k}_{2},{k}_{3},{k}_{4},{k}_{5},{k}_{6}$ are the rate constants for reaction in units of M/s.

$$\frac{d\left[TG\right]}{dt}=-{k}_{1}\left[A\right]\left[TG\right]+{k}_{2}\left[E\right]\left[DG\right]$$

$$\frac{d\left[DG\right]}{dt}=A\left({k}_{1}TG-{k}_{3}DG\right)-E\left({k}_{2}DG-{k}_{4}MG\right)$$

$$\frac{d\left[MG\right]}{dt}=A({k}_{3}DG-{k}_{5}MG)-E({k}_{4}MG-{k}_{6}GL)$$

$$\frac{d\left[E\right]}{dt}=A({k}_{1}TG+{k}_{3}DG+{k}_{5}MG)-E\left({k}_{2}DG+{k}_{4}MG+{k}_{6}GL\right)$$

$$\frac{d\left[A\right]}{dt}=-\frac{d\left[E\right]}{dt}$$

$$\frac{d\left[GL\right]}{dt}={k}_{5}\left[A\right]\left[MG\right]-{k}_{6}\left[E\right]\left[GL\right]$$

The reaction rate in practice is affected by various factors, including temperature. The Arrhenius equation (Equation 11) relates the temperature in the reaction rate, and it is expressed as:
where α is the pre-exponential factor, ε is an activation energy, ${T}_{R}$ is the reactor temperature, and $\vartheta $ is the gas constant.

$$k=\alpha {e}^{\raisebox{1ex}{$-\epsilon $}\!\left/ \!\raisebox{-1ex}{$\vartheta {T}_{R}$}\right.}$$

There is a direct relationship between temperature and the transesterification reaction. A high reaction temperature increases the rate of biodiesel formation, but it is limited by the boiling points of the reaction components. The component with the lowest boiling point is methanol (64.5 °C) [29]. For this reason, analyses are carried out at different temperatures to determine if the designed estimator had a suitable fit for temperature changes. In this sense, different authors have different simulations of this system model at different temperatures to analyse the effect of this variable in the conversion of triglycerides into methyl esters [29,30,31].

## 3. Extended Kalman Filter

In many engineering applications, there are variables and physical parameters that cannot be directly measured, either due to a lack of specific sensors or the expensive cost (in enormous quantities). An alternative for dealing with this issue is to obtain a dynamic estimation of the required variables or parameters by using state observers, also known as virtual sensors. The extended Kalman filter (EKF) is a reasonable estimator for this application, as it is able to handle system nonlinearities and is built to incorporate noise from measurements and processes [25].

A state observer is a dynamic algorithm which is used to estimate the variables of a process using the following: a mathematical model represented in state space, the available measurements of the process (inputs and outputs), and an error correction term to ensure the convergence of the algorithm.

The general representation of a nonlinear state space model is as follows:
with $f$ and $h$ being smooth functions, where$x\in {\mathcal{R}}^{n}$is the vector of state variables, $u\in {\mathcal{R}}^{m}$ is the input vector, and $y\in {\mathcal{R}}^{p}$is the vector of output variables. To derive a general structure of a state observer, let us consider the nonlinear state space model (12):
where the superscript $(\u02c6)$ at any variable denotes estimation, $\widehat{y}\left(t\right)$ are the online estimations, whereas $K\left(x\left(t\right)\right)$ is the gain of the observer. Then, the design of the state observer involves choosing an appropriate gain, $K\left(x\left(t\right)\right),$in order to make the estimation error converge to zero. If the observation error $e$ is defined as follows:

$$\dot{x}\left(t\right)=f\left(x\left(t\right),u\left(t\right)\right)$$

$$y\left(t\right)=h\left(x\left(t\right),u\left(t\right)\right)$$

$$\begin{array}{c}\widehat{x}\left(t\right)=\underset{modelcopy}{\underbrace{f\left(x\left(t\right),u\left(t\right)\right)}}+\underset{correctionterm}{\underbrace{K\left(x\left(t\right)\right)\left(y\left(t\right)-\widehat{y}\left(t\right)\right)}}\\ \widehat{y}\left(t\right)=h\left(x\left(t\right)\right)\end{array}$$

$$e\left(t\right)=x\left(t\right)-\widehat{x}\left(t\right)$$

The dynamics of the error observation are derived from Equations (12) and (13):

$$\dot{e}=f\left(x+e,u\right)-f\left(x,u\right)-K\left(x\right)\left(h\left(x+e\right)-h\left(x\right)\right)$$

The word “extended” emphasizes the fact that this observer is an extension of the original linear version to nonlinear systems. The design of the gain matrix $K\left(x\right)$ is based on a linearized version (the linearized tangent model) of the observation error from process dynamics (computed from a Taylor series expansion of a state space model around some operating point). Considering the linearization of Equation (15) around the observation error $e=0$, the following equation is obtained:
where $A\left(x\right)$ and $C\left(x\right)$ are, respectively, equal to:

$$\dot{e}=\left(A\left(x\right)-K\left(x\right)C\left(x\right)\right)e$$

$$A\left(x\right)={\frac{\partial f\left(x,u\right)}{\partial x}|}_{x},C\left(x\right)={\frac{\partial h\left(x\right)}{\partial x}|}_{x}$$

Although the Kalman filter was originally introduced in a stochastic framework, it can also be interpreted as the approximated solution of a deterministic optimization problem. Indeed, the design of the extended Kalman filter consists of finding the gain matrix, $K\left(x\right),$ that minimizes the mean square observation error:
with the dynamical model Equation (16) (under the constraints of the dynamical model, in the usual notations of optimization theory). Hence, the gain is computed as follows:
where $S\left(x\right)$ is a time-varying matrix calculated through the following Riccati equation:

$$E={{\displaystyle \int}}_{0}^{t}e{e}^{T}d\tau $$

$$K\left(x\right)=S\left(x\right)C{\left(x\right)}^{T}{R}^{-1}$$

$$\dot{S}\left(x\right)=A\left(\widehat{x}\right)S\left(x\right)+S\left(x\right){A}^{T}\left(x\right)-S\left(x\right)C\left(x\right){R}^{-1}C\left(x\right)S\left(x\right)+Q$$

For the implementation of the EKF, the concerning matrices must accomplish certain properties: $S\left(0\right)=S{\left(0\right)}^{T}>0$, $Q={Q}^{T}\ge 0$, and $R={R}^{T}\ge 0$, where $Q$ and $R$ are covariance matrices with elements chosen for optimal noise filtering. To ensure the convergence of the filter, one can use the following expression instead of Equation (16):
where I is the identity matrix with appropriated dimensions and α is a constant parameter that provides a stability degree to the estimation. Namely, by means of this parameter, the estimation error is bounded and the estimation rate can be tuned.

$$\dot{S}\left(x\right)=\left(A\left(x\right)+\alpha I\right)S\left(x\right)+S\left(x\right){\left(A\left(x\right)+\alpha I\right)}^{T}-S\left(x\right)C\left(x\right){R}^{-1}C\left(x\right)S\left(x\right)+Q$$

## 4. Results and Discussion

#### 4.1. Simulation of the Transesterification Reaction

The model of differential equations presented in Equations (5)–(10) were used to simulate the transesterification reaction of triglycerides of the oil of jatropha sp. biodiesel at 50 °C, with conditions presented in Table 1. Kinetic constants used were 1.6775, 0.1174, 2.1303, 0, 0.1961, 0.0449 with units M/s, ${k}_{i}$ for i = 1 ... 6, respectively, according to the data reported in Reference [31].

The simulation was carried out in the Matlab

^{®}simulation software using an ode45 solver. The results obtained from simulation of the nonlinear model of the transesterification reaction are shown in Figure 1. It shows that TG was consumed as the reaction proceeded, while E was formed. At the same time, intermediate reactions were carried out that produce and consume MG and DG. These behaviours coincide with the experimental results that have been reported in previous studies [29,31,32].#### 4.2. Reaction Estimation

This section presents the setup for the simulations used to examine the performance of the proposed estimator. The simulation was carried out in the Matlab Simulink

^{®}software. The EKF estimation was compared with experimental results that have been reported in previous studies [29,31,32]. An estimation of intermediate and final products of the transesterification reaction of methanol with Jatropha oil was carried out. Constant reaction temperature (50 °C) simulations and changes of temperature by 20 °C (changing 50 °C to 70 °C and 30 °C) were performed. This was done to analyse the performance of the estimation obtained by the extended Kalman filter.A block diagram of the Kalman filter extended for use as a virtual sensor is shown in Figure 2. Directly measuring the inlet temperature and indirectly measuring the concentration of E through a pH sensor [33] allows estimation of the six system states.

There is a direct relationship between pH and the transesterification reaction in the production of methyl ester. Changes in OH

^{−}concentration due to the conversion of oil to biodiesel are observed by the pH meter during the reaction. It appears that the OH^{−}ions do not dissolve in the oil because of their polar nature, but do dissolve in the biodiesel and glycerol. As the reaction occurs, the oil concentration decreases and the concentration of methyl ester and glycerol increases, causing changes in pH derived from the stoichiometric ratio. Thus, changes in pH are directly correlated with methyl ester concentration.The linearized model using Equation (17) is shown in Equation (23):

$$\begin{array}{cc}A=\frac{\partial f\left(X,U\right)}{\partial X}\hfill & =\left[\begin{array}{cccccc}-{k}_{1}A& {k}_{2}E& 0& {k}_{2}DG& -{k}_{1}TG& 0\\ {k}_{1}A& -{k}_{2}E-{k}_{3}A& {k}_{4}E& {k}_{4}MG-{k}_{2}DG& {k}_{1}TG-{k}_{3}DG& 0\\ 0& {k}_{3}A& -{k}_{4}E-{k}_{5}A& {k}_{6}GL-{k}_{4}MG& {k}_{3}DG-{k}_{5}MG& {k}_{6}E\\ {k}_{1}A& {k}_{3}A-{k}_{2}E& {k}_{5}A-{k}_{4}E& -{k}_{2}DG-{k}_{4}MG-{k}_{6}GL& {k}_{1}TG+{k}_{3}DG+{k}_{5}MG& -{k}_{6}E\\ -{k}_{1}A& -{k}_{3}A+{k}_{2}E& -{k}_{5}A+{k}_{4}E& {k}_{2}DG+{k}_{4}MG+{k}_{6}GL& -{k}_{1}TG-{k}_{3}DG-{k}_{5}MG& {k}_{6}E\\ 0& 0& {k}_{5}A& -{k}_{6}GL& {k}_{5}MG& -{k}_{6}E\end{array}\right]\hfill \end{array}$$

To show the performance of the proposed EKF, the calibration values that were used are shown in Table 2.

The results of the constant reaction temperature (at 50 °C) are shown in Figure 3. It can be observed that the estimated values (green line) can track the experimental values (blue line) in a highly effectively way from one measured state and one input, which are the six concentrations obtained from the transesterification reaction. Furthermore, the mean squared error (MSE) of the signals was calculated to analyse the performance of the observer with the MSE subsequently found to be zero. Since the concentration of triglycerides and diglycerides frequently have a value of 0, it is important to display the correct estimation of the graphs logarithmically.

The results of the estimation simulation against a change in the temperature of +20 °C (50 °C to 70 °C) in minute three of simulation are shown in Figure 4. It can be seen that even with a change in the reference system, the EKF continuously provides a perfect estimation for the system. MSE values were calculated, and there was only minimal error.

The estimation simulation against a −20 °C temperature change (50 °C to 30 °C) in minute 3 is shown in Figure 5. It can be seen that the slope of the concentration of MG becomes more pronounced and the formation of E and GL is less than the obtained amounts at 50 °C. Furthermore, it demonstrates how the estimator (green line) perfectly follows the change of the system (blue line).

The Kalman filter estimation is shown in Figure 6 with the introduction of random noise to the process data. In this estimation, a good filter performance is observed and the MSE was calculated in percentages (Table 3).

In Figure 7, the Kalman filter estimation is shown after the introduction of random measurement noise (sensor), with an excellent filter performance observed and the MSE being calculated in percentages (Table 4).

The error of estimation of the states with measurement noise is shown in Figure 8, with the error being close to zero. The convergence of the filter is corroborated according to Reference [34].

The prospects for the implementation of virtual sensors for biodiesel production involve developing a fault-tolerant control system with fault diagnosis to support the continuous operation of the production process and consequently achieve an improvement in production by doing this in a more robust and secure manner. In addition, the use of such virtual sensors will allow the implementation of control techniques that require all output variables to be measured. In addition to these, sensors can monitor the reagents and products of the reaction transesterification online. Reactors could even be designed with online readings where it can be visualized whether the reaction is complying with European Standard Automotive fuels—Fatty acid methyl esters (FAME) for diesel engines—Requirements and test methods (EN14214).

There is practical importance for implementing virtual sensors for biodiesel production, as these sensors can estimate variables that cannot be measured or are difficult to measure online, in addition to reducing instrumentation costs, since no extra sensors would be needed to measure the concentrations of MG, DG, TG, A, and GL. In addition, it would avoid the need for reading times and reagents for measuring concentrations by destructive and costly analytical techniques such as gas chromatography. The virtual sensors would have the measurements online as a first option, allowing evaluation of whether or not it meets the specifications of standard EN14214.

## 5. Conclusions

A Kalman filter was designed and implemented as a virtual sensor to estimate concentrations of the transesterification reaction of Jatropha oil with methanol (A) in a batch reactor to produce fatty acid esters (biodiesel, E) using measurements of temperature and pH sensors. The substances estimated were TG, DG, MG, E, A, and GL. To analyse the performance of the estimation system, we 3 simulated cases: (a) with the temperature inlet to 50 °C; (b) a change in temperature of +20 °C and change of −20 °C; and (c) with random noise in the system and measurement. For analysis of the estimation process, the MSE was calculated in percentages. In every case, the error was practically null, providing evidence that an excellent estimation is performed by the filter and proving its usefulness as a virtual sensor.

## Author Contributions

Betty López designed FKE, Betty López and Juan Pablo Castillo designed the simulation; Peggy Álvarez and Manuel Adam analized the data; Héctor Hernández and Luis Vela wrote the paper.

## Conflicts of Interest

The authors declare no conflict of interest.

## References

- Demirbas, M.F.; Mehmet, B. Progress and recent trends in biodiesel fuels. Int. J. Green Energy
**2009**, 50, 14–34. [Google Scholar] [CrossRef] - Felizardo, P.; Baptista, P.; Menezes, J.C.; Correia, M.J.N. Multivariate near infrared spectroscopy models for predicting the methyl esters content in biodiesel. Anal. Chim. Acta
**2008**, 607, 153–159. [Google Scholar] - Fukuda, H.; Kondo, A.; Noda, H. Biodiesel fuel production by transesterification of oils. J. Biosci. Bioeng.
**2001**, 92, 405–416. [Google Scholar] [CrossRef] - Mansouri, S.S.; Ismail, M.I.; Babi, D.K.; Simasatitkul, L.; Huusom, J.K.; Gani, R. Systematic Sustainable Process Design and Analysis of Biodiesel Processes. Processes
**2013**, 1, 167–202. [Google Scholar] [CrossRef] - Ovando-Medina, I.; Espinosa-García, F.; Núñez-Farfán, J.; Salvador-Figueroa, M. Does biodiesel from Jatropha Curcas represent a sustainable alternative energy source? Sustainability
**2009**, 1, 1035–1041. [Google Scholar] [CrossRef] - Ma, F.; Hanna, M.A. Biodiesel production: A review. Bioresour. Technol.
**1999**, 70, 1–15. [Google Scholar] [CrossRef] - Knothe, G. Biodiesel and renewable diesel: A comparison. Prog. Energy Combust. Sci.
**2010**, 36, 364–373. [Google Scholar] [CrossRef] - Franco, M. Simulación del Proceso de Producción de Biodiesel a Partir de Aceites Vegetales en Condiciones Súper-Críticas. Master’s Thesis, Escola Tecnica Superior d’Enginyeria Industrial de Barcelona, Barcelona, Espana, 2013. [Google Scholar]
- Holčapek, M.; Jandera, P.; Fischer, J.; Prokeš, B. Analytical monitoring of the production of biodiesel by high-performance liquid chromatography with various detection methods. J. Chromatogr. A
**1999**, 858, 13–31. [Google Scholar] [CrossRef] - Dubé, M.A.; Zheng, S.; McLean, D.D.; Kates, M. A comparison of attenuated total reflectance-FTIR spectroscopy and GPC for monitoring biodiesel production. J. Am. Oil Chem. Soc.
**2004**, 81, 599–603. [Google Scholar] [CrossRef] - Monteiro, M.R.; Ambrozin, A.R.P.; Lião, L.M.; Ferreira, A.G. Critical review on analytical methods for biodiesel characterization. Talanta
**2008**, 77, 593–605. [Google Scholar] [CrossRef] - Richard, R.; Li, Y.; Dubreuil, B.; Thiebaud-Roux, S.; Prat, L. On-line monitoring of the transesterification reaction between triglycerides and ethanol using near infrared spectroscopy combined with gas chromatography. Bioresour. Technol.
**2011**, 102, 6702–6709. [Google Scholar] [CrossRef] [PubMed][Green Version] - De Boni, L.A.B.; Da Silva, I.N.L. Monitoring the transesterification reaction with laser spectroscopy. Fuel Process. Technol.
**2011**, 92, 1001–1006. [Google Scholar] [CrossRef] - Fontalvo-Gómez, M.; Colucci, J.A.; Velez, N.; Romanach, R.J. In-line near-infrared (NIR) and raman spectroscopy coupled with principal component analysis (PCA) for in situ evaluation of the transesterification reaction. Appl. Spectrosc.
**2013**, 67, 1142–1149. [Google Scholar] [CrossRef] [PubMed] - Kouame, S.D.B.; Perez, J.; Eser, S.; Benesi, A. 1H-NMR Monitoring of the transesterification process of Jatropha oil. Fuel Process. Technol.
**2012**, 97, 60–64. [Google Scholar] [CrossRef] - Knothe, G. Analyzing biodiesel: Standards and other methods. JAOCS J. Am. Oil Chem. Soc.
**2006**, 83, 823–833. [Google Scholar] [CrossRef] - Reddy, S.R.; Titu, D.; Chadha, A. A novel method for monitoring the transesterification reaction of oil in biodiesel production by estimation of glycerol. JAOCS J. Am. Oil Chem. Soc.
**2010**, 87, 747–754. [Google Scholar] [CrossRef] - Xie, W.; Li, H. Hydroxyl content and refractive index determinations on transesterified soybean oil. JAOCS J. Am. Oil Chem. Soc.
**2006**, 83, 869–872. [Google Scholar] [CrossRef] - Ellis, N.; Guan, F.; Chen, T.; Poon, C. Monitoring biodiesel production (transesterification) using in situ viscometer. Chem. Eng. J.
**2008**, 138, 200–206. [Google Scholar] [CrossRef] - Oisiovici, R.M.; Cruz, S.L. State estimation of batch distillation columns using an extended Kalman filter. Chem. Eng. Sci.
**2000**, 55, 4667–4680. [Google Scholar] [CrossRef] - Patnaik, P.R. Improvement of the microbial production of streptokinase by controlled filtering of process noise. Process Biochem.
**1999**, 35, 309–315. [Google Scholar] [CrossRef] - Torres, L.; Verde, C.; Vázquez-Hernández, O. Parameter identification of marine risers using Kalman-like observers. Ocean Eng.
**2015**, 93, 84–97. [Google Scholar] [CrossRef] - Eftekhar, S.; Chatzi, E.; Papadimitriou, C. A dual Kalman filter approach for state estimation via output-only acceleration measurements. Mech. Syst. Signal Process.
**2015**, 60–61, 866–886. [Google Scholar] [CrossRef] - Beyer, M.A.; Grote, W.; Reinig, G. Adaptive exact linearization control of batch polymerization reactors using a Sigma-Point Kalman Filter. J. Process Control
**2008**, 18, 663–675. [Google Scholar] [CrossRef] - Docimo, D.J.; Ghanaatpishe, M.; Mamun, A. Extended Kalman Filtering to estimate temperature and irradiation for maximum power point tracking of a photovoltaic module. Energy
**2017**, 120, 47–57. [Google Scholar] [CrossRef] - Wang, J.; Zhao, L.; Yu, T. On-line estimation in fed-batch fermentation process using state space model and unscented kalman filter. Chin. J. Chem. Eng.
**2010**, 18, 258–264. [Google Scholar] [CrossRef] - Rezaei, N.; Rahimpour, M.R.; Khayatian, A.; Jahanmiri, A. A new hybrid approach in the estimation of end-states of a tubular plug-flow reactor by Kalman filter. Chem. Eng. Process. Process Intensif.
**2008**, 47, 770–779. [Google Scholar] [CrossRef] - Kupilik, M.J.; Vincent, T.L. Estimation of biogas composition in a catalytic reactor via an extended Kalman filter. In Proceedings of the IEEE International Conference on Control Applications, Denver, CO, USA, 28–30 September 2011; pp. 768–773.
- Noureddini, H.; Zhu, D. Kinetics of transesterification of soybean oil. J. Am. Oil Chem. Soc.
**1997**, 74, 1457–1463. [Google Scholar] [CrossRef] - Jain, S.; Sharma, M.P. Kinetics of acid base catalyzed transesterification of Jatropha curcas oil. Bioresour. Technol.
**2010**, 101, 7701–7706. [Google Scholar] [CrossRef] [PubMed] - Noriega, M.A.; Narváez, P.C.; Heinz, C. Kinetics of Jatropha oil methanolysis. Fuel
**2014**, 134, 244–249. [Google Scholar] [CrossRef] - Berchmans, H.J.; Morishita, K.; Takarada, T. Kinetic study of hydroxide-catalyzed methanolysis of Jatropha curcas–waste food oil mixture for biodiesel production. Fuel
**2013**, 104, 46–52. [Google Scholar] [CrossRef] - William, M.C.; Medeiros, N.J.; Boyd, D.J.; Snell, J.R. Biodiesel transesterification kinetics monitored by pH measurement. Bioresour. Technol.
**2013**, 136, 771–774. [Google Scholar] - Baras, J.S.; Bensoussan, A.; James, R.M. Dynamic observers as asymptotic limits of recursive filters: Special cases. Appl. Math.
**1988**, 48, 1147–1158. [Google Scholar] [CrossRef]

**Figure 2.**Diagram of estimation with Kalman filter for a biodiesel reaction. TG: triglyceride; DG; diglyceride; MG: monoglyceride; E: methyl ester; A: alcohol; GL: glycerol.

Type of Oil | Jatropha Oil |
---|---|

Alcohol:oil molar ratio | 6:1 |

Alcohol | Methanol (CH_{4}O) |

Ng’s reaction time | 90 min |

Catalyst | Sodium hydroxide (NaOH) |

Amount of catalyst | 0.20 wt % of sodium oxide hydraulic oil |

Temperature on reaction | 323.15 K (50 °C) |

Mixing intensity | 600 rpm |

**Table 2.**Parameters of the extended Kalman filter (EKF) with a degree of stability (tuning of the observer).

Parameters | Units |
---|---|

Initial conditions | $x=\left[100060\right]$ |

Stability parameter | $\alpha =0.01$ |

Initial condition of S | $S\left(0\right)=I$ |

Covariance Matrix | $Q=\left[\begin{array}{cccccc}1& 0& 0& 0& 0& 0\\ 0& 1& 0& 0& 0& 0\\ 0& 0& 1& 0& 0& 0\\ 0& 0& 0& 1& 0& 0\\ 0& 0& 0& 0& 1& 0\\ 0& 0& 0& 0& 0& 1\end{array}\right]\times 0.01$ |

Covariance Matrix | $R=5$ |

Component | MSE (%) |
---|---|

TG | $1.3580\times {10}^{-6}$ |

DG | $2.227\times {10}^{-6}$ |

MG | 0.0094 |

E | 0.0202 |

A | 0.0033 |

GL | 0.1250 |

Component | MSE (%) |
---|---|

TG | $3.9671\times {10}^{-8}$ |

DG | $3.1296\times {10}^{-7}$ |

MG | $6.7192\times {10}^{-5}$ |

E | $0.6752$ |

A | $7.1570\times {10}^{-4}$ |

GL | $1.3624\times {10}^{-4}$ |

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license ( http://creativecommons.org/licenses/by/4.0/).