**3. Methodology**

### **3.1 Reactive distillation using neural networks artificial**

Reactive distillation is implemented to separate mixtures of components that generally have more than one azeotrope, artificial human networks can be implemented to determine thermodynamic properties, for the solution of the differential equations of mass and energy transfer, the case study that presents artificial neural networks were implemented to determine the thermodynamic properties, as well as the solution for the mass transfer equations and the output compositions at the top of the column and the bottom (**Figure 4**).

#### **3.2 Case study**

A multicomponent mixture of ethanol, water, ethyl acetate, acetic acid and butanol is studied, the latter in a small proportion, it is observed that according to the multicomponent mixture, 2 azeotropic mixtures and azeotrope are formed in a ternary mixture of water-ethyl acetate-ethanol, which means that it is a complex reaction system, for the determination of thermodynamic properties as well as the design of a conventional distillation column.

**Figure 4.** *Schematic distillation reactive [33].*

**Figure 5** shows the binary azeotrope between ethanol-water, **Figure 6** shows the azeotrope between ethyl acetate-water, **Figure 7** between ethanol-ethyl acetate, at different temperatures; this implies that the conventional distillation column must be large in a number of plates, as geometry. **Figure 8** shows the ternary diagram of azeotrope formation.

In the compartment model (CM), one of the compartments is defined to consist of multiple single stages. Without loss of generality, balance equations for one single stage, the so-called sensitivity stage, can be replaced by the overall compartment balances. Assuming that stages Nc, 1 to Nc, 2 form compartment c (**Figure 9**), we obtain [1].

$$\mathbf{M}\_{\mathbf{f}} = \sum\_{i=Nc,1}^{Nc,i} \mathbf{M}\_{i} \tag{35}$$

*Distillation Processes - From Solar and Membrane Distillation to Reactive Distillation…*

$$\mathbf{x}\_{c}^{j} = \frac{\mathbf{1}}{M\_{c}} \sum\_{i=Nc,1}^{Nc,i} M\_{i} \mathbf{x}\_{i}^{j} \qquad \quad j = Component \tag{36}$$

$$h\_c^L = \frac{1}{\mathcal{M}\_c} \sum\_{i=Nc,1}^{Nc,i} \mathcal{M}\_i h\_c^L \tag{37}$$

Assuming the compartments to be sufficiently large, single-stage dynamics can be neglected compared to overall compartment dynamics. Consequently, singlestage balance equations are assumed stationary. Thus, the entire equation system for compartment c consists for stages *j = Nc, 1 ... Nc,* 2 and the steady-state versions for stages *j = Nc, 1 ... Nc, 2* except for the sensitivity stage [1].

**Figure 7.** *Azeotrope ethanol-ethyl acetate.*

**Figure 8.** *Ternary diagram ethanol-ethyl acetate-water.*

*Reactive Distillation Modeling Using Artificial Neural Networks DOI: http://dx.doi.org/10.5772/intechopen.101261*

#### **Figure 9.**

*Compartment model (CM). Dashed lines depict the compartment boundaries [33].*

We derive the proposed model from the representation of the original compartment model as an:

$$
\dot{\mathbf{x}}(t) = \hat{f}(\hat{\mathbf{x}}(t), \hat{u}(t), \hat{y}(t)) \tag{38}
$$

$$\mathbf{0} = \hat{\mathbf{g}}(\hat{\mathbf{x}}(t), \hat{\mathbf{u}}(t), \hat{\mathbf{y}}(t), \hat{\mathbf{z}}(t)) \tag{39}$$

In Eqs. (38) and (39), we introduce the following notation: differential compartment states are denoted by *x(t*). Compartment inputs, which are handed over by the neighboring compartments, are denoted by *û(t)* which corresponds to states of column stages *Nc, 1–1 and Nc, i + 1*. Compartment outputs, which are required in the equation system of neighboring compartments, are denoted *y(t),* which corresponds to the states of column stages *Nc, 1 and Nc, i*. The remaining (algebraic) compartment states are denoted *z(t).*

When solving Eqs. (40) and (41), the main computational effort is spent in the solution of the highly nonlinear algebraic that mainly originates from the thermodynamic relations (Eqs. (38) and (39)). To reduce the computational effort, Linhart and Skogestad [34], propose interpolation between tabulated solved solutions.

$$
\begin{pmatrix}
\hat{\boldsymbol{y}}(t) \\
\hat{\boldsymbol{z}}(t)
\end{pmatrix} = \mathbf{g}^{\hat{\boldsymbol{\alpha}}}(\hat{\boldsymbol{x}}(t), \hat{\boldsymbol{u}})\tag{40}
$$

Sophisticated computer codes are readily available for efficient training of the ANNs. In particular, ANNs can also be fitted very efficiently to large data sets, which arise from a sampling of the high-dimensional input space.

*Distillation Processes - From Solar and Membrane Distillation to Reactive Distillation…*

