Open access peer-reviewed chapter

Nonlinear Autoregressive with Exogenous Inputs Based Model Predictive Control for Batch Citronellyl Laurate Esterification Reactor

By Siti Asyura Zulkeflee, Suhairi Abdul Sata and Norashid Aziz

Submitted: October 17th 2010Reviewed: February 9th 2011Published: July 5th 2011

DOI: 10.5772/16963

Downloaded: 5005

1. Introduction

Esterification is a widely employed reaction in organic process industry. Organic esters are most frequently used as plasticizers, solvents, perfumery, as flavor chemicals and also as precursors in pharmaceutical products. One of the important ester is Citronellyl laurate, a versatile component in flavors and fragrances, which are widely used in the food, beverage, cosmetic and pharmaceutical industries. In industry, the most common ester productions are carried out in batch reactors because this type of reactor is quite flexible and can be adapted to accommodate small production volumes (Barbosa-Póvoa, 2007). The mode of operation for a batch esterification reactor is similar to other batch reactor processes where there is no inflow or outflow of reactants or products while the reaction is being carried out. In the batch esterification system, there are various parameters affecting the ester rate of reaction such as different catalysts, solvents, speed of agitation, catalyst loading, temperature, mole ratio, molecular sieve and water activity (Yadav and Lathi, 2005). Control of this reactor is very important in achieving high yields, rates and to reduce side products. Due to its simple structure and easy implementation, 95% of control loops in chemical industries are still using linear controllers such as the conventional Proportional, Integral & Derivative (PID) controllers. However, linear controllers yield satisfactory performance only if the process is operated close to a nominal steady-state or if the process is fairly linear (Liu & Macchietto, 1995). Conversely, batch processes are characterized by limited reaction duration and by non-stationary operating conditions, then nonlinearities may have an important impact on the control problem (Hua et al., 2004). Moreover, the control system must cope with the process variables, as well as facing changing operation conditions, in the presence of unmeasured disturbances. Due to these difficulties, studies of advanced control strategy have received great interests during the past decade. Among the advanced control strategies available, the Model Predictive Control (MPC) has proved to be a good control for batch reactor processes (Foss et al., 1995; Dowd et al., 2001; Costa et al., 2002; Bouhenchir et al., 2006). MPC has influenced process control practices since late 1970s. Eaton and Rawlings (1992) defined MPC as a control scheme in which the control algorithm optimizes the manipulated variable profile over a finite future time horizon in order to maximize an objective function subjected to plant models and constraints. Due to these features, these model based control algorithms can be extended to include multivariable systems and can be formulated to handle process constraints explicitly. Most of the improvements on MPC algorithms are based on the developmental reconstruction of the MPC basic elements which include prediction model, objective function and optimization algorithm. There are several comprehensive technical surveys of theories and future exploration direction of MPC by Henson, 1998, Morari & Lee, 1999, Mayne et al., 2000 and Bequette, 2007. Early development of this kind of control strategy, the Linear Model Predictive Control (LMPC) techniques such as Dynamic Matrix Control (DMC) (Gattu and Zafiriou, 1992) have been successfully implemented on a large number of processes. One limitation to the LMPC methods is that they are based on linear system theory and may not perform well on highly nonlinear system. Because of this, a Nonlinear Model Predictive Control (NMPC) which is an extension of the LMPC is very much needed.

