Professional Documents
Culture Documents
Section: Data Fetching
Section: Data Fetching
Section: Data Fetching
1. Covid-19 is something which is breathing around our neck for quite a some time. Now We
have the statistics of the state and it is time to analysis the data and predict when these all
will come to an end.
That is why here is the SIR model of COVID-19 and predict when we have everyone
recovered.
In this snippet, The given URL is read and date is extracted by using datetime command;
1. row is the size of the record where the data of West Bengal is stored.
2. r is assigned 1
3. for loop is defined
4. 2nd for loop defined
5. the body of the loop has D_R_C, which is a 3 column*row matrxis where
D=deceased,so all the deceased are stored,R=recovered,all recover
personel according to each date is stored and C=confirmed where all a
confirmed cases are being stored.
6. End of 2nd for
7. Decrementing row;
8. End of 1st for loop
9. 9,10,11 line, the cumulitive sum of Death,Recovered and Confirmed has
been calculated and stored which gives the total number of any case from
the beginning on a each date
13. The active case is calculate.
In this section,
1. total_pop count is taken(population of Bengal)
2. In totalcases, the total confirmed case of each date starting from 1 st day is stored,
So, the last date i.e totalcases(end) will give the recent total confirmed case. Now this
information is used to calculate the percentage of total cases out of population is
calculated.
3. The percentage is displayed.
4. Now, the percentage of susceptible is taken as 30 times of the affected percentage
5. Susceptible is calculated and stored in variable sus
6. Value of sus is displayed.
7. Sus_c is stored with 10 percent of total population who are not immune to
virus(Assumption)
end
2. avg=sum(factor)/length(factor);
Section: Plotting
plot(range_day,S,'y');
hold on;
plot(range_day,I,'R');
hold on;
plot(range_day,R,'g');
legend("Susceptible","Infected","Recovered","Location","best");
Section: Result
SUS_end=double.empty(tmax,0);
INFE_end=double.empty(tmax,0);
SUS_end=range_day(1==double(30>round(S)));
INFE_end=range_day(1==double(30>round(I)));
if(length(INFE_end)>1)
fprintf("on %s All infected will be recovered\n",INFE_end(1));
end
if(length(SUS_end)>1)
fprintf("on %s All Susceptible will be gone\n",SUS_end(1));
end
The value of any index if below 30 is displayed as the end of that case on the day of same index.