## 4 Simulation Experiment by MATLAB
### Multi-Formation Simulation  
The research objects are one navigation robot and four following robots. The angle between the motion direction of the navigation robot and the positive direction of the x-axis is \(\theta\). Its initial is 0. The initial coordinates are (0, 0). The initial coordinates of the other six following robots are set as (\(-\)3, \(-\)3), (2, 4), (\(8,-\)4), (\(-\)4, 2) respectively. The simulation results are shown in Figure 8. The x-axis and y-axis are the coordinate changes during the motion of each robot in Figure 8a. The orange solid line is the desired circular trajectory of the leader robot. The other pink, black, green and blue solid lines are the four motion trajectories following the robot. The horizontal axis and vertical axis respectively reflect the coordinate changes of each robot in the motion process. While maintaining the formation, the robot tracks the leader robot to make a circular motion. The curves of formation position error over time are shown in Figure 8b. The horizontal axis represents time. The vertical axis is the formation position error. The influence of algorithm control parameters on system convergence is discussed below. According to Equation (24), it is assumed that the robot formation position error is set as Equation (32). Then  
\[e^{f}= \begin{cases}\sqrt{(x_{ie}^{2}+y_{ie}^{2})}&x_{ie}>0\\ -\sqrt{(x_{ie}^{2}+y_{ie}^{2})}&x_{ie}<0\end{cases} . \tag{32}\]  
In Figure 8, Figure 8a,b describe the formation of each follower robot and the leader robot in the multi-robot system into two combined formations of triangle and column when the leader makes a circular motion. When \(t=0\) s, the error is large. As the robot gradually forms a formation, the error gradually decreases. Finally, when the leader robot forms a formation with four following robots, the error becomes zero, and the four following robots track the motion trajectory of the leader robot. The convergence time refers to the time required for the multiple robots to form the cooperative formation. The smaller the convergence time, the better the algorithm. The position error variation curves are shown in Figure 8b. In Figure 8b, it can be obtained that the formation error converges to zero when \(t=7\) s. To verify the applicability of the algorithm in this article for different numbers of odd and even robots in a multi-robot system, the six robots are employed as an example to form a formation, as shown in Figures 9 and 10. Figure 8: (**a**) Formation trajectory of each follower robot and leader robot; (**b**) Formation position error of each following robot and leader robot. Figure 9: (**a**) Trajectory of triangular formation by GCF; (**b**) Position error of triangular formation. The motion trajectories of six robots are shown in Figure 9a, when a triangular formation is formed. The x-axis and y-axis are the coordinate changes during the motion of each robot. The curves of formation position error over time are shown in Figures 9b and 10b. The horizontal axis represents time. The vertical axis is the formation position error. The variation diagram of the position error of a multi-robot system with time is shown in Figure 9b. The diagram shows that the final multi-robot system would converge when \(t=6\) s. The position error variation diagram is shown in Figure 10b. Based on Figure 10b, it can be concluded that the final multi-robot system would converge when \(t=4\) s.  
In order to illustrate the effectiveness of the group consistency control designed in this article, the comparison of the two with and without group strategy are performed. The robot trajectory diagram and the system error diagram are obtained by formation control without using the group strategy, as shown in Figure 11. The trajectory diagram and system error diagram of the robot are gained by applying the group strategy, as shown in Figure 12.  
The x-axis and y-axis are the coordinate changes during the motion of each robot in Figures 11a and 12a. The curves of formation position error over time are shown in Figures 11b and 12b.