资源简介
该程序为传染病建模的随机,微分,差分方程的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滑模控制程序
相关资源
- BFS 广度优先搜索算法 matlab
- matlab写的人工神经网络BP股价预测模型
- k-mean matlab
- 短时傅里叶变换的MATLAB代码
- 用Matlab实现的数字音频水印嵌入与提
- 信息论中各种熵的matlab实现
-
simuli
nk仿真bldc控制 - Harris算子 Matlab源代码 直接可以运行
- 《粒子滤波原理及应用-MATLAB仿真》程
- 无标度网络 BA模型 MATLAB
- 随机过程一步转移矩阵初始分布得到
- 卷积编码译码Matlab仿真程序保证可以
- M序列产生与卷积编码译码的设计实验
- 利用遗传算法进行图像分割(matlab源
- MATLAB的转子振动计算代码
- MATLAB 2018b windows破解文件
- MATLAB 2018b linux破解文件
- NURBS malab入门程序 实现字母 NURBS
- matlab 实现fastica源代码
- 基于matlab的直接序列扩频通信系统仿
- Bezier曲线_Bezier曲面_Matlab
- matlab车型识别demo
- 基于matlab-GUI简易计算器的设计
- 基于matlab-GUI实时人脸检测系统
- matlab中的db小波
- dwt代码,不用matlab自带的dwt
- 曲线测设程序用MATLAB语言编写
- MATLAB图像倾斜校正
- MATLAB实现马赫带
- 基于matlab的图像增强—空域变换增强
评论
共有 条评论