$$
\hat{\mathbf{x}}(t) = \hat{f}(\hat{\mathbf{x}}(t), \hat{u}(t), \hat{y}(t)) \tag{41}
$$

$$
\hat{\mathbf{y}}(t) = \hat{\mathbf{g}}\_{\text{ANN}}(\hat{\mathbf{x}}(t), \hat{\mathbf{u}}(t)) \tag{42}
$$

We highlight that model formulation Eqs. (41) and (42) is only one possibility of an ANN-based compartmentalization approach. The choice of this system, however, seems appealing as it shows an analogy to the dynamic modeling of simple flash units, that is, the model outputs can be calculated as an explicit function of the model inputs (Tx-flash or single-stage). Other possibilities for using ANNs exist as well. For instance, using a surrogate model for the ordinary differential equation (ODE) form thermodynamic system. Such are, the ANN could also be used to replace specific parts of mapping o searching thermodynamics properties.

Where a combination of ANN and CM result in a new model of reactive distillation, but new mathematical model show relationship between stochiometric and mass transfer, such relation to be.

$$T\_i(t) = \sum\_{i=N\epsilon,1}^{\text{Nc.}} \text{OM}\_{c,i} T\_{2i} = \frac{\sum\_{k=1}^m \sum\_{i=N\epsilon,1}^{\text{Nc.},i} M\_i T\_{2,k} \exp\left[-\frac{T - T\_i^2}{\sigma\_k^2}\right] \exp\left[-\frac{M - M\_i^2}{\sigma\_k^2}\right]}{\sum\_{k=1}^m \sum\_{i=N\epsilon,1}^{\text{Nc.},i} \exp\left[-\frac{T - T\_i^2}{\sigma\_k^2}\right] \exp\left[-\frac{M - M\_i^2}{\sigma\_k^2}\right]} \quad \text{(43)}$$

$$P\_i(t) = \sum\_{i=N\epsilon,1}^{\text{Nc.}} \text{OK}\_{c,i} P\_{2i} = \frac{\sum\_{k=1}^m \sum\_{i=N\epsilon,1}^{\text{Nc.},i} K\_i P\_{2,k} \exp\left[-\frac{p - p\_i^2}{\sigma\_k^2}\right] \exp\left[-\frac{K - K\_i^2}{\sigma\_k^2}\right]}{\sum\_{k=1}^m \sum\_{i=N\epsilon,1}^{\text{Nc.}} \exp\left[-\frac{p - P\_i^2}{\sigma\_k^2}\right] \exp\left[-\frac{K - K\_i^2}{\sigma\_k^2}\right]} \quad \text{(44)}$$

Subsequently, for reactive distillation, an approach to reaction kinetics of study mixture is necessary, this is established by the following Eq. (45).

$$r(t) = k\_1 \overline{\mathbf{x}}\_2 \overline{\mathbf{x}}\_0 - k\_1 \overline{\mathbf{x}}\_1 \overline{\mathbf{x}}\_3 \tag{45}$$

where *xo* represents the liquid fraction of acetic acid, *x1* of water, *x2* ethanol fraction, and *x3* ethyl acetate fraction.

Starting from the reaction kinetic equation, balances are established for each of the components as a function of time, for each stage of the separation process, that is, for each plate in the reactive column with DFANN.

$$M\_j \frac{d\overline{\mathbf{x}}\_{ij}}{dt} = +V\overline{\mathbf{y}}\_{i,j-1} - L\overline{\mathbf{x}}\_{i,j} - V\overline{\mathbf{y}}\_{i,j} + \zeta M\_j R \tag{46}$$

$$\sum\_{i,j}^{n} w\_{i,j} \prod\_{ij}^{m} \overline{\mathbf{x}}\_{ij}(t) \mathbf{M}\_{j} = \sum\_{i}^{n} \sum\_{j}^{m} \left[ L \overline{\mathbf{x}}\_{i,j+1} + V \overline{\mathbf{y}}\_{i,j-1} - L \overline{\mathbf{x}}\_{i,j} - V \overline{\mathbf{y}}\_{i,j} + \zeta \mathbf{M}\_{j} \mathbf{R} \right] \tag{47}$$

where *i = 0, 2, 3* components and *j = 1, … , n* number plates, *yi,j* is fraction steam in column ζ stoichiometric coefficient.

In condenser with DFANN

$$M\_j \frac{d\overline{\mathbf{x}}\_{i,n}}{dt} = V\overline{\mathbf{y}}\_{i,n-1} - L\overline{\mathbf{x}}\_{i,n} - D\_h \overline{\mathbf{x}}\_{i,n} + \zeta M\_n R \tag{48}$$

