Abstract
The Cucker and Smale model is a well-known flocking model that describes the emergence of flocks based on alignment. The first part focuses on investigating this model, including the effect of time delay and the presence of a leader. Furthermore, the control function is inserted into the dynamics of a leader to drive a group of agents to target. In the second part of this work, leadership-based optimal control is investigated. Moreover, the existence of the first-order optimality conditions for a delayed optimal control problem is discussed. Furthermore, the Runge–Kutta discretization method and the nonlinear conjugate gradient method are employed to solve the discrete optimality system. Finally, the capacity of the proposed control approach to drive a group of agents to reach the desired places or track the trajectory is demonstrated by numerical experiment results.
1. Introduction
Individual behaviors influence the dynamics of social systems. Studying the behavior of interacting individuals within a group of animals or a community of people is a new mathematical research field. The emergence of a collective level is one interesting issue raised by this type of study, with many natural systems showing collective phenomena, for instance, a flock of birds or a group of fish having coordinated movements, cells, chemical compounds, organisms or crystals, vehicular traffic, crowd dynamics, market economies, opinion formations, distributions of wealth, networks, and artificial intelligence (see, e.g., [1–6]). These collective behaviors are described as pattern configurations. In particular, collective action results from a superimposition of interactions between every possible pair of all agents. In general, the strength of such interaction forces depends on the amount of collaborative distance between agents. For example, birds orient with their nearest one in the group, and people more often agree with others who already conform to their beliefs. Nowadays, the application of these collective features is enormous and has a wide range. It appears in several engineering applications such as those using collective properties to perform complex tasks or in swarm robotics [7]. In addition, crowd models are applied in civil engineering to plan evacuation strategies in buildings (see, e.g., [8, 9]).
In recent years, researchers have been interested in studying collective phenomena, starting with using a few rules of interaction among agents to predict and explain unexpected phenomena or describe the emergence of pattern structure. Despite many works studying the emergence of consensus (see, e.g., [4, 10, 11]), investigating the enforcement and stabilization of pattern formation including the presence of noise or communication with time delays is especially interesting. Communication delays result from traffic congestion or finite speeds of transmission and spread. For example, the flocking model has a processing delay when analyzing information about the location and velocity of neighboring agents. This fact has motivated an increased interest in studying the consensus problem of a flocking system, including the effect of time delays. Pioneering work on this issue was done in [12–16]. Additionally, when the system’s behavior does not realize the desired result, control is essential to force the system to attain given objectives. This problem is related to the control of a self-organized system. Most results focus on the controllability of systems in which the topology of a group communication network is fully connected. In this case, all members of the group are regulated by the same distributed control law. These model settings, however, are limited when dealing with large networks. In particular, efficient control should apply only to a few group members, and this control strategy is known as “sparsity” in the mathematical literature. From the perspective of controllability, the hierarchical leadership concept provides the aggregation states of the system and some forms of group patterns for longtime behavior. The literature on control problems in these systems has recently been documented in [17–23].
The main contribution is divided into two parts. The first part discusses the Cucker and Smale (CS) flocking model, where the position and velocity of agents include the effect of time delay. Furthermore, primarily based on this model, a leader is added into the system to implement control functions. This control action can be applied to other agents through the mechanism of interaction force. The objective of the control strategy in this construction is to drive the evolution of flocking to track the desired trajectory. This control through leadership approach is constructed in the framework of optimal control problem mainly discussed in the second part of this work. In the second part, firstly, the formulation of optimal control problems with time delay is provided. The objective function includes three tracking terms and the cost of control function. The first and second terms account for the tracking error of the position of the leader and the desired target position at the final time and follow the desired path, respectively. The last tracking term is a measure of the distance between the leader and the other agents of the flock. Further, the theoretical and numerical results of optimization problems constrained with delayed CS systems are investigated. The resulting optimal control is obtained by solving an optimality system composed of the CS model’s delayed dynamical system, associated adjoint equations, and an optimality condition. Additionally, the aspect of numerical solution and implementation is discussed. An efficient conjugate gradient optimization procedure evaluates optimal control [24, 25]. The gradient of the reduced cost functional is computed using the adjoint framework by solving the forward and backward delayed CS flocking equations that appear in the optimality system. These equations are discretized using an accurate high-order Runge–Kutta scheme (see more details in [26]).
The subsequent sections of our work are organized as follows. In Section 2, the description of the flocking model is provided. This model is based on the Cucker and Smale model, which takes time delays and the presence of a leader into account. Additionally, the existence of solutions and stability for these systems are discussed. Furthermore, numerical simulations are demonstrated to examine the characteristic properties of our constructed model. Section 3 presents the formulation of optimal control of the Cucker and Smale system with time delays. The theoretical issues regarding the existence of first-order necessary optimality systems of delayed optimal control problems are discussed. Section 4 is comprised of two parts. In the first part, the control problem with time delays is discretized by using the Runge–Kutta scheme. Then, using the first-discretize-then-optimize strategy, a discrete gradient formula for the optimization problem is obtained. The second part of Section 4 contains numerical experiments demonstrating the validity and effectiveness of the proposed control strategy. The conclusion is provided in the last section to complete this work.
2. Cucker and Smale Flocking Model with Time Delays and Leadership
In this section, we investigate the flocking model, including the effect of time delays and the presence of a leader. In this work, we focus on the Cucker and Smale (CS) model. This model is one of the well-known flocking models that involve the alignment of the agent; that is, each agent changes its speed in response to an averaging weight of its relative speed to the other agents, which can be seen in [5]. Moreover, we investigate the effect of time delays, which have influenced to converge to state transition and pattern structure. In our case, we consider constant delay function as proposed in [27]. In this context, delays are defined as a lag in the processing of information. To illustrate this phenomenon, consider a situation involving two agents in which the second agent attempts to follow the first but receives information from the first agent after some time. As a result, it requires time to elaborate on its response. We define as a positive constant time delay. Additionally, a leader is incorporated into the CS system to facilitate developing a control strategy for guiding the flock dynamical system toward a target (described in the following section). The CS flocking system with one leader and followers including time delay is presented as follows:for , with given initial conditionswhere , are position and velocity of the agent at time . The initial conditions and are given continuous functions. The connectivity function measures the interaction strength between agents depending on the distance between and agents. The connectivity function is assumed to be positive, continuous, bounded, and nonincreasing function.
In this work, we consider the connectivity function with the following form:where , , and the notation denotes Euclidean norm in . The force governs the action of the leader with time delay. The leader force can take many forms, such as using short-range repulsion and long-range attraction described as Morse potential function in [18] or considering hierarchical leadership structure in [16]. In this work, the leader’s action takes the following form:where the parameter corresponds to the strength of the interaction force taken by the leader.
2.1. Stability of the Cucker and Smale Model with Time Delays
The solution of the CS flocking system is influenced by the parameters and . In particular, when , the CS model without time delays exhibits unconditional flocking for all initial configurations, in which the velocities approach asymptotically to the common limit velocity . On the other hand, the flocking is conditional with , i.e., the asymptotic behavior of the system is dependent on the value of and the initial configuration, as detailed in references [5, 14, 27]. To analyze the solution and stability of system (1), we consider the dispersion and disagreement as defined in [16, 19].
Definition 1. (dispersion and disagreement). Given a solution of system (1), for , we define dispersion and disagreement asThen, we say that the solution tends to consensus ifNext, the numerical simulation results of the CS system with time delays, including the presence of a leader, are demonstrated. Figure 1 depicts the numerical results of system (1) in one dimension, while Figures 2 and 3 illustrate results in two dimensions. For all experiments, we consider one leader and followers. The corresponding parameters in connectivity function are chosen as and . The leader interaction strength parameter is given as . Consider 1D case, and Figure 1(a) shows the trajectories of agents with no time delay, whereas the motion of flocking, including the effect of time delay (), is presented in Figures 1(b)–1(d). It is observed that due to time delay, agents require more time to adjust their alignments and follow the group.
We also consider one leader and followers in the experiments for 2D cases. The parameters for the 2D experiments are the same as those for the 1D studies. Agents begin with an initial configuration that places them all in random positions with random velocities, with a leader outside the group. After , each agent begins to adapt and organize its movement to follow the leader. Figure 3 shows that for the longtime behavior , the value tends to be constant at zero and the dispersion is becoming constant. It explains that the consensus is reached after some time. The pattern configuration is formed, and each agent’s velocity is synchronized and moves together at the same speed.