NMPC is conceptually similar to its linear counterpart, except that nonlinear dynamic models are used for process prediction and optimization. Even though NMPC has been successfully implemented in a number of applications (Braun et al., 2002; M’sahli et al., 2002; Ozkan et al., 2006; Nagy et al., 2007; Shafiee et al., 2008; Deshpande et al., 2009), there is no common or standard controller for all processes. In other words, NMPC is a unique controller which is meant only for the particular process under consideration. Among the major issues in NMPC development are firstly, the development of a suitable model that can represent the real process and secondly, the choice of the best optimization technique. Recently a number of modeling techniques have gained prominence. In most systems, linear models such as partial least squares (PLS), Auto Regressive with Exogenous inputs (ARX) and Auto Regressive Moving Average with Exogenous inputs (ARMAX) only perform well over a small region of operations. For these reasons, a lot of attention has been directed at identifying nonlinear models such as neural networks, Volterra, Hammerstein, Wiener and NARX model. Among of these models, the NARX model can be considered as an outstanding choice to represent the batch esterification process since it is easier to check the model parameters using the rank of information matrix, covariance matrices or evaluating the model prediction error using a given final prediction error criterion. The NARX model provides a powerful representation for time series analysis, modeling and prediction due to its strength in accommodating the dynamic, complex and nonlinear nature of real time series applications (Harris & Yu, 2007; Mu et al., 2005). Therefore, in this work, a NARX model has been developed and embedded in the NMPC with suitable and efficient optimization algorithm and thus currently, this model is known as NARX-MPC.

Citronellyl laurate is synthesized from DL-citronellol and Lauric acid using immobilized Candida Rugosalipase (Serri et. al., 2006). This process has been chosen mainly because it is a very common and important process in the industry but it has yet to embrace the advanced control system such as the MPC in their plant operation. According to Petersson et al. (2005), temperature has a strong influence on the enzymatic esterification process. The temperature should preferably be above the melting points of the substrates and the product, but not too high, as the enzyme’s activity and stability decreases at elevated temperatures. Therefore, temperature control is important in the esterification process in order to achieve maximum ester production. In this work, the reactor’s temperature is controlled by manipulating the flowrate of cooling water into the reactor jacket. The performances of the NARX-MPC were evaluated based on its set-point tracking, set-point change and load change. Furthermore, the robustness of the NARX-MPC is studied by using four tests i.e. increasing heat transfer coefficient, increasing heat of reaction, decreasing inhibition activation energy and a simultaneous change of all the mentioned parameters. Finally, the performance of NARX-MPC is compared with a PID controller that is tuned using internal model control technique (IMC-PID).


2. Batch esterification reactor

The synthesis of Citronellyl laurate involved an exothermic process where Citronellol reacted with Lauric acid to produce Citronellyl Laurate and water.

Figure 1.

Schematic represent esterification of Citronellyl laurate

The esterification process took place in a batch reactor where the immobilized lipase catalyst was mixed freely in the reactor. A layout of the batch esterification reactor with associated heating and cooling configurations is shown in Fig.2.

Figure 2.

Schematic diagram of the batch esterification reactor.

Typical operating conditions were 310K and 1 bar. The reactor temperature was controlled by manipulating the water flowrate within the jacket. The reactor’s temperature should not exceed the maximal temperature of 320K, due to the temperature sensitivity of the catalysts (Yadav & Lathi, 2004; Serri et. al., 2006; Zulkeflee & Aziz, 2007). The reactor’s temperature control can be achieved by treating the limitation of the jacket’s flowrate, Fj, which can be viewed as a state of the process and as the constraint control problem. The control strategy proposed in this paper was designed to meet the specifications of the laboratory scale batch reactor at the Control Laboratory of School of Chemical Engineering, University Sains Malaysia, which has a maximum of 0.2 L/min limitation on the jacket’s flowrate. Therefore, the constraint of the jacket’s flowrate will be denoted as Fjmax= 0.2 L/min.

The fundamental equations of the mass and energy balances of the process are needed to generate data for empirical model identification. The equations are valid for allt[0,]. The reaction rate and kinetics are given by (Yadav & Lathi, 2004; Serri et. al., 2006; Zulkeflee & Aziz, 2007):


where CAc,CAl,CEsand CWare concentrations (mol/L) of Lauric acid, Citronellol, Citronellyl laurate and water respectively; rmax (mol l-1 min-1 g-1 of enzyme) is the maximum rate of reaction,KAc(mol l-1 g-1 of enzyme), KAl (mol l-1 g-1 of enzyme) and Ki(mol l-1 g-1 of enzyme) are the Michealis constant for Lauric acid, Citronellol and inhibition respectively; Ai,AAcand AAlare the pre-exponential factors (L mol/s) for inhibition, Lauric acid and Citronellol respectively; Ei,EAcand EAlare the activation energy (J mol/K) for inhibition, acid lauric and Citronellol respectively;Ris the gas constant (J/mol K).

