Homework V Homework V CS-102 Warren Littlefield HomeworkV-A Viral Epidemic Model – Using Diamond Princess Data • The advent of the Covid19 virus (a.k.a. Coronavirus) has made predicting the spread of...

C++ program


Homework V Homework V CS-102 Warren Littlefield HomeworkV-A Viral Epidemic Model – Using Diamond Princess Data • The advent of the Covid19 virus (a.k.a. Coronavirus) has made predicting the spread of the virus of great public concern. • In this homework, we will be considering the effect of changing the basic Reproductive number, R0, on the strength of the epidemic. • Note: the basic Reproductive number, R0, is largely dependent on factors such as whether “Social Distancing” is maintained, whether people are wearing, ”surgical masks”, etc. • The Diamond Princess outbreak took place before the ameliorating effects of these measures were well understood. • The background of the mathematical model, we will be using may be found at: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3178755/ • The model is as follows: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3178755/ Homework V-A • Where S(t) represents the number of people susceptible to the virus. • I(t) represents the number of people who are infected at any time. • N is the number of people in the closed community. • b = a * R0/N where R0 is the basic reproductive number. • Dt will be 1 day. • i.e. if the variables on the right of the above equations represent the state of infection and susceptibility on Monday, then the variables on the left will be the expected state on Tuesday. • 1/a represents the number of days an infected person can transmit the infection to someone else. We will be trying 3 different values for a to see what will result. • 1/a = 3 days or a = .33333333; • 1/a = 6 days or a = .1666666667; • 1/a = 10 days or a = .1 Susceptible- Infectious- Recovered model and the epidemic curve generated. Homework V Diamond Princess Analysis • On January 20, 2020, the Cruise ship Diamond Princess set sail from Hong Kong carrying 1 passenger infected with Covid-19. • By February 20, 2020 when the last passengers had disembarked into Tokyo, 621 persons had come down with Covid-19. • This gives us 31 days of a well-documented controlled population from which to draw lessons and test our mathematical model. • What we would like to know is, what is the infection rate, R0, for this event. • The mean rate of recovery, alpha, used in this calculation is defined as one divided by the number of days that a person infected with the Covid-19 virus can actually infect other people with the Covid-19 virus. • In examining the data, estimates of the actual number of days that a person who has come down with Covid-19 is infectiou, vary from 3 days to 10 days. As a result, we will be doing this calculation using 1/alpha = 3, 1/alpha = 6, as well as 1/alpha = 10. • Because of the variability from patient to patient, the R0 is often given over a range of alpha. Your job is to compute the R0 for 1/alpha = 3, 6, and 10, which will give us the range in the Diamond Princess case. • Remember, in each of these three cases, on day 0 there is 1 infection and on day 31 there should be 621 people who have come down with infections (some of whom may have recovered while others may still be among the contagious or recovering or have died). Homework V-A • Your assignment is to write a program that calculates I(t) [the number of infected] and S(t) [Number still susceptible to infection], using the data from the Diamond Princess cruise ship which held N = 3711 passengers. • Note that people on the Diamond Princess were isolated on board the ship (effectively quarantined) for 31 days before being released. • Upon release, there were a total of 621 people who had come down with the disease. • Your calculation will generate a file of I(t) and S(t) over 150 days, rather than just the 31 days of the quarantine, showing what might have been expected to have occurred on board had the passengers been forced to remain on board more than 31 days. Homework V-A • You should create two files called Susceptible.txt and Infected.txt. • Your first entry into the file (day 0) should be N-1 for the Susceptible file and 1 for the Infected file (all you need is 1 infected person to start the process). • Using what you have learned about loops and files, calculate out what the number of infections would have been if for each of the following 149 days of the test. Also calculate the number of Susceptible people as a function of each of the 150 days (starting at day 1). • Although your calculations for I(t) and S(t) will be done in floating point, when you save the values for each day into the files for Infected.txt and Susceptible.txt, save these values as Integers (ultimately we’re dealing with whole persons, not fractions of persons.) Tip # 1 // So you would start off your files of susceptible people and infected people, on board, as follows: double s, i, sp, ip; // Where s is current value of susceptible people & sp is the previous day’s value. // Where i is current value of infected people & ip is the previous day’s value. ofstream susceptible, infected; susceptible.open("Susceptible.txt"); infected.open("Infected.txt"); s = N-1; i = 1; susceptible < s="">< endl;="" the="" initial="" value="" in="" our="" text="" file="" for="" #="" of="" susceptible,="" on="" day="" 0,="" will="" be="" n-1.="" infected="">< i="">< endl;="" the="" initial="" value="" in="" our="" text="" file="" for="" #="" of="" infected,="" on="" day="" 0,="" will="" be="" 1.="" tip="" #2="" now="" you="" would="" generate="" each="" succeeding="" day’s="" value="" of="" s="" and="" i,="" and="" the="" resulting="" file="" as="" follows:="" sp="s;" ip="i;" s="so" -="" beta*ip*sp;="" susceptible=""><>(s) < endl;="" we="" update="" the="" susceptible="" file="" with="" whole="" people,="" not="" fractions.="" i="ip" +="" beta*ip*sp="" -="" alpha*ip;="" infected=""><>(i) < endl; // we update the infected file with whole people, not fractions. • the above code would all be contained within a loop of your creation. • the rest of the program i will leave to you to work out. homework v-a • you will do the calculation for the following three values of alpha: • 1/alpha = 3 (this is the least number of days one might be contagious.) • 1/alpha = 6 (this is average number of days a covid19 patient might be contagious.) • 1/alpha = 10 (this is the upper limit over which patients might be contagious.) • from your files of susceptible.txt and infected.txt, determine the following: • on what day (starting with day=0) did the number of infected people reach a maximum for each of the three values of alpha given? • what was the maximum number of infected people, at any one time, for each of the three values of alpha given? • what are the values of r0 for each of these values of 1/alpha? • what is the percentage of remaining susceptible people after the number of infected people has returned to zero for each of the three values of alpha given? • note: the ratio of remaining susceptible people to n, will give you the herd immunity percentage. • based on your data, what is the earliest date that it would be safe to allow all the passengers to disembark into the general public without fear of contagion from this community? • submit your program: yourname_hwrkv-a.cpp, as well as the files, susceptible.txt and infected.txt for the case where 1/alpha = 6. endl;="" we="" update="" the="" infected="" file="" with="" whole="" people,="" not="" fractions.="" •="" the="" above="" code="" would="" all="" be="" contained="" within="" a="" loop="" of="" your="" creation.="" •="" the="" rest="" of="" the="" program="" i="" will="" leave="" to="" you="" to="" work="" out.="" homework="" v-a="" •="" you="" will="" do="" the="" calculation="" for="" the="" following="" three="" values="" of="" alpha:="" •="" 1/alpha="3" (this="" is="" the="" least="" number="" of="" days="" one="" might="" be="" contagious.)="" •="" 1/alpha="6" (this="" is="" average="" number="" of="" days="" a="" covid19="" patient="" might="" be="" contagious.)="" •="" 1/alpha="10" (this="" is="" the="" upper="" limit="" over="" which="" patients="" might="" be="" contagious.)="" •="" from="" your="" files="" of="" susceptible.txt="" and="" infected.txt,="" determine="" the="" following:="" •="" on="" what="" day="" (starting="" with="" day="0)" did="" the="" number="" of="" infected="" people="" reach="" a="" maximum="" for="" each="" of="" the="" three="" values="" of="" alpha="" given?="" •="" what="" was="" the="" maximum="" number="" of="" infected="" people,="" at="" any="" one="" time,="" for="" each="" of="" the="" three="" values="" of="" alpha="" given?="" •="" what="" are="" the="" values="" of="" r0="" for="" each="" of="" these="" values="" of="" 1/alpha?="" •="" what="" is="" the="" percentage="" of="" remaining="" susceptible="" people="" after="" the="" number="" of="" infected="" people="" has="" returned="" to="" zero="" for="" each="" of="" the="" three="" values="" of="" alpha="" given?="" •="" note:="" the="" ratio="" of="" remaining="" susceptible="" people="" to="" n,="" will="" give="" you="" the="" herd="" immunity="" percentage.="" •="" based="" on="" your="" data,="" what="" is="" the="" earliest="" date="" that="" it="" would="" be="" safe="" to="" allow="" all="" the="" passengers="" to="" disembark="" into="" the="" general="" public="" without="" fear="" of="" contagion="" from="" this="" community?="" •="" submit="" your="" program:="" yourname_hwrkv-a.cpp,="" as="" well="" as="" the="" files,="" susceptible.txt="" and="" infected.txt="" for="" the="" case="" where="" 1/alpha="">
Oct 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here