美文网首页
2.双方演化博弈代码

2.双方演化博弈代码

作者: 谭小飞同学 | 来源:发表于2021-05-06 00:25 被阅读0次

论文标题:基于演化博弈视角的“乡贤” 参与乡村治理及其稳定性分析

视频可关注bilibili:谭小飞同学

% xiangxian.m
function dydt=xiangxian(t,y,a,p,c1,c2)
dydt=zeros(2,1);
dydt(1)=y(1)*(1-y(1))*(a*p*y(2)-c1);
dydt(2)=y(2)*(1-y(2))*((1-a)*p*y(1)-c2);
end
% xiangxian2.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%the 1st image
clc;clear;
a=0.6,p=1400,c1=500,c2=200;
figure(1)
% the 1st line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.1,0.6]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'rh-','linewidth',1,'markersize',5,'markerfacecolor','r','markerindices',points);
grid on
hold on 
set(gca,'XTick',[0:0.2:1],'YTick',[0:0.1:1])
axis([0 1 0 1])
% the 2nd line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.3,0.5]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'cx-','linewidth',1,'markersize',5,'markerindices',points);
hold on 
% the 3rd line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.5,0.1]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'bo-','linewidth',1,'markersize',5,'markerindices',points);
hold on 
% the 4th line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.4,0.9]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'gs-','linewidth',1,'markersize',6,'markerindices',points);
hold on 
% the 5th line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.6,0.5]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'md-','linewidth',1,'markersize',6,'markerindices',points);
hold on 
% the 6th line
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0,0.1],[0.9,0.3]);
points=1:1:length(t);
plot(y(:,1),y(:,2),'kp-','linewidth',1,'markersize',7,'markerfacecolor','k','markerindices',points);
hold on
xlabel('$x$','interpreter','latex','Rotation',0);
ylabel('$y$','interpreter','latex','Rotation',360);
title('动态演化过程','FontWeight','bold');
legend('初始值[0.1 0.6]','初始值[0.3 0.5]','初始值[0.5 0.1]','初始值[0.4 0.9]','初始值[0.6 0.5]','初始值[0.9 0.3]');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%the 2rd image
clc;
clear;
a=0.6,p=1450,c1=500,c2=200;
set(0,'defaultfigurecolor','w')
% the 1st X,Y
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0 0.1],[0.5 0.5]);
points=1:1:length(t);
figure(2)
plot(t,y(:,1),'ro-','linewidth',1,'markersize',4,'markerindices',points);
hold on 
plot(t,y(:,2),'g^-','linewidth',1,'markersize',5,'markerindices',points);
grid on
hold on 
set(gca,'XTick',[0:0.01:0.1],'YTick',[0.4:0.1:1.1])
axis([0 0.1 0.4 1.1])
% the 2nd X,Y
a=0.6,p=1600,c1=500,c2=200;
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0 0.1],[0.5 0.5]);
points=1:1:length(t);
plot(t,y(:,1),'c.-','linewidth',1,'markersize',10,'markerindices',points);
hold on 
plot(t,y(:,2),'b-.','linewidth',1,'markerindices',points);
hold on 
% the 3rd X,Y
a=0.6,p=1700,c1=500,c2=200;
[t,y]=ode45(@(t,y) xiangxian(t,y,a,p,c1,c2),[0 0.1],[0.5 0.5]);
points=1:1:length(t);
plot(t,y(:,1),'kx-','linewidth',1,'markersize',5,'markerindices',points);
hold on 
plot(t,y(:,2),'mp-','linewidth',1,'markersize',5,'markerfacecolor','m','markerindices',points);
hold on 
xlabel('$Time$','interpreter','latex','Rotation',0);
ylabel('$Solution$','interpreter','latex');
legend('X:P=1450','Y:P=1450','X:P=1600','Y:P=1600','X:P=1700','Y:P=1700');

相关文章

  • 2.双方演化博弈代码

    论文标题:基于演化博弈视角的“乡贤” 参与乡村治理及其稳定性分析 视频可关注bilibili:谭小飞同学

  • 1.演化博弈入门代码

    MATLAB演化博弈仿真(双方)操作详解 声明:笔者所用win7+MATLAB2016b版本。安装破解过程可能会有...

  • 关于无限囚徒困境的思考

    一囚徒困境。 1. 博弈双方不知对方的选择。 2. 双方都合作共同利益最大化,双方背叛集体利益最小。 3. ...

  • 4. 四方演化博弈代码

    论文标题:重大疫情期医药研究报道质量监管四方演化博弈分析 关注b站:谭小飞同学 %sifang.m sifang2...

  • 3.三方演化博弈代码

    论文标题:政府奖惩机制下药品安全质量监管三方演化博弈及仿真分析 视频可关注bilibili:谭小飞同学 yaopi...

  • 策略的演化

    就好像生物演化是基因的竞争,文化演化是“模因(Meme)”的竞争一样,博弈的演化,是策略的竞争。如果使用...

  • 策略的演化

    就好像生物演化是基因的竞争,文化演化是“模因(Meme)”的竞争一样,博弈的演化,是策略的竞争。如果使用...

  • 博弈论04——差的分析02

    状态差,是博弈双方在博弈时,必须重点考虑的,是胜负的关键所在。所谓状态,是在实力分析的基础上,对博弈双方所...

  • 《好好说话》收获:

    1.谈判是一种权利在双方的关系,也就是说,谈判双方都持有退出的权利,在这样的前提下我们达成共识。 2.谈判是个博弈...

  • 对抗双方的情绪博弈

    胜利会激发个体兴奋情绪,个体的兴奋情绪会感染其他人。失败一方也是同理,因此悲观情绪会相互传染。 当两者处于同一互动...

网友评论

      本文标题:2.双方演化博弈代码

      本文链接:https://www.haomeiwen.com/subject/zerldltx.html