Keywords

1 Introduction

1.1 A Subsection Sample

In the distributed automatic control fields, cooperative control of multi-agent systems (MAS) is currently a critical research topic. It has many applications for cooperative control of MAS, including driverless cars, unmanned aerial vehicles and unmanned submarine detectors. These applications of distributed MAS provide the convenience of social life and promote the development of scientific research.

Consensus is an important issue in the cooperative control of MAS, which means the agents achieve the agreement of the position, velocity or phase by designing a communication protocol. In early research, centralized control of MAS is explored with the system structural features. Compared with centralized control of MAS, distributed control of MAS has its unique advantages. Examples of the advantages include lower cost, faster response speed and more flexible structure. Distributed MAS have been studied extensively in the recent research works. For distributed cooperative control of MAS, the consensus control algorithms in different settings are studied in [1,2,3,4,5]. The consensus of linear MAS in different backgrounds is studied in [6,7,8,9,10,11,12,13].

As a class of special condition in consensus control problem, the competition mechanism is introduced into MAS, group consensus control on the competition and cooperation mechanism has been proposed and studied in recent years [14,15,16,17,18,19]. In [14], group consensus for the first-order MAS with nonlinear input constraints is investigated. Group consensus of MAS with switching topologies and communication delays are addressed in [15,16,17]. In [18], the dynamics group consensus problem of heterogeneous multi-agent systems with time delays is investigated, in which agents’ dynamics are modeled by single integrators and double integrators. To achieve group consensus, a novel group consensus protocol is proposed for MAS with a time-varying estimator of the uncertain parameters in [19]. Based on the different requirement, group consensus of MAS with cooperative relationship and the competition mechanism are studied in practical applications.

In the process of the cooperative control of the dynamic MAS, how to reduce the cost and energy has become more and more important. The optimal control problem of cooperative control of MAS has attracted more and more the attention. Optimality issues in consensus algorithms have been studied in [20, 21], where the global optimal consensus problem for MAS with bounded controls is studied. Instead of studying global optimal algorithms, the optimal consensus control laws for agent-based models are discussed in [22]. The optimal consensus problem of continuous-time MAS with a common state set constraint is reported in [23]. In [24], the optimal control of a multi-agent consensus problem in an obstacle-laden environment is investigated. The optimal coordination control for nonlinear MAS based on event-triggered adaptive dynamic programming method is concerned in [25].

In this paper, the distributed optimal group consensus control of dynamic MAS is investigated. The contribution of this paper is the optimal cost function for the optimal control problem is proposed with distributed communication protocol. Based on graph theory and optimal control method, the group consensus algorithm of dynamic MAS with leaders and without leaders are discussed. Based on the optimal scaling factor in group control algorithm, the optimal group motion can be achieved for the distributed MAS.

The remainder of this paper is organized as follows. In Sect. 2, the graph theory and definitions are introduced. A new optimal cost function is proposed, and group consensus control algorithm of dynamic MAS is obtained in Sect. 3. Based on the proper value of the optimal scaling factor in optimal group control protocol, the optimal group consensus is analyzed in Sect. 3. Numerical simulations are used to verify the optimal group consensus algorithms of MAS with leaders and leaderless in Sect. 4. A short conclusion is given in Sect. 5.

2 Graph Theory and Definitions

