# Decentralized Consensus Protocols on \(SO(4)^{N}\) and \(Tso(4)^{N}\) with Reshaping
## 3 Consensus on \(SO(4)^{n}\) with Reshaping
### Local Stability Analysis  
Consider the Rodrigues formula for the relative configuration \[(R_{j}^{T}R_{i})^{n}=\exp(nS_{ij})=I_{4}+\sin(n\theta_{ij1})S_{ij1}+(1-\cos(n \theta_{ij1}))S_{ij1}^{2}+\sin(n\theta_{ij2})S_{ij2}+(1-\cos(n\theta_{ij2}))S_{ ij2}^{2}, \tag{39}\]  
where \(S_{ij}\) is the skew-symmetric matrix corresponding to relative configuration \(R_{j}^{T}R_{i}\), which decomposes into \(S_{ij}=\theta_{ij1}S_{ij1}+\theta_{ij2}S_{ij2}\), while \(S_{ijk}^{2}=E_{ijk}E_{ijk}^{T}-I_{4}\), \(k=1,2\). The variation of Equation (39) is  
\[\delta((R_{j}^{T}R_{i})^{n})=n(R_{j}^{T}R_{i})^{n}\Sigma_{ij}=n(R_{j}^{T}R_{i} )^{n}(\Sigma_{i}-\Sigma_{j}) \tag{40}\]  
where the last equality results from differencing infinitesimal variations. Using Equation (40), the first variation of the Lyapunov function in Equation (33) becomes  
\[\delta V(R_{j}^{T}R_{i}) =-\frac{1}{2}\sum_{1\leq i<j\leq N}a_{ij}\sum_{n=1}^{q}b_{n}\, \text{tr}((R_{j}^{T}R_{i})^{n}(\Sigma_{i}-\Sigma_{j}))\] \[=\sum_{1\leq i<j\leq N}a_{ij}(\Sigma_{i}^{\vee}-\Sigma_{j}^{\vee })^{T}\psi(R_{j}^{T}R_{i}) \tag{41}\]  
and the second variation yields  
\[\delta^{2}V(R_{j}^{T}R_{i}) =-\frac{1}{2}\sum_{1\leq i<j\leq N}a_{ij}\sum_{n=1}^{q}nb_{n}\, \text{tr}((R_{j}^{T}R_{i})^{n}(\Sigma_{i}-\Sigma_{j})^{2})\] \[=\sum_{1\leq i<j\leq N}a_{ij}(\Sigma_{i}^{\vee}-\Sigma_{j}^{\vee })^{T}\Psi(R_{j}^{T}R_{i})(\Sigma_{i}^{\vee}-\Sigma_{j}^{\vee}) \tag{42}\]  
where the Hessian of the second variation is  
\[\Psi(R_{j}^{T}R_{i})=\sum_{n=1}^{q}nb_{n}H((R_{j}^{T}R_{i})^{n}). \tag{43}\]  
Consider the Base case, where \(q=1\) and \(b_{n}=1\) in Equations (33) and (37). Then, consider the stack column matrix \(\Sigma=((\Sigma_{1}^{\vee})^{T}\ (\Sigma_{2}^{\vee})^{T}\ \ldots\ (\Sigma_{n}^{\vee})^{T})^{T}\). Denote the configuration of the multi-agent system as \(\mathcal{R}=\{R_{1},R_{2},\ldots,R_{n}\}\) and rewrite \(\delta V=\sum_{i<j}a_{ij}(\Sigma_{i}^{\vee}-\Sigma_{j}^{\vee})^{T}h(R_{j}^{T} R_{i})\) as \(\delta V=\Sigma^{T}\gamma(\mathcal{R})\), \(\gamma_{i}(\mathcal{R})=\sum_{j=1}^{N}(\mathcal{B}^{*}\mathcal{W}_{h}^{*}( \mathcal{R}))_{ij}\) where \(\mathcal{B}^{*}=\mathcal{B}\otimes I_{6}\), and \(\mathcal{W}_{h}^{*}(\mathcal{R})=diag(\ldots h(R_{j}^{T}R_{i})\ldots)\) is the \(6n_{e}\times n_{e}\) augmented weight matrix. Thus, the critical points of Equation (33) and relative equilibria in the closed loop of Equation (38) are obtained from \(\gamma(R)=0\), while the classification of these points is obtained by rewriting \(\delta V^{2}(R_{j}^{T}R_{i})=\Sigma^{T}\Gamma(\mathcal{R})\Sigma/2\), where \(\Gamma(\mathcal{R})=\mathcal{B}^{*}\mathcal{W}_{h}^{*}(\mathcal{R})\mathcal{B }^{*T}\), and \(W_{H}^{*}(\mathcal{R})=diag(\ldots H(R_{j}^{T}R_{i})\ldots)\) is the \(6n_{e}\times 6n_{e}\) augmented weight matrix that determines the classification. In addition to relative configurations satisfying \((\theta_{ij1}\), \(\theta_{ij2})=(0,0)\), \((\pi,0),(0,\pi)\), or \((\pi,\pi)\), the third category of equilibria mentioned above may exist. The balanced configuration of an \(N\)-agent ring graph results in Morse critical points of \(\{\theta_{1},\theta_{2}\}\in\{\{0,2p_{2}\pi/N\},\{2p_{1}\pi/N,0\},\{2p_{1}\pi/ N,2p_{2}\pi/N\}\}\), where \(p_{1},p_{2}\in[1,\lfloor\frac{N}{2}\rfloor]\) are integers corresponding to balanced configurations. In the case of a ring graph or ring lattice, for instance, balanced equilibria (which may be stable or unstable) and unbalanced equilibria (always unstable) corresponding to rotations about the same plane(s) also exist. As in the single-agent case, the critical point classification and the stability of \(R_{j}^{T}R_{i}=I_{4}\) depend on the spectrum of \(H(I_{4})=2I_{6}\succ 0\); therefore, the consensus manifold is locally stable. The partial consensus manifold is unstable since \(H(\exp(\pi S_{ijk}))\), \(k=1\) or \(2\), is indefinite, while \(H(\exp(\pi S_{ij1}+\pi S_{ij2})\) is negative definite.