资源简介
该程序为传染病建模的随机,微分,差分方程的matlab代码

代码片段和文件信息
function [tSIR] = differentialSIR(NbetagammaMaxTime)
%
%
%
% RISK_STRUCTURE( beta gamma S0 I0 MaxTime)
% This is the MATLAB version of program 2.1 from page 19 of
% “Modeling Infectious Disease in humans and animals“
% by Keeling & Rohani.
%
% It is the simple SIR epidemic without births or deaths.%
%
% Sets up default parameters if necessary.
I0 = 100 / N;
S0 = 1 - I0;
% Checks all the parameters are valid
if S0<=0
error(‘Initial level of susceptibles (%g) is less than or equal to zero‘S0);
end
if I0<=0
error(‘Initial level of infecteds (%g) is less than or equal to zero‘I0);
end
if beta<=0
error(‘Transmission rate beta (%g) is less than or equal to zero‘beta);
end
if gamma<=0
error(‘Recovery rate gamma (%g) is less than or equal to zero‘gamma);
end
if MaxTime<=0
error(‘Maximum run time (%g) is less than or equal to zero‘MaxTime);
end
if S0+I0>1
warning(‘Initial level of susceptibles+infecteds (%g+%g=%g) is greater than one‘S0I0S0+I0);
end
if beta warning(‘Basic reproductive ratio (R_0=%g) is less than one‘beta/gamma);
end
S=S0; I=I0; R=1-S-I;
% The main iteration
[t pop]=ode45(@Diff_2_1[0 MaxTime][S I R][][beta gamma]);
S=pop(:1); I=pop(:2); R=pop(:3);
% Calculates the differential rates used in the integration.
function dPop=Diff_2_1(tpop parameter)
beta=parameter(1); gamma=parameter(2);
S=pop(1); I=pop(2); R=pop(3);
dPop=zeros(31);
dPop(1)= -beta*S*I;
dPop(2)= beta*S*I - gamma*I;
dPop(3)= gamma*I;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-01-19 21:30 YBJAN1916_SIR model in whole population\
文件 12292 2016-01-22 19:37 YBJAN1916_SIR model in whole population\.DS_Store
目录 0 2016-03-15 21:12 __MACOSX\
目录 0 2016-03-15 21:12 __MACOSX\YBJAN1916_SIR model in whole population\
文件 120 2016-01-22 19:37 __MACOSX\YBJAN1916_SIR model in whole population\._.DS_Store
目录 0 2016-01-19 21:30 YBJAN1916_SIR model in whole population\SIR\
文件 1536 2016-01-19 02:31 YBJAN1916_SIR model in whole population\SIR\differentialSIR.m
目录 0 2016-03-15 21:12 __MACOSX\YBJAN1916_SIR model in whole population\SIR\
文件 120 2016-01-19 02:31 __MACOSX\YBJAN1916_SIR model in whole population\SIR\._differentialSIR.m
文件 2361 2016-01-19 02:40 YBJAN1916_SIR model in whole population\SIR\discreteSIR.m
文件 171 2016-01-19 02:40 __MACOSX\YBJAN1916_SIR model in whole population\SIR\._discreteSIR.m
文件 910 2016-01-19 02:40 YBJAN1916_SIR model in whole population\SIR\mean_fieldSIR.m
文件 120 2016-01-19 02:40 __MACOSX\YBJAN1916_SIR model in whole population\SIR\._mean_fieldSIR.m
文件 1295 2016-01-22 19:38 YBJAN1916_SIR model in whole population\SIR\SIR.m
文件 120 2016-01-22 19:38 __MACOSX\YBJAN1916_SIR model in whole population\SIR\._SIR.m
- 上一篇:EKF扩展卡尔曼滤波车身状态估计
- 下一篇:PMSM滑模控制程序
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
评论
共有 条评论