# Flocking of Multi-Agent System with Nonlinear Dynamics via Distributed Event-Triggered Control
## 4 Simulations  
In this section, numerical examples are given to validate the effectiveness of the theoretical results. Consider a group of 4 mobile robots [38] moving in 3-dimensional space, the dynamics of each robot is expressed in (1), where the nonlinear dynamic function \(f\left(v_{i}^{x},v_{i}^{y},v_{i}^{z},t\right)\) satisfies the Lorenz equation  
\[\left( \begin{array}{c}\dot{v}_{i}^{x}\\ \dot{v}_{i}^{y}\\ \dot{v}_{i}^{z}\end{array} \right)=0.01*\left( \begin{array}{c}10\left(v_{i} ^{y}-v_{i}^{x}\right)\\ 28v_{i}^{x}-v_{i}^{x}v_{i}^{z}-v_{i}^{y}\\ v_{i}^{x}v_{i}^{y}-\frac{8}{3}v_{i}^{z}\end{array} \right),\]  
where \(v_{i}^{x},v_{i}^{y}\) and \(v_{i}^{z}\) are the \(x\) axis, \(y\) axis, and \(z\) axis velocity component of agent \(i\). The initial position and velocity of each agent is chosen randomly from the box \([-15,15]\times[-15,15]\times[-15,15]\) and \([-10,10]\times[-10,10]\times[-10,10]\), respectively. For each agent, the radius of the Dead zone (Collisionregion) is chosen as \(r_{0}=1\), the radius of Controlled zone (Separation, Alignment, Attraction Region) is chosen as \(r=15\), which is the communication radius of each agent. If \(\left\|x_{ij}\right\|>15\), the connection between two agents will be lost. Besides, the following parameters remain fixed throughout all simulations: \(\tau=1,\underline{d}=5,\bar{d}=8\) and \(\theta=\theta^{\prime}=0.9\). The action function \(\phi(\cdot)\) is designed as  
\[\phi(\left\|x_{ij}\right\|)=\left\{ \begin{array}{ll}6(\left\|x_{ij}\right\|- 5)e^{\frac{(\left\|x_{ij}\right\|-5)^{2}}{3}},&\left\|x_{ij}\right\|\in(1,5) \\ 4(\left\|x_{ij}\right\|-8)e^{\frac{(\left\|x_{ij}\right\|-8)^{2}}{8}},&\left\| x_{ij}\right\|\in(8,15]\\ 0,&\text{otherwise.}\end{array} \right.\]  
For the flocking, the initial algebraic connectivity \(\lambda_{2}(L(0))=1\). Choosing \(\rho=0.5\), constants \(a_{1}=1,a_{2}=0.5\), the control gain \(c=4\) such that \(c>(2\rho+(a_{1}+ca_{2})/2)\left/\lambda_{2}(L(0))\right.\)  
The simulation results for flocking of MAS applying algorithm (6) are shown in Figures 3 and 4. Figure 3a shows the initial states of the agents, where the solid lines represent the links between agents, \(x_{i1},x_{i2}\) and \(x_{i3}\) are the position component of agent \(i\) and the red solid lines with arrow represent the direction of velocity. Figure 3b presents the configuration and velocities of the group of agents at \(t=50\) s. It can be seen that the communication network is fully connected, which means any agent can communicate with the others. Also, the velocities of 4 agents are almost same at \(t=50\) s. Figure 3c depicts the motion trajectories of all agents from \(t=0\) s to \(t=50\) s. Here, it must be stated that by observing the moving trajectories of all agents from different angle of view, we found no collision occurs during the whole process. Besides, the algebraic connectivity of the system is always positive, which implies that the network is connected during the whole process. Figure 3d shows the convergence of velocity, from which we can see that all the agents eventually achieve the same velocity. However, it can be seen from the subfigure that there are some vibrations during the convergence process of velocity, for example, at about \(t=35.5\) s. It is caused by new edges being added into the network. From Figure 3b-d, it is observed that the free flocking motion is achieved asymptotically with our ETC algorithm (6). Also, \(\forall t\geq 0\), the communication \(\mathcal{G}(t)\) is connected and no collisions occur along the motion of agents. Thus, the results of Theorem 1 is illustrated by these numerical examples. In Figure 4, the controller update time instants of each agent for the first \(5\)s are marked with \(*\). It can be observed that the controller update times are heterogeneous for the 4 agents, which implies that the controller is actuated asynchronously. Seemingly, the agent 4 has less controller times compared with the other 3 agents.