## 3 Control Algorithm Description
### Reference Trajectories Assignment Problem  
Since the number of satellites in the group is \(N\), there are \(N!\) possible ways to assign to each satellite the reference trajectory according to its position in the pixel image formed by the satellites. Suppose that initial satellite positions in the LVLH reference frame are represented by vectors \(\mathbf{r}_{i}(t_{0}),\ i=1\ldots N\), and the corresponding state vectors in curvilinear coordinates are expressed by \(\mathbf{x}_{ij}(t_{0})\). The trajectory assignment is performed to minimize the deviation of the initial state vector from the state vector \(\mathbf{x}_{ij}^{des}(t_{0})\) corresponding to the possible reference trajectory. First, a satellite closest to the center of the formation at the time \(t_{0}\) is chosen. The selection is performed according to the solution of the following optimization problem:  
\[s=\text{argmin}_{i}\Bigg{|}\mathbf{r}_{i}(t_{0})-\sum_{i=1}^{N}\mathbf{r}_{i}( t_{0})/N\Bigg{|}. \tag{24}\]  
The \(s\)-th satellite is to be assigned to the \(p\)-th reference trajectory, which is selected as the center of image rotation. The \(p\)-th satellite position is the nearest point to the image center according to the following:  
\[p=\text{argmin}_{i}\Bigg{|}\mathbf{r}_{1i}^{\text{des}}-\sum_{j=2}^{M}\mathbf{ r}_{1j}^{\text{des}}/M\Bigg{|}, \tag{25}\]  
where \(\mathbf{r}_{1i}^{\text{des}}\) is the radius-vector of the reference trajectories relative to the first satellite (which is chosen for unambiguity), \(M=N-1\). Next, consider the relative state vectors for all satellites \(\mathbf{x}_{ji}(t_{0}),\ i=1\ldots N\) (\(\mathbf{x}_{ss}(t_{0})=0\)) and state vectors according to the reference trajectories \(\mathbf{x}_{pj}^{\text{des}}(t_{0}),\ j=1\ldots N\) (taking into account that \(\mathbf{x}_{pp}^{\text{des}}(t_{0})=0\)). The following cost function is proposed for each pair of \(i\)-th satellite and \(j\)-th reference trajectory:  
\[\mathbf{\Delta}_{ij}=\sqrt{\Big{(}\mathbf{x}_{pj}^{\text{des}}(t_{0})-\mathbf{ x}_{si}(t_{0})\Big{)}^{\text{T}}\tilde{\mathbf{Q}}\Big{(}\mathbf{x}_{pj}^{ \text{des}}(t_{0})-\mathbf{x}_{si}(t_{0})\Big{)}}, \tag{26}\]  
where \(\tilde{\mathbf{Q}}\) is a positive definite matrix. The satellite assignment problem then can be formulated as the following optimization problem:  
\[j(i)=\text{argmin}_{j(i)}\sum_{i=1}^{N}\mathbf{\Delta}_{ij(i)}. \tag{27}\]  
This problem can be reformulated as a linear programming problem as follows. Consider a matrix \(\mathbf{X}\) whose elements can be equal to 0 or 1, and there is only one \"1\" in every line and column. This \"1\" in the \(i\)-th line and \(j\)-th column means that \(i\)-th satellite is assigned to the \(j\)-th reference trajectory. Then, the matrix \(\mathbf{X}\) can be transformed into the vector \(\tilde{\mathbf{x}}\) according to:  
\[\tilde{\mathbf{x}}=[\mathbf{X}_{11},\ldots,\mathbf{X}_{1N},\mathbf{X}_{21}, \ldots,\mathbf{X}_{2N},\ldots]_{N^{2}}^{\text{T}}\]The assignment problem (27) is equivalent to the following linear programming problem with two constraints:  
\[\vec{\mathbf{x}}=\operatorname*{argmin}_{\vec{\mathbf{x}}}\left(\mathbf{c}^{ \mathsf{T}}\vec{\mathbf{x}}\right),\ \ \vec{\mathbf{A}}\vec{\mathbf{x}}=\mathbf{b},\ \ \mathbf{e_{1}}\leq\vec{\mathbf{x}}\leq\mathbf{e_{2}}, \tag{28}\]  
where  
\[\mathbf{c}=[\Delta_{11},\dots,\Delta_{1\text{N}},\Delta_{21}, \dots,\Delta_{2\text{N}},\dots]_{N^{2}}^{\mathsf{T}},\mathbf{b}=[1\dots 1]_{2N^{2}}^{ \mathsf{T}},\ \mathbf{e_{1}}=[0\dots 0]_{N^{2}}^{\mathsf{T}},\ \mathbf{e_{2}}=[1\dots 1]_{N^{2}}^{ \mathsf{T}},\] \[\vec{\mathbf{A}}=\left( \begin{array}{cccccccccccccccc}1&1& \dots&1&0&0&\dots&0&\dots&0&0&\dots&0\\ 0&0&\dots&0&1&1&\dots&1&\dots&0&0&\dots&0\\ \dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots&\dots \\ 0&0&\dots&0&0&0&\dots&0&\dots&1&1&\dots&1\\ 1&0&\dots&0&1&0&\dots&0&\dots&1&0&\dots&0\\ 0&1&\dots&0&0&1&\dots&0&\dots&0&1&\dots&0\\ 0&0&\ddots&0&0&0&\ddots&0&\dots&0&0&\ddots&0\\ 0&0&\dots&1&0&0&\dots&1&\dots&0&0&\dots&1\end{array}