Skip to main content

Stability analysis of swarming model with time delays


A swarming model is a model that describes the behavior of the social aggregation of a large group of animals or the community of humans. In this work, the swarming model that includes the short-range repulsion and long-range attraction with the presence of time delay is investigated. Moreover, the convergence to a consensus representing dispersion and cohesion properties is proved by using the Lyapunov functional approach. Finally, numerical results are provided to demonstrate the effect of time delay on the motion of the group of agents.


The study of the behavior of interacting agents in groups of animals has gained increasing interest in various fields such as biology, engineering, mathematics (see [2, 8, 12, 15, 20]). One fascinating feature of such systems is the collective behavior described as formation patterns and can be found in many natural systems such as flocks of birds, schools of fish, chemical compounds, crowd dynamics. From the biological point of view, pattern motion is the consequence of two natural behaviors. On the one hand, agents desire to communicate and stay close to the group. On the other hand, when they stay too close, they try to keep a distance to avoid collision with other agents. Hence, for understanding these behaviors, it is indispensable to take biological phenomena into account. The research on mathematical modeling and simulation of these systems is of increasing interest, starting with the works of Reynolds [19]. Reynolds’s model, called the three-zone model, is the first principle model of swarming consisting of three fundamental characteristics of collective motion: cohesion, separation, and alignment rules. Further, this model has been extensively improved by adding many different effects and analyzed for different types of animals. For more details, see, e.g., [1, 3, 4, 10, 11, 14, 16]. In connection with these swarming models, it is essential to mention that the continuous models are developed through partial differential equations (PDEs) that describes the evolution of the particles’ density in the systems composed of a large number of interacting agents such as cell, molecular organism, or chemo-taxis with high drift effect; see [13, 21].

In the present day, despite a large number of works devoted to studying the stability of the swarm, it is still of paramount interest how agents form the pattern configuration when they are faced with situations where a converging stable state cannot be ensured, especially in the presence of communication with time delay which is a result of traffic congestion or finite speeds of transmission and spread. The stability of swarming concerning time delays is investigated in various models. Firstly, a well-known model is the Cucker–Smale flocking model, which describes agent’s motion based on its neighbor agents’ positions and velocities. The emergence of the flocking model described by the Cucker–Smale (CS) model with time delay was primarily investigated in [5, 6, 9, 17, 18]. In this model, time delays are included in the dynamic of velocities of agents. Besides, the model has been continuously extended by numerous researchers; for example, in [22] the authors consider the CS model by including a time delay in the communication function and velocities of agents, and the authors of [6] study the emergence of flocking where the interaction of agents is based on the CS communication function with a time delay and an attraction–repulsion force.

The contribution to this research effort is investigating the swarming model in which the interaction mechanism consists of attraction and repulsion functions which contain time delays. In particular, the first- and second-order models are studied. In the first-order model, time-delays are included in the agents’ position, while in the second-order model, agents adapt their velocity relative to other agents’ velocities with communication delay. Furthermore, based on these two models, the emergence of the swarm into the pattern formation is theoretically and numerically investigated. The stability of the swarm is related to parameters of the attraction and repulsion functions.

This work is organized as follows. In the next section, the first- and second-order swarm models with time-delay in the communication function are discussed. Additionally, in the first-order model, the stability of the swarm is analyzed and supplemented with two numerical test cases. In the second-order model, the dispersion and disagreement of the swarms that describe converging to pattern configuration are theoretically and numerically investigated. A conclusion in the last section completes the exposition of this work.

Swarm model and stability of swarm aggregation

In this section, we discuss the swarm model based on an agent-based model in an n-dimensional Euclidean space proposed in [7] where the attraction–repulsion function includes a time delay. The evolution of swarming for the first- and second-order models is discussed, and then for both models, its stability properties are theoretically and numerically investigated.

The first-order model

We consider the motion of N interacting individuals where their motion depends only on the position of an individual itself and its observation of other individuals’ positions. The equation of motion of the ith agent is given by

$$ \dot{x}_{i}(t)=-\frac{1}{N}\sum _{j\neq i}^{N}\nabla _{x_{i}}U\bigl( \bigl\Vert x_{i}(t)-x_{j}(t) \bigr\Vert \bigr),\quad i=1,\dots ,N, $$

