# Adaptive Cooperative Control of Multiple Urban Rail Trains with Position Output Constraints
## 3 Control Law Design
### Adaptive Cooperative Control Design of Multiple Trains with POC
Based on the error dynamics Equation (10) for multiple trains operation, the following global positive definite Lyapunov function is selected as  
\[Q_{1}=\frac{1}{2}d_{i}\sum_{i=1}^{n}\sum_{j=1}^{n}a_{ij}\widetilde{U}_{i,j}+ \frac{1}{2}\sum_{i=1}^{n}\widetilde{x}_{i,2}\widetilde{x}_{i,2}+\frac{1}{2} \alpha_{i}\sum_{i=1}^{n}\log\frac{k_{i}^{2}}{k_{i}^{2}-\widetilde{x}_{i,1}^{2}} +\frac{1}{2}\sum_{i=1}^{n}\left(\frac{\widetilde{f}_{i,1}^{2}}{\lambda_{i,1}}+ \frac{\widetilde{a}_{i,2}^{2}}{\lambda_{i,2}}+\frac{\widetilde{a}_{i,3}^{2}}{ \lambda_{i,3}}\right) \tag{16}\]The differential of \(Q_{1}\) is obtained as follows:  
\[ \begin{array}{rl}\dot{Q}_{1}=&\frac{1}{2}d_{i}\sum\limits_{i=1}^{n}\sum\limits_{ j=1}^{n}a_{ij}\dot{\widetilde{U}}_{i,j}+\sum\limits_{i=1}^{n}\widetilde{x}_{i,2} \Bigg{[}-d_{i}\sum\limits_{j\in N_{i}}a_{ij}\
abla_{\widetilde{x}_{i,1}} \widetilde{U}_{i,j}+h_{i}\sum\limits_{j\in N_{i}}a_{ij}\big{(}\widetilde{x}_{j,2}-\widetilde{x}_{i,2}\big{)}\Bigg{]}\\ &\hskip 14.226378 pt+\sum\limits_{i=1}^{n}\widetilde{x}_{i,2}\bigg{[} \widetilde{f}_{i}+\widetilde{a}_{i,1}x_{i,2}+\widetilde{a}_{i,2}x_{i,2}^{2}- \beta_{i}\widetilde{x}_{i,2}-\alpha_{i}\frac{\widetilde{x}_{i,1}}{k_{i}^{2}- \widetilde{x}_{i,1}^{2}}\bigg{]}\\ &\hskip 14.226378 pt+\alpha_{i}\sum\limits_{i=1}^{n}\frac{\widetilde{x}_{i,1} \widetilde{x}_{i,2}}{k_{i}^{2}-\widetilde{x}_{i,1}^{2}}+\sum\limits_{i=1}^{n} \left(\frac{\widetilde{f}_{i}^{\prime}\widetilde{f}_{i}}{\lambda_{i,1}}+\frac {\widetilde{a}_{i,1}\widetilde{a}_{i,1}}{\lambda_{i,2}}+\frac{\widetilde{a}_{ i,2}\widetilde{a}_{i,2}}{\lambda_{i,3}}\right)\end{array}  \tag{17}\]  
Sort out the first item in Equation (17), and we get that  
\[ \begin{array}{rl}\frac{1}{2}d_{i}\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a _{ij}\dot{\widetilde{U}}_{i,j}&=\frac{1}{2}d_{i}\sum\limits_{i=1}^{n}\sum \limits_{j=1}^{n}a_{ij}\
abla_{\widetilde{x}_{i,j}}\widetilde{U}_{i,j}\dot{ \widetilde{x}}_{i,j}\\ &=\frac{1}{2}d_{i}\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{ij}\
abla_{ \widetilde{x}_{i,j}}\widetilde{U}_{i,j}(\dot{\widetilde{x}}_{i,1}-\dot{ \widetilde{x}}_{j,1})\\ &=\frac{1}{2}d_{i}\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{ij}\Big{(} \widetilde{x}_{i,2}\
abla_{\widetilde{x}_{i,1}}+\widetilde{x}_{j,2}\
abla_{ \widetilde{x}_{i,1}}\Big{)}\widetilde{U}_{i,j}\\ &=d_{i}\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}a_{ij}\widetilde{x}_{i,2} \
abla_{\widetilde{x}_{i,1}}\widetilde{U}_{i,j}\end{array}  \tag{18}\]  
The Equation (17) can be expressed as  
\[ \begin{array}{rl}\dot{Q}_{1}=&h_{i}\sum\limits_{i=1}^{n}\widetilde{x}_{i,2} \Bigg{[}\sum\limits_{j\in N_{i}}a_{ij}(\widetilde{x}_{j,2}-\widetilde{x}_{i,2 })\Bigg{]}\\ &\hskip 14.226378 pt+\sum\limits_{i=1}^{n}\widetilde{x}_{i,2}\Big{(} \widetilde{f}_{i}+\widetilde{a}_{i,1}x_{i,2}+\widetilde{a}_{i,2}x_{i,2}^{2}- \beta_{i}\widetilde{x}_{i,2}\Big{)}\\ &\hskip 14.226378 pt+\sum\limits_{i=1}^{n}\Big{(}-\widetilde{x}_{i,2} \widetilde{f}_{i}-\widetilde{x}_{i,2}\widetilde{a}_{i,2}x_{i,2}^{2}- \widetilde{x}_{i,2}\widetilde{a}_{i,2}x_{i,2}^{2}\Big{)}\\ &\hskip 14.226378 pt=-h_{i}\widetilde{x}_{2}^{\mathsf{T}}L\widetilde{x}_{2}- \beta_{i}\widetilde{x}_{2}^{\mathsf{T}}\widetilde{x}_{2}\end{array}  \tag{19}\]  
where \(\widetilde{x}_{2}=(\widetilde{x}_{1,2},\widetilde{x}_{2,2},\cdots,\widetilde {x}_{n,2})^{\mathsf{T}}\). From Laplace matrices \(L\geq 0\), \(h_{i}>0\) and \(\beta_{i}>0\), we know that \(\dot{Q}_{1}\leq 0\). Integrate Equation (19) from \(0\) to t yields, \(Q_{1}(t)-Q_{1}(0)\leq 0\). Therefore, for any time \(t\geq 0\), \(Q_{1}\) is bounded. Equation (16) implies that for any \((i,j)\in E\), \(\widetilde{U}_{i,j}\leq Q_{1}(t)\leq Q_{1}(0)\), i.e., \(\widetilde{U}_{i,j}\) is bounded. However, for some \(i,j\in E\), if \(x_{i,j}\to l_{1}\) or \(x_{i,j}\to l_{2}\), then \(\widetilde{U}_{i,j}\rightarrow\infty\).