Fuzzy Logic Modeling and Observers Applied to Estimate Compositions in Batch Distillation Columns

In this chapter, the analysis and design of a fuzzy observer based on a Takagi-Sugeno model of a batch distillation column are presented. The observer estimates the molar compositions and temperatures of the light component in the distillation column considering a binary mixture. This estimation aims to allow monitoring the physical variables in the process to improve the quality of the distillated product as well as to detect failures that could affect the system performance. The Takagi-Sugeno fuzzy model is based on eight linear subsystems determined by three premise variables: the opening percentage of the reflux valve and the liquid molar composition of the light element of the binary mixture in the boiler and in the condenser. The stability analysis and the observer gains are obtained by linear matrix inequalities (LMIs). The observer is validated by MATLAB ® simulations using real data obtained from a distillation column to verify the observer ’ s convergence and analyze its response under system disturbances.


Introduction
Distillation is the process to separate chemical substances most used in the industry, with the petrochemical (petroleum products) [1] and food (alcoholic beverages production) industries being the most important due to the current people lifestyle in which the daily use of petroleum fuels is essential for both transport and energy generation.
Fractional distillation is used to separate homogeneous liquid mixtures in which the difference between the boiling points of the components is less than 25°C. Each of the separate components is called fractions. In general, there are two operating modes: continuous and batch. In the continuous mode, the feeding of the liquid mixture and the extraction of the distilled product are carried out continuously. In the batch distillation, the mixture is initially deposited in the boiler; at the end of the process, the distillate and bottom product are extracted.
The batch operation is mainly used to separate small amounts of mixture, to obtain different qualities of the distilled product from the same mixture, or to separate multicomponent mixtures.
A batch distillation column is not operated using constant parameters; the control actions are continuously adjusted according to the state of the distillation; therefore, monitoring and controlling all the variables of the process are essential to improve the quality and quantity of the distilled product, as well as to guarantee the safety of the process and the operators. To fulfill or facilitate this objective, it is necessary to implement control techniques such as models, observers, and controllers.
In the literature, modeling and control techniques such as estimators, observers, fault detection systems, and control systems are applied to distillation columns in order to obtain a better analysis and understanding of the dynamics of the process, improving the quality of the distilled product and enhancing the user safety, among other tasks.
Distillation column simplified models present the basic principles of the process and its operation taking into account several considerations to describe the dynamics of the system in a simpler but understandable form. Authors in [2] present a simplified model of a binary distillation column, based on the liquid-vapor equilibrium of the binary mixture and the mass balance considering all the elements of the distillation column as plates.
Authors in [3] design a model based on the existence of the liquid and vapor molar fluids that vary in each column plate; the compositions of the bottom product and the distilled product are estimated using a dynamic model based on the mass and component balances. In [4] a low-order model of an ideal multicomponent distillation using the theory of nonlinear wave propagation is presented. Authors in [5] present a low-order model for a reactive multicomponent distillation column, in addition to designing a predictive control to obtain the best quality of the distilled product.
Rigorous models are more complete because they represent plate by plate the element balance of phases in each element of the distillation column (boiler, condenser, and plates). In these models, the mathematic expressions are determined by a series of differential equations given by mass, light component, or energy balances depending on the application, the control strategy, or the operation type. An important advantage of the rigorous modeling is the high resolution of the dynamics, having the disadvantage of combining a greater number of variables and expressions that make difficult the design, simulation, and implementation of controllers.
In [6], a model based on neural networks is presented in order to optimize the energy efficiency in a binary distillation column. Authors in [7] present a model of a binary distillation column based on neural networks. The neural network training and validation are performed using real data from a nine-plate pilot plant for a mixture of methanol and water. Authors in [8] present the simulation and optimization of a rigorous model for a batch reactive distillation column. Authors in [9] present the design and simulation of a discrete Kalman filter to estimate the molar compositions of the light component in a batch distillation column.
Generally, the light component composition measurement is performed offline using expensive instruments, so the implementation of state observers to estimate online this composition has become a frequent and important task. Authors in [10][11][12] present high-gain observers to estimate the light component composition in all the distillation column plates from the measurement of the temperature of some plates and the column actual inputs.
Due to the different distillation types and their mathematical representation, there are different types of observers for different applications. In [13] the authors present a discrete-time D-LPV observer to estimate sensors and actuators states and faults, using the H∞ approach applied to the estimation error.
In [14], the authors present a pair of extended Luenberger observers (complete and reduced order) to estimate the compositions of a multicomponent mixture from temperature measurements of the distillation column plates. The observers' gains are calculated from the location of the closed-loop eigenvalues using a mathematical software.
In [15], a full-order nonlinear observer is presented to estimate the composition and temperatures of a distillation column. A nonlinear model obtained by the mass balance in each plate of the column is used, resulting in a set of high-order differential equations with nonlinear terms. The observer is validated in simulation to demonstrate his behavior and his robustness. The parametric representation or identification is another methodology used to estimate certain variables of the distillation columns, as presented in [16,17].
The difficulty of designing and implementing the observers lies mainly in the nonlinear dynamics of the distillation column; thus, having a linear system would facilitate the design of observers and controllers to implement control strategies such as fault detection and diagnosis systems and automatic control and tolerant control in order to improve the performance and safety of the process, as well as the quality of the distilled product.
The Takagi-Sugeno fuzzy modeling is a tool to model and control complex systems using a nonlinear system decomposition in a multi-model structure formed by linear and not necessarily independent and fuzzy logic models [18,19], where the representation of the nonlinear system is achieved by a weighted summation of the whole subsystems. The Takagi-Sugeno representation provides a solution to solve the problems in the design and implementation of control strategies for nonlinear systems.
In [20], the authors propose a methodology to design control techniques for systems represented in the Takagi-Sugeno form. In [21] the identification of a model of a binary distillation column, based on fuzzy models, taking into account 6 system inputs and 2 outputs for 64 rules is presented. The model is simulated using real data to validate its performance.
Authors in [22] present a controller of the molar composition of the distilled and bottom products for a binary distillation column using neural networks and fuzzy logic (ANFIS) based on a 2 Â 2 MIMO system. In [23] an adaptive PID controller based on Takagi-Sugeno modeling to control the distilled and bottom products of a binary distillation column is presented.
Due to the close relationship between the fuzzy representation of nonlinear systems and the theory of linear matrix inequalities, different works based on both techniques have been developed, allowing to find solutions to the calculations corresponding to the observer and controller gains and the Lyapunov stability analysis. In [24], a methodology to design observers and controllers for a fuzzy system is proposed.
The main contribution of this work is the design of a fuzzy observer based on a Takagi-Sugeno model to estimate the molar compositions and temperatures of the light component in each plate of a binary distillation column. The observer performance is validated for applications such as system monitoring and fault detection.

