传染病模型讲解比较清楚的是知乎这位博主,文章链接戳这在家宅着也能抵抗肺炎!玩一玩SEIR传染病模型
本文基于这篇文章进行记录和整理
对于一般传染病来说,都具备潜伏者(E),因此直接记录传统的SIER模型:
模型公式:
{ d S d t = − r β I S N d E d t = r β I S N − σ E d I d t = σ E − γ I d R d t = γ I \left\{ \begin{array}{l} \frac{
{dS}}{
{dt}} = – \frac{
{r\beta IS}}{N}\\ \\ \frac{
{dE}}{
{dt}} = \frac{
{r\beta IS}}{N} – \sigma E\\ \\ \frac{
{dI}}{
{dt}} = \sigma E – \gamma I\\ \\ \frac{
{dR}}{
{dt}} = \gamma I \end{array} \right. ⎩⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎧dtdS=−NrβISdtdE=NrβIS−σEdtdI=σE−γIdtdR=γI
迭代公式:
{ S n = S n − 1 − r β I n − 1 S n − 1 N E n = E n − 1 + r β I n − 1 S n − 1 N − σ E n − 1 I n = I n − 1 + σ E n − 1 − γ I n − 1 R n = R n − 1 + γ I n − 1 \left\{ \begin{array}{l} {S_n} = {S_{n – 1}} – \frac{
{r\beta {I_{n – 1}}{S_{n – 1}}}}{N}\\ \\ {E_n} = {E_{n – 1}} + \frac{
{r\beta {I_{n – 1}}{S_{n – 1}}}}{N} – \sigma {E_{n – 1}}\\ \\ {I_n} = {I_{n – 1}} + \sigma {E_{n – 1}} – \gamma {I_{n – 1}}\\ \\ {R_n} = {R_{n – 1}} + \gamma {I_{n – 1}} \end{array} \right. ⎩⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎧Sn=Sn−1−NrβIn−1Sn−1En=En−1+NrβIn−1Sn−1−σEn−1In=In−1+σEn−1−γIn−1Rn=Rn−1+γIn−1
引入潜伏者传染概率,改进SEIR模型,
公式为
{ d S d t = − r β I S N − r 2 β 2 E S N d E d t = r β I S N − σ E + r 2 β 2 E S N d I d t = σ E − γ I d R d t = γ I \left\{ \begin{array}{l} {\frac{
{dS}}{
{dt}} = – \frac{
{r\beta IS}}{N} – \frac{
{
{r_2}{\beta _2}ES}}{N}}\\ {}\\ {\frac{
{dE}}{
{dt}} = \frac{
{r\beta IS}}{N} – \sigma E + \frac{
{
{r_2}{\beta _2}ES}}{N}}\\ {}\\ {\frac{
{dI}}{
{dt}} = \sigma E – \gamma I}\\ {}\\ {\frac{
{dR}}{
{dt}} = \gamma I} \end{array} \right. ⎩⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎧dtdS=−NrβIS−Nr2β2ESdtdE=NrβIS−σE+Nr2β2ESdtdI=σE−γIdtdR=γI
迭代公式为:
{ S n = S n − 1 − r β I n − 1 S n − 1 N − r 2 β 2 E n − 1 S n − 1 N E n = E n − 1 + r β I n − 1 S n − 1 N − σ E n − 1 + r 2 β 2 E n − 1 S n − 1 N I n = I n − 1 + σ E n − 1 − γ I n − 1 R n = R n − 1 + γ I n − 1 \left\{ \begin{array}{l} {S_n} = {S_{n – 1}} – \frac{
{r\beta {I_{n – 1}}{S_{n – 1}}}}{N} – \frac{
{
{r_2}{\beta _2}{E_{n – 1}}{S_{n – 1}}}}{N}\\ \\ {E_n} = {E_{n – 1}} + \frac{
{r\beta {I_{n – 1}}{S_{n – 1}}}}{N} – \sigma {E_{n – 1}} + \frac{
{
{r_2}{\beta _2}{E_{n – 1}}{S_{n – 1}}}}{N}\\ \\ {I_n} = {I_{n – 1}} + \sigma {E_{n – 1}} – \gamma {I_{n – 1}}\\ \\ {R_n} = {R_{n – 1}} + \gamma {I_{n – 1}} \end{array} \right. ⎩⎪⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎪⎧Sn=Sn−1−NrβIn−1Sn−1−Nr2β2En−1Sn−1En=En−1+NrβIn−1Sn−1−σEn−1+Nr2β2En−1Sn−1In=In−1+σEn−1−γIn−1Rn=Rn−1+γIn−1
matlab代码:
源代码:
clear;clc;
%--------------------------------------------------------------------------
% 参数设置
%--------------------------------------------------------------------------
N = 12700000; %人口总数
E = 0; %潜伏者
I = 1; %传染者
S = N - I; %易感者
R = 0; %康复者
r = 20; %感染者接触易感者的人数
B = 0.03; %传染概率
a = 0.1; %潜伏者转化为感染者概率
y = 0.1; %康复概率
T = 1:140;
for idx = 1:length(T)-1
S(idx+1) = S(idx) - r*B*S(idx)*I(idx)/N;
E(idx+1) = E(idx) + r*B*S(idx)*I(idx)/N-a*E(idx);
I(idx+1) = I(idx) + a*E(idx) - y*I(idx);
R(idx+1) = R(idx) + y*I(idx);
end
plot(T,S,T,E,T,I,T,R);grid on;
xlabel('天');ylabel('人数')
legend('易感者','潜伏者','传染者','康复者')
稍作改进,反应每日新增病例情况:
%--------------------------------------------------------------------------
% 初始化
%--------------------------------------------------------------------------
clear;clc;
%--------------------------------------------------------------------------
% 参数设置
%--------------------------------------------------------------------------
N = 29000; %人口总数
E = 0; %潜伏者
I = 1; %传染者
S = N - I; %易感者
R = 0; %康复者
m=1;
r = 25; %感染者接触易感者的人数
B = 0.03; %传染概率
a = 0.1; %潜伏者转化为感染者概率
r2 = 3; %潜伏者接触易感者的人数
B2 = 0.03; %潜伏者传染正常人的概率
y = 0.1; %康复概率
T = 1:182;
for idx = 1:length(T)-1
S(idx+1) = S(idx) - r*B*S(idx)*I(idx)/N(1) - r2*B2*S(idx)*E(idx)/N;
E(idx+1) = E(idx) + r*B*S(idx)*I(idx)/N(1)-a*E(idx) + r2*B2*S(idx)*E(idx)/N;
I(idx+1) = I(idx) + a*E(idx) - y*I(idx);
R(idx+1) = R(idx) + y*I(idx);
m(idx+1) = E(idx+1) + I(idx+1);
end
x=1:182;
plot(x,m);grid on;
xlabel('day');ylabel('Demand for drugs')
今天的文章数学建模学习笔记(十七)传染病模型(SIER)「建议收藏」分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/85523.html