# Affine Formation Maneuver Control for Multi-Agent Based on Optimal Flight System
## 4 Formation Control with Virtual Leader
### Proof of Main Results
Consequently, each agent is required not only to track the global trajectory but also to actively adjust its own local trajectory. Although the paper does not specifically analyze the impact of acceleration and turning rate as inputs, it is important to note that these two factors are influenced by the agents themselves. Therefore, assuming that the initial distance and interaction range between agents meet the required range, \(Z(0)<U_{r}\) and \(Z(0)<U_{0}\) can effectively avoid collisions within the agent swarm and ensure the overall stability of the system. The controller protocol (20) offers several advantages to a certain extent. Firstly, it integrates protocols for leaders/followers and virtual agents, enabling simultaneous operation. This distinguishes it from existing control protocols and enhances the adaptability and scalability of the system. Secondly, the local adjustment eliminates the need for additional feedback information interaction among leaders and followers, thereby greatly reducing communication consumption. Thirdly, based on the aforementioned local protocol, each UAV can be dynamically and randomly assigned as a leader in complex environments, ensuring continuity in the event that leaders are shot down or destroyed. Simulation and Analysis In this section, we proceed to conduct numerical simulations to illustrate the theoretical results and validate the effectiveness of the novel formation control algorithm. The whole experimental process is shown in Figure 6, and the algorithm in two-dimensional is described as follows:  
1. The randomly distributed generated agents denoted as \(\left\{\mathbf{p}\big{|}\mathbf{p}_{ij}\in\mathbb{R}^{d},\forall(i,j)\in\mathbb{R}\right\}\), \((i,j)\in(1,\ldots,n)\) are steered to rendezvous and make a swarm formation as the nominal configuration \(\mathbf{p}_{0}\in(\mathbf{P},r)\). The leaders are set and then time-varying velocity \(\mathbf{v}(t)\) (10) starts to change in this stage for all agents \(\mathbf{u}_{i}\) (20). 2. Desired geometric patterns \(A(r)\) are predefined and generated with desired trajectories and corresponding positions of the formation \(p^{*}(t)\) based on the knowledge of obstacle position and shape available. 3. A trajectory through all the barycenter of leaders of each predefined configuration; thus, this virtual agent motives with constant velocity \(X(v_{vl},\mathbf{p}_{vl})\) in a single-integrator differentiable. 4. Based on the available knowledge of obstacles, using constant interaction with other agents and obstacle constraints (20) to trigger local trajectory planning in Algorithm 1 (15) and (16). 5. The formation operated the (20) control law to adjust the trajectories of agents possibly entering collide zones of obstacles while changing the configuration of formation \(p(t)\to p^{*}(t)\), which can demonstrate the tracking ability of the algorithm (21). It is noted that only the leaders possess global information regarding the desired trajectory (\(u_{d}\)). The focus on the position error relative to the reference trajectory is solely on the leaders. Consequently, the control laws for the leaders are not explicitly designed in this paper. In order to evaluate the performance of our proposed methods, all the experiments are simulated on PC with MATLAB R2020a Windows 10. Protocol (20) is used to steer seven UAV agents moving in a two-dimensional space with five processes above through Algorithms 1 and 2. The number of agents \(N=7\), the sensing range \(d_{ract}=30\), desired distance from the virtual leader \(d_{0}=30\), obstacles radius \(obs_{rnd}=20\), maximum velocity \(v_{\max}=80\) m/s, max acceleration \(u_{\max}=2\) m/s\({}^{2}\), max velocity error \(e_{\max}=0.5\) m/s, max trajectory error \(e_{\max}=10\) m, the timestep \(d_{t}=0.1\) s. Other parameters were set as \(a=1.5\), \(b=2\), \(c=0.5\), \(\delta=0.6\), \(\omega_{ij}=1\). All the above parameters remained fixed throughout the simulation.