Takagi-Sugeno fuzzy model for a batch distillation column
The objective of a batch distillation process is to separate two or more elements from a mixture, where the most volatile element is obtained as the distilled product. The equipment used to carry out the distillation process is the distillation columns or the distillation pilot plants, as shown in Figure 1.
A distillation column is composed by a boiler that provides the heat necessary to evaporate the mixture to be distilled; the body of the column is formed by n À 2 plates, where a partial separation of the mixture is performed due to the phase equilibrium and a condenser that provides the necessary cooling to convert the distilled product to liquid [11].
Due to the high cost of the distillation columns and the amount of energy required in a distillation process, it is necessary to design adequate control strategies to monitor the main process variables and detect sensor and actuator faults to improve the quality of the distilled product and the safety of the process and the user.

Binary distillation column nonlinear model
The mathematical model of a distillation column consists of a set of differential equations that represent the dynamics of each plate of the column. Usually, the model of a distillation column is based on the balance of the light component in all the plates [10]. The model of a distillation column that considers a binary mixture as well as constant vapor and liquid flows through all columns is shown in Eq. (1): where V is the vapor molar flow, L is the liquid molar flow, M is the retained mass, x i is the liquid composition in plate i, and y i is the vapor composition in plate i.
The dynamic representation of a distillation column is based on submodels of the light component balance in each element of the column.
For the condenser, numbered as plate 1, Eq. (2) shows: For the intermediate plates of the body of the distillation column, Eq. (3) shows: For the boiler, numbered as plate 1, Eq. (4) shows: where D is the distilled product and n is the total number of plates.