$$\sum\_{i,j}^{n} w\_{i,j} \prod\_{i \atop j}^{m} \overline{\mathbf{x}}\_{i,n}(t) \mathbf{M}\_j = \sum\_{i}^{n} \sum\_{j}^{m} \left[ V \overline{\mathbf{y}}\_{i,n-1} - L \overline{\mathbf{x}}\_{i,n} - D\_k \overline{\mathbf{x}}\_{i,n} + \zeta \mathbf{M}\_n \mathbf{R} \right] \tag{49}$$

Reboiler with DFANN

$$\frac{d(M\_0, \overline{x}\_{i,0})}{dt} = L\overline{x}\_{i,0} - V\overline{y}\_{i,0} + \zeta M\_0 R \tag{50}$$

*Reactive Distillation Modeling Using Artificial Neural Networks DOI: http://dx.doi.org/10.5772/intechopen.101261*

$$\sum\_{i,j}^{n} w\_{i,j} \prod\_{\vec{\eta}}^{m} \overline{\chi}\_{i,0}(t) \mathcal{M}\_0 = \sum\_{i}^{n} \sum\_{j}^{m} \left[ L \overline{\kappa}\_{i,0} - V \overline{\chi}\_{i,0} + \zeta \mathcal{M}\_0 \mathcal{R} \right] \tag{51}$$

where *dM*<sup>0</sup> *dt* <sup>¼</sup> *<sup>L</sup>* � *<sup>V</sup>* and *xDc*,*<sup>j</sup>* <sup>¼</sup> <sup>1</sup> � <sup>P</sup>*Cc <sup>i</sup>*¼*Acxi*,*<sup>j</sup>* from j = 0, 1, … , n; the mole fraction of vapor meets the constraint.

$$\sum\_{i=Ac}^{Ac} \overline{\mathcal{y}}\_{i,j} = \sum\_{i=Ac}^{p\_C} \frac{P\_{i,j} \left( T\_i \overline{\mathcal{X}}\_{i,j} \right)}{P\_j} = \mathbf{1}. \tag{52}$$

where *Dc,j* represents the amount of bottom distillate, likewise the partial pressures of the vapor and liquid phase are determined and *Mj* represents. **Table 1** shows the constants for the simulation.

The density with DFANN of the mixture is calculated by Eq. (53).

$$\rho\_l = \sum\_{i=1}^{m} \left[ \prod\_{d=1}^{n} \left( A\_d B\_d \right)^{(1-Tr)^{2/\gamma}} \cdot w\_{di,dj} \right]\_i \tag{53}$$

The case study simulation was performed through modular programming in Aspen Plus®, using code linking in Matlab ®, the simulation parameters in Aspen Plus are shown in **Figures 10**–**16**, shows in a summarized way the parameters entered in a RadFrac column of Aspen, the calculation of properties was carried out with the binding of Matlab® and Aspen using both the NRTL methods for Aspen, as well as the DFANN methods in Matlab®.

#### **3.3 Training dynamic fuzzy artificial neural network**

The neural network has a structure of 16 inputs, two hidden layers with 12 neurons in each of the layers, and 16 output neurons, the training is based on an unsupervised training of the Quasi-Newton-Function (QSF) type, without backward propagation.


**Table 1.**

*Constants for simulation.*


**Figure 10.** *Global design.*

#### *Distillation Processes - From Solar and Membrane Distillation to Reactive Distillation…*


#### **Figure 11.** *Configuration.*

#### **Figure 12.** *Stages of feed.*


It is worth mentioning that the structure of the neural network was optimized using a supervised algorithm, which is based on the heuristic rule of 2n, where n is the number of inputs to the neural network, which implies that the minimum

*Reactive Distillation Modeling Using Artificial Neural Networks DOI: http://dx.doi.org/10.5772/intechopen.101261*


#### **Figure 14.** *Condenser design.*

#### **Figure 15.** *Reboiler design.*

**Figure 16.** *Reaction equilibrium.*

**Figure 17.** *Training surface.*

number of neurons present is sought. To avoid overlearning, **Figures 17** and **18** show the learning settings.

#### **3.4 Results and discussion case study**

**Figure 19** schematically shows a distillation column using the commercial Aspen Plus® simulator, two streams are introduced, the acetic acid stream separated from the azeotropic mixture, this to facilitate the transfer of mass and energy, each stream is fed in one stage superior and in under stage, to facilitate the mentioned phenomena.

Simulations are performed using the same configuration with 17 separation stages (**Table 2**), the feeds were carried out in stages 4 and 5 respectively, the compositions of the dome and the bottom of the column are compared to determine the purity of the components, where *yi* is the output composition in mole fraction, it *Reactive Distillation Modeling Using Artificial Neural Networks DOI: http://dx.doi.org/10.5772/intechopen.101261*

**Figure 19.** *Schematic of reactive distillation.*


**Table 2.** *Composition reactive distillation.*

is observed that the column that simulates the process with artificial intelligence provides better results based on its ability to displace the azeotropes present.

The reaction that takes place in the reactive stages is as follows:
