## 4 Results  
This study explores the use of neuronal networks to mimic the behavior of a PID controller in regulating biohydrogen purity. In this context, three main signals are involved in the training process:  
* The feedback signal represents the purity of the biohydrogen, enabling dynamic adjustments in control actions to maintain the desired performance. * The error signal is computed as the difference between the reference signal and the feedback signal. * The reference signal corresponds to the desired purity level of the biohydrogen. \begin{table}
\begin{tabular}{c c c} \hline
**Component** & **Specification** & **Assigned Value** \\ \hline
**Input Layer** & Number of input features & 8 (4 from feedback signals, 4 as reference inputs) \\ \hline
**Hidden Layers** & Total hidden layers & 1 \\ \hline
**Neurons per Layer** & Distribution across layers & 8 (Input), 64 (Hidden), 1 (Output) \\ \hline
**Output Layer** & Neurons in the output layer & 1 \\ \hline
**Activation Functions** & Applied activation per layer & ReLU (Input Layer), ReLU (Hidden Layer), \\  & & None (Output Layer) \\ \hline
**Optimization Method** & Algorithm used for optimization & Adam \\ \hline
**Training Epochs** & Total number of epochs & 100 \\ \hline
**Network Type** & Learning approach & Regression Model \\ \hline
**Loss Function** & Error function used & Mean Squared Error (MSE) \\ \hline
**Evaluation Metrics** & Performance metrics used & Mean Absolute Error (MAE), Mean Squared Error (MSE) \\ \hline
**Validation Split** & Data reserved for validation & 25\% \\ \hline \end{tabular}
\end{table} 
Table 6: Key parameters of the feedforward multi-layer neural network. Figure 9: Training curves of the NN model. (**a**) The behavior of the loss metric across each epoch, and (**b**) the behavior of the MAE metric across each epoch. The NN architecture comprises three layers: an input layer with eight neurons using a ReLU activation function, a hidden layer with 64 neurons and ReLU activation, and an output layer without activation function. The NN is trained to map these input signals to the control actions generated by the PID controller. We changed the reference from 0.94 to 0.97 kmol/kmol of H\({}_{2}\) and added additive perturbations at the output of the system, as shown in Figure 10. The controller reacts slowly due to the type of process; however, it reaches the reference despite the perturbations. The behavior of the control signal is presented in Figure 11. We can observe that in the time 3000 and 5000 s, the control increases the action of control to maintain the output at the desired purity using the H-W model. The NN controller was tested using a 6-bit PRBS signal with variable amplitude as input. The results are shown in Figure 11; in Figure 12a, the PRBS signal is presented; Figure 12b shows the output of the H-W model to perform the feedback; Figure 12c shows the controller signal generated by PID to control the purity using the temperature of the reboiler. Figure 11: Control signal with disturbances in the output. Figure 10: The behavior of the output signal with disturbances at the process output. We used the PSA plant simulated in Aspen Adsorption to validate our controller because this tool allows accurate simulations and detailed analysis of adsorption processes. Figure 13 shows the behavior of the purity of the biohydrogen using the NN controller when two reference changes were applied--one at 1000 s from 0.94 to 0.97 and the other from 0.97 to 0.99 at 5000 s.  
Figure 14 shows the control signal of the NN controller; in this case, it is the output for the linear model. However, by using the inverse equations calculated in the mathematical model section, which are Equations (10) and (11), we obtain the control signal for the production of biohydrogen using the PSA plant simulated in Aspen; this signal is shown in Figure 15.  
Figure 12: (**a**) Reference signal; (**b**) output of the PSA process to feedback the controller; and (**c**) control signal from NN.