## 4 Conclusions  
Raman spectra were acquired at-line during the operation of a lab-scale photo-BNR reactor and PLS regression was performed to develop calibration models for the prediction of key monitoring parameters, essential for process control and optimization. This study showed that Raman spectroscopy, allied with PLS, is a very promising tool for monitoring the concentrations of TOC, VFAs, CO\({}_{2}\), NO\({}_{3}\), total P, PHAs, TSSs and VSSs in a photo-BNR reactor in real-time. This was shown by the high R\({}^{2}\)CV and RPDcv values obtained for these parameters: 96.7% and 5.5 for TOC, 95.4% and 4.7 for VFAs, 90.0% and 3.2 for CO\({}_{2}\), 97.7% and 6.7 for NO\({}_{3}\), 99.0% and 10.3 for Total P, 95.9% and 5.0 for PHAs, 97.5% and 6.3 for TSSs, 93.9% and 4.1 for VSSs, respectively. Regarding NH\({}_{3}\), PO\({}_{4}\) and total carbohydrates, the prediction accuracy of the respective Raman-based PLS models (R\({}^{2}\)CV and RPDcv of 65.5%and 1.7 for NH\({}_{3}\), 70.0% and 1.8 for PO\({}_{4}\); 88.2% and 2.9 for total carbohydrates, respectively) could possibly be improved by including more samples in the calibration set. The performance of the PLS calibration models was evaluated by a full cross-validation procedure and can be further assessed by an external validation using additional samples that were not included in model development (external test set). After external validation, the models can then be used for predicting the concentration of the different parameters simply based on the Raman spectral data, minimizing the need for performing extensive off-line analyses. Although the external validation of the developed PLS calibration models was not performed due to the lack of an external test set, this study presents very promising results for the real-time monitoring of a photo-BNR reactor using Raman spectroscopy, being the first to report this specific application. Overall, the application of Raman-based monitoring in a photo-BNR reactor offers a fast, simple, non-destructive, eco-friendly and holistic alternative to laborious standard analytical and expensive methods, enabling the quantification of various parameters within a single Raman measurement. Once robust and reliable PLS calibration models have been developed, Raman spectroscopy can be used online to provide real-time process information, facilitating decision-making during wastewater treatment. Nevertheless, regular reference analytical data will always be needed in order to guarantee the long-term validity of PLS models. The following figures are available online at [[https://www.mdpi.com/article/10.3390/app11146600/s1](https://www.mdpi.com/article/10.3390/app11146600/s1)]([https://www.mdpi.com/article/10.3390/app11146600/s1](https://www.mdpi.com/article/10.3390/app11146600/s1)), Figure S1: Photo-BNR daily cycle of day 85; Figures S2-S12: Pre-processed Raman spectra of calibration samples used for the development of the PLS model for total carbohydrates, CO\({}_{2}\), NH\({}_{3}\), NO\({}_{3}\), PHAs, PO\({}_{4}\), TOC, total P, TSS, VFAs, and VSSs, respectively. Conceptualization, M.A.M.R. and N.D.L. ; data curation, R.D.G.F. and V.C.F.C. ; formal analysis, R.D.G.F. and V.C.F.C. ; funding acquisition, M.A.M.R. ; investigation, R.D.G.F. and V.C.F.C. ; methodology, R.D.G.F. and N.D.L. ; project administration, M.A.M.R. and N.D.L. ; resources, J.C.F., M.A.M.R. and N.D.L. ; supervision, M.A.M.R. and N.D.L. ; validation, J.C.F., M.A.M.R. and N.D.L. ; visualization, R.D.G.F. ; writing--original draft, R.D.G.F. and V.C.F.C. ; writing--review and editing, J.C.F., M.A.M.R. and N.D.L. All authors have read and agreed to the published version of the manuscript. This research was funded by Fundacao para a Ciencia e a Tecnologia--FCT, Portugal, grant number UIDP/04378/2020 and UIDB/04378/2020. The data presented in this study are contained within the article and supplementary materials and are available on request from the corresponding author.