## 3 Controller Design for WWTP
### Stability Analysis  
To demonstrate the stability of the designed WWTP control system, the following assumptions are added:  
**Assumption 3**.: _Every time a bounded expected output signal \(y_{d}(k+1)\) is given, a bounded \(u(k)\) always exists, so that the system's output approach is \(y_{d}(k+1)\) driven by this control input signal._  
**Assumption 4**.: _At any time \(k\), when \(\Delta u(k)\
eq 0\), the sign of the system's PPD remains unchanged; that is, \(\phi_{c}(k)>\varepsilon>0\) or \(\phi_{c}(k)<-\varepsilon\), where \(\varepsilon\) is a small positive constant._  
**Remark 2**.: _Assumption 3 is a necessary condition for system controllability. Assumption 4 suggests that the system output should not decrease in proportion to an increase in the control input, which can be considered as a quasi-linear characteristic of the system. Obviously, the WWTP system meets the above assumptions._  
**Theorem 2**.: _For the WWTP system in Equation (3), under the conditions of Assumptions 1-4, when \(y_{d}(k+1)=y_{d}=\text{const}\), using the MFA-NFITSMC control strategy in Equation (27), there are: (1) The WWTP system's tracking error is convergent., and \(\lim\limits_{k\to\infty}|y_{d}(k+1)-y(k+1)|=0\). (2) The output and input sequences \(\{y(k)\}\) and \(\{u(k)\}\) are bounded._  
Figure 2: The control flow chart.  
**Proof of Theorem 2.** The following one-step forward sliding mode function can be obtained from Equation (21):  
\[s(k+1)=e(k+1)+TE(k) \tag{28}\]  
By introducing Equation (20) into Equation (28) and considering Equations (8) and (25), it can be concluded that:  
\[\begin{gathered} s(k+1)=y_{d}(k+1)-y(k+1)+TE(k)\\ =y_{d}(k+1)-\big{(}y(k)+\hat{\phi}_{c}(k)\Delta u(k)\big{)}+TE(k) \\ =y_{d}(k+1)-\big{(}y(k)+mT|s(k)|^{\lambda}sgn(s(k))+nTs(k)\\ +\alpha T|e(k)|^{\frac{p_{1}}{p_{2}}}\text{sgn}(e(k))+\beta T\text {sgn}(e(k)))+TE(k)\\ =e(k)+TE(k-1)-mT|s(k)|^{\lambda}\text{sgn}(s(k))-nTs(k)\\ =s(k)-mT|s(k)|^{\lambda}\text{sgn}(s(k))-nTs(k)\end{gathered} \tag{29}\]  
Thus  
\[s(k+1)-s(k)=-mT|s(k)|^{\lambda}\text{sgn}(s(k))-nTs(k) \tag{30}\]  
Since both \(m\) and \(n\) are greater than 0, when \(s(k)>0\)  
\[s(k+1)-s(k)<0 \tag{31}\]  
and when \(s(k)<0\)  
\[s(k+1)-s(k)>0 \tag{32}\]  
Considering Equations (31) and (32), it can be concluded that  
\[s(k+1)<s(k),s(k)>0s(k+1)>s(k),s(k)<0 \tag{33}\]  
Equation (33) satisfies the existence and arrival conditions of a discrete sliding mode  
\[[s(k+1)-s(k)]sgn(s(k))<0[s(k+1)+s(k)]sgn(s(k))>0 \tag{34}\]  
Therefore, \(s(k)\) is monotonically decreasing and Equation (34) is a necessary and sufficient condition for the existence of discrete quasi sliding mode states [28]. This means that under the action of Equation (27), the tracking error of the WWTP system can converge to the neighborhood of zero, that is, \(\{e(k)\}\) is bounded. According to Theorem 1, \(e(k)\) can converge to zero in a finite time, i.e., \(\lim\limits_{k\to\infty}|y_{d}(k+1)-y(k+1)|=0\).  
The tracking error is defined as \(e(k)=y_{d}(k)-y(k)\); given that \(\{y_{d}(k)\}\) is bounded and it has been proven that \(\{e(k)\}\) is bounded, thus \(\{y(k)\}\) is bounded. According to the zero dynamic characteristics of the system's asymptotic stability, there are constants \(a\), \(b\), and \(k_{0}\) that satisfy:  
\[|\Delta u(k-1)\leqslant |\underset{\tau<k}{\text{max}}|y(\tau)|+b,\forall k>k_{0} \tag{35}\]  
That is, \(\{u(k)\}\) is bounded. Thus, Theorem 2 is proved. \(\square\)  
**Remark 3**.: _The \(\beta\text{sgn}(e(k))\) in Equation (27) will cause higher chattering, the sign function is replaced with the sigmoid function, which is given below, in order to lessen the chattering it causes._  
\[\text{sigmoid}(\sigma,e(k))=\frac{2}{1+\exp(-\sigma e(k))}-1 \tag{36}\]  
_where \(\sigma>0\) and \(\sigma=2\) is chosen in order to obtain a balance between chattering and robustness._