## 8 Cooperative Model-Predictive Control Methodology
### Linear MPC Formulation  
The LMPC method implemented in this work is the implicit LMPC applied in [26; 45], and details can be found therein. Therefore, the method is summarized here for completeness. The quadratic problem for the LMPC is provided in (66). \[\underset{\mathbf{u}_{i,K}}{\text{minimize}} \overline{\mathcal{L}}_{i}(\mathbf{x}_{i,K},\ \mathbf{\Delta}\mathbf{u}_{i,K},\ \mathbf{x}_{i,ref}) \tag{66}\] \[\overline{\mathcal{C}}_{eq}(\mathbf{x}_{i,K},\ \mathbf{u}_{i,K})\ =\ \mathbf{0}\] \[\overline{\mathcal{C}}_{inq}(\mathbf{x}_{i,K},\ \mathbf{u}_{i,K})\ \leq\ \mathbf{0}\]  
The quadratic objective function is denoted as \(\overline{\mathcal{L}}_{i}(\mathbf{x}_{i,K},\ \mathbf{\Delta}\mathbf{u}_{i,K},\ \mathbf{x}_{i, ref})\) and given in (67), where the decision variable is \(\mathbf{\Delta}\mathbf{u}_{i,K}\) and \(\mathbf{x}_{i,K}\) is a function of \(\mathbf{\Delta}\mathbf{u}_{i,K}\). \[\overline{\mathcal{L}}_{i}(\mathbf{x}_{i,K},\ \mathbf{\Delta}\mathbf{u}_{i,K},\ \mathbf{x}_{i, ref})\ = \tag{67}\] \[\overline{\mathcal{L}}_{i,tp}(\mathbf{x}_{i,ref},\ \mathbf{x}_{i,K})+\mathbf{u}_{i,K}^{T} \overline{\mathbf{R}}\mathbf{u}_{i,K}+\mathbf{x}_{i,K}^{T}\overline{\mathbf{Q}}\mathbf{x}_{i,K}\]  
where \(\overline{\mathbf{R}}\ =\ diag\{\mathbf{R}\}_{1}^{M}\), \(\overline{\mathbf{Q}}\ =\ diag\{\mathbf{Q}\}_{1}^{M}\) and \(\overline{\mathcal{L}}_{i,tp}(\mathbf{x}_{i,ref},\ \mathbf{x}_{i,K})\) is calculated in Section 8.3. \[\dot{\mathbf{\dot{e}}}_{i,t}\ =\ M_{i}(a_{ij})\dot{S}_{i,t} \tag{73}\]  
Following that, the inverse mapping from TS to LSS is calculated as  
\[\dot{\mathbf{\dot{S}}}_{i,t}\ =\ M_{i}^{+}\dot{\mathbf{\dot{e}}}_{i,t} \tag{74}\]  
where \(\mathbf{M}_{i}^{+}\) is the pseudo inverse of \(\mathbf{M}_{i,t}\) and \(a_{ij}\) is dropped from the expression for brevity. Note that \(\mathbf{x}_{j}\) is the state of a neighboring agent. As illustrated in [47] for robots, excessive (redundant) LSS can be utilized to manage secondary tasks. Let \(\mathbf{\dot{e}}_{i,1}\) and \(\mathbf{\dot{S}}_{i,1}\) denote the first TS and LSS and \(\mathbf{\dot{e}}_{i,t}\), and let \(\mathbf{S}_{i,t},\ t=2,\cdots,T\) denotes the remaining ones; then, following task management methodology can be used [40]:  
\[\dot{\mathbf{\dot{S}}}_{i,1} =\ M_{i,1}^{+}\dot{\mathbf{\dot{e}}}_{1} \tag{75}\] \[\dot{\mathbf{\dot{S}}}_{i,t} =\ \dot{\mathbf{\dot{S}}}_{i,t-1}+(\mathbf{M}_{i,t}\mathbf{\Phi}_{i,t-1})^{+}( \dot{\mathbf{e}}_{i,t}-\mathbf{M}_{i,t}\dot{\mathbf{S}}_{i,t-1})\]  
where \(\mathbf{\Phi}_{i,t}\) is the null space projection matrix and calculated is as follows:  
\[\mathbf{\Phi}_{i,1}\ =\ \mathbf{I}_{n_{st}}-\mathbf{M}_{i,1}^{+}\mathbf{M}_{i,1} \tag{76}\] \[\overline{\mathcal{C}}_{eq}(\mathbf{x}_{i,K},\ \mathbf{u}_{i,K})\ =\ \mathbf{0}\]0  
The formulation defined in (75) is collected in a minimal representation as in (77). \[\overline{\mathcal{C}}_{eq}(\mathbf{x}_{i,K},\ \mathbf{u}_{i,K})\ =\ \mathbf{0}\]1  
where \(\dot{\mathbf{S}}_{i}\ =\ \left[ \begin{array}{cccc}\dot{S}_{i,1}^{T}&\dot{S}_{i,t}^{T}& \cdots&\dot{S}_{i,T}^{T}\end{array} \right]^{T}\) and \(\dot{\mathbf{e}}_{i}=\left[ \begin{array}{cccc}\dot{\mathbf{\dot{e}}}_{i,t}^{T}&\dot {\mathbf{\dot{e}}}_{i,t}^{T}&\cdots&\dot{\mathbf{\dot{e}}}_{i,T}^{T}\end{array} \right]^ {T}\). Thus, a quadratic function can be written as in (78) based on (77). \[L(\dot{\mathbf{e}}_{i}):=\dot{\mathbf{S}}^{T}\dot{\mathbf{S}}\ =\ \dot{\mathbf{e}}_{i}^{T}\mathbf{ \
abla}^{T}\mathbf{\
abla}\dot{\mathbf{e}}_{i} \tag{78}\]  
Finally, based on (78), \(\mathcal{L}_{i,tp}(\mathbf{x}_{i,ref},\ \mathbf{x}_{i,k})\) and \(\overline{\mathcal{L}}_{i,tp}(\mathbf{x}_{i,ref},\ \mathbf{x}_{i,K})\) are calculated as given in (79) and (83), respectively, where \(\mathbf{Q}_{s}^{T}\ =\ \mathbf{Q}_{s}\geq\mathbf{0}\in\mathbb{R}^{n_{st}\times n_{st}}\). \[\mathcal{L}_{i,tp}(\mathbf{x}_{i,ref},\ \mathbf{x}_{i,k}) =\ \dot{\mathbf{e}}_{i}^{T}\mathbf{\
abla}^{T}\left[ \begin{array}{c|c} \mathbf{Q}_{s}&\mathbf{0}\\ \hline\mathbf{0}&\mathbf{Q}_{s}\end{array}