## 4 Application to WWTP
### Process Model  
This application focuses specifically on the N-Removal process, which occurs in the biological treatment of the WWTP. The model that represents the N-Removal process is taken from the Benchmark Simulation Protocol (BSM1) [32]. The Benchmark Simulation Model (BSM1) is widely accepted by the scientific community and it has been broadly applied to test control approaches for the Activated Sludge Process (ASP). In order to represent the N-Removal process, the BSM1 is reduced to one anoxic and one aerated reactor, as shown in Figure 2. The volumes of the tanks are \(2000\,\mathrm{m}^{3}\) and \(3999\,\mathrm{m}^{3}\) respectively, to make them equivalent to total volumes of the anoxic and the aerobic compartments in the BSM1.  
The following equations represent the dynamic behavior of the plant:  
Figure 2: Schematic representation of the plant.  
* Anoxic reactor: \[\begin{split}\dot{S}_{NH1}&=\frac{1}{V_{1}}\left[Q_{in}S_{ NHin}+Q_{a}S_{NH2}-(Q_{in}+Q_{a})S_{NH1}\right]-i_{xb}\rho_{11}-i_{xb}\rho_{21}-(i_{xb}+ \frac{1}{Y_{A}})\rho_{31}\\ \dot{S}_{NO1}&=\frac{1}{V_{1}}\left[Q_{a}S_{NO2}-(Q_{ in}+Q_{a})S_{NO1}\right]-\frac{1-Y_{H}}{2.86Y_{H}}\rho_{21}+\frac{1}{Y_{A}} \rho_{31}\\ \dot{S}_{S1}&=\frac{1}{V_{1}}\left[Q_{in}S_{Sin}+Q_{a }S_{S2}-(Q_{in}+Q_{a})S_{S1}\right]-\frac{1}{Y_{H}}\rho_{11}-\frac{1}{Y_{H}} \rho_{21}\\ \dot{S}_{O1}&=\frac{1}{V_{1}}\left[Q_{a}S_{O2}-(Q_{ in}+Q_{a})S_{O1}\right]-\frac{1-Y_{H}}{Y_{H}}\rho_{11}-(\frac{4.57}{Y_{A}}+1) \rho_{31}\end{split}\] (48)
* Aerobic reactor: \[\begin{split}\dot{S}_{NH2}&=\frac{1}{V_{2}}\left[(Q _{in}+Q_{a})(S_{NH1}-S_{NH2})\right]-i_{xb}\rho_{12}-(i_{xb}+\frac{1}{Y_{A}}) \rho_{32}\\ \dot{S}_{NO2}&=\frac{1}{V_{2}}\left[(Q_{in}+Q_{a})(S _{NO1}-S_{NO2})\right]-\frac{1-Y_{H}}{2.86Y_{A}}\rho_{22}+\frac{1}{Y_{A}}\rho_ {32}\\ \dot{S}_{S2}&=\frac{1}{V_{2}}\left[(Q_{in}+Q_{a})(S _{S1}-S_{S2})\right]-\frac{1}{Y_{H}}\rho_{12}-\frac{1}{Y_{H}}\rho_{22}\\ \dot{S}_{O2}&=\frac{1}{V_{2}}\left[(Q_{in}+Q_{a})(S _{O1}-S_{O2})\right]-\frac{1-Y_{H}}{Y_{H}}\rho_{12}-\frac{4.57-Y_{A}}{Y_{A}} \rho_{32}+KLa(S_{O,Sat}-S_{O2})\end{split}\] (49)  
In the first reactor, the anoxic growth of heterotrophic biomass is the main biological process, related to denitrification:  
\[\rho_{21}=\mu_{H}.(\frac{S_{S1}}{K_{S}+S_{S1}}).(\frac{K_{O,H}}{K_{O,H}+S_{O1} }).(\frac{S_{NO1}}{K_{NO}+S_{S1}})\eta_{g}X_{B,H} \tag{50}\]  
In the second reactor, where there is a higher concentration of oxygen, the aerobic growths of heterotrophic and autotrophic biomass are considered, related to nitrification:  
\[\begin{split}\rho_{12}&=\mu_{H}.(\frac{S_{S2}}{K_ {S}+S_{S2}}).(\frac{S_{O2}}{K_{O,H}+S_{O2}}).X_{B,H}\\ \rho_{32}&=\mu_{A}.(\frac{S_{NH2}}{K_{NH}+S_{NH2}}). (\frac{S_{O2}}{K_{O,A}+S_{O2}}).X_{B,A}\end{split} \tag{51}\]  
The rest of processes \(\rho\) are assumed to be zero in Equations (46) and (47).  
The definitions of the state variables are given in Table 1. The definitions of kinetic and physical parameters are presented in Tables 2 and 3, their values are the same as for BSM1 [32].  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Notation** & **Definition** & **Unit** \\ \hline S\({}_{\text{NH}}\) & NH\({}_{4}+\text{NH}_{3}\) concentration & grN/m\({}^{3}\) \\ S\({}_{\text{NO}}\) & Nitrate and nitrite concentration & grN/m\({}^{3}\) \\ S\({}_{\text{S}}\) & Readily biodegradable substrate concentration & grCOD/m\({}^{3}\) \\ S\({}_{\text{O}}\) & Dissolved oxygen concentration & gr/m\({}^{3}\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: List of state variables of the model.