## 5 Conclusions  
In conclusion, this study demonstrates the effectiveness of a neural PID controller in regulating product purity in the PSA process. We successfully captured the smoothed process dynamics with a 74% fit by first developing a Hammerstein-Wiener model. Using this model, a discrete PID controller was designed, and subsequently, a neural PID controller was trained to emulate its behavior. The neural PID controller was optimized using the Adam algorithm, achieving a fit of 96%. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Stream** & **Unit** & **FV** & **WV** & **PV** & **BED1** & **BED2** \\ \hline Total material forward & kmol & 0.00757 & 0.00481 & 0.00247 & 0.00185 & 6.14\(\times 10^{-4}\) \\ Average flowrate forward & kmol/s & 5.19\(\times 10^{-5}\) & 3.30\(\times 10^{-5}\) & 1.69\(\times 10^{-5}\) & 1.27\(\times 10^{-5}\) & 4.21\(\times 10^{-6}\) \\ \hline \multicolumn{8}{c}{**Total Component Forward**} \\ \hline CO & kmol & 8.33\(\times 10^{-4}\) & 7.61\(\times 10^{-4}\) & 3.12\(\times 10^{-5}\) & 2.95\(\times 10^{-5}\) & 9.78\(\times 10^{-6}\) \\ HYDROGEN & kmol & 0.00462 & 0.00207 & 0.00244 & 0.00182 & 6.05\(\times 10^{-4}\) \\ METHANE & kmol & 0.00212 & 0.00198 & 3.64\(\times 10^{-8}\) & 2.93\(\times 10^{-8}\) & 9.72\(\times 10^{-9}\) \\ \hline \multicolumn{8}{c}{**Average Composition Forward**} \\ \hline CO & kmol/kmol & 0.11 & 0.158 & 0.013 & 0.016 & 0.016 \\ HYDROGEN & kmol/kmol & 0.61 & 0.43 & 0.987 & 0.984 & 0.984 \\ METHANE & kmol/kmol & 0.28 & 0.412 & 1.48\(\times 10^{-5}\) & 1.58\(\times 10^{-5}\) & 1.58\(\times 10^{-5}\) \\ \hline \multicolumn{8}{c}{**Energy Consumption**} \\ \hline Total energy forward & MJ & 0.2531 & 0.2345 & 0.0042 & 0.0037 & 0.0012 \\ Average enthalpy forward & MJ/kmol & 33.42 & 48.72 & 1.71 & 1.98 & 1.97 \\ \hline Total energy reverse & MJ & 0.0 & 0.0058 & 0.0 & 9.20\(\times 10^{-4}\) & 8.98\(\times 10^{-4}\) \\ Average enthalpy reverse & MJ/kmol & 0.0 & 61.69 & 0.0 & 1.49 & 1.46 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Productivity report at the highest purity (0.99 kmol/kmol) in the 35 th cycle. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Product:** & **PV (\%)** & **WV (\%)** \\ \hline Material: & 32.5695 & 63.5582 \\ \hline Component: & & \\ \hline CO & 3.73975 & 91.3675 \\ \hline HYDROGEN & 61.7174 & 44.8093 \\ \hline METHANE & 0.0017184 & 93.4792 \\ \hline Energy & 1.67027 & 92.6473 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Energy efficiency and recovery H\({}_{2}\) report. To validate the approach, we applied system identification techniques to develop an initial model from PSA process data. The results demonstrate that the neural PID controller effectively represents the discrete PID controller, as both maintain a biohydrogen purity of 0.99 molar fraction while attenuating output disturbances. A key finding is the high hydrogen purity (\(\approx\)99%) reach in the product; this control also keeps an efficient gas separation. The analysis of the streams indicates that the methane is almost retained in the waste stream (93.48%), ensuring the purity of the H\({}_{2}\) in the final product. In conclusion, the neural controller based on a discrete PID demonstrates performance and robustness equivalent to that of the discrete PID controller. Both controllers achieve the international standard for biohydrogen purity at 0.99 molar fraction while effectively countering disturbances. The advantages of using a neural network are the feasibility, adaptation to new control points, better disturbance rejection, and multivariate control. This study uses NN as a MISO (Multiple-Inputs, Single-Output) controller. In the case study, the complex behavior of the PSA plant can be challenging to control without the help of modern tools such as NN. Thus, the NN implemented in this process allows us to operate and control the desired purity despite its cyclical behavior. Future works should focus on improving hydrogen recovery by minimizing losses in the wind-generated current stream while improving energy efficiency.