ApproximantCoeffici​entsSIR

版本 1.0.1 (2.3 KB) 作者: Nathaniel Barlow
Computes the the coefficients of an approximate analytic solution to the SIR epidemic model (https://doi.org/10.1016/j.physd.2020.132540)
42.0 次下载
更新时间 2020/6/17

查看许可证

This computes the A_n coefficients and Sinf needed for the N-term SIR approximant
given as equation (12a) in Barlow & Weinstein, Physica D 408, 1 (2020) (https://doi.org/10.1016/j.physd.2020.132540)
The inputs correspond to the SIR parameters and initial conditions as
specified by equation (1). Python code available at https://github.com/nsbsma/SIR-approximant

%%% example, reproducing figure 2b in Barlow & Weinstein, Physica D 408, 1 (2020)
alpha=2.73; r=0.0178; I0=7; S0=254; %input parameters
t=0:0.01:6 %time interval 0 to 6 in increments of 0.01
N=25; %number of terms in the approximant, increase until answer stops changing
[A,Sinf,a0,a]=ApproximantCoefficientsSIR(N,alpha,r,S0,I0); %using the code provided to get the stuff needed below
kappa=r*Sinf-alpha;
Ssum=1;
for j=1:N
Ssum=Ssum+A(j)*exp(kappa*t*j); %approximant (equation 4.7a in paper)
end
S=Sinf./Ssum;
plot(t,S,'displayname','S'); hold on
I=alpha/r*log(S/S0)+S0-S+I0;
plot(t,I,'displayname','I');
R=S0+I0-S-I; %b/c S+I+R=constant
plot(t,R,'displayname','R'); xlabel('t'); legend show

引用格式

Nathaniel Barlow (2024). ApproximantCoefficientsSIR (https://www.mathworks.com/matlabcentral/fileexchange/75131-approximantcoefficientssir), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Epidemiology 的更多信息
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.1

Added test case, comments, link to python code, and link to published article

1.0.0