疾病模型 - 难以让僵尸疾病模型发挥作用

时间:2015-12-08 06:30:44

标签: r modeling

我正在努力创建一个人群中狂犬病狂犬病爆发的模型。考虑到在最初出现症状后对狂犬病缺乏治疗,它就是一个有趣的模型。我的模型相当简单,但我似乎无法获得变量的值,或者我的模型可能存在缺陷。正如您所看到的那样dE会导致EI人口逐渐增多,而且我无法弄清楚如何解决这个问题。如果有人有任何提示我会非常感激!

代码可以在下面找到:

#
# Initial conditions and variables:

S      = 3500000;    # Size of susceptible population
E      = 0;          # Asymptomatic infected population
I      = 7;          # Asymptomatic infected population, derived from a patient zero who was an organ donor
J      = 0;          # Symptomatic  infected population
Q      = 0;          # Quarantined population
qE     = 0;          # Rate at which LE quarantines exposed
qI     = 0;          # Rate at which LE quarantines nonfatal infected
qJ     = 0;          # Rate at which LE quarantines fatal infected
b      = 0.00003616; # Birth rate of USA per person per day
delta  = 0.00002301; # Death rate of USA per person per day
eta    = 0;          # Rate at which vigilantes kill infected individuals
pV     = 0;          # Proportion of S that will become vigilantes and kill zombies
pL     = 0.00114;    # Proportion of S that is law enforcement
t      = 0;          # Set time to zero
omega  = 0.8;        # Rate of successful bites per zombie encounter
d      = 1;       # Rate of successful infections per bite     
beta   = omega*d;    # Rate at which infected "turn" susceptible
u1     = 1/14;       # Rate at which exposed begin exhibiting symptoms
u2     = 1/5;        # Rate at which nonlethal symptomatic individuals enter lethal stage
alpha  = 1/45;       # Death rate of lethal infected individuals
tmax   = 20;          # Determine how long the model will run
dt     = 0.00001;    # Determine size of steps made by model. Must be small to behave differentially
tbeg   = 10;         # Determine time at which population begins quarantining and killing zombies.


cat(t, S, E, I, J, Q, "\n");

while(t<tmax)
 {if(t<tbeg) { eta=.00; pV=.00; qE=.00; qI=.00;         }
  else       { eta=.0125; pV=.2; qE=.01; qI=.03; qJ=.03; }

  dS=(0 +b*S       -beta*(I+J)*(S/(S+E))               -delta*S ) *dt;
  dE=(0 -qE*pL*S*E +beta*(I+J)*(S/(S+E))   -u1*E       -delta*E ) *dt;
  dI=(0 -qI*pL*S*I -eta*pV*S*I             +u1*E -u2*I -delta*I ) *dt;

  dJ=(0 -qJ*pL*S*J -eta*pV*S*J                   +u2*I -alpha*J ) *dt;
  dQ=(0 +qE*pL*S*E  +qI*pL*S*I +qJ*pL*S*J              -alpha*Q ) *dt;

  t=t+dt; S=S+dS; E=E+dE; I=I+dI; J=J+dJ; Q=Q+dQ;

  #if((as.integer(t*100000)%%10000)==0) cat(t, S, E, I, J, Q, "\n");
  if((as.integer(t*100000)%%100000)==0) cat("dE=", dE, "\n", "Susceptible at t",t, " = ",S, "\n", "Exposed at t",t, " = ",E, "\n", "Nonfatal infected at t",t, " = ",I, "\n", "Fatal infected at t",t, " = ",J, "\n", "Quarantined at t",t, " = ",Q, "\n", "\n")
  if(S<0||E<0||I<0||J<0||Q<0) { cat("Went negative\n"); break; }}

0 个答案:

没有答案