Published in

Analytics Vidhya

# Simplified epidemic model of COVID 19

`# Number people exposed to an infected person (E)E = 1# Probablity that an exposed person catches on the diseasep = 0.05# Total population Size (set at 100 million)pop = 1e8#Total Infections by day (starts by 1 person getting infected)`

# Plotting the impact of Exposure

`E = 1for j in range(20):    for i in range(1,300): #100 days        N_d[i] = (1+ E*p*(1-N_d[i-1]/pop))*N_d[i-1]    E= E+1    plt.plot(N_d, label= E-1)#plt.yscale('log')plt.legend()plt.show()`

# The number of new cases Every Day

`E = 1del_d = np.zeros(300)for j in range(20):    for i in range(1,300): #100 days        N_d[i] = (1+ E*p*(1-N_d[i-1]/pop))*N_d[i-1]        del_d[i] = N_d[i] - N_d[i-1]    E= E+1    plt.plot(del_d, label= E-1)#plt.yscale('log')plt.legend()plt.show()`

# Modelling with Recovery @ 1% of the population

`R = 0.01E = 1p = 0.05for j in range(10):    for i in range(1,300): #100 days        N_d[i] = (1+ E*p*(1-N_d[i-1]/pop))*N_d[i-1] - R*N_d[i-1]    E= E+2    plt.plot(N_d, label= "E=" + str(E-1)+" with recovery="+str(100*R) +"%")#plt.yscale('log')R = 0.01E = 1p = 0.05for j in range(10):    for i in range(1,300): #100 days        N_d[i] = (1+ E*p*(1-N_d[i-1]/pop))*N_d[i-1] #- R*N_d[i-1]    E= E+2    plt.plot(N_d, label= "E=" + str(E-1)+" (model without recovery)")plt.legend()plt.show()`

--

--

## More from Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com