Let \( G = \left( {V,\omega ,\varLambda } \right) \) be a networked topology of order \( n + m \) with the set of nodes \( V = \left\{ {\nu_{1} ,\nu_{2} , \ldots ,\nu_{n + m} } \right\} \), set of edges \( \omega \subseteq \nu \times \nu \), and the symmetrical weighted adjacency matrix \( \varLambda = \left[ {a_{ij} } \right] \in R^{{\left( {n + m} \right) \times \left( {n + m} \right)}} \) with real adjacency elements \( a_{ij} \). An edges of \( G \) is denoted by \( e_{ij} = \left( {\nu_{i} ,\nu_{j} } \right) \), which starts from \( i \) and ends on \( j \). The adjacency elements associated with the edges of the graph are nonzero, i.e., \( e_{ij} \in \omega \) if and only if \( a_{ij} \ne 0 \). For all nodes \( i \), it is assumed that \( a_{ii} = 0 \). There are two ways to describe the communication link between two nodes. If there is a communication link between \( \nu_{i} \) and \( \nu_{j} \), the sending and receiving of information can be represented by \( \nu_{i} \to \nu_{j} \) and \( \nu_{j} \to \nu_{i} \) respectively. In the set of neighbors of node \( \nu_{i} \) is denoted by \( N_{i} = \left\{ {\nu_{j} \left| {\nu_{j} \in V:e_{ij} \in \omega } \right.} \right\} \). The set of a node subset neighbors \( \varsigma \subset V \) is defined by \( N_{\varsigma } = \left\{ {\nu_{j} \left| {\nu_{j} \in V,\nu_{i} \in \varsigma :e_{ij} \in \omega } \right.} \right\} \). The Laplacian matrix \( L\left( G \right) = \left[ {l_{ij} } \right]_{{\left( {n + m} \right) \times \left( {n + m} \right)}} \) of networked topology \( G \) is defined by