(a)

(b)

(c)

(d)

(a)

(b)

(c)

(d)

(a)

(b)
3. Optimal Control of Cucker and Smale Model with Time Delays
This section discusses the optimal control problem constrained with the delayed dynamical system of the CS model, including a leader. We note that this control problem is the leadership-based control strategy which is discussed in [18] for the refined flocking model. In addition, the theoretical results corresponding to optimal control problems with delays are investigated. In particular, the existence and characterization properties of solutions and optimality conditions are provided. In the following, we consider the optimal control problem governed by the delayed CS system and the presence of a leader presented astogether with the delayed differential constraints given byfor , along with their corresponding initial conditions. The state of the system is represented by the notation
The control function is denoted by . The parameters , and in the cost functional are positive constants. The first term in objective functional aims to minimize the terminal position of the leader and the given target. The second term is related to track the desired path by the leader agent. Also, the distance between the leader agent and others is measured in the third term. The cost of control is minimized in the last term.
To investigate the solution of our optimal control problems (8), we consider the optimal control problem that state and control variables have an effect of time delays, that is, state variable and control variable include time delays and , respectively. The theoretical results of the delayed optimal control problems are investigated in [28, 29]. The general framework of an optimal control problem with delay in state and control is presented as follows:
We assume that and . The function represents the objective function and is assumed to be continuously differentiable. represents the dynamics of the model and is assumed to be continuously differentiable. The initial conditions and are continuous. We note that a solution of the dynamical system in (11) is uniquely determined for a given control and the initial conditions denoted by ; moreover, is a differentiable map. For all admissible , we aim to find a control such that
Furthermore, to obtain the necessary optimality conditions for delayed optimal control (11), we introduce two additional variables and for delayed state and control variables, respectively, where the functions and are defined as follows:
The first-order optimality system can be obtained by considering the Hamiltonian function that is given bywhere .
Theorem 1. Let be locally optimal solution to optimal control problem (11). Assume that there exists an open set such that the neighborhood with a small radius of is a subset of for every . We assume that and are Lipschitz continuous in . Moreover is Lipschitz continuous in the neighborhood . Then, there exists an adjoint function that satisfies the first-order optimality conditions at , for a.e. such thatwhere , , , and refer to the evaluation of the partial derivatives with respect to , and , respectively. The function is defined as
To investigate the solution of our problem (10), we formulate our optimal control in form (11) by introducing the following equation:
Then, the problem of optimal control (10) can be transformed into the following problem:for andtogether with corresponding initial conditions, and the compact form can be rewritten as follows:
Now, the state variable isand represents the dynamics of the transformed delayed CS systems.
Further, we discuss the first-order optimality conditions for optimal control problem (20). For this purpose, the delayed system is transformed to nondelayed system by using variablesand we denote .
The Hamiltonian function for system (20) is presented aswhere .
Assumption 1. There exist Lagrange multipliers corresponding to the optimization constraint equation of problem (20). Moreover, the adjoint satisfies the following equation:Therefore, a solution of (20) can be characterized by the first-order optimality system as presented in the following:In addition, the corresponding gradient can be expressed asIn particular, the explicit formulations of adjoint equations (20) can be expressed as follows:with transversality conditionThe numerical solution of problems (20) representing as the considered optimality systems (25) will be shown and discussed in the next section.
4. Numerical and Implementation Aspects of Delayed Control Problems
4.1. First-Discretize-Then-Optimize Strategy and Discrete Optimality Conditions
The discretization of the reduced gradient is a critical step in the numerical method for solving optimal control problems. To obtain an accurate discretization for the reduced gradient, we consider the first-discretize-then-optimize strategy. To carry out this strategy, one can follow the procedures outlined below. The cost functional and corresponding differential constraints representing the optimal control problem are discretized in the first step using the Runge–Kutta method, discussed in detail in [26]. Second, the discrete Lagrangian function corresponding to the discrete optimal control problem must be constructed. The final step is to obtain the first-order optimality system for the discretized problem.
For the discretization of optimal control problem (20), the Runge–Kutta scheme is employed on a uniform mesh in the time intervals such that the step-sized is defined aswith the total number of discrete time intervals, . It is important to match the uniform step size with positive delay ; that is, we choose any integer fraction of to refine the discretization grid. For this task, for any step size , there exist positive integers satisfying
By this setting, we denote the value of at the discrete time by
Therefore, the discretization of the s-stage Runge–Kutta scheme setting for optimal control problem (20) becomesfor and . Note that the control denotes the s stages of the RK discrete control function at the stage k, which can be written in the following form:
We remark that the order of a Runge–Kutta discretization for optimal control problem depends on coefficients and (see more details in [26]).
The discrete optimality system that corresponds to (32) is expressed as the following equations:
Further, the gradient is in the following form:for , and .
To solve optimization problem (32), the nonlinear conjugate gradient (NCG) strategy with the Hager and Zhang scheme [24, 25] is implemented. First, we use the following algorithm to compute the gradient specified in First, we use the following algorithm to compute the gradient specified in (35).
Following that, we apply the gradient derived from Algorithm 1 to the NCG scheme defined in Algorithm 2.
|
4.2. Numerical Results
This section presents the numerical results of our flocking models. These results demonstrate the control performance of our leader-based control strategy. The test is divided into two parts as follows:(i)Test I: reach the desired target point.(ii)Test II: follow the desired path.
In our experiments, we investigate problem (20) in two dimensions by considering a system composed of nine agents and one leader. As a result, the state variables’ total , while the control variables’ total . In numerical test I, we focus on controlling the leader agent to reach the goal position at the final time. The purpose of numerical test II is to force the flocks to follow the desired trajectories. We provide two examples of the desired trajectory in these tests: the linear and circular paths. We use the same initial conditions in all three examples, where agents’ positions are distributed, and their initial velocities are random. Additionally, the initial position of the leader is set to .
In numerical test I, the goal position is given as and the end time is set to . The interaction force parameters are and the strength of leader interaction force is . The objective of this test is to force the system to reach the desired target at the final time; as a consequence, the corresponding parameters in objective functional are , and . As illustrated in Figure 4, the leader is capable of reaching the desired location and leading the flock there.

