Abstract. The aim of this paper is to analyse the behaviour of HegselmannâKrause type models. General sufficient conditions for achieving consensus are ...
Application of predictive control to the Hegselmann–Krause model Ricardo Almeida1 , Ewa Girejko2 , Lu´ıs Machado3 , Agnieszka B. Malinowska2 , Nat´alia Martins1 1
Center for Research and Development in Mathematics and Applications (CIDMA), Department of Mathematics, University of Aveiro, 3810–193 Aveiro, Portugal 2 Faculty of Computer Science, Bialystok University of Technology, 15-351 Bialystok, Poland 3 Department of Mathematics, University of Tr´as os Montes e Alto Douro (UTAD), 5001–801 Vila Real, Portugal, ISR - University of Coimbra, 3030–290 Coimbra, Portugal Abstract The aim of this paper is to analyse the behaviour of Hegselmann–Krause type models. General sufficient conditions for achieving consensus are provided. The Model Predictive Control is applied to the Hegselmann–Krause system in the context of time scales. Numerical simulations show that the predictive control mechanism has the ability to steer the system to attain a consensus. Moreover, faster consensus speed is observed when compared with the classical model. Finally, considering the case when the time scale is discrete and all agents are neighbours at the initial time, conditions guaranteeing an average consensus are given.
Mathematics Subject Classification 2010: 39A12, 34N05, 49K05. Keywords: Consensus formation, opinion dynamics, time scale calculus, predictive control.
1
Introduction
Consensus or agreement theory seeks conditions under which the states (representing, e.g., positions, opinions, attitudes) of all individuals (also called agents or experts) of a given group converge asymptotically toward a common value. In the last decades, this theory has been extensively investigated in sociology, robotics, computer science, economics, political sciences, sociophysics, and biology, just to name a few. In particular, it finds applicability in mobile robots, autonomous aerial and underwater vehicles (UAVs and AUVs). In networks of agents, information can be spread in different ways. For example, vehicles can communicate via wireless networks, position sensors and/or joint knowledge given by pre-programming before the beginning of a task [2, 6, 8]. Dynamical systems with collective behaviours arise also in biological systems where agents are human beings or animals. In human societies, international agreements such as climate change initiatives, nuclear safety, marine living resources, are difficult to obtain. For that reason, it is important to provide mechanisms or strategies in order to promote a common goal. One of the pioneer mathematical models in this direction is due to Krause [14], which was later developed by Hegselmann and Krause in [12]. In this model, a set of N agents is considered and the opinion of each agent i at time t is a real value denoted by xi (t), for i ∈ {1, 2, . . . , N }. The dynamics is given by the system of difference equations: X 1 xi (t + 1) = P xj (t), i = 1, . . . , N. j:|xj (t)−xi (t)| 0 such that for any feasible (x, u) with kx − x ¯kC < ε and ku − u ¯kCprd < ε we have J(¯ x, u ¯) ≤ J(x, u), where kukCprd :=
sup t∈[t0 ,ρ(T )]T
|u(t)| ,
kxkC := max |x(t)|. t∈[t0 ,T ]T
Theorem 1. Assume that I − µ(t)L is nonsingular for all t ∈ [t0 , ρ(T )]T . If (x, u) is a weak local 1 minimum for problem (6)–(7), then there exists a unique function p : [t0 , T ]T → RN , p ∈ Cprd satisfying the following conditions: 1. the adjoint equations: for all t ∈ [t0 , ρ(T )]T and i = 1, . . . , N , p∆ i (t) =
N X j=1
2(xj (t) − xi (t)) + aij (t0 )pσi (t) − aji (t0 )pσj (t) ;
2. the stationary condition: pσ (t) = −ωu(t), for all t ∈ [t0 , ρ(T )]T ; 3. the transversality condition: p(T ) = 0. Proof. Apply the Weak Maximum Principle on time scales (see Theorem 9.4 in [13]). Next, we show that necessary optimality conditions given in Theorem 1 are also sufficient. Theorem 2. Assume that I − µ(t)L is nonsingular for all t ∈ [t0 , ρ(T )]T . If a triplet (x, u, p) satisfies conditions 1 − 3 of Theorem 1, then (x, u) is a weak minimum for problem (6)–(7). Proof. Observe that system (6) can be rewritten in matrix form as x∆ (t) = −Lx(t) + u(t),
(8)
and the function in (7) is convex. Hence, by conditions 1 and 2 of Theorem 1, for any feasible (x, u) we have J(x, u) − J(x, u) ≥
Z
T
t0
−(p∆ (t))T + (pσ (t))T L (x(t) − x(t))∆t −
Z
T
t0
(pσ (t))T (u(t) − u(t))∆t.
Integrating by parts we get
T Z J(x, u) − J(x, u) ≥ (−p(t)) (x(t) − x(t)) +
T
T
t0
+
Z
t0
(pσ (t))T (x∆ (t) − x∆ (t))∆t
T
t0
(pσ (t))T L(x(t) − x(t))∆t −
Z
T
t0
(pσ (t))T (u(t) − u(t))∆t.
(9)
Finally, substituting (8) into (9) and using condition 3 of Theorem 1, we conclude that J(x, u) − J(x, u) ≥ 0.
5
4
Consensus algorithm with predictive control
In this section we propose a control strategy for consensus based on a Model Predictive Control (MPC) scheme defined on a finite horizon. Let T be an unbounded time scale and consider the Hegselmann–Krause model with control: x∆ i (t) =
N X j=1
aij (t)(xj (t) − xi (t)) + ui (t),
i = 1, . . . , N,
t ∈ T,
(10)
with coefficients aij (t) given by (2). The feedback control will be obtained by repeatedly solving open loop optimal control problems in each sampling interval, every time using the current system state at time tk , i.e. x(tk ), as the initial condition. In more detail, the MPC conceptual consensus algorithm works as follows. The MPC consensus algorithm Step 1. Let x(t0 ) = x0 . Choose a sequence of sampling instants {ti }i>0 , where ti ∈ T for all i > 0, and a positive integer q ≥ 2. Set k = 0. Step 2. Compute A = [aij ], where ( 1 P if |xj (tk ) − xi (tk )| < 1 l:|xl (tk )−xi (tk )| 0, 1 = (1, · · · , 1)T and kxk2 := xT x. That is, for each ǫ, Tc (ǫ) is the minimum number of steps required for D(k) to reach a value less or equal than ǫ. The ratio 1/Tc(ǫ) can be 1 N
7
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0
1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Figure 2: Time evolution of systems without (left) and with (right) control on T = 0.25N0. 0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
0
1
2
3
4
5
0
6
0
1
2
3
4
5
6
Figure 3: Time evolution of systems without (left) and with (right) control on T = 1.5N0 . interpreted as the consensus speed. The next example shows that the addition of the predictive mechanism increases significantly the consensus speed. Example 4. We analyze HK and HKPC models with 10 agents and the initial conditions chosen randomly from the interval [0, 2]. In Figure 6 and Figure 7 (left), we consider ω = 1 and homogeneous time scales T = µN0 , µ ∈ {0.01, 0.25, 1.5, 2.0}. In Figure 6, plots of D(k) are presented with log scale on the vertical axis. The increase of the convergence speed towards consensus is visible in the case of the HKPC system. Figure 7 (left) shows plots of Tc (0.01) for both HK and HKPC models. As we can observe, in case with control, the influence of the graininess function is not so relevant in terms of the consensus speed. In Figure 7 (right) and Figure 8, we present the relevance of the weight parameter ω that appears in the second term of functional (11) and penalizes the MPC control. As expected, the consensus speed increases when ω decreases.
5
Analysis of the HKPC model
Since the two first steps in the HKPC algorithm are clear and simple, we start an analysis from Step 3. Let q = 2 and ω = 1. Then necessary and sufficient conditions for solutions to problem
8
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
0
1
2
3
4
5
6
7
0
8
0
1
2
3
4
5
6
7
8
Figure 4: Time evolution of systems without (left) and with (right) control on T = 2N0 . 9
10
9
8
8 7 7 6
6
5
5
4
4
3 3 2 2
1
0
0
100
200
300
400
500
600
1
700
0
10
20
30
40
50
60
70
80
Figure 5: Time evolution of systems with 6 agents without (left) and with (right) control on T = {0, 1, 2, 6, 18, . . . , 2 · 3i−1 , . . .}. (11)–(12) have the following form: x(σ(tk+i )) = Mk x(tk+i ) + µ(tk+i )u(tk+i ), p(σ(tk+i )) = −u(tk+i ), p(σ(tk+i )) = Mk−T p(tk+i ) − 2µ(tk+i )Mk−T L1 x(tk+i ) , p(tk+2 ) = 0,
for i = 0, 1,
where Mk = I − µ(tk )L, Mk−T := (Mk−1 )T and matrix L1 = [lij ]1≤i,j≤N with entries lij = −1 if
i 6= j and lii = N − 1. Then, according to Step 4, we apply the feedback control to system (12) and obtain x(σ(tk )) = Pk · Mk x(tk ) ,
(14)
where Pk = (I + 2µ(tk )µ(tk+1 )L1 )−1 . It follows that stabilization problem of the HK model using the MPC consensus algorithm can be analyzed as an asymptotic stability problem of system (14).
9
10 0
10 -1
10 -5
10 -2
10 -10
D(k)
D(k)
10 0
10 -3
10 -4
10 -20
10 -5
10 -6
10 -15
10 -25
µ = 0.01 µ = 0.25 µ=2 µ = 1.5
0
1
2
3
4
5
6
7
8
10 -30
9
µ = 0.01 µ = 0.25 µ=2 µ = 1.5
0
1
2
3
4
k
5
6
7
8
9
k
Figure 6: The evolution of D(k) for µ ∈ {0.01, 0.25, 1.5, 2.0} for systems without (left) and with (right) control. 10 3
10 2 without control with control
Tc (0.01)
Tc (0.01)
10 2
10 1
10 1
10 0
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
10 0
2
0
1
2
3
4
5
6
ω
µ
Figure 7: Evolution of Tc (0.01) for µ ∈ {0.01, 0.25, 1.5, 2.0} (left) and for different values of ω (right). Simple calculations lead to
Pk =
1 1 + 2N µ(tk )µ(tk+1 )
1 + 2µ(tk )µ(tk+1 )
2µ(tk )µ(tk+1 )
...
2µ(tk )µ(tk+1 )
2µ(tk )µ(tk+1 )
1 + 2µ(tk )µ(tk+1 )
...
2µ(tk )µ(tk+1 )
:
:
2µ(tk )µ(tk+1 )
2µ(tk )µ(tk+1 )
..
.
...
: 1 + 2µ(tk )µ(tk+1 )
,
n o and therefore spec(Pk ) = 1, 1+2N µ(t1k )µ(tk+1 ) , where the eigenvalue 1+2N µ(t1k )µ(tk+1 ) has multiplicity N − 1. In what follows, we consider the case where the adjacency matrix is of the form A = [aij ]1≤i,j≤N
with entries aij =
1 , N
(15)
meaning that all agents are neighbours, and assume that µ(tk ) 6= 1, for all tk ∈ T. In this case, matrix Mk is nonsingular and matrix Pk · Mk = Mk · Pk = [mij ]1≤i,j≤N is symmetric with entries 1 k) for i = 6 j and m = mij = 1+2N µ(t1k )µ(tk+1 ) 2µ(tk )µ(tk+1 ) + µ(t ii N 1+2N µ(tk )µ(tk+1 ) 1 + 2µ(tk )µ(tk+1 ) − 10
µ(tk )(N −1) N
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
0
0.2
0.4
0.6
0.8
1
0
1.2
0
0.2
0.4
0.6
0.8
1
1.2
Figure 8: Time evolution of the HKPC system with 6 agents on T = 0.25N0 for ω = 0.5 (left) and ω = 100 (right). PN Remark 2. Observe that in matrix Pk · Mk , j=1 mij = 1 for every i ∈ {1, ..., N }. It implies that x = (c, ..., c)T , where c is a constant, is an equilibrium point of system (14). Theorem 3. Assume that |xj (t0 ) − xi (t0 )| < 1, for all i, j ∈ {1, ..., N }, and there exists a real 0 < b < 1 such that 1 − µ(tk ) ≤ b. sup (16) k∈N0 1 + 2N µ(tk )µ(tk+1 ) PN Then, in HKPC model an average consensus is achieved and is given by c = N1 j=1 xj (t0 ). Proof. First, observe that under assumption (16), for all i, j ∈ {1, ..., N }, if |xj (t0 ) − xi (t0 )| < 1, k) then |xj (tk )−xi (tk )| < 1 for all k. Since spec(Pk ·Mk ) = {1, 1+2N1−µ(t µ(tk )µ(tk+1 ) }, where the eigenvalue 1−µ(tk ) 1+2N µ(tk )µ(tk+1 )
has multiplicity N − 1, matrix Pk · Mk can be written as Pk · Mk = Q · Λk · Q−1 , where matrices Q, Q−1 and Λk are given by 1
Q=
1
−1 1
−1 0
:
:
:
1
0
0
...
... ..
−1 0
.
:
...
1
,
Q
−1
1 = N
1
1
1
...
1
−1
N −1
−1
...
−1
:
:
:
−1
−1
−1
...
1−
k−1 Y
..
.
1−µ(tk ) k) , . . . , and Λk = diag 1, 1+2N1−µ(t µ(tk )µ(tk+1 ) 1+2N µ(tk )µ(tk+1 ) . Therefore, x(σ k (t0 )) = Q ·
k−1 Y l=0
Λl · Q−1 x(t0 ).
It follows that, for all i ∈ {1, 2, . . . , N }, ! k−1 Y 1 1 − µ(tl ) k xi (σ (t0 )) = 1 + (N − 1) · xi (t0 ) + N 1 + 2N µ(tl )µ(tl+1 ) l=0
: N −1
,
l=0
1 − µ(tl ) 1 + 2N µ(tl )µ(tl+1 )
!
·
N X j6=i
xj (t0 ) .
Since N N X X 1 1 1 + (N − 1)bk · xi (t0 ) + 1 + bk · xj (t0 ) ≤ xi (σ k (t0 )) ≤ xj (t0 ) 1 − (N − 1)bk · xi (t0 ) + 1 − bk · N N j6=i
j6=i
11
we conclude that xi (σ k (t0 )) tends to desired.
1 N
PN
j=1
xj (t0 ) for all i ∈ {1, . . . , N }, when k → ∞, as
Remark 3. It is worth pointing out that the condition |xj (t0 ) − xi (t0 )| < 1, for all i, j ∈ {1, ..., N }, together with assumption µ(t) ≥ 2, for all t ≥ t0 , implies that in the HK model consensus cannot be reached (see Proposition 3.6 [9]). On the other hand, under assumption µ(t) < 2, for all t ≥ t0 , this condition is sufficient for consensus in the HK model (see Remark 4 [10]). However, as it could be observed in Example 2, the HKPC model achieves consensus faster. Remark 4. In the special case when the time scale is homogeneous and the step size is different from 1, that is, µ(tk ) = h 6= 1, for all tk ∈ T, condition (16) in Theorem 3 is trivially satisfied since |(1 − h)/(1 + 2N h2 )| < 1 holds for any N ∈ N.
6
Conclusion
We have studied the Hegselmann–Krause model in the context of time scales. In order to improve the performance of collective behaviour in a group of interacting agents, we have added a predictive mechanism to the routine consensus protocol. Numerical simulations showed that predictive control can produce faster consensus speed. Moreover, conditions ensuring asymptotic convergence to an average consensus, when all the agents are neighbours at the initial time, were provided. To the best of our knowledge, a model predictive control in the framework of time scales has not been studied yet. Therefore, this work can be also recognized as an attempt to motivate further studies in this direction. A challenging but important problem is the stability of the MPC scheme, especially in the case of system (10), where the coefficients aij (t) are updated in each moment of time based on the current available state information. This problem will be considered in forthcoming papers.
Acknowledgments R. Almeida and N. Martins are supported by Portuguese funds through the CIDMA - Center for Research and Development in Mathematics and Applications, and the Portuguese Foundation for Science and Technology (FCT-Funda¸ca˜o para a Ciˆencia e a Tecnologia), within project UID/MAT/04106/2013. E. Girejko and A. B. Malinowska are supported by Polish founds of National Science Center, granted on the basis of decision DEC-2014/15/B/ST7/05270. L. Machado acknowledges “Funda¸ca˜o para a Ciˆencia e a Tecnologia” (FCT-Portugal) and COMPETE 2020 Program for financial support through project UID-EEA-00048-2013.
References [1] Aulbach B, Hilger S. A unified approach to continuous and discrete dynamics, in Qualitative Theory of Differential Equations, Szeged, 1988, in: Colloq. Math. Soc. Janos Bolyai, vol 53, North-Holland, Amsterdam, 1990, pp. 37–56. [2] Balch, T, Parker, LE eds. Robot Teams: From Diversity to Polymorphism. Natick, Massachusetts: A. K. Peters, Ltd., 2002. [3] Blondel VD, Hendrickx JM, Tsitsiklis JN. Continuous-time average-preserving opinion dynamics with opinion-dependent communications. SIAM Journal on Control and Optimization 2010; 18:5214–5240. [4] Bohner M, Peterson A. Dynamic equations on time scales, Birkh¨ auser Boston, Boston, MA, 2001. [5] Camacho E, Bordons C. Model predictive control. In: Advanced Textbooks in Control and Signal Processing, Springer, 2007. [6] Carpenter, JR. Decentralized control of satellite formations. International Journal of Robust and Nonlinear Control 2002; 12:141–161.
12
[7] Cucker F, Smale S. On the mathematics of emergence. Japanese Journal of Mathematics 2007; 2:197– 227. [8] Fax, JA, Murray, RM. Information flow and cooperative control of vehicle formations. IEEE Transactions on Automatic Control 2004; 49:1465–1476. [9] Girejko E, Machado L, Malinowska AB, Martins N. Krause’s model of opinion dynamics on isolated time scales. Mathematical Methods in the Applied Sciences 2016; 39:5302–5314. [10] Girejko E, Machado L, Malinowska AB, Martins N. On consensus in the Cucker–Smale type model on isolated time scales. Discrete and Continuous Dynamical Systems. Series S 2018; 11:77–89. [11] Gr¨ une L, Pannek J. Nonlinear Model Predictive Control–Theory and Algorithms. Springer-Verlag, London, 2011. [12] Hegselmann R, Krause U. Opinion dynamics and bounded confidence: models, analysis, and simulation. Journal of Artificial Societies and Social Simulations 2002; 5: 1–33. [13] Hilscher R, Zeidan V. Weak maximum principle and accessory problem for control problems on time scales. Nonlinear Analysis 2009; 70:3209–3226. [14] Krause U. A discrete nonlinear and non-autonomous model of consensus formation. Communications in Difference Equations 2000; 2000:227–236. [15] Zhang HT, Chen M, Stan GB, Zhou T, Maciejowski JM. Collective behaviour coordination with predictive mechanisms. IEEE Circuits Systems Magazine 2008; 8:67–85. [16] Zhang HT, Chen M, Zhou T, Stan GB. Ultrafast consensus via predictive mechanisms. Europhysics Letters 2008; 83:40003.
13