where \(x_{i}(t) \in \mathbb {R}^{d}\) represents the position of the ith agent and \(\nabla _{x_{i}}U(\|x_{i}(t)-x_{j}(t)\|)\) denotes the gradient of U with respect to \(x_{i}\). Here \(\|x_{i}(t)-x_{j}(t)\|\) is the Euclidean distance between the ith and jth agents. The function \(U:(\mathbb{R}^{d})^{N}\rightarrow \mathbb{R}\) represents the Morse potential function, which contains attractive and repulsive parts. The Morse potential has the following form:

$$ U(r)=C_{r}e^{-\frac{r}{l_{r}}}-C_{a}e^{-\frac{r}{l_{a}}}, $$

where \(C_{r}e^{-\frac{r}{l_{r}}}\) and \(C_{a}e^{-\frac{r}{l_{a}}}\) model short-range repulsion and long-range attraction, respectively. Parameters \(C_{r}\), \(C_{a}\) represent repulsive and attractive strengths, respectively, whereas \(l_{r}\), \(l_{a}\) are repulsive and attractive length scales. The derivative of the Morse potential is expressed as follows:

$$ \frac{\partial }{\partial x_{i}}U\bigl( \bigl\Vert x_{i}(t)-x_{j}(t) \bigr\Vert \bigr)= \frac{x_{i}(t)-x_{j}(t)}{ \Vert x_{i}(t)-x_{j}(t) \Vert } \biggl( \frac{C_{a}}{l_{a}}e^{-\frac{ \Vert x_{i}(t)-x_{j}(t) \Vert }{l_{a}}}- \frac{C_{r}}{l_{r}}e^{-\frac{ \Vert x_{i}(t)-x_{j}(t) \Vert }{l_{r}}} \biggr). $$

Next, we discuss the swarming system described in (1) with the effect of time-delays on repulsion and attraction. In this system, the time delay is a positive constant and is denoted as τ. Time delays model the situation that agents receive information from other members in the group after a certain time delay. As a consequence, each agent needs time to elaborate its reaction to other agents in the group. The swarming system (1) including the effect of time delay is presented as follows:

$$ \dot{x}_{i}(t)=-\frac{1}{N}\sum _{j\neq i}^{N}\nabla _{x_{i}}U\bigl( \bigl\Vert x_{i}(t)-x_{j}(t- \tau ) \bigr\Vert \bigr),\quad i=1,\dots ,N. $$

For simplicity, we define

$$ r_{ij}(t,\tau )= \bigl\Vert x_{i}(t)-x_{j}(t- \tau ) \bigr\Vert , $$

and rewrite the derivative with respect to \(r_{ij}\) as

$$ U'(r_{ij})=\frac{C_{a}}{l_{a}}e^{-\frac{r_{ij}}{l_{a}}}- \frac{C_{r}}{l_{r}}e^{-\frac{r_{ij}}{l_{r}}}. $$

Therefore, the swarming system with time delay becomes

$$\begin{aligned} \dot{x}_{i}(t) =&-\frac{1}{N}\sum _{j\neq i}^{N}\nabla _{x_{i}}U(r_{ij}) \\ =&-\frac{1}{N}\sum_{j\neq i}^{N} \biggl( \frac{x_{i}(t)-x_{j}(t-\tau )}{r_{ij}} \biggr)U'(r_{ij}), \end{aligned}$$

for \(i=1,\dots ,N\), with given initial data

$$ x_{i}(s)=x_{i}^{0}(s) ,\quad \text{for } s\in [-\tau ,0]. $$

In the following, we consider numerical simulations with the swarming system in the one-dimensional case, \(d=1\), in two test cases: a system without time delay (\(\tau = 0\)) and a system with time delay \(\tau =3\). In both experiments, we consider three agents where the initial positions of agents are distributed randomly in \([-1, 1]\) and the parameters related to the model are \(C_{a} = 5\), \(C_{r} = 3\), \(l_{a}= 4 \), and \(l_{r} = 1\). The results of numerical experiments are shown in Fig. 1. It can be seen in Figs. 1(a) and 1(b) that, due to the effect of the time delay, agents’ motion fluctuates during the early time; however, after a certain time, they start self-organizing and then become stationary.

Figure 1
figure 1

Simulation of the swarming model with three agents. Panel (a) presents the position of agents where the communication function has no time-delay effect, while panel (b) shows agents’ position where the interaction between agents exhibits the time-delay effect

Stability analysis for the first-order model