The reactor can be described by the following thermal balances (Aziz et al., 2000):


where Tr(K), Tj(K) and Tjinis reactor, jacket and inlet jacket temperature respectively; ΔHrxn(kJ/mol)is heat of reaction; V(l) and Vj(l) is the volume of the reactor and jacket respectively;CpAc,CpAl,CpEsand CpWare specific heats (J/mol K) of Lauric acid, Citronellol, Citronellyl laurate and water respectively; ρwis the water density (g/L) in the jacket;Fjis the flowrate of the jacket (L/min); Q˙(kW) is the heat transfer through the jacket wall; Aand Uare the heat exchange area (m2) and the heat exchange coefficient (W/m2/K) respectively.

Eq. 1 - Eq. 10 were simulated using a 4th/5th order of the Runge Kutta method in MATLAB® environment. The model of the batch esterification process was derived under the assumption that the process is perfectly mixed where the concentrations of[Ac], [Al], [Es], [w]and temperature of the fluid in the tank is uniform. Table 1 shows all the value of the parameters for the batch esterification process under consideration.The validations of corresponding dynamic models have been reported in Zulkeflee & Aziz (2007).

AAcL mol/s18.20871CpwJ/mol K75.40
AAlL mol/s24.04675VL1.5
AiL mol/s0.319947VjL0.8
EAcJ mol/K-105.405QJ/m311.648
EAlJ mol/K-66.093ΔHrxnkJ16.73
EiJ mol/K-249.944α-1
CpAcJ/mol K420.53UJ/s m2 K2.857
CpAlJ/mol K235.27Am20.077
CpEsJ/mol K617.79RJ/mol K8.314

Table 1.

Operating Conditions and Calculated Parameters

3. NARX model

The Nonlinear Autoregressive with Exogenous inputs (NARX) model is characterized by the non-linear relations between the past inputs, past outputs and the predicted process output and can be delineated by the high order difference equation, as follows:


where u(t)and y(t)represents the input and output of the model at time tin which the current output y(t)depends entirely on the current inputu(t). Here nuand nyare the input and output orders of the dynamical model which arenu0,ny1. The function fis a nonlinear function. X¯=[y(t1)y(tny)u(t1)u(tnu)]Tdenotes the system input vector with a known dimensionn=ny+nu. Since the function fis unknown, it is approximated by the regression model of the form:


where a(i)and a(i,j)are the coefficients of linear and nonlinear for originating exogenous terms; b(i)and b(i,j)are the coefficients of the linear and nonlinear autoregressive terms; c(i,j)are the coefficients of the nonlinear cross terms. Eq. 12 can be written in matrix form:




The Eq. 13 can alternatively be expressed as:


and can be simplified as:




Finally, the solution of the above identification problem is represented by


The procedures fora NARX model identification is shown in Fig.3. This model identification process includes:

Figure 3.

NARX model identification procedure

  • Identification pre-testing: This study is very important in order to choose the important controlled, manipulated and disturbance variables. A preliminary study of the response plots can also gives an idea of the response time and the process gain.

  • Selection of input signal: The study of input range has to be done, to calculate the maximal possible values of all the input signals so that both inputs and outputs will be within the desired operating conditions range. The selection of input signal would allow theincorporationof additional objectives and constraints, i.e. minimum or maximum input event separations which are desirable for the input signals and the resulting process behavior.

  • Selection of model order: The important step in estimating NARX models is to choose the model order. The model performance was evaluated by the Means Squared Error (MSE) and Sum Squared Error (SSE).

  • Model validation: Finally, the model was validated with two sets of validation data which were unseen independent data sets that are not used in NARX model parameter estimation.

The details of the identification of NARX model for the batch esterification can be found at Zulkeflee & Aziz (2008).

4. MPC algorithm

