## 2 Materials and Methods
### Mathematical Modeling Methodology  
Figure 3 shows the numerical prediction section. To set up the PSO algorithm, the initial parameters selected were set to 500 particles, 500 iterations, and the search space was for the lower bound of \(A_{0}=9\times 10^{4}\) and \(Ea=9\times 10^{3}\) and at the upper bound of \(A_{0}=9\times 10^{80}\) and \(Ea=9\times 10^{6}\), for each of the Arrhenius \(k_{i}\) constants. To obtain the adjustment curves for each proposed temperature, the PSO algorithm is studied in terms of accuracy by estimating the objective function (\(1.551\times 10^{-12}\)), estimating computational efficiency by measuring the algorithm's execution time (10.145 min), and estimating convergence efficiency with the adjustment (99.99996887%), and this methodology is shown in Figure 3. The initial search range of the PSO was adjusted to generate real values of \(k_{1}\), \(k_{V1}\), \(k_{2}\), and \(k_{V2}\) for wheat straw between \(-20\) and \(0\) dB (\(0>k_{i}>-20\) dB, where \(i=1\), \(2\), \(V1\), and \(V2\)).  
Figure 3: Numerical prediction methodology: (**a**) numerical modeling and (**b**) PSO algorithm.  
The numerical prediction section addresses four cases in this work: searching for Arrhenius parameters that help to establish degradation curves by weight loss at different isothermal torrefaction temperatures, finding the elemental composition (CHNO), predicting the higher heating value (HHV), and determining the densification energy (DE) of wheat straw.  
In one approach, using \"global Arrhenius parameters\", which consist of adjusting sixteen experimental values of the percentage weight loss for the study temperatures (250, 275, 300, and 325 \({}^{\circ}\)C), four experimental values for each isothermal temperature are determined, using the particle swarm optimization (PSO) algorithm. Considering the weight loss yields and the initial and final elemental analysis of wheat straw, it is possible to calculate the elemental component matrix \(X^{(T)}\) as described in (8) for any instant of time, obtain the yields per temperature, and, consequently, perform predictions of the elemental components of the matrix and the HHV of Equation (11). A relationship is found between the atomic ratios of H/C and O/C and the torrefaction temperature.  
On the other hand, when using \"individual Arrhenius parameters\", the process is similar to that of global parameters, with the difference that, with the PSO algorithm, the Arrhenius parameters are obtained for each isothermal study temperature. Once a weight loss degradation curve is obtained for each temperature, the predictions of elemental components, the HHV, and ED are calculated.  
Once the parameters and the Arrhenius kinetic constants are determined through individual or global analysis, the percentage weight loss functions, determined from Equation (8), are calculated for each isothermal torrefaction temperature. Using the percentage weight loss data and the initial and final values of the elemental analysis, the percentages of CHNO present in the wheat straw during the torrefaction process are predicted using Equation (9), and then the HHV and ED are predicted using Equations (11) and (12).