文章链接:Consensus of second-order heterogeneous multi-agent systems with and without input saturation - ScienceDirect

仿真图FIG23

% Consensus of second-order heterogeneous multi-agent systems with and without input saturation
% author:JCGUY
% date:2022-04-20
clear
clc%%
tBegin = 0;
dT     = 0.01;
tFinal = 50;
times  = (tFinal - tBegin) / dT;
time   = 1;
t(1,1) = 0;D = [  2  0  0  0  0  ;0  4  0  0  0  ;0  0  2  0  0  ;0  0  0  2  0  ;0  0  0  0  2  ;];
A = [0 1 0 1 0;1 0 1 1 1;0 1 0 0 1;1 1 0 0 0;0 1 1 0 0];
L = D - A;
%t=0时刻,状态为a
X(:,1) = [6, 3, -7, 2, -5]';
V(:,1) = [1, -3, 5, -2, 6]';
U(:,1) = [0, 0, 0, 0, 0]';
alpha4 = 2;
alpha5 = 3;
b1 = 1;
b2 = 2;
b3 = 3;
b4 = 2;
b5 = 3;%% 迭代公式,收敛计算
for i=1:timest(:,i+1) = t(:,i) + dT;% 控制输入分别为 atan()U(1, i) = A(1,2) * atan(X(2, i)-X(1, i)) + A(1,4) * atan(X(4, i)-X(1, i)) - b1 * atan(V(1, i));U(2, i) = A(2,1) * atan(X(1, i)-X(2, i)) + A(2,3) * atan(X(3, i)-X(2, i)) + A(2,4) * atan(X(4, i)-X(2, i)) + A(2,5) * atan(X(5, i)-X(2, i)) - b2 * atan(V(2, i));U(3, i) = A(3,2) * atan(X(2, i)-X(3, i)) + A(3,5) * atan(X(5, i)-X(3, i)) - b3 * atan(V(3, i));U(4, i) = A(4,1) * atan(X(1, i)-X(4, i)) + A(4,2) * atan(X(2, i)-X(4, i)) - b4 * atan(V(4, i)) + 2 * cos(X(4, i)) * sin(atan(V(4, i)));U(5, i) = A(5,2) * atan(X(2, i)-X(5, i)) + A(5,3) * atan(X(3, i)-X(5, i)) - b5 * atan(V(5, i)) - 3 * cos(X(5, i))* atan(V(5, i));V(:,i+1) = V(:,i) + U(:,i)*dT;X(:,i+1) = X(:,i) + V(:,i)*dT;end%% 绘图
subplot(1,2,1)
plot(t,X(1,:),'linewidth',1.0); hold on % x1
plot(t,X(2,:),'linewidth',1.0); hold on % x2
plot(t,X(3,:),'linewidth',1.0); hold on % x3
plot(t,X(4,:),'linewidth',1.0); hold on % x4
plot(t,X(5,:),'linewidth',1.0); hold on % x5
title('Position Trajectory');
legend("x_1", "x_2", "x_3", "x_4", "x_5");
axis([0 50 -8 8]);
grid on; box on;subplot(1,2,2)
plot(t,V(1,:),'linewidth',1.0); hold on % v1
plot(t,V(2,:),'linewidth',1.0); hold on % v2
plot(t,V(3,:),'linewidth',1.0); hold on % v3
plot(t,V(4,:),'linewidth',1.0); hold on % v4
plot(t,V(5,:),'linewidth',1.0); hold on % v5
title('Velocity Trajectory');
legend("v_1", "v_2", "v_3", "v_4", "v_5");
axis([0 50 -4 6]);
grid on; box on;% subplot(2,2,3)
% plot(t(1,1:5000),U(1,1:5000),'linewidth',1.0); hold on % v1
% plot(t(1,1:5000),U(2,1:5000),'linewidth',1.0); hold on % v2
% plot(t(1,1:5000),U(3,1:5000),'linewidth',1.0); hold on % v3
% plot(t(1,1:5000),U(4,1:5000),'linewidth',1.0); hold on % v4
% plot(t(1,1:5000),U(5,1:5000),'linewidth',1.0); hold on % v5
% title('Input Trajectory');
% legend("i_1", "i_2", "i_3", "i_4", "i_5");
% %axis([0 50 -6 1]);
% grid on; box on;

仿真图FIG4