$$ l_{ij} = \left\{ {\begin{array}{*{20}c} { - a_{ij} ,\quad \quad \quad \;\;{\kern 1pt} {\kern 1pt} j \ne i} \\ {\sum\nolimits_{k = 1,k \ne i}^{n + m} {a_{ik} } ,\quad j = i} \\ \end{array} } \right. $$

The in-degree and out-degree of node \( i \) are defined as

$$ Deg_{in} \left( i \right) = \sum\nolimits_{j = 1}^{n + m} {a_{ij} } ,\,Deg_{out} \left( i \right) = \sum\nolimits_{j = 1}^{n + m} {a_{ji} } $$

\( D = diag\left\{ {\sum\nolimits_{j = 1}^{n + m} {a_{1j} } , \cdots ,\sum\nolimits_{j = 1}^{n + m} {a_{n + m,j} } } \right\} \) is defined as degree matrix. The Laplacian matrix satisfies \( L = D - \varLambda \).

Definition 1.

A networked topology \( G_{1} = \left\{ {V_{1} ,\omega_{1} ,A_{1} } \right\} \) is said to be a sub-network of a networked topology \( G = \left\{ {V,\omega ,A} \right\} \), if \( V_{1} \subseteq V \) and \( \omega_{1} \subseteq \omega \). Furthermore, if \( V_{1} \subset V \) and \( \omega_{1} = \left\{ {\left( {v_{i} ,v_{j} } \right):i,j \in V_{1} ,e_{ij} \in \omega } \right\} \), the graph \( G_{1} \) is a proper sub-graph of \( G \).

We suppose a group \( G = \left\{ {V,\omega ,\varLambda } \right\} \) can be partitioned into two bipartite graphs \( G_{1} = \left\{ {V_{1} ,\omega_{1} ,\varLambda_{1} } \right\} \) and \( G_{2} = \left\{ {V_{2} ,\omega_{2} ,\varLambda_{2} } \right\} \) with \( V_{1} \cup V_{2} = V \) and \( V_{1} \cap V_{2} = \emptyset \). Without loss of generality, a network graph \( G \) with \( n + m \) (\( n,m > 1 \)) agents indexed by \( 1,2, \ldots ,n + m \) is consisted with nodes \( 1,2, \ldots ,n \) in sub-graph \( G_{1} \) and nodes \( n + 1,n + 2, \ldots ,n + m \) in sub-graph \( G_{2} \).

Consider a second-order multi-agent system, the \( i \) th agent with double-integrator given by

$$ \begin{array}{*{20}c} {\dot{x}_{i} \left( t \right) = v_{i} \left( t \right)} \\ {\dot{v}_{i} \left( t \right) = u_{i} \left( t \right)} \\ \end{array} $$
(1)

where \( x_{i} \left( t \right) \in R \), \( v_{i} \left( t \right) \in R \) and \( u_{i} \left( t \right) \in R \) are the position, velocity and control input of the \( i \) th agent, respectively.

Assumption 1.

There is a balance of effect between two sub-graph:\( \sum\nolimits_{j = n + 1}^{n + m} {a_{ij} = 0} \), \( \forall i = G_{1} \); \( \sum\nolimits_{j = 1}^{n} {a_{ij} = 0} \), \( \forall i = G_{2} \).

Remark 1.

The weighting factor \( a_{ij} \) in the networked topology could be negative, which provides the competition relationships between two sub-graph and more complex dynamic behavior of agents.

Definition 2.

The multi-agent system described by (1) is considered. The protocol \( u_{ij} \) is said to achieve asymptotically a group consensus problem if for any initial state \( x\left( 0 \right) \in R^{n} \), the states of agents satisfy

(I) \( \mathop {\lim }\limits_{t \to \infty } \left\| {x_{i} \left( t \right) - x_{j} \left( t \right)} \right\| = 0 \), \( \forall i,j \in G_{1} \), \( \mathop {\lim }\limits_{t \to \infty } \left\| {v_{i} \left( t \right) - v_{j} \left( t \right)} \right\| = 0 \), \( \forall i,j \in G_{1} \)

(II) \( \mathop {\lim }\limits_{t \to \infty } \left\| {x_{i} \left( t \right) - x_{j} \left( t \right)} \right\| = 0 \), \( \forall i,j \in G_{2} \), \( \mathop {\lim }\limits_{t \to \infty } \left\| {v_{i} \left( t \right) - v_{j} \left( t \right)} \right\| = 0 \), \( \forall i,j \in G_{2} \)

Assumption 2.

There may be two agents in the undirected graph \( G \) as leaders. Each leader is a globally reachable node in each sub-graph (\( G_{1} \) or \( G_{2} \)).

Remark 2.

In this paper, the MAS with leaders and without leaders are considered. The symmetric Laplacian matrix can be derived from the networked topology \( G \) in two conditions. Both of them can get the same theoretical result.

3 Optimal Group Consensus of MAS

In this section, we propose a cost function for the second-order MAS. From the LQR perspective, an optimal control algorithm is derived, which guarantees the MAS to achieve group flocking movement.

The dynamic multi-agent system (1) can be rewritten as follows

$$ \left( {\begin{array}{*{20}c} {\dot{x}_{i} \left( t \right)} \\ {\dot{v}_{i} \left( t \right)} \\ \end{array} } \right) = A\left( {\begin{array}{*{20}c} {x_{i} \left( t \right)} \\ {v_{i} \left( t \right)} \\ \end{array} } \right) + Bu_{i} \left( t \right)\quad \quad \quad i = \left\{ {1,2, \ldots ,n + m} \right\} $$
(2)

where \( A = \left( {\begin{array}{*{20}c} 0 & 1 \\ 0 & 0 \\ \end{array} } \right) \), \( B = \left( {\begin{array}{*{20}c} 0 \\ 1 \\ \end{array} } \right) \) are the system matrix and input matrix. It is assumed that distributed dynamic systems are composed of two sub-graphs with \( n + m \) agents randomly connection, where the networked topology can be represented by \( G_{1} = \left\{ {1,2, \ldots ,n} \right\} \) and \( G_{2} = \left\{ {n + 1,n + 2, \ldots ,n + m} \right\} \).

The dynamics of the leader is

$$ \begin{array}{*{20}c} {\dot{x}_{0k} \left( t \right) = v_{0k} \left( t \right),} \\ {\dot{v}_{0k} \left( t \right) = 0,\quad \quad } \\ \end{array} \quad \quad \quad k = 1,2 $$
(3)

where \( x_{0k} \) is the position of the leader, \( v_{0k} \) is the velocity of the leader.

Remark 3.

The leader of the dynamic MAS has the velocity with the acceleration zero, which means that if other agents receive information from the leader, they will adjust their speed under the control algorithm (10), eventually catch up with the speed and position of the leader.

The group consensus cost function for dynamic second-order system (2) is proposed as

$$ J_{f} = \sum\limits_{i = 1}^{n} {\int\limits_{0}^{\infty } {\left\{ {\sum\limits_{j = 1}^{i - 1} {a_{ij} \left[ {x_{j} \left( t \right) - x_{i} \left( t \right)} \right]^{2} } + \sum\limits_{j = 1}^{i - 1} {a_{ij} \left[ {v_{j} \left( t \right) - v_{i} \left( t \right)} \right]^{2} } + ru_{i}^{2} \left( t \right)} \right\}} dt} $$
(4)

where \( a_{ij} \in R \) is the element of weight adjacency matrix of structure graph \( G \), and \( r \) is the given constant, \( r > 0 \).

The dynamic system (2) can be written as

$$ \dot{X}\left( t \right) = \tilde{A}X\left( t \right) + \tilde{B}U\left( t \right) $$
(5)

where \( X( t) = [ x_{1} ( t), \ldots ,x_{n + m} ( t),v_{1} ( t), \ldots ,v_{n + m} ( t)]^{\rm T} \), \( U(t) = [ u_{1} ( t), \ldots ,u_{n + m} ( t)]^{\rm T} \), \( \tilde{A} = A \otimes I_{n + m} \), \( \tilde{B} = B \otimes I_{n + m} \).

Thus, the optimization problem for system (5) as

$$ \mathop {\hbox{min} }\limits_{{a_{i,j} }} J_{a} = \int_{0}^{\infty } {[X^{\rm T} \left( t \right)QX\left( t \right) + U^{\rm T} \left( t \right)RU\left( t \right)]dt} , $$
(6)
$$ {\text{subject}}\,{\text{to}}\,:\,\dot{X}\left( t \right) = \tilde{A}X\left( t \right) + \tilde{B}U\left( t \right)\,,\,U\left( t \right) = U^{*} \left( t \right) $$
(7)

where \( Q = \left[ {\begin{array}{*{20}c} {Q_{1} } & 0 \\ 0 & {Q_{3} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\beta^{2} H^{2} } & 0 \\ 0 & {\beta^{2} H^{2} - 2\beta H} \\ \end{array} } \right] \) is a positive definite matrix, \( R = I_{n + m} \) is an identity matrix, the parameter \( \beta \) is an optimal scaling factor. \( H \) is the positive definition symmetric Laplacian matrix associated with the structure of MAS.

Remark 4.

According to the definition of the performance indicator function, \( Q \) should be a positive definite matrix, that is \( Q > 0 \). Therefore, the optimal scaling factor \( \beta \) should be ensured that the matrix \( \beta^{2} H^{2} - 2\beta H \) is a positive definite matrix.

Theorem 1.

For dynamic multi-agent systems (5) with Assumption 1 and Assumption 2. By solving the optimal control problem (6), the optimal group consensus control can be obtained

$$ U^{*} \left( t \right) = - \beta \left( {\begin{array}{*{20}c} H & H \\ \end{array} } \right)X\left( t \right) $$
(8)

where \( H \) is the symmetric Laplacian matrix and \( \beta > {2 \mathord{\left/ {\vphantom {2 {\lambda_{\hbox{min} } }}} \right. \kern-0pt} {\lambda_{\hbox{min} } }} \) corresponds to the minimum eigenvalue of matrix \( H \).

Proof.

Since the matrix \( \tilde{A} \) and \( \tilde{B} \) is controllable matrix in Eq. (2), the dynamic MAS (5) with the system matrix \( \left( {\tilde{A},\tilde{B}} \right) \) is controllable, which implies that there exists a matrix \( P \) satisfying the algebraic Riccati equation

$$ \tilde{A}^{\rm T} P + P\tilde{A} - P\tilde{B}R^{ - 1} \tilde{B}^{\rm T} P + Q = 0_{n \times n} $$
(9)

Let \( P{ = }\left( {\begin{array}{*{20}c} {P_{1} } & {P_{2} } \\ {P_{2}^{\rm T} } & {P_{3} } \\ \end{array} } \right) \), \( R = I_{n + m} \), the Riccati Eq. (8) can be written as

$$ \left\{ {\begin{array}{*{20}c} {P_{2} R^{ - 1} P_{2}^{\rm T} = Q_{1} \quad \quad \quad } \\ {P_{2} R^{ - 1} P_{3} = P_{1} {\kern 1pt} \,{\kern 1pt} \quad \quad \quad } \\ {P_{3} R^{ - 1} P_{3} - P_{2} - P_{2}^{T} = 0} \\ \end{array} } \right. $$
(10)

It follows that \( P = \left( {\begin{array}{*{20}c} {\beta^{2} H^{2} } & {\beta H} \\ {\beta H} & {\beta H} \\ \end{array} } \right) \). Then, we can obtain the optimal consensus control \( U^{*} \left( t \right) = - \beta \left( {\begin{array}{*{20}c} H & H \\ \end{array} } \right)X\left( t \right) \), where \( H \) is the symmetric Laplacian matrix.

For dynamic multi-agent systems (5) with Assumption 1 and Assumption 2, the optimal group consensus control (7) can be written as

$$ u_{i} \left( t \right) = \left\{ {\begin{array}{*{20}l} {\beta \left\{ {\left[ {\sum\limits_{{j \in N_{1i} }} {a_{ij} \left( {x_{j} - x_{i} } \right) + b_{i} \left( {x_{01} - x_{i} } \right)} } \right] + \sum\limits_{{j \in N_{2i} }} {a_{ij} \left( {x_{j} - x_{i} } \right)} } \right\}} \hfill \\ {\quad \quad + \,\beta \left\{ {\left[ {\sum\limits_{{j \in N_{1i} }} {a_{ij} \left( {v_{j} - v_{i} } \right) + b_{i} \left( {v_{01} - v_{i} } \right)} } \right] + \sum\limits_{{j \in N_{2i} }} {a_{ij} \left( {v_{j} - v_{i} } \right)} } \right\},\quad \forall i \in G_{1} } \hfill \\ {\beta \left\{ {\sum\limits_{{j \in N_{1i} }} {a_{ij} \left( {x_{j} - x_{i} } \right)} + \left[ {\sum\limits_{{j \in N_{2i} }} {a_{ij} \left( {x_{j} - x_{i} } \right) + b_{i} \left( {x_{02} - x_{i} } \right)} } \right]} \right\}} \hfill \\ {\quad \quad + \,\beta \left\{ {\sum\limits_{{j \in N_{1i} }} {a_{ij} \left( {v_{j} - x_{i} } \right)} + \left[ {\sum\limits_{{j \in N_{2i} }} {a_{ij} \left( {v_{j} - v_{i} } \right) + b_{i} \left( {v_{02} - v_{i} } \right)} } \right]} \right\},\quad \forall i \in G_{2} } \hfill \\ \end{array} } \right. $$
(11)

where \( a_{ij} \) is the element of the adjacency matrix of MAS, \( \forall i,j \in G_{1} \) or \( \forall i,j \in G_{2} \). The set \( N_{1i} = \left\{ {\nu_{j} \in V_{1} :\left( {\nu_{i} ,\nu_{j} } \right) \in \omega } \right\} \) and \( N_{2i} = \left\{ {\nu_{j} \in V_{2} :\left( {\nu_{i} ,\nu_{j} } \right) \in \omega } \right\} \) is neighbor set of agent \( i \). If followers \( i \) can receive information from the leader \( x_{0k} \), then \( b_{i} > 0 \), otherwise \( b_{i} = 0 \). Note that \( H = L\left( G \right) + B = \left[ {\begin{array}{*{20}c} {L\left( {G_{1} } \right) + B_{1} } & \Delta \\ {\Delta^{\rm T} } & {L\left( {G_{2} } \right) + B_{2} } \\ \end{array} } \right] \) is positive definition symmetric matrix, \( \Delta = - \left[ {\begin{array}{*{20}c} {a_{1,n + 1} } & {a_{1,n + 2} } & \cdots & {a_{1,n + m} } \\ {a_{2,n + 1} } & {a_{2,n + 2} } & \cdots & {a_{1,n + m} } \\ \vdots & \vdots & \ddots & \vdots \\ {a_{n,n + 1} } & {a_{n,n + 2} } & \cdots & {a_{n,n + m} } \\ \end{array} } \right] \), \( B_{1} = diag\left\{ {b_{i} ,i = 1, \ldots ,n} \right\} \), \( B_{2} = diag\left\{ {b_{i} ,i = n + 1, \ldots ,n + m} \right\} \). With the Assumption 1 and Assumption 2, the matrix \( H \) is positive definite.

Remark 5.

In the optimal group consensus control protocol (11) of dynamic MAS, the weight value \( b_{i} \) may be zero, which means that there is the leaderless condition of the dynamic MAS, or agents do not receive information from the leader. If there is a globally reachable node in subgroups, MAS with the cooperative and competitive relationship between the two subgroups will achieve the group flocking motion without leaders.

Theorem 2.

Considering the formation of dynamic MAS (2), the networked topology is composed of \( n + m \) agents with undirected graph. If Assumption 1 and Assumption 2 are established for the dynamic MAS (2) with the optimal group consensus control (11), the optimal group consensus can be achieved for MAS.

Proof.

Let \( \bar{x}_{i} \left( t \right) = x_{i} \left( t \right) - x_{0k} \left( t \right) \), \( \bar{v}_{i} \left( t \right) = v_{i} \left( t \right) - v_{0k} \left( t \right) \). The dynamic system (2) with the optimal control algorithm (11) be written as

$$ \begin{array}{*{20}l} {\dot{\bar{x}} = \bar{v}} \hfill \\ {\dot{\bar{v}} = \left( { - \beta H\bar{x}} \right) + \left( { - \beta H\bar{v}} \right)} \hfill \\ \end{array} $$
(12)

where \( \bar{x} = \left[ {\bar{x}_{1} ,\bar{x}_{2} , \ldots ,\bar{x}_{n + m} } \right]^{\rm T} \), \( \bar{v} = \left[ {\bar{v}_{1} ,\bar{v}_{2} , \ldots ,\bar{v}_{n + m} } \right]^{\rm T} \). Let \( z = H\bar{x} \), \( w = H\bar{v} \). We definite the Lyapunov function

$$ V = V_{1} + V_{2} , $$
(13)

where \( V_{1} = \bar{v}^{\rm T} H\bar{v} \), \( V_{2} = z^{\rm T} \beta z \). The derivative of the Lyapunov function along the solution trajectory of the system (2) is

$$ \begin{aligned} \dot{V}_{1} & = 2\bar{v}^{\rm T} H\dot{\bar{v}} \\ & = 2w^{\rm T} \cdot \left[ {\left( { - \beta z} \right) + \left( { - \beta w} \right)} \right] \\ & = - 2w^{\rm T} \beta z - 2w^{\rm T} \beta w \\ \end{aligned} $$
(14)
$$ \dot{V}_{2} = 2w^{\rm T} \beta z $$
(15)

It can be obtain that

$$ \dot{V} = \dot{V}_{1} + \dot{V}_{2} = - 2w^{\rm T} \beta w \le 0. $$
(16)

Note that the equilibrium states of the dynamic system satisfy \( \dot{\bar{x}} = 0 \), \( \dot{\bar{v}} = 0 \). We can obtain that \( \bar{v} = 0 \) and \( u_{i} \left( t \right) = 0 \), that is \( - \beta H\bar{x} = 0 \). We can obtain the equilibrium states of the dynamic system satisfy \( \bar{x} = 0 \) and \( \bar{v} = 0 \) from the positive definite matrix \( H \).

When \( \dot{V} \equiv 0 \), there exists \( w = - H\bar{v} = 0 \) such that \( \bar{v} = 0 \) and \( \dot{\bar{v}} = 0 \). And then it has \( \bar{x} = 0 \), \( \bar{v} = 0 \). Therefore, when \( \dot{V} = 0 \), there exists only the equilibrium point in this solution set. According to the principle of Lasalle’s invariant set, the dynamic MAS (2) are asymptotically stable at the equilibrium point. The optimal group consensus of the dynamic MAS (2) with the optimal control algorithm (11) will be achieved.

4 Numerical Examples

In this section, simulations of MAS with leaders/leaderless are given to illustrate the theoretical results of this paper.

4.1 The Simulation of MAS with Leaders

It is assumed that the networked topology of MAS with leaders is shown in Fig. 1. Two sub-graph composed of followers 1–3 and 4–7. Agents L1 and L2 are the corresponding leaders in two sub-graph. Lines and numbers indicate that the information transfer and associated weigh.

Fig. 1.
figure 1

Multi-agent system with leaders

Based on the networked topology of Fig. 1, we can get its Laplacian matrix, and then we can obtain the eigenvalue of Laplacian matrix of Fig. 1.

We choose the initial states and the initial speeds of agents are \( x\left( 0 \right) = \left[ {5,8,6,12,4,2,5} \right]^{\rm T} \), \( v\left( 0 \right) = \left[ {4,7,5,11,3,1,4} \right]^{\rm T} \). Considering leaders in two subgraph with the initial state and the initial speed \( x_{01} = 5,v_{01} = 4 \) and \( x_{02} = 6,v_{02} = 5 \), respectively. The simulation results of the system motion are shown in Fig. 2.

Fig. 2.
figure 2

Motion trajectory of MAS with leaders, \( \beta = 18 \)

It has been revealed that the motion trajectories of each agent finally converge to two equilibrium states with the optimal control algorithm (11). The followers track the trajectory of leaders into two subgroups, and the two equilibrium states are the initial states of the two leaders (\( x_{01} = 5,x_{02} = 6 \)).

Comparing Fig. 3 and Fig. 4, we can see that when \( \beta = 0.8 \) in Fig. 3, the convergence time \( t \) required for the MAS to reach the equilibrium state is longer. Therefore, it is concluded that the optimal scaling factor \( \beta \) has an effect on the convergence speed of the MAS. The larger the optimal scaling factor \( \beta \), the faster the convergence speed.

Fig. 3.
figure 3

Motion trajectory of MAS with leaders, \( \beta = 0.8 \)

Fig. 4.
figure 4

Multi-agent system with leaderless

4.2 The Simulation of MAS with Leaderless

Now we assume the networked topology graph of MAS with leaderless is shown in Fig. 4. In the topology graph, the agents 1-7 are all substantive agents. There is information transfer between each agent.

The initial value of agents and the parameter are same with Subsect. 4.1. The optimal control algorithm (11) is applied in simulation, then the motion trajectory of MAS without leaderless is shown in Fig. 5. It can be seen that the agents move into two subgroups and the movement consensus of MAS with leaderless is realized.

Fig. 5.
figure 5

Motion trajectory of MAS with leaderless \( \beta = 33 \)

Comparing Fig. 5 and Fig. 6, we can see that when \( \beta = 0.8 \) in Fig. 6, the convergence time \( t \) required for the MAS to reach the equilibrium state is longer. Therefore, it is concluded that the relationship between optimal scaling factor \( \beta \) and the convergence speed of the multi-agent system is proportional.

Fig. 6.
figure 6

Motion trajectory of MAS with leaderless

5 Conclusions

In the paper, the problem for optimal group consensus control of second-order MAS with/without leaders has been investigated. The group consensus cost function for dynamic system and the optimal consensus algorithm are proposed. By applying the LQR method, the symmetric Laplacian matrix associated with the undirected graph is derived. In addition, the optimal scaling factor for optimal control problem is studied. Based on algebraic graph theory and modern control theory, group flocking motions of second-order MAS are studied. Numerical examples are given to validate the theoretical results. One future research work will focus on the optimality issues for group consensus algorithms of high-order dynamic MAS.