## 2 Materials and Methods
### Model Tool Development and Optimization  
The optimization tool of the functions developed for the models (Equations (3) and (4)) was developed by using the generalized reduced gradient (GRG) method, which is a feature available within the software in use (described in the previous chapter). This method is widely used in non-linear optimization to address problems with considerable complexity. Initially introduced by [PERSON] and [PERSON] [40], it adjusts gradients of objective functions to iteratively move toward an optimized solution that satisfies the necessary constraints. GRG is effective and versatile, and recent studies highlight advances in applying GRG in different contexts, including multi-objective optimization. [PERSON] and [PERSON] [41] use GRG for minimization problems to enhance computational efficiency through processing. [PERSON] and [PERSON] [42] discuss the application of meta-learning and Bayesian optimization to improve the efficiency of industrial data science, where GRG-based techniques are applied to improve process automation and the accuracy of predictive models. In the field of oil well drilling, [PERSON] et al. [18] also uses GRG, specifically for optimizing ROP and MSE, aiming at maximizing ROP and minimizing MSE with a multi-objective focus. Figure 3: Modeled MSE versus Real MSE. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Variables** & **Coefficients** & **Standard Error** & \(p\)**-Value** \\ \hline X\({}_{1}\) & 31.9602 & 9.4933 & 0.0008 \\ X\({}_{2}\) & 15.2027 & 9.9886 & 0.1281 \\ X\({}_{3}\) & 260.5446 & 10.3556 & 0.0000 \\ X\({}_{1}\)\({}^{2}\) & 181  
In the presented context, one of the objectives of this research is to provide room for STICKRATIO and MSE optimization by finding the optimal combination of drilling mechanic parameters, combining RPM, FLOW, and WOB, targeting the lowest possible STICKRATIO and MSE. This optimization leads, for instance, to an eventual reduction in drill-bit wear, possibility of more reliable downhole tools, and also a decrease in the energy required to excavate a unit volume of rock, thus achieving better effective energy efficiency in rock penetration in an overall sense. Figure 4 presents part of the schema developed for optimization. It was created using Microsoft Excel 365 and consists of an action button called OPTIMIZE, and three labeled tables: COEFFICIENTS, OPTIMIZATION, and GOAL. * COEFFICIENTS table: Divided into two main parts, this section maintains the coefficients that compose the STICKRATIO and MSE models (formulations/equations), orderly presenting the linear terms RPM, FLOW, and WOB, the quadratic terms (RPM\({}^{2}\), FLOW\({}^{2}\), and WOB\({}^{2}\)), and the second-order interaction terms (RPM vs. FLOW, RPM vs. WOB, and FLOW vs. WOB);
* OPTIMIZATION table: In this table, one can visualize the input drilling mechanic parameters (variables RPM, FLOW, and WOB), the outputs (variables STICKRATIO and MSE, respectively, Y\({}_{1}\) and Y\({}_{2}\)). The desirability values for Y\({}_{1}\), Y\({}_{2}\), and the global desirability (d1, d2, and D), which indicate how close the goal is to the established target. A loop counter is also presented, which the VBA script will use to record data in each row and column;
* GOAL table: This section allows setting acceptable lower and upper limits for optimization. If the actual limit is lower than the desired, the desirability (d) returns 1; if it is higher, d returns 0. If this occurs during optimization, the global desirability (D) will return #NULL! as a value, indicating the desired range was not achieved;
* OPTIMIZE button: This action button allows starting the optimization process to begin. It is based on a VBA macro script developed by the authors. In Figure 4, it also shows an overview of the data used in the spreadsheet arrangement for the optimization process. For instance, the first row displays the data read in real-time in the \"Optimization\" row. These values are transferred to the first line of the \"Loop\", as they are processed until all related rows are completed.