% Consensus of second-order heterogeneous multi-agent systems with and without input saturation
% author:JCGUY
% date:2022-04-20
clear
clc%%
tBegin = 0;
dT     = 0.01;
tFinal = 40;
times  = (tFinal - tBegin) / dT;
time   = 1;
t(1,1) = 0;D = [  2  0  0  0  0  ;0  4  0  0  0  ;0  0  2  0  0  ;0  0  0  2  0  ;0  0  0  0  2  ;];
A = [0 1 0 1 0;1 0 1 1 1;0 1 0 0 1;1 1 0 0 0;0 1 1 0 0];
L = D - A;
%t=0时刻,状态为a
X(:,1) = [6, 3, -7, 2, -5]';
V(:,1) = [1, -3, 5, -2, 6]';
U(:,1) = [0, 0, 0, 0, 0]';
beta4 = 2;
beta5 = 3;
c1 = 1;
c2 = 2;
c3 = 3;
c4 = 2;
c5 = 3;%% 迭代公式,收敛计算
for i=1:timest(:,i+1) = t(:,i) + dT;% 控制输入分别为 atan()U(1, i) = A(1,2) *  (X(2, i)-X(1, i)) + A(1,4) *  (X(4, i)-X(1, i)) - c1 *  V(1, i);U(2, i) = A(2,1) *  (X(1, i)-X(2, i)) + A(2,3) *  (X(3, i)-X(2, i)) + A(2,4) *  (X(4, i)-X(2, i)) + A(2,5) *  (X(5, i)-X(2, i)) - c2 * V(2, i);U(3, i) = A(3,2) *  (X(2, i)-X(3, i)) + A(3,5) *  (X(5, i)-X(3, i)) - c3 * V(3, i);U(4, i) = A(4,1) *  (X(1, i)-X(4, i)) + A(4,2) *  (X(2, i)-X(4, i)) - c4 *  V(4, i) + 2 * cos(X(4, i)) * sin(V(4, i));U(5, i) = A(5,2) *  (X(2, i)-X(5, i)) + A(5,3) *  (X(3, i)-X(5, i)) - c5 *  V(5, i) - 3 * sin(X(5, i)) *  V(5, i);V(:,i+1) = V(:,i) + U(:,i)*dT;X(:,i+1) = X(:,i) + V(:,i)*dT;end%% 绘图
subplot(1,2,1)
plot(t,X(1,:),'linewidth',1.0); hold on % x1
plot(t,X(2,:),'linewidth',1.0); hold on % x2
plot(t,X(3,:),'linewidth',1.0); hold on % x3
plot(t,X(4,:),'linewidth',1.0); hold on % x4
plot(t,X(5,:),'linewidth',1.0); hold on % x5
title('Position Trajectory');
legend("x_1", "x_2", "x_3", "x_4", "x_5");
%axis([0 50 -8 8]);
grid on; box on;subplot(1,2,2)
plot(t,V(1,:),'linewidth',1.0); hold on % v1
plot(t,V(2,:),'linewidth',1.0); hold on % v2
plot(t,V(3,:),'linewidth',1.0); hold on % v3
plot(t,V(4,:),'linewidth',1.0); hold on % v4
plot(t,V(5,:),'linewidth',1.0); hold on % v5
title('Velocity Trajectory');
legend("v_1", "v_2", "v_3", "v_4", "v_5");
%axis([0 50 -4 6]);
grid on; box on;% subplot(2,2,3)
% plot(t(1,1:5000),U(1,1:5000),'linewidth',1.0); hold on % v1
% plot(t(1,1:5000),U(2,1:5000),'linewidth',1.0); hold on % v2
% plot(t(1,1:5000),U(3,1:5000),'linewidth',1.0); hold on % v3
% plot(t(1,1:5000),U(4,1:5000),'linewidth',1.0); hold on % v4
% plot(t(1,1:5000),U(5,1:5000),'linewidth',1.0); hold on % v5
% title('Input Trajectory');
% legend("i_1", "i_2", "i_3", "i_4", "i_5");
% %axis([0 50 -6 1]);
% grid on; box on;

仿真图FIG56

