% This script needs the file Fseirs.m to run
% Fseirs.m contains the differential equation model
% S is the number of Susceptible individuals at each time step
% E is the number of Exposed individuals at each time step
% I is the number of Infected individuals at each time step
% R is the number of Recovered individuals at each time step
N=1000; %Population Size
%-- initial condictions
i0=5; % initial condition for I
s0=N-i0; % initial condition for S
e0=0; % initial condition for E
r0=0; % initial condition for R
% --
T=100; % evaluation time
%-- parameters
beta=0.5; % infectious rate
gamma= 0.1; % recover rate
omega= 0.1; % migration rate of latency
mu = 0.03; % immunity loss rate
%--
S0E0I0R0=[s0 e0 i0 r0]; % initial condictions Vector
Tspam=[0:0.1:T]; % time interval
%-- Numerical Integration
[T,Y] = ode45(@(t,Y) Fseirs(t,Y,beta,gamma,omega,mu,N),Tspam,S0E0I0R0);
%--
S=Y(:,1); % Solution S
E=Y(:,2); % Solution E
I=Y(:,3); % Solution I
R=Y(:,4); % Solution R (another solution is R=N-S-E-I)
%----- plots -----
plot(T,S,'k');
hold on;
grid on;
plot(T,E,'m:');
plot(T,I,'r--');
plot(T,R,'b-.');
title(['SEIRS model: \beta= ',num2str(beta),', \gamma= ',num2str(gamma), '\omega= ',num2str(omega), '\mu= ',num2str(mu),', N=',num2str(N)])
xlabel('Time')
ylabel('Number of Individuals')
legend('S','E','I','R','Location','best')
%------------------
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab传染病学模型(Epidemic Models)
共18个文件
m:12个
jpg:6个
4 下载量 201 浏览量
2023-07-18
22:18:53
上传
评论 1
收藏 248KB ZIP 举报
温馨提示
Matlab传染病学模型(Epidemic Models:SI, SIS, SIR, SIRS, SEIR, SEIRS)
资源推荐
资源详情
资源评论
收起资源包目录
Epidemic-Models-main.zip (18个子文件)
Epidemic-Models-main
SIS
Fsis.m 143B
SIS_model.jpg 39KB
run_SIS.m 977B
SEIR
Fseir.m 262B
run_SEIR.m 1KB
SEIR_model.jpg 45KB
SEIRS
SEIRS_model.jpg 62KB
run_SEIRS.m 1KB
Fseirs.m 446B
SIRS
SIRS_model.jpg 50KB
run_SIRS.m 1KB
Fsirs.m 326B
SI
run_SI.m 919B
Fsi.m 124B
SI_model.jpg 18KB
SIR
Fsir.m 215B
run_SIR.m 1KB
SIR_model.jpg 36KB
共 18 条
- 1
资源评论
算法如诗
- 粉丝: 1215
- 资源: 60
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功