(a)

(b)

(c)

(d)

(e)

(f)
In numerical test II, the corresponding parameters and initial data are chosen similarly to those in the numerical test I, except that is used to keep the leader agent tracking the desired trajectories. We illustrate two scenarios using two distinct tracking trajectories. The results of the first example are depicted in Figure 5. The plot of snapshots for ten agents traveling along the specified linear path is shown in Figure 5. Figures 5(a)–5(e) illustrate the solutions to optimal control problems at various time points. As illustrated in Figure 5(f), the leader attempts to move in the direction of a given trajectory while the group of agents follows the leader. In the last example, the desired path is given as a circle. As shown in Figure 6, the leader agent tracks the path, and the other agents follow the leader. It can be observed from three examples that agents keep some distance from the leader because time delay creates some absence of leader position. It would take some time for the group to respond to this emotion and attempt to follow the leader; however, the group eventually achieves it.

(a)

(b)

(c)

(d)

(e)

(f)

(a)

(b)

(c)

(d)

(e)

(f)
5. Conclusion
The Cucker and Smale flocking model, including the effect of time delays and the presence of a leader, was studied. A control-based leadership technique was investigated for this model. An optimal control problem was formulated, and the corresponding discretization of an optimal problem was solved using an accurate RK method such that accurate gradients of the reduced objectives can be guaranteed. The nonlinear conjugate gradient scheme was implemented to compute the gradients. The results of the numerical experiment show that the proposed control approach is practical. From a modeling point of view, this flocking system could be enhanced by including the effects of attraction and repulsion and alignment with the vision cone and delay. In addition, the delay in control function would be considered a part of the optimal control problem.
Data Availability
No data were used to support this study.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This research was supported by Chiang Mai University.