% Consensus of second-order heterogeneous multi-agent systems with and without input saturation
% author:JCGUY
% date:2022-04-20
clear
clc%%
tBegin = 0;
dT     = 0.01;
tFinal = 40;
times  = (tFinal - tBegin) / dT;
time   = 1;
t(1,1) = 0;D = [  2  0  0  0  0  ;0  4  0  0  0  ;0  0  2  0  0  ;0  0  0  2  0  ;0  0  0  0  2  ;];
A = [0 1 0 1 0;1 0 1 1 1;0 1 0 0 1;1 1 0 0 0;0 1 1 0 0];
L = D - A;
%t=0时刻,状态为a
X(:,1) = [6, 3, -7, 2, -5]';
V(:,1) = [1, -3, 5, -2, 6]';
U(:,1) = [0, 0, 0, 0, 0]';
gama4 = 2;
gama5 = 3;
d1 = 1;
d2 = 2;
d3 = 3;
d4 = 2;
d5 = 3;%% 迭代公式,收敛计算
for i=1:timest(:,i+1) = t(:,i) + dT;% 控制输入分别为 atan()U(1, i) = A(1,2) *  g1(X(2, i)-X(1, i)) + A(1,4) *  g1(X(4, i)-X(1, i)) - d1 *  g1(V(1, i));U(2, i) = A(2,1) *  g1(X(1, i)-X(2, i)) + A(2,3) *  g1(X(3, i)-X(2, i)) + A(2,4) *  g1(X(4, i)-X(2, i)) + A(2,5) *  g1(X(5, i)-X(2, i)) - d2 * g1(V(2, i));U(3, i) = A(3,2) *  g1(X(2, i)-X(3, i)) + A(3,5) *  g1(X(5, i)-X(3, i)) - d3 * g1(V(3, i));U(4, i) = A(4,1) *  g1(X(1, i)-X(4, i)) + A(4,2) *  g1(X(2, i)-X(4, i)) - d4 *  g1(V(4, i)) + 2 * cos(X(4, i)) * sin(V(4, i));U(5, i) = A(5,2) *  g1(X(2, i)-X(5, i)) + A(5,3) *  g1(X(3, i)-X(5, i)) - d5 *  g1(V(5, i)) - 3 * sin(X(5, i)) *  V(5, i)/sqrt(1+V(5, i)*V(5, i));V(:,i+1) = V(:,i) + U(:,i)*dT;X(:,i+1) = X(:,i) + V(:,i)*dT;end%% 绘图
subplot(1,2,1)
plot(t,X(1,:),'linewidth',1.0); hold on % x1
plot(t,X(2,:),'linewidth',1.0); hold on % x2
plot(t,X(3,:),'linewidth',1.0); hold on % x3
plot(t,X(4,:),'linewidth',1.0); hold on % x4
plot(t,X(5,:),'linewidth',1.0); hold on % x5
title('Position Trajectory');
legend("x_1", "x_2", "x_3", "x_4", "x_5");
%axis([0 50 -8 8]);
grid on; box on;subplot(1,2,2)
plot(t,V(1,:),'linewidth',1.0); hold on % v1
plot(t,V(2,:),'linewidth',1.0); hold on % v2
plot(t,V(3,:),'linewidth',1.0); hold on % v3
plot(t,V(4,:),'linewidth',1.0); hold on % v4
plot(t,V(5,:),'linewidth',1.0); hold on % v5
title('Velocity Trajectory');
legend("v_1", "v_2", "v_3", "v_4", "v_5");
%axis([0 50 -4 6]);
grid on; box on;% subplot(2,2,3)
% plot(t(1,1:5000),U(1,1:5000),'linewidth',1.0); hold on % v1
% plot(t(1,1:5000),U(2,1:5000),'linewidth',1.0); hold on % v2
% plot(t(1,1:5000),U(3,1:5000),'linewidth',1.0); hold on % v3
% plot(t(1,1:5000),U(4,1:5000),'linewidth',1.0); hold on % v4
% plot(t(1,1:5000),U(5,1:5000),'linewidth',1.0); hold on % v5
% title('Input Trajectory');
% legend("i_1", "i_2", "i_3", "i_4", "i_5");
% %axis([0 50 -6 1]);
% grid on; box on;
function [output]=g1(a)
if(a>-1 && a<1)output=a;
elseoutput=sign(a);
end

