## 5 Conclusions  
This study presents a methodology to model a continuous stirred-tank reactor considering oil changes in the feed stream during the continuous operation of the reactor. Following the methodology, a first principle model for and industrial reactor of biodiesel was developed. Based on the reactor simulation, an analysis of the perturbation effects caused by the oil changes were developed. The simulation results show that main reactor variables, reaction mixture temperature, and ester concentration (molarity) vary after each feed oil change, although the temperature variations were negligible (around 1.48% in the worst-case). In contrast, the effects of the disturbances on the variable of ester concentration were significant. The main factor affecting the steady state production of ester is the quantity of triglycerides in the oil. Hence, palm oil that has the higher triglyceride concentration achieves a mayor ester production regarding palm and mustard oils. Even palm oil, which has about two times more triglycerides than mustard, produces twice as many esters as mustard oil. This is consistent with the literature results in a batch process. Similarly, the mass fraction of the ester phase, which is a more practical indicator, is considerably disturbed. A variation of 10.90% in the mass fraction of methyl esters was observed during the change from palm to mustard oil. This concentration varied by up to 22.07% in the change from mustard to sunflower oil. Finally, the variation in this indicator was around 9% during the final change back to palm oil again. Mathematical models for continuous stirred-tank reactor of biodiesel developed with the methodology presented in this study can be used to improve the economic viability of biodiesel production. In this sense, they can help in decision-making for the production processes or in the design of advances control strategy that ensure the production viability even when disturbances caused by oil changes occur. Moreover, observers for online estimation of concentration variables, which are not available for online measurements, can be developed based on the models. Therefore, this work presents an important tool for developing sophisticated technologies that are able to face the challenging and changing conditions of biodiesel manufacturing. Nevertheless, the methodology for oil changes modeling is based on usual kinetic studies reported in the literature. These studies assume that glycerides and esters are all equal and only consider three reversible reactions (i.e., six elemental reactions). However, a lot of different glycerides and esters, reacting with different characteristics, take part in the transesterification reaction. In order to improve the model accuracy, detailed kinetic models must be used. Moreover, the model has not been validated due to the lack of experimental data. Thus, the validation of methodology is the next step for the actual investigation. Furthermore, advances in control systems can be designed to ensure the correct reactor performance and the productivity. In addition, state observers can be design based on models developed with the proposed methodology to enhance the productivity of production process. Conceptualization, J.P.C.G. and P.E.A.G. ; methodology, M.A.M. and G.V.R.G. ; project administration, M.A.M; software, J.P.C.G. ; validation, P.E.A.G and C.V.R.G ; formal analysis, B.Y.L.Z. and L.G.V.V. ; investigation, J.P.C.G. ; writing--original draft, P.E.A.G. and M.A.M. ; writing review and editing, G.V.R.G. and L.G.V.V. All authors have read and agreed to the published version of the manuscript. This research received no external funding. The authors thank the Consejo Nacional de Ciencia y Tecnologia (National Council of Science and Technology) for the scholarship granted to J.P.C.G. The authors declare no conflict of interest. The following abbreviations are used in this manuscript:  
TG  Triglycerides  
DG  Diglycerides* [1] [PERSON] Analyzing biodiesel: Standards and other methods. _J. Am. Oil Chem.