The conceptual structure of MPC is depicted in Fig. 4. The conception of MPC is to obtain the current control action by solving, at each sampling instant, a finite horizon open-loop optimal control problem, using the current state of the plant as the initial state. The desired objective function is minimized within the optimization method and related to an error function based on the differences between the desired and actual output responses. The first optimal input was actually applied to the plant at time t and the remaining optimal inputs were discarded. Meanwhile, at time t+1, a new measurement of optimal control problem was resolved and the receding horizon mechanism provided the controller with the desired feedback mechanism (Morari & Lee, 1999; Qin & Badgwell, 2003; Allgower, Findeisen & Nagy, 2004).

Figure 4.

Basic structure of Model Predictive Control

A formulation of the MPC on-line optimization can be as follows:


Where Pand Mis the length of the process output prediction and manipulated process input horizons respectively with P ≤ M. u[t+k|t]k=0,Pis the set of future process input values. The vector wkis the weight vector.

The above on-line optimization problem could also include certain constraints. There can be bounds on the input and output variables:


It is clear that the above problem formulation necessitates the prediction of future outputs


In this NARX model, for k step ahead:

The error e(t):


The prediction of future outputs:


Substitution of Eq. 35 and Eq. 36 into Eq 31 yields:




The above optimization problem is a nonlinear programming (NLP) which can be solved at each time t. Even though the input trajectory was calculated until M-1sampling times into the future, only the first computed move was implemented for one sampling interval and the above optimization was repeated at the next sampling time. The structure of the proposed NARX-MPC is shown in Fig. 5.

In this work, the optimization problem was solved using constrained nonlinear optimization programming (fmincon) function in the MATLAB. A lower flowrate limit of 0 L/min and an upper limit of 0.2 L/min and a lower temperature limit of 300K and upper limit of 320K were chosen for the input and output variables respectively. In order to evaluate the performance of NARX-MPC controller, the NARX-MPC has been used to track the temperature set-point at 310K. For the set-point change, a step change from 310K to 315K was introduced to the process at t=25 min. For load change, a disturbance was implemented with a step change (+10%) for the jacket temperature from 294K to 309K. Finally, the performance of NARX-MPC is compared with the performance of PID controller. The parameters of PID controller have been estimated using the internal model based controller. The details of the implementation of IMC-PID controller can be found in Zulkeflee & Aziz (2009).

Figure 5.

The structure of the NARX-MPC

5. Results

5.1. NARX model identification

The input and output data for the identification of a NARX model have been generated from the validated first principle model. The input and output data used for nonlinear identification are shown in Fig. 6.The minimum-maximum range input (0 to 0.2 L/min) under the amplitude constraint was selected in order to achieve the most accurate parameter to determine the ratio of the output parameter. For training data, the inputs signal for jacket flowrate was chosen as multilevel signal. Different orders of NARX models which was a mapping of past inputs (nu) and output (ny) terms to future outputs were tested and the best one was selected according to the MSE and SSE criterion. Results have been summarized in Table 2. From the results, the MSE and SSE value decreased by increasing the model order until the NARX model with nu=1 and ny= 2. Therefore, the NARX model with nu=1 and ny= 2 was selected as the optimum model with MSE and SSE equal to 0.0025 and 0.7152 respectively. The respective graphical error of identification for training and validation of estimated NARX model is depicted in Fig. 7.


The identified NARX model of the process has been implemented in the MPC algorithm. Agachi et al., (2007) proposed some criteria to select the significant tuning parameters (prediction horizon, P; control horizon, M; penalty weight matrices wkand rk) for the MPC controller. In many cases, the prediction (P) and control horizons (M) are introduced as P>M>1 due to the fact that it allows consequent control over the variables for the next future cycles. The value of weighting (wkand rk) of the controlled variables must be large enough to minimize the constraint violations in objective function. Tuning parameters and SSE values of the NARX-MPC controller are shown in Table 3. Based on these results, the effect of changing the control horizon, M for M: 2, 3, 4 and 5 indicated that M=2 gave the smallest error of output response with SSE value=424.04. From the influence of prediction horizon, P results, the SSE value was found to decrease by increasing the number of prediction horizon until P=11 with the smallest SSE value = 404.94. SSE values shown in Table 3 demonstrate that adjusting the elements of the wkand rkweighting matrix can improve the control performance. The value of wk= 0.1 and rk= 1 had resulted in the smallest error with SSE=386.45. Therefore, the best tuning parameters for the NARX-MPC controller were P=11; M=2; wk= 0.1 and rk= 1.