In this subsection, theoretical results concerning the formation pattern of the swarm are investigated. We begin by introducing a free agent, a swarm member who does not have any neighbors in its repulsive range.

Definition 1

An agent i is called a “free agent” with respect to time delay if \(r_{ij}(t, \tau )>\delta \), \(\forall j=1, \dots , N\), \(j\neq i\), and δ is a repulsive range such that \(U'(r_{ij})>0\).

Theorem 1

Let \(R(s)=\sup_{i}\{\|x_{i}(s)\|\}\), for \(i=1, \ldots , N\) and \(s\in [t-\tau ,t]\), be the swarming radius. If all members of the swarm are free agents with respect to some time delay, then their motion is towards the center.


Without loss of generality, we choose \(R=\|x_{1}\|\). Consider

$$\begin{aligned} \frac{d}{dt} \biggl(\frac{1}{2} \bigl\Vert x_{1}(t) \bigr\Vert ^{2} \biggr) =&\bigl\langle x_{1}(t), \dot{x}_{1}(t)\bigr\rangle \\ =& \Biggl\langle x_{1}(t),-\frac{1}{N}\sum _{j\neq 1}^{N} \biggl( \frac{x_{1}(t)-x_{j}(t-\tau )}{r_{1j}} \biggr)U'(r_{1j}) \Biggr\rangle \\ =&\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{\langle x_{1}(t),x_{j}(t-\tau )\rangle - \Vert x_{1}(t) \Vert ^{2}}{r_{1j}} \biggr)U'(r_{1j}), \end{aligned}$$

where \(\lVert \cdot \rVert \) and \(\langle \cdot , \cdot \rangle \) denote the Euclidean norm and inner product, respectively. Since the first agent is free,

$$ \bigl\Vert x_{1}(t)-x_{j}(t-\tau ) \bigr\Vert > \delta ,\quad \forall j=2, \ldots , N, \quad\text{and}\quad U' \bigl( \bigl\Vert x_{1}(t)-x_{j}(t-\tau ) \bigr\Vert \bigr)=U'(r_{1j}) > 0. $$

As a consequence, \(\langle x_{1}(t),x_{j}(t-\tau )\rangle -\|x_{1}(t)\|^{2}\leq 0\). It follows that \(\frac{d}{dt} (\frac{1}{2}\|x_{1}(t)\|^{2} )\leq 0\).

Therefore R is a decreasing function, that is, all agents move towards the center. □

In the following theorem, the stability of swarming corresponding to dispersion and cohesion properties are investigated. These properties are related to attraction and repulsion parameters (\(C_{a}\), \(C_{r}\), \(l_{a}\), \(l_{r}\)) in Morse potential function. We denote \(C=C_{r}/C_{a}\) and \(l=l_{r}/l_{a} \).

Theorem 2

(Dispersion and cohesion under Morse potential)

  1. 1.

    For \(C\geq l>0\), the swarming radius becomes unbounded as \(t\rightarrow \infty \).

  2. 2.

    For \(l\leq \min \{1,C\}\), the swarming radius is bounded.


Without loss of generality, we choose the swarming radius \(R=\|x_{1}\|\). We consider

$$\begin{aligned} \frac{d}{dt} \biggl(\frac{1}{2} \bigl\Vert x_{1}(t) \bigr\Vert ^{2} \biggr) =& \Biggl\langle x_{1}(t),-\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{x_{1}(t)-x_{j}(t-\tau )}{r_{1j}} \biggr)U'(r_{1j}) \Biggr\rangle \\ =&-\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{ \Vert x_{1}(t) \Vert ^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \biggr) \biggl(\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}}- \frac{C_{r}}{l_{r}}e^{-\frac{r_{1j}}{l_{r}}} \biggr) \\ =&\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{ \Vert x_{1}(t) \Vert ^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \biggr) \biggl(\frac{C_{r}}{l_{r}}e^{-\frac{r_{1j}}{l_{r}}}- \frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggr) \\ =&\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{ \Vert x_{1}(t) \Vert ^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \biggr) \biggl[e^{-\frac{r_{1j}}{l_{a}}} \biggl( \frac{C_{r}}{l_{r}}e^{r_{1j}( \frac{1}{l_{a}}-\frac{1}{l_{r}})}-\frac{C_{a}}{l_{a}} \biggr) \biggr] \\ =&\frac{1}{N}\sum_{j\neq 1}^{N} \biggl( \frac{ \Vert x_{1}(t) \Vert ^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \biggr) \biggl[\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl( \frac{C}{l}e^{r_{1j}(\frac{l-1}{l_{r}})}-1 \biggr) \biggr]. \end{aligned}$$