Distillation column state-space model
The state-space dynamics of the distillation column, considering as states the light component composition in all the plates and as control inputs to the heating power, Q f , and the reflux, R f , is expressed in Eq. (5): where A and B matrixes are defined by where the molar fluids of liquid, L, and vapor, V, are determined by Eqs. (6) and (7): where H The G x i ; α i ð Þfunction is determined by the light component composition x i ð Þ, the relative volatility α i ð Þ, the saturation pressure P sat i À Á , the pressure in the column P T , the vapor molar V ð Þ, and the activity coefficient γ i ð Þ, as expressed in Eq. (8):

Distillation column Takagi-Sugeno model
The Takagi-Sugeno model is the fuzzy representation of a nonlinear model obtained from the linear subsystems interpolation according to fuzzy rules having the form (Eq. 9): where z i t ð Þ $ z p t ð Þ is the premise variables, M i1 $ M p1 is the fuzzy sets, r is the number of linear subsystems, x t ð Þ is the state vector, u t ð Þ is the input vector, A i is the linear submodel state matrices, and B i is the input vector for each subsystem.
Each consecutive linear equation represented by A i x t ð Þ þ B i u t ð Þ is called a subsystem and represents an operating point of the nonlinear system.
Given the pair x t ð Þ; u t ð Þ ð Þ , the complete fuzzy model is obtained by using a singleton fuzifier, product-type inference mechanism, and center of gravity as a defuser, as described in Eq. (10): where the vector for p premise variables z t ð Þ is defined by Eq. (11): In addition, the calculated weight w i z t ð Þ ð Þ for each i rule from the membership functions is defined by Eq. (12): and the normalized weight h i for each rule is defined by Eq. (13):

Fuzzy observer
According to the structure of the fuzzy observer [24][25][26] expressed in Eq. (14), The estimation error is determined by Eq. (15): The fuzzy observer stability is demonstrated if each A i , C i pair is observable and P complies with the Lyapunov equation expressed in Eq. (16): where In [25], the demonstration that the observer is stable is presented as long as a positive definite matrix P that satisfies the system of linear matrix inequalities (LMIs) is found, as shown in Eq. (17): The observer gains are defined by the LMI systems solution defined in Eq. (18):
The boiler is composed of a 2-L tank to contain the mixture and a side tank to contain a 300-watt heating resistance.

Case of study: state-space nonlinear model
The following assumptions are considered in the EDF-1000 distillation pilot plant to simplify the designing state without significantly affecting the dynamics and precision of the model: • Constant pressure in the column.
• Liquid output flows in the column.
• Vapor and liquid balance in all the column plates.

Distillation -Modelling, Simulation and Optimization
Eq. (19) shows the mathematical model of a batch-type 11-plate EDF-1000 distillation pilot plant for an ethanol-water mixture, considering the compositions in each plate x 1 ; x 2 ; ⋯ x 10 ; x 11 ð Þ , where the condenser composition is x 1 and the boiler composition is x 11 ; in addition, the control inputs are the heating power Q f and the reflux R f : where A and B matrixes are defined by where the output matrix is defined by an 11 Â 11 identity matrix as shown in Eq. (20).

