COVID-19 Optimum Control Response Using Python (GEKKO)

Emad Elgebesy
Kagera
Published in
5 min readMar 24, 2020

With the rapid spread of the disease COVID-19, epidemiologists have devised a strategy to flatten the curve by applying various levels of social distancing (sd). The strategy is to reduce the transmission of the virus SARS-Cov-2 so that the healthcare system is not overburdened.

Social distancing lowers the total number of people who are infected to keep hospitals below full capacity and reduces the total cumulative infected. Social distancing also minimizes the pandemic until a vaccine or effective treatments can be developed.

Economic Considerations

One of the downsides of extended social distancing is economic disruption where businesses fail, unemployment rises, supplies become scare, and assistance is needed to provide for the most vulnerable. Repeated outbreak cycles over multiple years are common when the virus mutates and the fraction of susceptible individuals is high. The objective of this exercise is to not just “flatten the curve” but to optimize social distancing to minimize the outbreak time and keep healthcare services below full capacity.

SEIR Compartmental Model

The fraction of Susceptible, Exposed, Infected, and Recovered (SEIR) population is given by a compartmental model with four differential equations.

Susceptible (s): population fraction that is susceptible to the virus

Exposed (e): population fraction is infected with the virus but does not transmit to others

Infectious (i): population fraction that is infected and can infect others

Recovered (r): population fraction recovered from infection and is immune from further infection

This model is a simplification and neglects mortality and birth rates. There is also an opportunity to update the model with data sources such as search engine queries to improve early identification of regional outbreaks. Outbreak data on cruise ships give a controlled study to better assess under-reported cases. The model also neglects the variable fraction of infected patients that will need healthcare services. This fraction depends on how well vulnerable populations such as the elderly or immuno-compromised patients are protected.

Jeff Kantor’s simulation model shows the effect of social distancing (u=0 (none), u=1 (total isolation)) and other ways to alter the outcome. A starting simulation model in Python Gekko predicts the response with a single social distancing factor (u==0) for 200 days for a population of 100,000.

This model is a simplification and neglects mortality and birth rates. There is also an opportunity to update the model with data sources such as search engine queries to improve early identification of regional outbreaks. Outbreak data on cruise ships give a controlled study to better assess under-reported cases. The model also neglects the variable fraction of infected patients that will need healthcare services. This fraction depends on how well vulnerable populations such as the elderly or immuno-compromised patients are protected.

Jeff Kantor’s simulation model shows the effect of social distancing (u=0 (none), u=1 (total isolation)) and other ways to alter the outcome. A starting simulation model in Python Gekko predicts the response with a single social distancing factor (u==0) for 200 days for a population of 100,000.

Optimize the Curve

When a constant social distancing policy is enforced, the outbreak peaks before receding. The constant social distancing also creates undue economic damage. Devise an optimal distancing policy that changes over time to not only flatten the curve but also optimize to available healthcare constraints.

For this case study, assume that the number of infected must stay below 2000 (i<0.02) to keep healthcare below full capacity. Minimize social distancing to decrease economic disruption. Assume that the maximum achievable social

Python (GEKKO) Solution

The source code for the solution is shown below. A simulation is used to initialize the optimization problem to determine the best social distancing strategy that is adjusted every two days.

While the spread of the disease is longer in duration than with no social distancing, a maximum of only 2% of the population is infective and 3.5% are exposed at any time.

Conclusions

Self-monitoring might include regularly checking temperature and watching the signs of a respiratory illness, such as fever, cough or shortness of breath, according to the Centers for Disease Control and Prevention. It also involves limiting interaction with others.

References

  • Kantor, J., Modeling and Control of a Campus COVID-19 Outbreak, 2020, Video Link.
  • Keeling, Matt J., and Pejman Rohani. Modeling Infectious Diseases in Humans and Animals. Princeton University Press, 2008. JSTOR, www.jstor.org/stable/j.ctvcm4gk0. Accessed 25 Feb. 2020.
  • Cook, S., et al., Assessing Google flu trends performance in the United States during the 2009 influenza virus A (H1N1) pandemic, PloS one 6(8): e23610, 2011.
  • Ginsberg, J., et al., Detecting influenza epidemics using search engine query data, Nature 457.7232: 1012–1014, 2009.
  • Word, D.P., Abbott, G.H., Cummings, D., Laird, C.D., Estimating seasonal drivers in childhood infectious diseases with continuous time and discrete-time models, Proc. 2010 American Control Conference, Baltimore, MD, 5137–5142, June 2010.
  • Carneiro, H.A., Mylonakis, E., Google trends: a web-based tool for real-time surveillance of disease outbreaks, Clinical infectious diseases 49.10: 1557–1564, 2009.
  • Vishal S. Arora, Martin McKee, David Stuckler, Google Trends: Opportunities and limitations in health and health policy research, Health Policy, 123: 3, 2019, 338–341, 2019.

--

--