• 啊发发啊发放
    了解作者
  • Others
    开发工具
  • 11KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 5
    下载次数
  • 2019-03-27 10:12
    上传日期
matlab .m文件,包括一阶二阶有领导、无领导仿真
固定系统一致性.zip
  • 固定系统一致性
  • 一阶无领导者
  • Whole_Twodimension_total_state.m
    704B
  • plot_Twodimension.m
    2.1KB
  • q0.mat
    179B
  • 一阶有领导者
  • Whole_Twodimension_total_state.m
    896B
  • plot_Twodimension.m
    1.5KB
  • q0.mat
    260B
  • 二阶无领导
  • Whole_Twodimension_total_state.m
    1.1KB
  • plot_Twodimension.m
    2.8KB
  • q0.mat
    202B
  • 一般线性有领导
  • Whole_Twodimension_total_state.m
    1.1KB
  • plot_Twodimension.m
    2.2KB
  • q0.mat
    260B
  • 一般线性无领导
  • Whole_Twodimension_total_state.m
    988B
  • plot_Twodimension.m
    1.6KB
  • q0.mat
    242B
  • 二阶一领导四跟随
  • Whole_Twodimension_total_state.m
    1.3KB
  • plot_Twodimension.m
    2.5KB
  • q0.mat
    278B
内容介绍
clc clear close all t0=0;tf=15; step_qw=0.01; p1=20;Y=0.1;M=0.15;N=0.275; q0=[0.0; 0.0; 0.1; 0.1; 0.0; 0.4; 0.1; 0.1; 0.4; 0.1; 0.1; 0.1; 0.2; 0.6; 0.1; 0.1]; %save('q0.mat','q0'); load('q0.mat','q0'); [t,q]=ode45('Whole_Twodimension_total_state',t0:step_qw:tf,q0); figure(1); hold on xlabel('x position','FontName','Times New Roman','FontSize',14);ylabel('y position','FontName','Times New Roman','FontSize',14); plot(q(:,1),q(:,2),'g'); hold on plot(q(:,5),q(:,6),'r'); hold on plot(q(:,9),q(:,10),'b'); hold on plot(q(:,13),q(:,14),'k'); hold on legend('agent 1','agent 2','agent 3','agent 4',4); plot(q(1,1),q(1,2),'ro'); hold on plot(q(1,5),q(1,6),'bo'); hold on plot(q(1,9),q(1,10),'bo'); hold on plot(q(1,13),q(1,14),'bo'); hold on plot(q(end,1),q(end,2),'rp'); hold on box on figure(2) hold on xlabel('t/s','FontName','Times New Roman','FontSize',14);ylabel('$\bar{x}_i$','interpreter','latex','fontsize',14); hold on plot(t,q(:,1),'r:',t,q(:,2),'r'); hold on plot(t,q(:,5),'b:',t,q(:,6),'b'); hold on; plot(t,q(:,9),'k:',t,q(:,10),'k'); hold on; plot(t,q(:,13),'m:',t,q(:,14),'m'); hold on legend('agent 1','agent 2','agent 3','agent 4',4); box on figure(3) hold on xlabel('t/s','FontName','Times New Roman','FontSize',14);ylabel('$\bar{v}_i$','interpreter','latex','fontsize',14); hold on plot(t,q(:,3),'r:',t,q(:,4),'r'); hold on plot(t,q(:,7),'b:',t,q(:,8),'b'); hold on; plot(t,q(:,11),'k:',t,q(:,12),'k'); hold on; plot(t,q(:,15),'m:',t,q(:,16),'m'); hold on legend('agent 1','agent 2','agent 3','agent 4',4); box on figure(4) hold on xlabel('t/s','FontName','Times New Roman','FontSize',14);ylabel('vi-$\bar{v}_i$','interpreter','latex','fontsize',14); hold on plot(t,q(:,3)-Y,'r:',t,q(:,4)-Y,'r'); hold on plot(t,q(:,7)-Y,'b:',t,q(:,8)-Y,'b'); hold on; plot(t,q(:,11)-Y,'k:',t,q(:,12)-Y,'k'); hold on; plot(t,q(:,15)-Y,'m:',t,q(:,16)-Y,'m'); hold on legend('agent 1','agent 2','agent 3','agent 4',4); box on %figure(4) %hold on %xlabel('t/s','FontName','Times New Roman','FontSize',14);ylabel('','interpreter','latex','fontsize',14); %hold on %plot(t,q(:,1)-M,'r:',t,q(:,2)-N,'r'); %hold on %plot(t,q(:,5)-M,'b:',t,q(:,6)-N,'b'); %hold on; %plot(t,q(:,9)-M,'k:',t,q(:,10)-N,'k'); %hold on; %plot(t,q(:,13)-M,'m:',t,q(:,14)-N,'m'); %hold on %box on grid off
评论
    相关推荐