Case of study: Takagi-Sugeno fuzzy model
The state-space model of the case of study expressed in Eq. (10) contains nonlinearities in the A and B matrices since both are dependent on the states; in addition, the reflux input (Rf ) disturbs all the states of the system (compositions) when it is activated.
The premise variables considered in the fuzzy model are the reflux valve opening percentage (z 3 ¼ Rf ) due to its effect in all the states of the system; the light component composition in the condenser (z 2 ¼ x 1 Þ, where the distillate product is obtained; and the light component composition in the boiler z 1 ¼ x 11 ð Þ , where the original mixture is located; besides, the boiler is directly related to the heating power (one of the system input variables) that provides the energy required to evaporate the mixture.
According to the steady-state dynamics of the distillation column, trapezoidaltype membership functions are chosen with two rules for each one, as expressed mathematically in Eqs. (21) and (22). This type of function is selected because it allows a greater range in the universe of discourse, where the belonging degree of belonging is 1, which prevents an oscillation when the states stabilize: The number of subsystems of the Takagi-Sugeno fuzzy model is dependent on the number of combinations that the membership functions have; for the case of study considering three premise variables (z 1 ¼ x 11 , z 2 ¼ x 1 , and z 3 ¼ Rf ), each one with two rules (z imax and z imin ), the number of subsystems is 2 3 ¼ 8.

Model 1 rule
If Then Then where M1 and M2 are fuzzy sets for z 1 t ð Þ, M3 and M4 are fuzzy sets for z 2 t ð Þ, and M5 and M6 are fuzzy sets for z 3 t ð Þ. According to the fuzzy rules, the Takagi-Sugeno fuzzy model of the EDF-100 distillation pilot plant is expressed in Eq. (23):

Case of study: fuzzy observer
From the general structure of the fuzzy observer presented in Eq. (14) and the fuzzy Takagi-Sugeno model expressed in Eq. (9), the fuzzy observer for the 11-plate distillation column is expressed in Eq. (24): The fuzzy observer scheme proposed for the distillation column of the case study is shown in Figure 3, taking as inputs the heating power and the reflux action; the estimated states are the molar compositions in all the plates, and the measured outputs are the temperatures in the condenser; in plates 2, 4, 6, 8, and 10; and in the boiler. Using the LMI system for eight rules, the LMI system for the fuzzy observer is obtained. The LMI's characteristics of each function are expressed in Eq. (25): The LMIs that represent the membership functions overlaps are expressed in Eq. (26): where P is positive definite diagonal matrix P . 0 of 11 Â 11 dimension, and N is an auxiliary matrix dependent on the number of states (11) and the measured outputs (7), resulting in a 7 Â 11 dimension.
The resulting system of 36 LMIs is solved using the MATLAB ® lmiedit tool. Once the LMI system is solved, with P . 0 to guarantee the closed-loop stability of each subsystem, the K i gains are calculated in Eq. (27):

Results and discussion
The fuzzy observer validation is performed using real data from a distillation process; the main characteristics are shown in Tables 1 and 2.
The process operates during 50 min, taking the initial compositions   The system input signals used in the validation stage are the reflux signal, considering an opening percentage of 20%, starting at the 5 min and lasting 30 min, and the heating power. Figure 4 shows the light component compositions calculated by the nonlinear model in the 11 plates of the distillation column; this simulation is carried out considering no disturbances in the system. Figure 5 shows the composition estimated by the observer with initial conditions different from the nonlinear model. The composition initial conditions of the observer are_ x 0 ð Þ ¼ [0.8555, 0.8525, 0.8480, 0.8412, 0.8309, 0.8148, 0.7896, 0.7483, 0.6767, 0.5369, 0.2300]. The convergence time of the observer is 48 sec. Figure 6 shows the result of the fuzzy observer simulation considering a disturbance in the plate 6 composition. Figure 7 shows the plate 6 composition estimated by the fuzzy observer and the comparison with the nonlinear model to verify the observer's convergence. Figure 8 shows the simulation of the compositions estimated by the fuzzy observer under seven perturbations in the composition of plates 4, 6, and 8.
In Figure 9, a comparison between the light component compositions in plates 4, 6, and 8 is shown to verify the convergence of the fuzzy observer with the nonlinear model.  It can be noted that the light component composition estimation has a minimum error compared with the composition obtained from the nonlinear model using real data; besides, the convergence time is suitable for an online failure detection system or different control tasks.

Conclusions
In this work a fuzzy observer to estimate the molar composition of the light component in each plate of a binary distillation column is presented. The observer is based on a Takagi-Sugeno fuzzy model of eight rules, taking as premise variables the light component composition in the condenser and in the boiler, as well as the reflux signal.
The gains are calculated by means of LMIs in order to guarantee the stability for each of the closed loop linear subsystems.
The fuzzy observer is validated in simulation by using real data from an 11-plate binary distillation column for an ethanol-water mixture, considering seven RTD temperature sensors and a 300-watt heating resistor. In order to validate the fuzzy observer convergence, different tests were carried out with ideal and different initial conditions between the nonlinear system and the fuzzy observer, as well as disturbances in the light component composition in the nonlinear system.
The observer under different initial conditions has a convergence time of 45 sec. It is also shown that the observer's convergence time under disturbances in the composition of the plate 1 is 1 sec.
Applying from two to seven perturbations to the nonlinear system, it is demonstrated that the observer is robust under multiple perturbations, enabling its implementation as a residual generator in a fault detection system.