## 3 Results and Discussion
### Thermodynamics  
The enthalpy change, entropy change, and Gibbs free energy change values predicted using artificial neural networks (ANNs) were calculated using the experimentally obtained data and the activation energy derived from the Friedman method. The results are presented in Figure 6 and Table 5 in detail. The experimental average enthalpy change (\(\Delta\)H) values for chitosan and chitin were 155.2 kJ/mol and 154.6 kJ/mol, respectively. The predicted average \(\Delta\)H values were slightly lower than the experimental values (151.7 kJ/mol for chitosan and 153.1 kJ/mol for chitin), but the percentage deviation remained low, which indicates a good agreement between model predictions and actual values. These values confirm that the carbonization of chitosan and chitin is an endothermic process, requiring significant thermal energy for thermal decomposition. The average experimental Gibbs free energy change (\(\Delta\)G) values  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{3}{c}{**Experimental**} & \multicolumn{2}{c}{**Prediction**} \\ \hline  & \(\alpha\) & **A (s\({}^{-1}\))** & \ \begin{tabular}{c} **Compensation Plot** \\ **Equation** \\ \end{tabular}  & **A (s\({}^{-1}\))** & \begin{tabular}{c} **Compensation Plot** \\ **Equation** \\ \end{tabular}  \\ \hline  & 0.1 & 1.53 \(\times\) 10\({}^{12}\) & & 6.81 \(\times\) 10\({}^{12}\) & \\  & 0.2 & 4.55 \(\times\) 10\({}^{13}\) & & 2.90 \(\times\) 10\({}^{15}\) & \\  
were found to be significantly higher for chitin (183.7 kJ/mol) compared with chitosan (168.2 kJ/mol), indicating that chitin carbonization is thermodynamically less favorable during the main thermal decomposition stage. The higher average \(\Delta\)G for chitin suggests a more stable structure, requiring greater energy to reach the transition state, possibly due to its higher crystallinity and stronger interchain hydrogen bonding. The average entropy change (\(\Delta\)S) values were negative for both materials, indicating a decrease in system disorder during carbonization, likely due to the formation of more ordered char structures. Chitin showed a much more negative entropy change (\(-42.9\) J/mol\(\cdot\)K vs. \(-22.7\) J/mol\(\cdot\)K for chitosan), suggesting a greater degree of structural reorganization and condensation during thermal degradation. Overall, chitin exhibited a higher average \(\Delta\)G and more negative average \(\Delta\)S, indicating greater thermal stability and a more structured char formation process compared with chitosan. On the other hand, chitosan's lower average \(\Delta\)G and less negative average \(\Delta\)S suggests a more favourable and less structured decomposition pathway, which may be due to its higher degree of deacetylation and lower crystallinity. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & \(\Delta\)**H** & \(\Delta\)**G** & \(\Delta\)**S** \\  & & **(k/mol)** & **(k/mol)** & **(J/mol)** \\ \hline \multirow{3}{*}{Chitosan} & Experimental & 155.2 & 168.2 & \(-22.7\) \\  & Prediction & 151.7 & 166.3 & \(-25.5\) \\  & \% Deviation & 2.2 & 1.1 & 12.3 \\ \hline \multirow{3}{*}{Chitin} & Experimental & 154.6 & 183.7 & \(-42.9\) \\  & Prediction & 153.1 & 182.9 & \(-43.9\) \\  & \% Deviation & 0.9 & 0.4 & 2.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Average values of the thermodynamic parameters for carbonization. Figure 6: Variation of the thermodynamic changes in thermodynamic parameters with respect to conversion degree. When Figure 6 was carefully investigated to determine instantaneous changes in the thermodynamic parameters, ANN predictions for chitin demonstrated better accuracy in instantaneous estimations when compared with those for chitosan. These findings indicate that the average thermodynamic parameters can be accurately predicted; however, deviations in specific thermodynamic parameters may occur using ANN. The ANN learned trends for average values of the changes in thermodynamic functions effectively but struggled with extreme values or cases.