## 3 Methodology
### Modeling of the Continuous Stirred-Tank Reactor  
#### 3.2.1 Transesterification Modeling for Pure Vegetable Oils  
Transesterification is the chemical process that converts animal fats or vegetable oils into biodiesel. Vegetable oils are the most commonly used raw materials in biodiesel production and are mainly constituted by triglycerides and small amounts of diglycerides, monoglycerides, free fatty acids, water, and other substances. Triglycerides (TG), which make up about 95-98 wt% of vegetable oil, are tri-esterified glycerols with three fatty acid molecules, i.e., a triester [41]. Because fatty acids can be either different or identical, triglycerides can therefore be classified into mixed triglycerides and simple triglycerides.  
During the transesterification process, the vegetable oil (triglyceride) reacts with a short chain alcohol, usually methanol (AL), wherein three methanol molecules react with one triglyceride molecule, producing three fatty acid methyl ester (ME) molecules and one glycerol (GL) molecule.  
As transesterification is a reversible process, part of the total product formed in the forward reaction then reacts to form reactants again via a reverse reaction. The chemical Equation (1) presents the general transesterification process for a type-i vegetable oil reaction with methanol:  
\[TG_{i}+3 AL\ \  
temperature. Thus, the velocity of reaction of the components in the transesterification of a single oil is defined as:  
\[v_{TG,i} = -r_{1,i}+r_{2,i}, \tag{6}\] \[v_{DG,i} = r_{1i}-r_{2,i}-r_{3,i}+r_{4,i},\] (7) \[v_{MG,i} = r_{3,i}-r_{4,i}-r_{5,i}+r_{6,i},\] (8) \[v_{ME,i} = r_{1,i}-r_{2,i}+r_{3,i}-r_{4,i}+r_{5,i}-r_{6,i},\] (9) \[v_{GL} = r_{5,i}-r_{6,i}\] (10) \[v_{AL} = -r_{1,i}+r_{2,i}-r_{3,i}+r_{4,i}-r_{5,i}+r_{6,i}. \tag{11}\]  
The transesterification reaction rate is not only defined by the kinetics of the reactions, but by three regimes: an initial mass transfer-controlled regime (slow); a kinetically-controlled regime (fast); and a final regime occurring as equilibrium approaches (slow) [26]. The initial mass transfer regime is associated with the time that the triglyceride molecule spends in moving into the methanol phase and colliding with the methanol molecule [42], although an adequate mixing intensity minimizes the effects of the mass transfer. For example, various studies have demonstrated that the mass transfer region becomes insignificant (at approximately one minute), with, at laboratory scale, the impeller rotating at an intensity of 600 rpm [26,42,43,44, 26]; meanwhile, high reaction temperatures (50-65 \({}^{\circ}\)C) also reduce the mass transfer period due to the increased solubility of the oil in the methanol [26]. The present study does not focus on the mass transfer regime, assuming an adequate agitation and a high reaction temperature (60 \({}^{\circ}\)C); therefore, the transesterification rate can be modeled via the reaction rate equations in the form of Equation (5).  
As the glycerides in the vegetable oils are formed by different fatty acids, there are a large variety of glycerides and esters in the reaction mixture, implying that two glyceride or ester molecules can be nonidentical and can react differently. If the kinetic parameters of the reactions for every possible glyceride and ester are known, the rate equations for all reactions can be used to formulate the kinetic model for the transesterification mixture, although this procedure involves the determination of a large number of kinetic parameters for all reactions. To simplify this, most kinetic studies reported in the literature characterize the reaction of glycerides and ester in the elementary steps with a unique rate constant. Thus, it is assumed that all glycerides or esters, regardless of whether they are formed by different fatty acids, react in the same way. Consequently, there are only three reversible reactions and six rate constants in the transesterification kinetic model.