## 6 Case Study  
The mathematical model is derived from Activated Sludge Model No. 1 (ASM1) [34] and describes the aerobic digestion process that occurs in a CSTR, consisting of the material balances of the components, the kinetics, and the stoichiometry of the major processes in the plant. The TCOD is the variable of interest that will be controlled by regulating the KLA. The following nonlinear discrete-time Equations (40)-(49) describe the biological transformation processes that occur in the reactor, and Figure 6 illustrates the plant configuration.  
Readily biodegradable soluble substrate  
\[X_{1,k+1}=D\Big{(}X_{1,in}-X_{1,k}\Big{)}-\frac{1}{Y\!H}.\mu_{\max,H}.\mu_{1}.( \mu_{3}+\mu_{6}.\mu_{4}.n_{g})X_{3,k}+k_{h}.\mu_{7}(\mu_{3}+n_{h}.\mu_{6}.\mu_{4 })X_{3,k} \tag{40}\]  
Slowly biodegradable particulate substrate  
\[X_{2,k+1}=D\Big{(}X_{2,in}-X_{2,k}\Big{)}+D_{r}(b-1)X_{2,k}+(1-fp)(b_{H}X_{3,k} +b_{A}X_{4,k})-k_{h}.\mu_{7}(\mu_{3}+n_{h}.\mu_{6}.\mu_{4})X_{3,k} \tag{41}\]  
Active heterotrophic particulate biomass  
\[X_{3,k+1}=D\Big{(}X_{3,in}-X_{3,k}\Big{)}+D_{r}(b-1)X_{3,k}+\mu_{\max,H}.\mu_{ 1}.\mu_{3}.X_{3,k}+\mu_{\max,H}.\mu_{1}.\mu_{6}.\mu_{4}.n_{g}.X_{3,k}-b_{H}.X_{ 3,k} \tag{42}\]  
Active autotrophic particulate biomass  
\[X_{4,k+1}=D\Big{(}X_{4,in}-X_{4,k}\Big{)}+D_{r}(b-1)X_{4,k}+\mu_{\max,A}.\mu_{5 }.\mu_{2}.X_{4,k}-b_{A}.X_{4,k} \tag{43}\]  
Figure 5: Optimal neural tracking control strategy for nonlinear systems.  
Figure 6: Wastewater plant configuration.  
Soluble oxygen  
\[X_{5,k+1}=D\big{(}X_{5,in}-X_{5,k}\big{)}+KLA(X_{5,\max}-X_{5})-\frac{(1-Y_{H})} {Y_{H}}.\mu_{\max,H}.\mu_{1}.\mu_{3}.X_{3,k}-\frac{(4.57-Y_{A})}{Y_{A}}.\mu_{ \max,A}.\mu_{5}.\mu_{2}.X_{4,k} \tag{44}\]  
Soluble nitrate and nitrite nitrogen  
\[X_{6,k+1}=D\big{(}X_{6,in}-X_{6,k}\big{)}-\frac{(1-Y_{H})}{2.86Y_{H}}.\mu_{\max,H}.\mu_{1}.\mu_{6}.\mu_{4}.\mu_{g}.X_{3}+\frac{1}{Y_{A}}.\mu_{\max,A}.\mu_{5}.\mu_{2}.X_{4} \tag{45}\]  
Soluble ammonium (NH+ 4 and NH) nitrogen  
\[X_{7,k+1}=D\big{(}X_{7,in}-X_{7,k}\big{)}-i_{XB}\mu_{\max,H}.\mu_{1}\big{(}\mu_ {3}+\mu_{6}.\mu_{4}.\mu_{g}\big{)}X_{3}-\bigg{(}i_{XB}+\frac{1}{Y_{A}}\bigg{)} \mu_{\max,A}.\mu_{5}.\mu_{2}.X_{4,k}+k_{A}.X_{8,k}.X_{3,k} \tag{46}\]  
Soluble biodegradable organic nitrogen  
\[X_{8,k+1}=D\big{(}X_{8,in}-X_{8,k}\big{)}-k_{A}.X_{8,k}.X_{3,k}+k_{h}.\mu_{7} (\mu_{3}+n_{h}\mu_{6}\mu_{4})X_{3,k}\frac{X_{9,k}}{X_{2,k}} \tag{47}\]  
Particulate biodegradable organic nitrogen  
\[\begin{array}{rl}X_{9,k+1}=&D\big{(}X_{9,in}-X_{9,k}\big{)}+D_{r}(b-1)X_{9, k}+\Big{(}i_{XB}-f_{p}.i_{XP}\Big{)}\Big{(}b_{H}.X_{3,k}+b_{A}.X_{4,k}\Big{)}\\ &-k_{h}.k_{sat}.(\mu_{3}+n_{h}.\mu_{6}.\mu_{4})X_{3,k}.\frac{X_{9,k}}{X_{2,k} }\end{array} \tag{48}\]  
Parameters of the model and Monod reaction rates \(\mu_{i}\), \(i=1,...,7\)[35] are given in Appendix A. The inputs of the plant are the dilution rates (\(D\), \(D_{r}\)), KLA, biomass, and substrate concentrations (\(X_{i,in}\)). The output of the plant is the TCOD given by (49), which is composed of the readily biodegradable soluble substrate (\(X_{1,k}\)), the slowly biodegradable particulate substrate (\(X_{2,k}\)), and the inert soluble and particulate organic material (\(I_{s}\)). The steady-state value for \(I_{s}\) is given by the corresponding constant value of the influent:  
\[TCOD=X_{1,k}+X_{2,k}+I_{s} \tag{49}\]