武汉加油——传染病模型概念与仿真

武汉加油——传染病模型概念与仿真

SI模型在这里插入图片描述

SIS模型

在这里插入图片描述
在这里插入图片描述

SIR模型

在这里插入图片描述

SIER模型与改良SIER模型

在这里插入图片描述

仿真

global alpha beta r gamma N r2 beta2
N=1400;%1400050000;
r=5;%每个感染者每日接触平均人数
gamma=25/198;%治愈率

%%%%%%%%%SI模型%%%%%%%%%%%%%%%%%
options = odeset('MaxStep',0.01,'NonNegative',1:2);
[T,Y] = ode45(@func_SI, [0,50], [1202 198], options);%[T,Y] = solver(odefun,tspan,y0)。
subplot(2,3,1);
plot(T,Y(:,1),'r','LineWidth',2);
hold on;
plot(T,Y(:,2),'k','LineWidth',2);
xlabel('t');
ylabel('people');
title('SI')
legend({'S','I'},'Location','SouthEast');%'southeastoutside'

%%%%%%%%%SIS模型%%%%%%%%%%%
options = odeset('MaxStep',0.01,'NonNegative',1:2);
[T,Y] = ode45(@func_SIS, [0,50], [1202 198], options);%[T,Y] = solver(odefun,tspan,y0)。
subplot(2,3,2);
plot(T,Y(:,1),'r','LineWidth',2);
hold on;
plot(T,Y(:,2),'k','LineWidth',2);
xlabel('t');
ylabel('people');
title('SIS')
legend({'S','I'},'Location','SouthEast');%'southeastoutside'


%%%%%%%%%SIR模型%%%%%%%%%%%%%%%%
options = odeset('MaxStep',0.01,'NonNegative',1:3);
[T,Y] = ode45(@func_SIR, [0,50], [1202 198 0], options);%[T,Y] = solver(odefun,tspan,y0)。
subplot(2,3,3);
plot(T,Y(:,1),'r','LineWidth',2);
hold on;
plot(T,Y(:,2),'k','LineWidth',2);
hold on;
plot(T,Y(:,3),'g','LineWidth',2);

xlabel('t');
ylabel('people');
title('SIR')
legend({'S','I','R'},'Location','SouthEast');%'southeastoutside'

%%%%%%%%%SEIR模型%%%%%%%%%%%%
beta=90/(198-25);%设接触感染者变为潜伏者概率(1.19,67+10=77)%90/(198*5);设医学观察的是接触过病人的
alpha=77/(817+77);%潜伏者发病概率
r2=6;%每个潜伏者每日接触平均人数
beta2=((1739-817)-(922-90))/(817*6);%接触潜伏者变为潜伏者概率((1739-817)*0.8)/(817*6)

options = odeset('MaxStep',0.01,'NonNegative',1:4);
[T,Y] = ode45(@func_SEIR, [0,50], [1202 198 0 817], options);%[T,Y] = solver(odefun,tspan,y0)。
subplot(2,3,4);
plot(T,Y(:,1),'r','LineWidth',2);
hold on;
plot(T,Y(:,2),'k','LineWidth',2);
hold on;
plot(T,Y(:,3),'g','LineWidth',2);
hold on;
plot(T,Y(:,4),'b','LineWidth',2);
xlabel('t');
ylabel('people');
title('SEIR')
legend({'S','I','R','E'},'Location','SouthEast');%'southeastoutside'

%%%%%%%%%改良版SEIR模型%%%%%%%%%%%%
options = odeset('MaxStep',0.01,'NonNegative',1:4);
[T,Y] = ode45(@func_SEIR2, [0,50], [1202 198 0 817], options);%[T,Y] = solver(odefun,tspan,y0)。
subplot(2,3,5);
plot(T,Y(:,1),'r','LineWidth',2);
hold on;
plot(T,Y(:,2),'k','LineWidth',2);
hold on;
plot(T,Y(:,3),'g','LineWidth',2);
hold on;
plot(T,Y(:,4),'b','LineWidth',2);
xlabel('t');
ylabel('people');
title('SEIR2')
legend({'S','I','R','E'},'Location','SouthEast');%'southeastoutside'

function dy=func_SI(t,y)
global r N 
beta=77/198;%设接触感染者发病概率(1.19,67+10=77)
S = y(1);
I = y(2);
%x=beta0*(cos(2*pi*tt)*beta1+1);
dS = -r*beta*I*S/N;
dI =  r*beta*I*S/N;
dy=[dS;dI];
end

function dy=func_SIS(t,y)
global r N gamma
beta=77/198;%设接触感染者发病概率(1.19,67+10=77)
S = y(1);
I = y(2);
%x=beta0*(cos(2*pi*tt)*beta1+1);
dS = -r*beta*I*S/N+gamma*I;
dI =  r*beta*I*S/N-gamma*I;
dy=[dS;dI];
end

function dy=func_SIR(t,y)
global r N gamma
beta=77/198;%设接触感染者发病概率(1.19,67+10=77)
S = y(1);
I = y(2);
R = y(3);
%x=beta0*(cos(2*pi*tt)*beta1+1);
dS = -r*beta*I*S/N;
dI =  r*beta*I*S/N-gamma*I;
dR = gamma*I;
dy=[dS;dI;dR];
end

function dy=func_SEIR(t,y)
global r beta N gamma alpha
S = y(1);
I = y(2);
R = y(3);
E = y(4);
%x=beta0*(cos(2*pi*tt)*beta1+1);
dS = -r*beta*I*S/N;
dE = r*beta*I*S/N-alpha*E;
dI = alpha*E-gamma*I;
dR = gamma*I;
dy=[dS;dI;dR;dE];
end

function dy=func_SEIR2(t,y)
global r beta N gamma alpha r2 beta2
S = y(1);
I = y(2);
R = y(3);
E = y(4);
%x=beta0*(cos(2*pi*tt)*beta1+1);
dS = -r*beta*I*S/N-r2*beta2*E*S/N;
dE = r*beta*I*S/N-alpha*E+r2*beta2*E*S/N;
dI = alpha*E-gamma*I;
dR = gamma*I;
dy=[dS;dI;dR;dE];
end

仿真结果

在这里插入图片描述

  • 13
    点赞
  • 51
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值