## 3 Control Design and Stability Analysis
### Controller Design
: _From the control law (58), it follows that the value of the control signal \(u\) depends on (i) the nutrient concentration in the upper CSTR, that is, \(x_{1}=P_{e}\); (ii) the nutrient concentration in the lower CSTR, that is, \(x_{2}=P_{i}\), (iii) the measurement of the liquid volume in the lower CSTR, that is, \(x_{3m}=V_{1m}\); (iv) the reaction rate term \(r_{x1}\) and \(d\bar{r}_{x1}/dx_{1}\), which are functions of \(x_{1}\); and (v) the desired output \(y_{d}\) and its time derivative \(dy_{d}/dt\), provided by Equation (5). Therefore, the input signal \(v\) also depends on \(x_{1}\), \(x_{2}\), \(x_{3}\), \(y_{d}\), as it is a saturation function of \(u\) according to expression (4)._  
**Remark 3**. : _In practical implementation of the developed controller, the flow valve manipulates the flow of nutrient solution \(Q_{ad}\), using the signal \(v\) (4) and the control law (58), so as to drive \(z_{1}\) to \(\Omega_{z1}\), \(\Omega_{z1}=\{z_{1}:|z_{1}|\leq C_{b}\}\) and \(z_{2}\) to \(\Omega_{z2}\), \(\Omega_{z2}=\{z_{2}:|z_{2}|\leq C_{b}\}\). Also, as \(v\) depends on \(x_{1}\), \(x_{2}\), \(x_{3}\) according to Remark 2, the flow valve uses their measurement._  
**Remark 4**. : _A closed loop is generated by the application of the developed controller, because the saturated signal \(v\) depends on \(x_{1}\), \(x_{2}\), \(x_{3}\) according to remark 2, and \(x_{1}\), \(x_{2}\) and \(x_{3}\) depend on \(v\) according to model (1)-(3)._  
Substituting \(u\) (58) into Equation (57) yields  
\[\dot{\psi}_{1}=-K_{\psi 1}\psi_{1}+\psi_{2} \tag{47a}\]9 \[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]0  
In order to tackle the effect of the parameter updating errors in \(\dot{V}_{z}\), the overall Lyapunov function is defined as  
\[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]1  
where \(V_{\theta}\) is the sum of the quadratic forms for the parameter updating errors, and it is defined as  
\[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]2 \[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]3  
The vector of closed loop state variables is \(\tilde{x}=\big{[}z_{1},\ z_{2},\ \bar{\theta}_{1},\ \bar{\theta}_{3},\ \bar{\theta}_{4},\ \bar{ \theta}_{rx1},\ \bar{\theta}_{2},\ \ \bar{\theta}_{ilb},\ \bar{\theta}_{ub}\big{]}^{\top}\). Differentiating (60) with respect to time yields  
\[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]4  
Differentiating \(V_{\theta}\) (61) with respect to time yields  
\[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]5 \[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]6  
Substituting (63) and (59) into Equation (62) yields\[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]7 \[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]8 \[\dot{\psi}_{2}=-K_{\psi 2}\psi_{2}+a_{1}\hat{\theta}_{ub}sat_{ 22}|b_{m}\Delta u|\]9 \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]0  
In order to cancel the effect of the term  
\[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]1 \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]2  
the update laws are chosen as  
\[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]3 \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]4 (66) \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]5 (67) \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]6 (68) \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]7 (69) \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]8 (70) \[K_{\psi 1}>1/2,\;\;K_{\psi 2}>1/2 \tag{47c}\]9  
where \(\Gamma_{1}\) is \(2\times 2\) diagonal matrix whose diagonal entries are user-defined, positive, and constant, whereas \(\gamma_{rx1}\), \(\gamma_{3}\), \(\gamma_{lib}\), \(\gamma_{ub}\), \(\gamma_{4}\), and \(\gamma_{2}\) are user-defined positive constants.