## 2 Mathematical Model and Tracking Error Dynamics
### Problem Formulation  
The desired trajectory tracking \(r_{ri}\) is supposed to exist in limited time functions of the position \(r_{ri}\in C^{2}\), which is a twice continuously differentiable function. The velocity vector and acceleration vector \(r_{ri}\) can be expressed as \(\dot{r}_{ri}\) and \(\ddot{r}_{ri}\), respectively. The definition of the tracking error between the desired trajectory tracking and a swarm of WMRs can be described as the following equation. \[e_{i}=\left[ \begin{array}{c}\dot{r}_{i}\\ \dot{r}_{i}\end{array} \right]=\left[ \begin{array}{c}\ddot{r}_{i}-\dot{r}_{ri }\\ r_{i}-r_{ri}\end{array} \right] \tag{4}\]  
where:  
\[r_{ri}=\left[ \begin{array}{cc}x_{i}&y_{i}&\theta_{di}\end{array} \right]^{T}\]  
and the tracking error dynamics equation is given as:  
\[\dot{e}_{i}=\left[ \begin{array}{cc}-M_{i}{}^{-1}(r_{i})G_{i}(r_{i},\dot{r}_ {i})&0_{3\times 3}\\ I_{3\times 3}&0_{3\times 3}\end{array} \right]e_{i}+\left[ \begin{array}{c}- \ddot{r}_{ri}-M_{i}{}^{-1}(r_{i})G_{i}(r_{i},\dot{r}_{i})\dot{r}_{ri}\\ 0_{3\times 3}\end{array} \right]+\left[ \begin{array}{c}M_{i}{}^{-1}(r_{i}) O_{i}(r_{i})\tau_{i}\\ 0_{3\times 3}\end{array} \right] \tag{5}\]  
where:  
\[\left[ \begin{array}{c}\dot{e}_{1}\\ \dot{e}_{2}\\ \vdots\\ \dot{e}_{n}\end{array} \right]=\left[ \begin{array}{ccccc}-M_{1}{}^{-1}(r_{1} )G_{1}(r_{1},\dot{r}_{1})&0_{3\times 3}&\cdots&\cdots&\cdots&0_{3\times 3}\\ I_{3\times 3}&0_{3\times 3}&\cdots&\cdots&\cdots&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}&-M_{2}{}^{-1}(r_{2})G_{2}(r_{2},\dot{r}_{2})&0_{3 \times 3}&\cdots&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}&I_{3\times 3}&0_{3\times 3}&\cdots&0_{3\times 3}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0_{3\times 3}&\cdots&\cdots&\cdots&-M_{n}{}^{-1}(r_{n})G_{n}(r_{n},\dot{r}_{n})&0_{3 \times 3}\\ 0_{3\times 3}&\cdots&\cdots&\cdots&I_{3\times 3}&0_{3\times 3}\end{array} \right]e_{1}\]  
\[+\left[ \begin{array}{c}-\ddot{r}_{r1}-M_{1}{}^{-1}(r_{1})G_{1}(r_{1},\dot{ r}_{1})\dot{r}_{r1}\\ 0_{3\times 3}\\ -\ddot{r}_{r2}-M_{2}{}^{-1}(r_{2})G_{2}(r_{2},\dot{r}_{2})\dot{r}_{r2}\\ 0_{3\times 3}\\ \vdots\\ -\ddot{r}_{m}-M_{n}{}^{-1}(r_{n})G_{m}(r_{n},\dot{r}_{n})\dot{r}_{m}\\ 0_{3\times 3}\end{array} \right]+\left[ \begin{array}{c}M_{1}{}^{-1}(r_{1})O_{1}( r_{1})\tau_{1}\\ 0_{3\times 3}\\ M_{2}{}^{-1}(q_{2})O_{2}(r_{2})\tau_{2}\\ 0_{3\times 3}\\ \vdots\\ M_{1}{}^{-1}(r_{n})O_{n}(r_{n})\tau_{n}\\ 0_{3\times 3}\end{array} \right]\]  
To simplify the above equations, the tracking error dynamic equation can be described in the following format. \[\dot{E}=F(r_{1},r_{2},\ldots,r_{n})E+C(r_{1},r_{2},\ldots,r_{n},r_{r1},r_{r2}, \ldots,r_{m})+\overline{U} \tag{6}\]  
where the vector \(E\) is the tracking error between the desired trajectory tracking and a swarm of WMRs, both vector \(F\) and \(C\) are the dynamic model of a swarm of WMRs, and the vector \(\overline{U}\) is the nonlinear optimal control law. \[E=\left[ \begin{array}{cccc}e_{1}&e_{2}&\ldots&e_{n}\end{array} \right]^{T}\]\[=\left[ \begin{array}{cccccccc}-{M_{1}}^{-1}(r_{1})G_{1}(r_{1},\dot{r}_{1})&0_{3 \times 3}&\cdots&\cdots&\cdots&0_{3\times 3}\\ I_{3\times 3}&0_{3\times 3}&\cdots&\cdots&\cdots&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}&-{M_{2}}^{-1}(r_{2})G_{2}(r_{2},\dot{r}_{2})&0_{3 \times 3}&\cdots&0_{3\times 3}\\ \cdots&\cdots&I_{3\times 3}&0_{3\times 3}&\cdots&0_{3\times 3}\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ 0_{3\times 3}&0_{3\times 3}&0_{3\times 3}&-{M_{n}}^{-1}(r_{n})G_{n}(r_{n},\dot{r}_{n})&0 _{3\times 3}&0_{3\times 3}\\ 0_{3\times 3}&0_{3\times 3}&0_{3\times 3}&I_{3\times 3}&0_{3\times 3}&0_{3 \times 3}\end{array} \right]\]  
\[C(r_{1},r_{2},\ldots,r_{n},r_{r1},r_{2},\ldots,r_{m})=\left[ \begin{array}{ ccccc}-\ddot{r}_{r1}-{M_{1}}^{-1}(r_{1})G_{1}(r_{1},\dot{r}_{1})\dot{r}_{r1} \\ 0_{3\times 3}\\ -\ddot{r}_{r2}-{M_{2}}^{-1}(r_{2})G_{2}(r_{2},\dot{r}_{2})\dot{r}_{r2}\\ 0_{3\times 3}\\ \vdots\\ -\ddot{r}_{m}-{M_{n}}^{-1}(r_{n})G_{n}(r_{n},\dot{r}_{n})\dot{r}_{m}\\ 0_{3\times 3}\end{array}