【一致性仿真】Consensus of second-order heterogeneous multi-agent systems with and without input saturation相关推荐

  1. 如何利用AI(ChatGPT、NewBing、PHIND、YouChat)实现多智能体系统一致性仿真的代码编写

    多智能体系统(Multi-Agent System,MAS)已成为人工智能.机器人.自动化等领域的研究热点之一.在MAS中,实现智能体之间的一致性是一个重要问题.为了研究这个问题,如今爆火的AI软件被 ...

  2. 【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 ...

  3. 多智能体强化学习Multi agent,多任务强化学习Multi task以及多智能体多任务强化学习Multi agent Multi task概述

    概述 在我之前的工作中,我自己总结了一些多智能体强化学习的算法和通俗的理解. 首先,关于题目中提到的这三个家伙,大家首先想到的就是强化学习的五件套: 状态:s 奖励:r 动作值:Q 状态值:V 策略: ...

  4. 【一致性仿真】Consensus Control of Leader-Following Multi-Agent Systems in Directed Topology With ...

    文章链接:Consensus Control of Leader-Following Multi-Agent Systems in Directed Topology With Heterogeneo ...

  5. 【一致性仿真】Group-Bipartite Consensus in the Networks With Cooperative-Competitive Interactions

    文章链接:Group-Bipartite Consensus in the Networks With Cooperative-Competitive Interactions 仿真图Fig3: MA ...

  6. 【一致性仿真】Multi-Agent Consensus Using Both Current and Outdated States

    文章链接:Multi-Agent Consensus Using Both Current and Outdated States 仿真图FIG4: 代码 % Multi-Agent Consensu ...

  7. 【一致性仿真】Fixed-time bipartite consensus of multi-agent systems with disturbances

    文章链接:Fixed-time bipartite consensus of multi-agent systems with disturbances 仿真图Fig2: MATLAB代码: % Fi ...

  8. 使用PaupGUI软件合并一致性树consensus tree

    ​PAUP是一款用于构建进化树(系统发育树)及进行相关检验的软件.本文解决的问题是How to create consensus phylogenetic tree by PaupGUI. 适用情形: ...

  9. A Novel Proof-of-Reputation Consensus for Storage Allocation in Edge Blockchain Systems 精读笔记(三)

    目录 POR BLOCKCHAIN Summary POR BLOCKCHAIN In this section, we propose a PoR blockchain to maintain th ...

最新文章

  1. 智能车竞赛技术报告 | 智能车视觉 - 青岛工学院 - 青工战斗
  2. 全国计算机等级考试 简称NCRE,长春大学2018年下半年全国计算机等级考试(简称NCRE)招生简章...
  3. 2017-2018-1 20155327 实验五 通讯协议设计
  4. Twitter的分布式自增ID算法snowflake (Java版)
  5. 洛谷 2777 [AHOI2016初中组]自行车比赛
  6. Redhat 安装Informix 12.10
  7. android 支付宝 6002,IOS支付宝支付出现6002问题的解决办法
  8. 便携式明渠流量计的功能特点及资质证书
  9. 大数据下无隐私APP为何要用户摄像头麦克风通讯录等全权限才服务(公号回复“无隐私APP”下载PDF彩标典藏版资料,欢迎转发赞赏)
  10. php如何上传doc文件,php实现将上传word文件转为html的方法
  11. 数学期望(离散型和连续型)
  12. [JAVA面试] java面试
  13. 睿智的目标检测28——YoloV4当中的Mosaic数据增强方法
  14. Java中线程基础-线程间的共享-volatile
  15. 1.19(Cake Baking)
  16. 【烈日炎炎战后端】JAVA集合(1.8万字)
  17. unix常用操作命令
  18. 对这个java虚拟机内存的,年轻代,年老代,永久代i,搞不太清楚。年轻代、年老代存放在堆还是栈。新版虚拟机没有永久代是个啥情况
  19. 浅显易懂入门大数据系列:二、MapReduce、YARN(超详细)
  20. SAP中建立一个ODATA步骤

热门文章

  1. Linux网络管理员实用教程
  2. 如何在谷歌卫星地图中叠加等高线并打印
  3. java 判断list是否越界_关于ArrayList的越界问题?
  4. 微信零钱提现还要手续费?不存在的
  5. Linux从入门到秃头
  6. 微信公众号之微信支付
  7. Invoke 和 BeginInvoke 的真正涵义
  8. 《用户体验设计:100堂入门课》20190917
  9. Hadoop3.2.0 YARN资源配置
  10. 办公室office工具————Word基础