*3.2. Transesterification Reaction*

Transesterification reactions were carried out in a 500 mL spherical glass reactor connected to a condenser, which had a sampling outlet and stirring, heating, and temperature control systems. The process was composed of two successive transesterification reactions which were carried out in the same experimental setup. For the first step, oil was preheated to 45 ◦C, the reaction temperature, and a solution with the desired amount of methanol and KOH was added to the reactor. For the second step, after 10 min, the mixture of reaction was separated in a decantation funnel, removing glycerol. Biodiesel phase was put into the reactor again, it was heated (45 ◦C) and a new solution of catalyst and alcohol was added. After the reaction time (10 min), the catalyst was neutralized with sulfuric acid, glycerol and methanol were removed, and the biodiesel was washed with distilled water. The remaining water was removed by heating at 110 ◦C.

To optimize the process, catalyst concentration and methanol/oil molar ratio were studied, whereas temperature and time were set at 45 ◦C and 10 min, respectively, for both steps and every reaction.

#### *3.3. Experimental Design and Statistical Analysis*

Central composite rotatable design (that is, CCD) was used to evaluate the influence of operational conditions on methyl ester yield. There were five levels of points and four factors for the statistical analysis, as indicated in Table 10. The selected variables were catalyst concentration and methanol/oil molar ratio in the first and the second step. Four factors in 24 full factorial CCD with five levels culminated in 31 runs of experiments (2k + 2k + 7), where k represents the number of independent variables or factors selected. Seven runs of center point experiments evaluated the pure error increased with 8 axial and 16 factorial experimental runs. The variables were normalized in the range from −2 to +2 to compare between variables according to Equation (4):

$$\chi\_{\rm i} = \frac{2(\chi\_{\rm i} - \chi\_{\rm min})}{(\chi\_{\rm max} - \chi\_{\rm min})} - 1 \tag{4}$$

where xi is the normalized value of a certain variable (X) at a certain condition i; Xi is the actual value; and Xmin and Xmax are the lower and upper limits, respectively. The range of each variable and the decoded values are shown in Table 10. Catalyst concentration in each step was calculated considering the total volume of reaction for each step and the methanol/oil molar ratio for both steps was based on the initial oil amount.


**Table 10.** Factors and their levels for response surface design.

Experimental reactions were performed in a random order to minimize errors due to systematic trends in variables. The results were analyzed through RSM to fit a second-order polynomial model (see Equation (5)):

$$\mathbf{y} = \beta\_0 + \sum\_{\mathbf{i}} \beta\_{\mathbf{j}} \mathbf{X}\_{\mathbf{i}} + \sum\_{\mathbf{i}} \beta\_{\mathbf{j}\bar{\mathbf{j}}} \mathbf{X}\_{\mathbf{j}}^2 + \sum\_{\mathbf{i} \prec \mathbf{j}} \sum\_{\mathbf{i}} \beta\_{\mathbf{i}\bar{\mathbf{j}}} \mathbf{X}\_{\mathbf{i}} \mathbf{x}\_{\mathbf{j}} + \varepsilon \tag{5}$$

where y is the response factor (that is, % methyl ester); xi is the ith independent factor; β0 is the intercept; βi is the first order coefficient of the model; βii the quadratic coefficient for i factor; βij the lineal coefficients of the model for the interaction between i and j factors; and ε the experimental error related to y. The quality of the model fit was assessed by ANOVA test and a confidence level of α = 5% was used to check the statistical significance of the polynomial model. Table 11 shows the experimental conditions, the predicted and experimental values of the response factor and the residual values for each experiment.




**Table 11.** *Cont.*
