【Paper】2003_Consensus Problems in Networks of Agents with Switching Topology and Time-Delays
此篇文章主要在于仿真代码,关于文献的解释请参考 【Paper】2003_Murr_Consensus Problems in Networks of Agents with Switching Topology and Time-Delays
文献原文: Consensus Problems in Networks of Agents with Switching Topology and Time-Delays
Consensus Problems in Networks of Agents with Switching Topology and Time-Delays
- 原Paper中Figure5复现
- 原Paper中Figure6复现
- 原Paper中Figure6复现
三种网络:
- 切换拓扑无时滞
- 固定拓扑有时滞
- 离散时间最大一致性(领航者模型)
第一个问题:另一篇文章中,有提到若全连接,则系统的稳定性会被破坏。
第二个问题:第二个问题:平均一致性与系统的一致性不是一码事,平均一致性是 average-consensus,系统一致性是 general agreement。
% 此为论文中,关于Fig5(a)中a子图的复现结果。
% 输入参数包括初始状态(位置)和图的拉普拉斯矩阵
% 最后显示状态一致性收敛的踪迹和输入的变化曲线
clc;
clear;%% 输入初始化参数
X0 = [-10.2999, 0.2575, -4.4997, 3.6258, 3.0922, 9.0156, 3.5099, -2.6645, 2.4552, -4.4921]';
% 一致性决策值
AveVal = mean(X0); % 平均一致性
MaxVal = max(X0); % 最大一致性
MinVal = min(X0); % 最小一致性
n = 10; % 节点数量
% 度矩阵,有向拓扑结构
D =[1 0 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1;];
% 邻接矩阵,有向拓扑结构
A =[0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0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 0 0 2 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 2 0 0 0;0 0 0 0 0 0 0 3 0 0;0 0 0 0 0 0 0 0 2 0;0 0 0 0 0 0 0 0 0 1;];
% 邻接矩阵,有向拓扑结构
A =[0 1 0 0 0 0 0 0 1 0;0 0 1 0 0 0 0 1 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 1 0 0;0 0 0 0 0 1 1 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 1 0 0 1 0 0;0 1 0 1 0 0 0 0 1 0;1 0 0 0 0 0 0 0 0 1;1 0 0 0 0 0 0 0 0 0;];
% 拉普拉斯矩阵
L = D - A;% 矩阵的代数连通度
eig_val = eig(L); % L的特征值
eig_val = sort(eig_val,'ascend'); % 从小到大排序,最小特征值为0
algeb_conn = eig_val(2); % algebraic connectivity 代数连通度:lap_matrix的第二小特征值>0,连通图%% 收敛相关参数
tBegin = 0; % 开始时间
tEnd = 15; % 结束时间
h = 0.1; % 最小时间间隔
times = (tEnd-tBegin) / h; % 迭代计算次数
X(:,1) = X0; % X的第一列等于X1
U(:,1) = -L * X0;
t(1) = tBegin; % 时间间隔记录表i = 1;
while(i <= times)t(i+1) = tBegin + i * h; % 添加更新后的t值Xt = X(:,i);Ut = -L * Xt; % u = -Lx
% Xt1 = Xt + h * Ut; % x = x + h*uXt1 = expm(-L*(tBegin+i*h)) * X0; % x = x + h*uX(:,i+1) = Xt1; % 添加更新后的Xt值U(:,i+1) = Ut; % 添加更新后的Ut值 i = i+1;
end%% 结果显示
% 绘制图像
subplot(2,1,1)
plot(t,X(1,:), t,X(2,:), t,X(3,:), t,X(4,:), t,X(5,:), t,X(6,:), t,X(7,:), t,X(8,:), t,X(9,:), t,X(10,:), 'linewidth',2.0)
% legend("x_1","x_2","x_3","x_4","x_5","x_6","x_7","x_8","x_9","x_{10}");
xlabel('Times/收敛次数');
ylabel('States/状态值');
title('States-Times');subplot(2,1,2)
plot(t,U(1,:), t,U(2,:), t,U(3,:), t,U(4,:), t,U(5,:), t,U(6,:), t,U(7,:), t,U(8,:), t,U(9,:), t,U(10,:), 'linewidth',2.0)
% legend("u_1","u_2","u_3","u_4","u_5","u_6","u_7","u_8","u_9","u_{10}");
xlabel('Times/收敛次数');
ylabel('U/输入值');
title('U-Times');
原Paper中Figure5复现
clear;
clc;
% 此为原Paper中Figure5复现代码% 状态初值如下
X0 = [-10.2999, 0.2575, -4.4997, 3.6258, 3.0922, 9.0156, 3.5099, -2.6645, 2.4552, -4.4921]';Node_Nums = 10;% a图度矩阵,邻接矩阵,拉普拉斯矩阵
D_a = [ 1 0 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1;];
A_a = [ 0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1;1 0 0 0 0 0 0 0 0 0;];
L_a = D_a - A_a;% b图度矩阵,邻接矩阵,拉普拉斯矩阵
D_b = [ 1 0 0 0 0 0 0 0 0 0;0 2 0 0 0 0 0 0 0 0;0 0 2 0 0 0 0 0 0 0;0 0 0 2 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 2 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 2;];
A_b = [ 0 1 0 0 0 0 0 0 0 0;0 0 1 0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0 0 0;0 0 0 0 1 0 0 1 0 0;0 1 0 1 0 0 0 0 1 0;1 0 0 0 0 0 0 0 0 1;1 0 0 0 0 0 0 0 0 0;];
L_d = D_d - A_d;% 设置收敛相关参数
tBegin = 0; % 开始时间
tEnd = 20; % 结束时间
dt = 0.1; % 最小时间间隔
times = (tEnd-tBegin) / dt; % 迭代计算次数
time = 1;
% 定义记录时间数组
t(:,1) = tBegin;
% 定义图a数据存储数组
X_a(:,1) = X0;
U_a(:,1) = -L_a * X0;
Delta_a(:,1) = X0' * L_a * X0;
% 定义图b数据存储数组
X_b(:,1) = X0;
U_b(:,1) = -L_b * X0;
Delta_b(:,1) = X0' * L_b * X0;X_c(:,1) = X0;
U_c(:,1) = -L_c * X0;
Delta_c(:,1) = X0' * L_c * X0;X_d(:,1) = X0;
U_d(:,1) = -L_d * X0;
Delta_d(:,1) = X0' * L_d * X0;
% 开始收敛计算
while(time <= times)t(:,time+1) = tBegin + time * dt;% 图a数据迭代X_a(:,time+1) = expm(-L_a * t(:,time+1)) * X0; % Xt = expm(-Lx)*X0 添加更新后的Xt值U_a(:,time+1) = -L_a * X_a(:,time+1); % Ut = -LXt 添加更新后的Ut值 Delta_a(:,time+1) = X_a(:,time+1)'*L_a*X_a(:,time+1); % Delta = X^T * L * X% 图b数据迭代X_b(:,time+1) = expm(-L_b * t(:,time+1)) * X0;U_b(:,time+1) = -L_b * X_b(:,time+1);Delta_b(:,time+1) = X_b(:,time+1)'*L_b*X_b(:,time+1);X_c(:,time+1) = expm(-L_c * t(:,time+1)) * X0;U_c(:,time+1) = -L_c * X_c(:,time+1);Delta_c(:,time+1) = X_c(:,time+1)'*L_c*X_c(:,time+1);X_d(:,time+1) = expm(-L_d * t(:,time+1)) * X0;U_d(:,time+1) = -L_d * X_d(:,time+1);Delta_d(:,time+1) = X_d(:,time+1)'*L_d*X_d(:,time+1);time = time + 1;
end% 矩阵的代数连通度
eig_val_a = eig(L_a); % L_a的特征值
eig_val_a = sort(eig_val_a,'ascend'); % 从小到大排序,最小特征值为0
AC_a = real(eig_val_a(2)); % algebraic connectivity 代数连通度:lap_matrix的第二小特征值>0,连通图eig_val_b = eig(L_b); % L_b的特征值
eig_val_b = sort(eig_val_b,'ascend'); % 从小到大排序,最小特征值为0
AC_b = real(eig_val_b(2)); % algebraic connectivity 代数连通度:lap_matrix的第二小特征值>0,连通图eig_val_c = eig(L_c);
eig_val_c = sort(eig_val_c,'ascend');
AC_c = real(eig_val_c(2));eig_val_d = eig(L_d);
eig_val_d = sort(eig_val_d,'ascend');
AC_d = real(eig_val_d(2));% 绘制图a数据
subplot(4,2,1);
plot(t,X_a(1,:), t,X_a(2,:), t,X_a(3,:), t,X_a(4,:), t,X_a(5,:), t,X_a(6,:), t,X_a(7,:), t,X_a(8,:), t,X_a(9,:), t,X_a(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("node value");
title("Algebraic Connectivity="+num2str(AC_a));
subplot(4,2,3);
plot(t,Delta_a, 'linewidth',1.5);
xlabel("time(sec)");ylabel("disagreement");subplot(4,2,2);
plot(t,X_b(1,:), t,X_b(2,:), t,X_b(3,:), t,X_b(4,:), t,X_b(5,:), t,X_b(6,:), t,X_b(7,:), t,X_b(8,:), t,X_b(9,:), t,X_b(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("node value");
title("Algebraic Connectivity="+num2str(AC_b));
subplot(4,2,4);
plot(t,Delta_b, 'linewidth',1.5);
xlabel("time(sec)");ylabel("disagreement");subplot(4,2,5);
plot(t,X_c(1,:), t,X_c(2,:), t,X_c(3,:), t,X_c(4,:), t,X_c(5,:), t,X_c(6,:), t,X_c(7,:), t,X_c(8,:), t,X_c(9,:), t,X_c(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("node value");
title("Algebraic Connectivity="+num2str(AC_c));
subplot(4,2,7);
plot(t,Delta_c, 'linewidth',1.5);
xlabel("time(sec)");ylabel("disagreement");subplot(4,2,6);
plot(t,X_d(1,:), t,X_d(2,:), t,X_d(3,:), t,X_d(4,:), t,X_d(5,:), t,X_d(6,:), t,X_d(7,:), t,X_d(8,:), t,X_d(9,:), t,X_d(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("node value");
title("Algebraic Connectivity="+num2str(AC_d));
subplot(4,2,8);
plot(t,Delta_d, 'linewidth',1.5);
xlabel("time(sec)");ylabel("disagreement");figure(2)
plot(t,X_a(1,:), t,X_a(2,:), t,X_a(3,:), t,X_a(4,:), t,X_a(5,:), t,X_a(6,:), t,X_a(7,:), t,X_a(8,:), t,X_a(9,:), t,X_a(10,:), 'linewidth',1.5)
原Paper中Figure6复现
clear;
clc;
% 此为原Paper中Figure6复现代码% 状态初值如下
X0 = [-10.2999, 0.2575, -4.4997, 3.6258, 3.0922, 9.0156, 3.5099, -2.6645, 2.4552, -4.4921]';Node_Nums = 10;% b图度矩阵,邻接矩阵,拉普拉斯矩阵
D_a = [ 1 0 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1;];
A_a = [ 0 1 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1;1 0 0 0 0 0 0 0 0 0;];
L_a = D_a - A_a;% b图度矩阵,邻接矩阵,拉普拉斯矩阵
D_b = [ 1 0 0 0 0 0 0 0 0 0;0 2 0 0 0 0 0 0 0 0;0 0 2 0 0 0 0 0 0 0;0 0 0 2 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0;0 0 0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,有向拓扑结构
A_d = [ 0 1 0 0 0 0 0 0 1 0;0 0 1 0 0 0 0 1 0 0;0 0 0 1 0 0 0 0 0 0;0 0 0 0 1 0 0 1 0 0;0 0 0 0 0 1 1 0 0 0;0 0 0 0 0 0 1 0 0 0;0 0 0 0 1 0 0 1 0 0;0 1 0 1 0 0 0 0 1 0;1 0 0 0 0 0 0 0 0 1;1 0 0 0 0 0 0 0 0 0;];
L_d = D_d - A_d;% 设置收敛相关参数
tBegin = 0; % 开始时间
tEnd = 15; % 结束时间
dt = 0.1; % 最小时间间隔
times = (tEnd-tBegin) / dt; % 迭代计算次数
time = 1;
% 定义记录时间数组
t(:,1) = tBegin;
% 定义图数据存储数组
% t=0时刻,状态为b
X(:,1) = X0;
U(:,1) = -L_b * X0;
Delta(:,1) = X0' * L_b * X0;% 开始收敛计算
while(time <= times)% 迭代顺序为 b->a->d->c->bif ((time>=1 && time<=10)||(time>=41 && time<=50)||(time>=81 && time<=90)||(time>=121 && time<=130))L = L_b;elseif((time>=11 && time<=20)||(time>=51 && time<=60)||(time>=91 && time<=100)||(time>=131 && time<=140))L = L_a;elseif((time>=21 && time<=30)||(time>=61 && time<=70)||(time>=101 && time<=110)||(time>=141 && time<=150))L = L_d;elseif((time>=31 && time<=40)||(time>=71 && time<=80)||(time>=111 && time<=120))L = L_c;endt(:,time+1) = tBegin + time * dt;X(:,time+1) = expm(-L * t(:,time+1)) * X0;U(:,time+1) = -L * X(:,time+1);Delta(:,time+1) = X(:,time+1)'*L*X(:,time+1);time = time + 1;
end% 绘制图数据
subplot(2,1,1);
plot(t,X(1,:), t,X(2,:), t,X(3,:), t,X(4,:), t,X(5,:), t,X(6,:), t,X(7,:), t,X(8,:), t,X(9,:), t,X(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("node value");
subplot(2,1,2);
plot(t,Delta, 'linewidth',1.5);
xlabel("time(sec)");ylabel("disagreement");
原Paper中Figure6复现
clear;
clc;
% 此为原Paper中Figure6复现代码% 状态初值如下
X0 = [-10.2999, 0.2575, -4.4997, 3.6258, 3.0922, 9.0156, 3.5099, -2.6645, 2.4552, -4.4921]';Node_Nums = 10;D = [ 2 0 0 0 0 0 0 0 0 0;0 3 0 0 0 0 0 0 0 0;0 0 4 0 0 0 0 0 0 0;0 0 0 4 0 0 0 0 0 0;0 0 0 0 4 0 0 0 0 0;0 0 0 0 0 4 0 0 0 0;0 0 0 0 0 0 4 0 0 0;0 0 0 0 0 0 0 4 0 0;0 0 0 0 0 0 0 0 3 0;0 0 0 0 0 0 0 0 0 2;];
A = [ 0 1 1 0 0 0 0 0 0 0;1 0 1 1 0 0 0 0 0 0;1 1 0 1 1 0 0 0 0 0;0 1 1 0 1 1 0 0 0 0;0 0 1 1 0 1 1 0 0 0;0 0 0 1 1 0 1 1 0 0;0 0 0 0 1 1 0 1 1 0;0 0 0 0 0 1 1 0 1 1;0 0 0 0 0 0 1 1 0 1;0 0 0 0 0 0 0 1 1 0;];
L = D - A;% 设置收敛相关参数
tBegin = 0; % 开始时间
tEnd = 15; % 结束时间
dt = 0.01; % 最小时间间隔
times = (tEnd-tBegin) / dt; % 迭代计算次数
time = 1;
% 定义记录时间数组
t(:,1) = tBegin;
% 定义图数据存储数组
X1(:,1) = X0;
U1(:,1) = -L * X0;
Delta(:,1) = X0' * L * X0;X2(:,1) = X0;
U2(:,1) = -L * X0;X3(:,1) = X0;
U3(:,1) = -L * X0;X4(:,1) = X0;
U4(:,1) = -L * X0;X5(:,1) = X0;
U5(:,1) = -L * X0;X6(:,1) = X0;
U6(:,1) = -L * X0;% 开始收敛计算
while(time <= times)t(:,time+1) = tBegin + time * dt;U1(:,time) = -L*X1(:,time);X1(:,time+1) = U1(:,time)*dt + X1(:,time);
% X(:,time+1) = expm(-L * t(:,time+1)) * X0;if time<=13
% U2(:,time) = -L*X2(:,time);
% X2(:,time+1) = U2(:,time)*dt + X2(:,time);X2(:,time+1) = -L*X2(:,time) * dt + X2(:,time);
% X2(:,time+1) = expm(-L * t(:,time+1)) * X0;else
% U2(:,time) = -L*X2(:,time-13);
% X2(:,time+1) = U2(:,time)*dt + X2(:,time-13);X2(:,time+1) = -L*X2(:,time-13) * dt + X2(:,time);
% X2(:,time+1) = expm(-L * t(:,time+1-13)) * X0;endif time<=18
% U3(:,time) = -L*X3(:,time);
% X3(:,time+1) = U3(:,time)*dt + X3(:,time);X3(:,time+1) = -L*X3(:,time) * dt + X3(:,time);
% X3(:,time+1) = expm(-L * t(:,time+1)) * X0;else
% U3(:,time) = -L*X3(:,time-18);
% X3(:,time+1) = U3(:,time)*dt + X3(:,time-18);X3(:,time+1) = -L*X3(:,time-13) * dt + X3(:,time);
% X3(:,time+1) = expm(-L * t(:,time+1-18)) * X0;endif time<=26
% U4(:,time) = -L*X4(:,time);
% X4(:,time+1) = U4(:,time)*dt + X4(:,time);X4(:,time+1) = -L*X4(:,time) * dt + X4(:,time);
% X4(:,time+1) = expm(-L * t(:,time+1)) * X0;else
% U4(:,time) = -L*X4(:,time-26);
% X4(:,time+1) = U4(:,time)*dt + X4(:,time-26);X4(:,time+1) = -L*X4(:,time-26) * dt + X4(:,time);
% X4(:,time+1) = expm(-L * t(:,time+1-26)) * X0;endif time<=25X5(:,time+1) = -L*X5(:,time) * dt + X5(:,time);elseX5(:,time+1) = -L*X5(:,time-25) * dt + X5(:,time);endif time<=28X6(:,time+1) = -L*X6(:,time) * dt + X6(:,time);elseX6(:,time+1) = -L*X6(:,time-28) * dt + X6(:,time);endtime = time + 1;
end% 绘制图数据
subplot(3,2,1);
plot(t,X1(1,:), t,X1(2,:), t,X1(3,:), t,X1(4,:), t,X1(5,:), t,X1(6,:), t,X1(7,:), t,X1(8,:), t,X1(9,:), t,X1(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0(sec)");subplot(3,2,2);
plot(t,X2(1,:), t,X2(2,:), t,X2(3,:), t,X2(4,:), t,X2(5,:), t,X2(6,:), t,X2(7,:), t,X2(8,:), t,X2(9,:), t,X2(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0.13(sec)");subplot(3,2,3);
plot(t,X3(1,:), t,X3(2,:), t,X3(3,:), t,X3(4,:), t,X3(5,:), t,X3(6,:), t,X3(7,:), t,X3(8,:), t,X3(9,:), t,X3(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0.18(sec)");subplot(3,2,4);
plot(t,X4(1,:), t,X4(2,:), t,X4(3,:), t,X4(4,:), t,X4(5,:), t,X4(6,:), t,X4(7,:), t,X4(8,:), t,X4(9,:), t,X4(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0.26(sec)");subplot(3,2,5);
plot(t,X5(1,:), t,X5(2,:), t,X5(3,:), t,X5(4,:), t,X5(5,:), t,X5(6,:), t,X5(7,:), t,X5(8,:), t,X5(9,:), t,X5(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0.25(sec)");subplot(3,2,6);
plot(t,X6(1,:), t,X6(2,:), t,X6(3,:), t,X6(4,:), t,X6(5,:), t,X6(6,:), t,X6(7,:), t,X6(8,:), t,X6(9,:), t,X6(10,:), 'linewidth',1.5)
xlabel("time(sec)");ylabel("state");
title("Time-Delay=0.28(sec)");
参考文献:
[1] N. Biggs. Algebraic Graph Theory. Cambridge Tracks in Mathematics. Cambridge University Press, 1974.
[2] I. Daubechies and J. C. Lagarias. Sets of matrices all infinite products of which converge. Linear Algebra and Its Applications, 161:227–263, 1992.
[3] I. Daubechies and J. C. Lagarias. Corrigendum/addendum to: Sets of matrices all infinite products of which converge. Linear Algebra and Its Applications, 327:69–83, 2001.
[4] J. P. Desai, J. P. Ostrowski, and V. Kumar. Modeling and control of formations of nonholonomic mobile robots. IEEE Trans. on Robotics and Automation, 17(6), December 2002.
[5] R. Diestel. Graph Theory, volume 173 of Graduate Texts in Mathematics. SpringerVerlag, 2000.
[6] A. Fax and R. M. Murray. Graph Laplacians and stabilization of vehicle formations. The 15th IFAC World Congress, June 2002.
[7] A. Fax and R. M. Murray. Information Flow and Cooperative Control of Vehicle Formations. The 15th IFAC World Congress, June 2002.
[8] M. Fiedler. Algebraic connectivity of graphs. Czechoslovak Mathematical Journal, 23(98):298–305, 1973.
[9] M. Fiedler. A property of eigenvectors of nonnegative symmetric matrices and its application to graph theory. Czechoslovak Mathematical Journal, 25(100):619–633, 1975.
[10] F. R. Gantmacher. Matrix Theory, volume II. Chelsea Publishing Company, 1959.
[11] C. Godsil and G. Royle. Algebraic Graph Theory, volume 207 of Graduate Texts in Mathematics. Springer, 2001.
[12] R. A. Horn and C. R. Johnson. Matrix Analysis. Cambridge University Press, 1987.
[13] A. Jadbabaie, J. Lin, and S. A. Morse. Coordination of groups of mobile agents using nearest neighbor rules. IEEE Trans. on Automatic Control (to appear).
[14] R. W. Lawton, J. R. T. Beard and B. J. Young. A Decentralized Approach to Formation Maneuvers. IEEE Trans. on Robotics and Automation (to appear).
[15] N. A. Lynch. Distributed Algorithms. Morgan Kaufmann Publishers, Inc., 1997.
[16] M. Marcus and H. Minc. A Survey of Matrix Theory and Matrix Inequalities. Dover Publications, 1969.
[17] R. Merris. Laplacian matrices of a graph: a survey. Linear Algebra and its Applications, 197:143–176, 1994.
[18] M. Mesbahi. On a dynamic extension of the theory of graphs. Proc. of the American Control Conference, Anchorange, AL, May 2002.
[19] M. Mesbahi and F. Y. Hadegh. Formation flying of multiple spacecraft via graphs, matrix inequalities, and switching. AIAA Journal of Guidance, Control, and Dynamics, 24(2):369–377, March 2000.
[20] R. Olfati Saber and R. M. Murray. Consensus Protocols for Networks of Dynamic Agents. Proc. of the American Control Conference, June 2003.
[21] F. Paganini, J. Doyle, and S Low. Scalable laws for stable network congestion control. Proc. of the Int. Conf. on Decision and Control, Orlando, FL, Dec. 2001.
[22] C. W. Reynolds. Flocks, herds, and schools: a distributed behavioral model. Computer Graphics (ACM SIGGRAPH ’87 Conference Proceedings), 21(4):25–34, July 1987.
[23] J. Toner and Y. Tu. Flocks, herds, and schools: A quantitative theory of flocking. Physical Review E, 58(4):4828–4858, October 1998.
[24] T. Vicsek, A. Cziro´ok, E. Ben-Jacob, and O. Cohen, I. Shochet. Novel type of phase transition in a system of self-deriven particles. Physical Review Letters, 75(6):1226–1229, August, 1995.
【Paper】2003_Consensus Problems in Networks of Agents with Switching Topology and Time-Delays相关推荐
- 【Paper】2021_Consensus Control of Leader-Following Multi-Agent Systems in Directed Topology
参考文献格式: Qinglai Wei, Xin Wang, Xiangnan Zhong and Naiqi Wu, "Consensus Control of Leader-Follow ...
- 【Paper】2021_Distributed Consensus Tracking of Networked Agent Systems Under Denial-of-Service Attack
Y. Wan, G. Wen, X. Yu and T. Huang, "Distributed Consensus Tracking of Networked Agent Systems ...
- 【Paper】2009_Controllability of Multi-Agent Systems from a Graph-Theoretic Perspective 精炼版
详细版请参考:[Paper]2009_Controllability of Multi-Agent Systems from a Graph-Theoretic Perspective 文章目录 5. ...
- 【Paper】2017_水下潜航器编队海洋勘测的协调控制方法研究
友情链接:[paper]2019_Consensus Control of Multiple AUVs Recovery System Under Switching Topologies and T ...
- 【Paper】2019_Consensus Control of Multiple AUVs Recovery System Under Switching Topologies and Time D
Zhang W, Zeng J, Yan Z, et al. Consensus control of multiple AUVs recovery system under switching to ...
- 【Paper】2015_El H_Decentralized Control Architecture for UAV-UGV Cooperation
Decentralized Control Architecture for UAV-UGV Cooperation 1 Introduction 2 Problem Statement and Ar ...
- 【论文研读】【医学图像分割】【BCRNN】Fine-grained Recurrent Neural Networks for Automatic Prostate Segmentation ...
[论文研读][医学图像分割][BCRNN]Fine-grained Recurrent Neural Networks for Automatic Prostate Segmentation inUl ...
- 【Paper】2009_Controllability of Multi-Agent Systems from a Graph-Theoretic Perspective
[Rahmani, Amirreza and Ji, Meng and Mesbahi, Mehran and Egerstedt, Magnus. Controllability of Multi- ...
- 【ECCV2020】Spatio-Temporal Graph Transformer Networks for Pedestrian Trajectory Prediction
[ECCV2020]用于行人轨迹预测的时空图 Transformer 网络 摘要 了解人群运动动力学对于现实世界的应用至关重要,例如监控系统和自动驾驶.这是具有挑战性的,因为它需要对具有社会意识的人群 ...
最新文章
- nfs原理及安装配置
- 崩溃了,一个HashMap跟面试官扯了半个小时
- Windows Server 2012体验之卸载辅助域控制器
- 为Eclipse安装功能扩展插件
- 新浪安装weiphp2.0的方法
- asp.net IsPostBack属性
- 流程控制示例:---3个实例示例:
- AWS云架构策略副总裁:开源是基础,也是未来
- Java 线程池实际运用案例
- 多元函数的微分学思维导图_多元函数微分学思维导图_多元函数微分学j_多元函数微分学思维导图...
- 【MM32F5270开发板试用】四、SPI的驱动,先点个屏幕
- Vue自学之路8-vue模版语法(事件绑定)
- Rayman的绝顶之路——Leetcode每日一题打卡17
- Vue3 router 默认加载 views 文件夹下全部vue文件
- Strategy策略模式详解与实例
- SAS更新SID问题
- IDEA中好用的功能(不断更新中)
- 联想电脑计算机怎么设置十进制,联想笔记本win10老友系统如何给电池设置充电阈值【图文】...
- 语音视频自动生成字幕在线工具介绍
- Word转PDF失败,报错Adobe Acrobat没激活!!!我如此穷,肯定会换个办法解决呀!