Figure 6.

Input output data for NARX model identification


Table 2.

MSE and SSE values of NARX model for different number of nuand ny

Figure 7.

Graphical error of identification for the training and validation of estimated NARX model

Tuning ParameterSSETuning ParameterSSE
M=2424.04wk= 10410.13
M=3511.35wk= 1404.94
M =4505.26wk= 0.1386.45
M=5509.95wk= 0.01439.37
with P= 7; wk= 1; rk= 1with P= 11; M= 2; rk= 1
P =7424.04rk= 10439.23
P =10405.31rk= 1386.45
P =11404.94rk= 0.1407.18
P =12
rk= 0.01
with M= 2; wk= 1; rk= 1with P =11; M=2; wk=0.1

Table 3.

Tuning parameters and SSE criteria for applied controllers in set-point tracking

The responses obtained from the NARX-MPC and the IMC-PID controllers with parameter tuning, Kc=8.3; TI=10.2; TD=2.55 (Zulkeflee & Aziz, 2009) during the set-point tracking are shown in Fig. 8. The results show that the NARX-MPC controller had driven the process output to the desired set-point with a fast response time (10 minutes) and no overshoot or oscillatory response with SSE value = 386.45. In comparison, the output response for the unconstrained IMC-PID controller only reached the set-point after 25 minutes and had shown smooth and no overshoot response with SSE value = 402.24. However, in terms of input variable, the output response for the IMC-PID controller has shown large deviations as compared to the NARX-MPC. Normally,actuator saturation is among the most conventional and notable problem in control system designs and the IMC-PID controller did not take this into consideration.Concerning to this matter, an alternative to set a constraint value for the IMC-PID manipulated variable has been developed. As a result, the new IMC-PID control variable with constraint had resulted in higher overshoot with a settling time of about 18 minutes with SSE=457.12.

Figure 8.

Control response of NARX-MPC and IMC-PID controllers for set-point tracking with their respective manipulated variable action.

With respect to the conversion of ester, the implementation of the NARX-MPC controller led to a higher conversion of Citronellyl laurate (95% conversion) as compared to the IMC-PID, with 90% at time=150min (see Fig. 9).Hence, it has been proven that the NARX-MPC is far better thanthe IMC-PID control scheme.

Figure 9.

Profile of ester conversion for NARX-MPC, IMC-PID-Unconstraint and IMC-PIC controllers.

With a view to set-point changing (see Fig. 10), the responses of the NARX-MPC and IMC-PID for set-point change have been varied from 310K to 315K at t=25min. The NARX-MPC was found to drive the output response faster than the IMC-PID controller with settling time, t= 45min and had shown no overshoot response with SSE value = 352.17.On the other hand, the limitation of input constraints for IMC-PID was evidenced in the poor output response with some overshoot and longer settling time, t= 60min (SSE=391.78). These results showed that NARX-MPC response controller had managed to cope with the set-point change better than the IMC-PID controllers.

Fig. 11 shows the NARX-MPC and the IMC-PID responses for 10% load change (jacket temperature) from the nominal value at t=25min. The NARX-MPC was found to drive the output response faster than the IMC-PID controller. As can be seen in the lower axes of Fig 9, the input variable response for the IMC-PID had varied extremely as compared to the input variable from NARX-MPC. From the results, it was concluded that the NARX-MPC controller with SSE=10.80 was able to reject the effect of disturbance better than the IMC-PID with SSE=32.94.

Figure 10.

Control response of NARX-MPC and IMC-PID controllers for set-point changing with their respective manipulated variable action.

