新冠疫情建模代码

```

#include

#include

int main(){

long long S=1400000000;

long long day=1;

long long I=41;

long long E=60;

long long R=0;

float d=1.0/5;

long long  d3=10;

float w=0.6;

float re=0.7;

float ri=0.7;

long long dS,dE,dI,dR;

float p=0.1;

float dp;

while(day<68){

day++;

if(day<=12){

dp=(1-p)*(1-p)/20.0;

}

if(day==12){

w=0;

}

if(day>12&&day<20){

dp=(1-p)*(1-p)/(15);

}

if(day>=20&&day<25)

{

dp=(1-p)*(1-p)/(10);

}

if(day>=25&&day<29)

{

dp=(1-p)*(1-p)/3;

}

if(day>=29)

{

dp=(1-p)*(1-p);

}

dS=-(w*I*ri+(1-p)*E*re);

dE=w*I*ri+(1-p)*E*re-E*d;

dI=d*E-I/d3;

dR=I/d3;

S=S+dS;

E=E+dE;

I=I+dI;

R=R+dR;

p=p+dp;

printf("day %lld 确诊病人变化:%lld,潜伏期病人变化:%lld,退出者变化:%lld\n",day,dI,dE,dR);

printf("确诊累计病人:%lld,潜伏期病人:%lld,退出者:%lld\n",I+R,E,R);

//printf("%lld\n",I+R+E);

}

return 0;

}

```

你可能感兴趣的:(新冠疫情建模代码)