Since \(R=\|x_{1}\|\), it follows that \(\|x_{1}(t)\|^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle \geq 0\). For \(C\geq l>1\),

$$ \frac{C}{l}e^{r_{1j}(\frac{l-1}{l_{r}})}-1 >0. $$

This yields that \(\frac{d}{dt} (\frac{1}{2}\|x_{1}(t)\|^{2} )\geq 0\). Therefore, the swarming radius becomes unbounded as \(t\rightarrow \infty \).

Further, we prove the second statement when \(l\leq \min \{1,C\}\). From

$$ \frac{d}{dt} \biggl(\frac{1}{2} \bigl\Vert x_{1}(t) \bigr\Vert ^{2} \biggr)= \frac{1}{N} \sum_{j\neq 1}^{N} \biggl( \frac{ \Vert x_{1}(t) \Vert ^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \biggr) \biggl[\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl( \frac{C}{l}e^{r_{1j}(\frac{l-1}{l_{r}})}-1\biggr) \biggr], $$

we know that \(\frac{\|x_{1}(t)\|^{2}-\langle x_{1}(t),x_{j}(t-\tau )\rangle }{r_{1j}} \geq 0\). Let us consider three cases.

Case I: If \(r_{1j}=\frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then

$$\begin{aligned} \frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{r_{1j}( \frac{l-1}{l_{r}})}-1 \biggr) =&\frac{C_{a}}{l_{a}}e^{- \frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{(\frac{l_{r}}{1-l})( \frac{l-1}{l_{r}})\ln (\frac{C}{l})}-1 \biggr) \\ =&\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{(-1) \ln (\frac{C}{l})}-1 \biggr) \\ =&\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l} \biggl( \frac{C}{l} \biggr)^{-1}-1 \biggr)=0. \end{aligned}$$

We get that \(\frac{d}{dt} (\frac{1}{2}\|x_{1}(t)\|^{2} )=0\). Therefore, the swarming radius is norm-preserving.

Case II: If \(r_{1j}=\frac{l_{r}}{1-l}\ln (\frac{2C}{l} )> \frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then

$$\begin{aligned} \frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{r_{1j}( \frac{l-1}{l_{r}})}-1 \biggr) =&\frac{C_{a}}{l_{a}}e^{- \frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{(\frac{l_{r}}{1-l})( \frac{l-1}{l_{r}})\ln (\frac{2C}{l})}-1 \biggr) \\ =&\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{(-1) \ln (\frac{2C}{l})}-1 \biggr) \\ =&\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l} \biggl( \frac{2C}{l} \biggr)^{-1}-1 \biggr) \\ =&\frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(-\frac{1}{2} \biggr)< 0. \end{aligned}$$

It follows that \(\frac{d}{dt} (\frac{1}{2}\|x_{1}(t)\|^{2} )<0\). Therefore, the swarming radius is decreased.

Case III: If \(r_{1j}=\frac{l_{r}}{1-l}\ln (\frac{C}{2l} ) < \frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then

$$\begin{aligned} \frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{r_{1j}( \frac{l-1}{l_{r}})}-1 \biggr) =& \frac{C_{a}}{l_{a}}e^{- \frac{r_{1j}}{l_{a}}} \biggl(\frac{C}{l}e^{(\frac{l_{r}}{1-l})( \frac{l-1}{l_{r}})\ln (\frac{C}{2l})}-1 \biggr) \\ =& \frac{C_{a}}{l_{a}}e^{-\frac{r_{1j}}{l_{a}}}>0, \end{aligned}$$

that is, \(\frac{d}{dt} (\frac{1}{2}\|x_{1}(t)\|^{2} ) >0\). Hence, the swarming radius is increased. □