The performance of the NARX-MPC and the IMC-PID controllers was also evaluated under a robustness test associated with a model parameter mismatch condition. The tests were;

  1. Test 1: A 30% increase for the heat of reaction, from 16.73 KJ to 21.75 KJ. It represented a change in the operating conditions that could be caused by a behavioral phase of the system.

  2. Test 2: Reduction of heat transfer coefficient from 2.857 J/s m2 K to 2.143 J/s m2 K, which was a 25 % decrease. This test simulated a change in heat transfer that could be expected due to the fouling of the heat transfer surfaces.

  3. Test 3: A 50% decrease of the inhibition activation energy, from 249.94 J mol/K to 124.97 J mol/K. This test representeda change in the rate of reaction that could be expected due to the deactivation of catalyst.

  4. Test 4: Simultaneous changes in heat of reaction, heat transfer coefficient and inhibition activation energy based on previous tests. This test represented the realistic operation of an actual reactive batch reactor process which would involve more than one input variable changes at one time.

Figure 11.

Control response of NARX-MPC and IMC-PID controllers for load change with their respective manipulated variable action.

Fig.12- Fig.15 have shown the comparison of both IMC-PID and NARX-MPC control scheme’s response for the reactor temperature and their respective manipulated variable action for robustness test 1 to test 4 severally. As can be seen in Fig. 12- Fig. 15, in all tests, the time required for the IMC-PID controllers to track the set-point is greater compared to the NARX-MPC controller. Nevertheless, NARX-MPC still shows good profile of manipulated variable, maintaining its good performance. The SSE values for the entire robustness test are summarized in Table 4. These SSE values shows that both controllers manage to compensate with the robustness. However, the error values indicated that the NARX-MPC still gives better performance compared to the both IMC-PID controllers.

ControllerTest 1Test 2Test 3Test 4

Table 4.

SSE value of NARX-MPC and IMC-PID for robustness test

Figure 12.

Control response of NARX-MPC and IMC-PID controllers for robustness Test 1 with their respective manipulated variable action.

Figure 13.

Control response of NARX-MPC and IMC-PID controllers for robustness Test 2 with their respective manipulated variable action.

Figure 14.

Control response of NARX-MPC and IMC-PID controllers for robustness Test 3 with their respective manipulated variable action.

Figure 15.

Control response of NARX-MPC and IMC-PID controllers for robustness Test 4 with their respective manipulated variable action.


6. Conclusion

In this work, the NARX-MPC controller for the Batch Citronellyl Laurate Esterification Reactor has been developed. The validated first principle model was used as a process model to generate data required for NARX model identification. The NARX model with nu=1 and ny= 2 was chosen since it gave the best performance with MSE and SSE equal to 0.0025 and 0.7152 respectively. Finally, the performances of the NARX-MPC controller were evaluated for set-point tracking, set-point change, load change and robustness test. For all cases, the developed controller strategy (NARX-MPC) has been proven to perform well in controlling the temperature of the batch esterification reactor, as compared to the IMC-PID controllers.


The authors wish to acknowledge the financial support by Universiti Sains Malaysia (USM), for the research funding through the Research University Grant scholarship and Ministry of Science, Technology and Innovation, Malaysia (MOSTI) for the scholarship for the first author.

© 2011 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike-3.0 License, which permits use, distribution and reproduction for non-commercial purposes, provided the original is properly cited and derivative works building on this content are distributed under the same license.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Siti Asyura Zulkeflee, Suhairi Abdul Sata and Norashid Aziz (July 5th 2011). Nonlinear Autoregressive with Exogenous Inputs Based Model Predictive Control for Batch Citronellyl Laurate Esterification Reactor, Advanced Model Predictive Control, Tao Zheng, IntechOpen, DOI: 10.5772/16963. Available from:

chapter statistics

5005total chapter downloads

1Crossref citations

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Using Model Predictive Control for Local Navigation of Mobile Robots

By Lluís Pacheco, Xavier Cufí and Ningsu Luo

Related Book

First chapter

A Real-Time Gradient Method for Nonlinear Model Predictive Control

By Knut Graichen and Bartosz Käpernick

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us