From the three cases discussed above, it can be concluded that if the distance between the first agent who has maximum swarming radius and the jth agent is equal to \(r_{1j}=\frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then the swarming radius is bounded. On the other hand, if \(r_{1j}\) is greater than \(\frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then the swarming radius is decreased to zero. While, if the distance between the first and jth agent is less than \(\frac{l_{r}}{1-l}\ln (\frac{C}{l} )\), then swarming radius is increased. It shows that agents get far away from the center.

We present results of experiments to numerically verify Theorem 2.

It can be seen from Fig. 2 that for \(C\geq l>1\), when \(t\rightarrow \infty \), each agent moves far away from the origin, whereas Fig. 3 illustrates that for \(l\leq \min \{1,C\}\) the swarming radius is bounded.

Figure 2
figure 2

Trajectories of solutions to swarming system with time delay (\(\tau =5\)) in time \(t\in [0,50]\) for \(N=5\) where parameters are \(C_{a}=1\), \(l_{a}=2\), \(C_{r}=4\), and \(l_{r} =3\)

Figure 3
figure 3

Simulation of the swarming system with time delay (\(\tau = 5\)) for \(N=5\) in time \(t\in [0,50]\) where parameters are given as \(C_{a}=1\), \(l_{a}=2\), \(C_{r}=4\), and \(l_{r} =1\)

The second-order model

In this section, we focus on the swarming model which includes rules for orientation. In particular, this model contains a mechanism of self-propulsion in which each agent moves with constant speed and adopts the average direction among its neighbors. The second-order model is given by the following equations:

$$\begin{aligned}& \dot{x}_{i}(t) = v_{i}(t), \\& \dot{v}_{i}(t) = \bigl(\alpha -\beta \bigl\Vert v_{i}(t) \bigr\Vert ^{2}\bigr)v_{i}(t)- \frac{1}{N}\sum_{j\neq i}^{N}\nabla _{x_{i}}U\bigl( \bigl\Vert x_{i}(t)-x_{j}(t- \tau ) \bigr\Vert \bigr),\quad i=1,\dots ,N, \end{aligned}$$

where \(x_{i} ,v_{i} \in \mathbb{R}^{d}\) are position and velocity of the ith agent, respectively. The term \((\alpha -\beta \|v_{i}(t)\|^{2})v_{i}(t)\) models self-propulsion and friction forces where parameters \(\alpha >0\) and \(\beta >0\) represent self-propulsion and friction, respectively. The second term is the Morse potential function including interaction with a time delay.

In the following, we theoretically and numerically study the stability of the swarm described as converging to the pattern configuration. For investigation of pattern properties, we calculate dispersion \(X(t)\) and disagreement \(V(t)\) proposed in [17].

Definition 2

Let \(\mathbf {x}(t) =(x_{1}(t), \ldots , x_{N}(t))\) and \(\mathbf {v}(t)=(v_{1}(t), \dots , v_{N}(t))\) be the solution of the swarming model (7). We define dispersion and disagreement as

$$ X(t):=\max_{i,j} \bigl\Vert x_{i}(t)-x_{j}(t) \bigr\Vert \quad\text{and}\quad V(t):= \max_{i,j} \bigl\Vert v_{i}(t)-v_{j}(t) \bigr\Vert , $$

for \(i, j=1, \ldots , N\). We say that the solution \((\mathbf {x}(t), \mathbf {v}(t))\) tends to consensus if

$$ \sup_{t>0}X(t)< +\infty \quad\text{and}\quad \lim _{t \rightarrow +\infty }V(t)=0. $$

Proposition 1

Let \((\mathbf {x}(t), \mathbf {v}(t))\) be the solution of system (7). If the solution \((\mathbf {x}(t), \mathbf {v}(t))\) converges to consensus, then

$$ \lim_{t\rightarrow \infty } \frac{1}{N}\bigl\lVert x_{i}(t)-x_{j}(t- \tau )\bigr\rVert = \frac{\l _{r}}{1-l}\ln \biggl(\frac{C}{l} \biggr) \quad\textit{and}\quad \lim_{t\rightarrow \infty } \frac{1}{N} \bigl\lVert v_{i}(t)\bigr\rVert = \sqrt{\frac{\alpha }{\beta }}. $$


From the dynamical system (7), we consider \(\dot{v_{i}}(t)=0\), for \(i=1, \ldots , N\), that is,

$$ \bigl(\alpha -\beta \bigl\Vert v_{i}(t) \bigr\Vert ^{2}\bigr)v_{i}(t) =0 \quad\text{and}\quad \frac{1}{N}\sum_{j\neq i}^{N}\nabla _{x_{i}}U\bigl( \bigl\Vert x_{i}(t)-x_{j}(t- \tau ) \bigr\Vert \bigr) =0. $$

We consider \((\alpha -\beta \|v_{i}(t)\|^{2})v_{i}(t) =0 \) and assume that \(v_{i}(t) \neq 0\). Then it yields

$$\begin{aligned}& \alpha -\beta \bigl\Vert v_{i}(t) \bigr\Vert ^{2} = 0, \\& \bigl\lVert v_{i}(t) \bigr\rVert = \sqrt{\frac{\alpha }{\beta }}. \end{aligned}$$

Next, consider \(\frac{1}{N}\sum_{j\neq i}^{N}\nabla _{x_{i}}U(\|x_{i}(t)-x_{j}(t- \tau )\|) =0\), which can be written as

$$\begin{aligned} -\frac{1}{N}\sum_{j\neq i}^{N} \biggl( \frac{x_{i}(t)-x_{j}(t-\tau )}{r_{ij}} \biggr) \biggl( \frac{C_{a}}{l_{a}}e^{-\frac{r_{ij}}{l_{a}}}- \frac{C_{r}}{l_{r}}e^{- \frac{r_{ij}}{l_{r}}} \biggr) =&0. \end{aligned}$$

Since \((\frac{x_{i}(t)-x_{j}(t-\tau )}{r_{ij}} ) \neq 0\), we have \((\frac{C_{a}}{l_{a}}e^{-\frac{r_{ij}}{l_{a}}}- \frac{C_{r}}{l_{r}}e^{-\frac{r_{ij}}{l_{r}}} ) =0 \).

Consequently, \(r_{ij} = \lVert x_{i}(t)-x_{j}(t-\tau )\rVert = \frac{l_{r}}{1-l} \ln (\frac{C}{l})\). It can be concluded that when the system (7) tends to consensus, the velocity of each agent converges to value \(\sqrt{\frac{\alpha }{\beta }}\) and

$$ \lim_{t\rightarrow \infty } \frac{1}{N}\bigl\lVert x_{i}(t)-x_{j}(t- \tau )\bigr\rVert = \frac{\l _{r}}{1-l}\ln \biggl(\frac{C}{l} \biggr). $$


In the sequel, we present results of numerical experiments to validate some aspects of theoretical findings and demonstrate the stability of swarms in two dimensions. For this purpose, we consider the following four test-cases:

Case I: \(C_{a}>C_{r}\) and \(l_{a}>l_{r}\) (see Figs. 46).

Figure 4
figure 4

Simulation of the second-order swarming model with time delay (\(\tau =5\)) for five agents, \(N=10 \) in time \(t\in [0,1000]\). The corresponding parameters are given as \(\alpha =0.7\), \(\beta =0.5\), \(C_{a}=5\), \(l_{a}=100\), \(C_{r}=1 \), and \(l_{r}=1\). The position of each agent is depicted by a circle and the velocity is represented by a vector at agent’s position

In Case I, attraction parameters are stronger than those of repulsion. Hence, agents get closer to each other. As a consequence, the swarm is formed as a tight cluster, as showed in Fig. 4. In addition, it can be seen from Fig. 5 that \(X(t)\) and \(V(t)\) are periodical in amplitude and bounded by some value.

Figure 5
figure 5

Dispersion and disagreement of Case I for \(t\in [0,1000]\)

Figure 6
figure 6

The average distance between agents and the velocity of agents for Case I and \(t\in [0,1000]\). Panel (a) shows the comparison of the average distance between agents with the value \(\frac{l_{r}}{1-l}\ln (\frac{C}{l})\). Panel (b) shows the average velocity of agents compared with the value \(\sqrt{\frac{\alpha }{\beta }}\)

Case II: \(C_{a}>C_{r}\) and \(l_{a}< l_{r}\) (see Figs. 79).

Figure 7
figure 7

Simulation of the second-order swarming model with time delay (\(\tau =5\)) for five agents, \(N=10 \), and time \(t\in [0,100]\). The corresponding parameters are given as \(\alpha =0.7\), \(\beta =0.5\), \(C_{a}=5\), \(l_{a}=1\), \(C_{r}=1 \), and \(l_{r}=100\). The position of each agent is depicted by a circle and the velocity is represented by a vector at agent’s position

Case III: \(C_{a}< C_{r}\) and \(l_{a}< l_{r} \) (see Figs. 1012).

In Cases II and III, the repulsive length has a greater magnitude than the attractive one. It means that agents are repelled from others. It follows that the pattern configuration would not be formed, as shown in Figs. 8 and 11.

Figure 8
figure 8

Dispersion and disagreement of Case II for \(t\in [0,100]\)

Figure 9
figure 9

The average distance between agents and the average velocity of agents of Case II for \(t\in [0,100]\)

Figure 10
figure 10

Simulation of the second-order swarming model with time delay (\(\tau =5\)) for five agents, \(N=10 \), and time \(t\in [0,100]\). The corresponding parameters are given as \(\alpha =0.7\), \(\beta =0.5\), \(C_{a}=1\), \(l_{a}=1\), \(C_{r}=5 \), and \(l_{r}=100\). The position of each agent is depicted by a circle and the velocity is represented by a vector at agent’s position

Figure 11
figure 11

Dispersion and disagreement of Case III for \(t\in [0,100]\)

Figure 12
figure 12

The average distance between agents and average velocity of agents of Case II for \(t\in [0,100]\)

Case IV: \(C_{a}< C_{r}\) and \(l_{a}>l_{r}\) (see Figs. 1315).

Figure 13
figure 13

Simulation of the second-order swarming model with time delay (\(\tau =5\)) for five agents, \(N=10 \), and time \(t\in [0,1000]\). The corresponding parameters are given as \(\alpha =0.7\), \(\beta =0.5\), \(C_{a}=1\), \(l_{a}=100\), \(C_{r}=2 \), and \(l_{r}=1\). The position of each agent is depicted by a circle and the velocity is represented by a vector at agent’s position

It can be seen from Figs. 14 and 15 that, when \(t\rightarrow \infty \), \(X(t)\) becomes constant and \(V(t)\) tends to zero. This means that the swarm converges to an asymptotic state. Pattern configuration is formed and each agent moves with the same velocity.

Figure 14
figure 14

Dispersion and disagreement of Case IV for \(t\in [0,1000]\)

Figure 15
figure 15

The average distance between agents and average velocity of agents of Case I for \(t\in [0,1000]\). Panel (a) shows the comparison of the average distance between agents with the value \(\frac{l_{r}}{1-l}\ln (\frac{C}{l})\). Panel (b) shows the average velocity of agents compared with the value \(\sqrt{\frac{\alpha }{\beta }}\)


This work presented the emergence of swarm with delayed communication. First, the first- and second-order models of the swarm were described, where in the interaction function the time delay was taken into account. Further, the stability of the swarm was analyzed. For both models, agents’ movement to a stable state depended on the attraction–repulsion strengths and length scale in the Morse potential function. Finally, numerical results demonstrated the emergence of the swarm and referred that the swarm converges to an asymptotic state. Pattern configuration was formed, and each agent moved with the same velocity.

Availability of data and materials

Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.


  1. Borzi, A., Wongkaew, S.: Modeling and control through leadership of a refined flocking system. Math. Models Methods Appl. Sci. 25(2), 255–282 (2015)

    Article  MathSciNet  Google Scholar 

  2. Camazine, S., Deneubourg, J.-L., Franks, N.R., Sneyd, J., Bonabeau, E., Theraula, G.: Self-Organization in Biological Systems. Princeton University Press, Princeton (2003)

    MATH  Google Scholar 

  3. Caponigro, M., Fornasier, M., Piccoli, B., Trélat, E.: Sparse stabilization and control of alignment models. Math. Models Methods Appl. Sci. 25(3), 521–564 (2015)

    Article  MathSciNet  Google Scholar 

  4. Carrillo, J.A., Huang, Y., Martin, S.: Nonlinear stability of flock solutions in second-order swarming models. Nonlinear Anal., Real World Appl. 17, 332–343 (2014)

    Article  MathSciNet  Google Scholar 

  5. Choi, Y.-P., Haskovec, J.: Cucker–Smale model with normalized communication weights and time delay. arXiv preprint (2016). arXiv:1608.06747

  6. Choi, Y.-P., Li, Z.: Emergent behavior of Cucker–Smale flocking particles with heterogeneous time delays. Appl. Math. Lett. 86, 49–56 (2018)

    Article  MathSciNet  Google Scholar 

  7. Chuang, Y.-L., Huang, Y.R., D’Orsogna, M.R., Bertozzi, A.L.: Multi-vehicle flocking: scalability of cooperative control algorithms using pairwise potentials. In: Proceedings 2007 IEEE International Conference on Robotics and Automation, pp. 2292–2299. IEEE Press, New York (2007)

    Chapter  Google Scholar 

  8. Couzin, I.D., Krause, J., James, R., Ruxton, G.D., Franks, N.R.: Collective memory and spatial sorting in animal groups. J. Theor. Biol. 218(1), 1–12 (2002)

    Article  MathSciNet  Google Scholar 

  9. Erban, R., Haskovec, J., Sun, Y.: A Cucker–Smale model with noise and delay. SIAM J. Appl. Math. 76(4), 1535–1557 (2016)

    Article  MathSciNet  Google Scholar 

  10. Gazi, V., Passino, K.M.: Stability analysis of social foraging swarms: combined effects of attractant/repellent profiles. In: Proceedings of the 41st IEEE Conference on Decision and Control, vol. 3, pp. 2848–2853. IEEE Press, New York (2002)

    Google Scholar 

  11. Gazi, V., Passino, K.M.: A class of attractions/repulsion functions for stable swarm aggregations. Int. J. Control 77(18), 1567–1579 (2004)

    Article  MathSciNet  Google Scholar 

  12. Levine, H., Rappel, W.-J., Cohen, I.: Self-organization in systems of self-propelled particles. Phys. Rev. E 63(1), 017101 (2000)

    Article  Google Scholar 

  13. Li, T., Pintus, N., Viglialoro, G.: Properties of solutions to porous medium problems with different sources and boundary conditions. Z. Angew. Math. Phys. 70(3), 1–18 (2019)

    Article  MathSciNet  Google Scholar 

  14. Maria, R., Orsogna, D., Chuang, Y.-L., Bertozzi, A.L., Chayes, L.S.: Self-propelled particles with soft-core interactions: patterns, stability, and collapse. Phys. Rev. Lett. 96(10), 104302 (2006)

    Article  Google Scholar 

  15. Mogilner, A., Edelstein-Keshet, L., Bent, L., Spiros, A.: Mutual interactions, potentials, and individual distance in a social aggregation. J. Math. Biol. 47(4), 353–389 (2003)

    Article  MathSciNet  Google Scholar 

  16. Pareschi, L., Toscani, G., Tosin, A., Zanella, M.: Hydrodynamic models of preference formation in multi-agent societies. J. Nonlinear Sci. 29(6), 2761–2796 (2019)

    Article  MathSciNet  Google Scholar 

  17. Pignotti, C., Reche Vallejo, I.: Flocking estimates for the Cucker–Smale model with time lag and hierarchical leadership. J. Math. Anal. Appl. 464(2), 1313–1332 (2018)

    Article  MathSciNet  Google Scholar 

  18. Pignotti, C., Trélat, E.: Convergence to consensus of the general finite-dimensional Cucker–Smale model with time-varying delays. arXiv preprint (2017). arXiv:1707.05020

  19. Reynolds, C.W.: Flocks, herds and schools: a distributed behavioral model. In: Proceedings of the 14th Annual Conference on Computer Graphics and Interactive Techniques, pp. 25–34 (1987)

    Google Scholar 

  20. Vicsek, T., Czirók, A., Ben-Jacob, E., Cohen, I., Shochet, O.: Novel type of phase transition in a system of self-driven particles. Phys. Rev. Lett. 75(6), 1226 (1995)

    Article  MathSciNet  Google Scholar 

  21. Viglialoro, G., Woolley, T.E.: Solvability of a Keller–Segel system with signal-dependent sensitivity and essentially sublinear production. Appl. Anal. 99(14), 2507–2525 (2020)

    Article  MathSciNet  Google Scholar 

  22. Yang, Z., Zhang, Q., Jiang, Z., Chen, Z.: Flocking of multi-agents with time delay. Int. J. Syst. Sci. 43(11), 2125–2134 (2012)

    Article  MathSciNet  Google Scholar 

Download references


This research is supported by Department of Mathematics, Faculty of Science, Chiang Mai University. The authors would like to thank the anonymous reviewers for their constructive criticism and suggestions.


Not applicable.

Author information

Authors and Affiliations



All authors contributed equally in writing of this manuscript. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Suttida Wongkaew.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Himakalasa, A., Wongkaew, S. Stability analysis of swarming model with time delays. Adv Differ Equ 2021, 217 (2021).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI:


  • Swarming model
  • Consensus
  • Stability
  • Differential equations with time delay