% SIMIODE-TeacherStudent-Template.tex and simiode.cls for LaTeX2e
% Version 22 November 2016.
% 
% This template is to be used with the  class file "simiode.cls". 
%  
% The latest version of this class and template files 
% can be found at
% 
%       <http://www.SIMIODE.org> in the Author section.
%
% A "Quick Start Guide" appears below.
%
% This file must be processed with version LaTeX2e or higher.
% Appreciation to Mark Frantz, IUPUI; John Thoo, Yuba College; and Eric Sullivan, Carroll College.
%
\documentclass{simiode}
%
% With this version of the tex file and the associated SIMIODE.cls file you can produce BOTH a Student Version and a Teacher Version of your modeling scenario or technique narrative.
%
% Student Version contains the title STUDENT VERSION along with the NAME OF SCENARIO, with no abstract, no keywords, no tags, no author identifiers, and no COMMENTS section. The Student Version contains only the STATEMENT of the modeling scenario only with appropriate figures, data, instructions, and perhaps a bibliography appropriate for student resourcing, but nothing in the bibliography which would "give away" the nature of the modeling scenario, etc.
%
%The Teacher Version contains the material in the Student Version, namely the title NAME OF SCENARIO, now headed with   TEACHER VERSION, but also full author  identification, abstract, key words, tag words, and, following the STATEMENT, a section of COMMENTS which can be discussion of presentation  ideas, "solutions," techniques, etc.
%
% Authors can prepare a full Teacher Version using the notions immediately below  to create a pdf for review, but in review please eliminate all information about the author as we use a double-blind referee system. Such information will be restored when accepted and published in SIMIODE at www.simiode.org.
%
%***********   Toggle the following line to turn the teacher version on (1) or off (0). ***********
%
\def\TeacherEdition{0} % Toggle this line's value.
\newcommand{\teacher}[1]{\ifnum\TeacherEdition=1 #1 \fi}
%
% The \teacher{ } command wraps any text that will appear only in the teacher version of
% the document. See this file for examples. This has been done for you in the document below.   
% Rename the pdf after you compile each final version.
%
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usepackage{color}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{url}
%
\renewcommand{\baselinestretch}{1.3}
%
% NOTE regarding macros %%
%
% Any macros defined for your paper should be contained in 
% the top matter. Likewise, any environment definitions such 
% as \newtheorem or \newenvironment should also go in the 
% top matter. 
% 
% Do not \input your macros as separate files within your 
% final version because more files make it harder for the 
% editors and users to keep track of and/or modify and 
% append your paper.
%
% Top matter is above and the beginning of the document below.
%
\begin{document}

\newpage
%
% You only need to change the NAME OF SCENARIO in the next line and delete the footnote. 
% See above for instructions on toggling from Teacher Version to Student Version.
%
\title{\ifnum\TeacherEdition=1 TEACHER VERSION \else STUDENT VERSION \fi\\ Functions and their Derivatives in SIR Models}



\markboth{Functions and their Derivatives in SIR Models}{Functions and their Derivatives in SIR Models}

\author{Meredith L. Greer\\
Bates College\\
Lewiston ME 04240 USA\\
mgreer@bates.edu
}

\makeStitlePDFLaTex


\begin{abstract}
%Which is the graph of a differential equation, and which is the graph of its solution? What does this look like for a system of differential equations? 

Given a system of differential equations, how do the solution graphs compare with the graphs of the differential equations? Students tackle this question using SIR models for well-known infectious diseases. The students view graphs both of solution curves and of the differential equations in the model. Students determine which graphs show solutions, which show derivatives, and which correspond to each compartment (S, I, and R) in the model. Students are then encouraged to update the model to demonstrate non-autonomous infection terms, such as incorporating changed health policy within the timeframe of an outbreak.

Solutions are provided for all exercises, including sample solutions to open-ended questions. A table of data makes it easy to change the given SIR model to  represent measles, smallpox, or different influenza outbreaks. This scenario works best if the professor or students have access to software that can numerically solve and graph solutions to systems of ordinary differential equations.
\end{abstract}




\section*{SCENARIO DESCRIPTION}

\subsection*{Introduction to SIR Models}

Epidemic spread can be modeled by a system of differential equations. Such models include the SIR (Susceptible-Infectious-Removed) model and its relatives. An example appears in Figure~\ref{fig:function}. 

\begin{figure}[hpt]
\centering
\begin{tikzpicture}

    \draw [thick] [blue] (0,0) -- (2,0);
    \draw [thick] [blue] (2,0) -- (2,2);
    \draw [thick] [blue] (2,2) -- (0,2);
    \draw [thick] [blue] (0,2) -- (0,0);
    \node [blue] at (1,1) {\Huge $S$};
    \draw [thick] [->] (2.1,1) to (3.9,1); 
    \node at (3,1.5) {\Large $\beta SI$};
    \draw [thick] [red] (4,0) -- (6,0);
    \draw [thick] [red] (6,0) -- (6,2);
    \draw [thick] [red] (6,2) -- (4,2);
    \draw [thick] [red] (4,2) -- (4,0);
    \node [red] at (5,1) {\Huge $I$};
    \draw [thick] [->] (6.1,1) to (7.9,1); 
    \node at (7,1.5) {\Large $\gamma I$};
    \draw [thick] [green] (8,0) -- (10,0);
    \draw [thick] [green] (10,0) -- (10,2);
    \draw [thick] [green] (10,2) -- (8,2);
    \draw [thick] [green] (8,2) -- (8,0);
    \node [green] at (9,1) {\Huge $R$};

\end{tikzpicture}
\caption{Sample $SIR$ (Susceptible-Infectious-Removed) diagram}
\label{fig:function}
\end{figure}

In the example of Figure~\ref{fig:function}, the compartment S consists of Susceptible people, that is, those who could become infected. Compartment I is people who are currently infected and who are able to spread the disease. Once people can no longer spread the disease, whether due to immunity or for other reasons, they move to the Removed compartment, labeled R.

The differential equations that match Figure~\ref{fig:function} are

\begin{align*}
\frac{dS}{dt} &= -\beta SI \\
\frac{dI}{dt} &= \beta SI - \gamma I \\
\frac{dR}{dt} &= \gamma I.
\end{align*}

\noindent The following simple rules permit the creation of many related models. 

\begin{enumerate}
	\item Each compartment has its own differential equation representing people entering and/or leaving the compartment. For instance, $dS/dt=-\beta SI$ is the equation for the S compartment. Entering and leaving are represented by arrows in the diagram.
    \item Positive terms on the right-hand side of each differential equation represent people entering the compartment. Negative terms represent people leaving the compartment. 
    \item At any given moment, a person must be in exactly one compartment. 
    \item When all movement is between compartments---that is, no new people enter or leave due to birth, death, immigration, or emigration---the total number of people in the population remains constant, that is, the population size is conserved.
\end{enumerate}
    
Different outbreaks have different characteristics. There may be incubation periods, or people entering or leaving the population, or isolation of infected individuals, or many other variations. These can be incorporated into models by including different compartments, different arrows into and out of compartments, and different functions on those arrows. To decide how to write a model, modelers consider the outbreak at hand as well as the specific questions they wish to ask about those models.

\subsection*{Determining Outcomes: Visualizing DEs and Their Solutions}

A common goal for modeling is to understand likely outcomes in the short term and the long term. These outcomes may be visualized via solutions to the differential equations, or via the differential equations directly.

{\bf This activity focuses on interpreting graphical representations of both differential equations and their solutions.}

\vspace{5mm}

\noindent {\bf Exercise 1: Initial Observations About the Differential Equations}

\noindent Consider the right-hand sides of the differential equations in the model above. Qualitatively, what can you say about $\frac{dS}{dt}$? Temporarily skip over $\frac{dI}{dt}$ and instead consider: what can you say about $\frac{dR}{dt}$? Finally, consider $\frac{dI}{dt}$. This differential equation includes both positive and negative terms. Can the right-hand side ever equal zero? What would this mean about the outbreak? Finally, be sure you think carefully about the interaction term $\beta SI$: when either $S$ or $I$ is close to zero, there cannot be many new infections per time unit, but when both $S$ and $I$ are larger, infection spreads quickly.  

\vspace{5mm}

\noindent {\bf Exercise 2: Checking Understanding Via Graphs} 

\noindent Below are six graphs from the SIR model for a theoretical outbreak of influenza in a population of 3,000 people. At the start of the outbreak, there is one Infectious person, and everyone else is Susceptible. There is one graph for each of the following: $S(t)$, $I(t)$, $R(t)$, $dS/dt$, $dI/dt$, and $dR/dt$. Which is which? How do you know? Consider shapes of graphs, values on the vertical axis, and other information you believe to be relevant. In particular, two graphs look nearly identical. One is a derivative graph ($dS/dt$, $dI/dt$, or $dR/dt$) and one is a solution graph ($S(t)$, $I(t)$, or $R(t)$). Reason through which graph is which. Explain your logic.

\begin{center}
1a.) \includegraphics[width=0.4\textwidth]{Iprime_plot_basic.eps} \hfill 1b.) \includegraphics[width=0.4\textwidth]{Rplot_basic.eps} \\
\vspace{5mm}
1c.) \includegraphics[width=0.4\textwidth]{Splot_basic.eps} \hfill 1d.) \includegraphics[width=0.4\textwidth]{Rprime_plot_basic.eps} \\
\vspace{5mm}
1e.) \includegraphics[width=0.4\textwidth]{Sprime_plot_basic.eps} \hfill 1f.) \includegraphics[width=0.4\textwidth]{Iplot_basic.eps} \\
\end{center}

\vspace{5mm}

\noindent {\bf Exercise 3: Allow Discontinuities} 

\noindent Next imagine an outbreak in which $\beta $ is not constant. Reasons for the change in $\beta $ could include a public health response to the outbreak, where measures such as social distancing or hand washing may reduce the likelihood of disease spread. This can be modeled by reducing the value of $\beta $. Or, on a college campus, weekends or specific social events may cause a temporary increase in the value of $\beta $. Changes in $\beta $ lead to changes in how many people become sick, and changes in the model provide a fascinating moment for building insight into the relationship between a differential equation and its solution.

As a first adjustment, consider $\beta = \beta (t)$ to be piecewise constant, as shown in Figure~\ref{fig:beta_piecewise}. This may represent suddenly changed health policies once authorities realize an outbreak has begun.

\begin{figure}[ht]
\centering
\includegraphics[width=0.4\textwidth]{beta_piecewise.eps}
\caption{A piecewise beta function}
\label{fig:beta_piecewise}
\end{figure}

Again, determine which graph is which below. The choices are $S(t)$, $I(t)$, $R(t)$, $dS/dt$, $dI/dt$, and $dR/dt$.

\begin{center}
2a.) \includegraphics[width=0.4\textwidth]{Splot_piecewise.eps} \hfill 2b.) \includegraphics[width=0.4\textwidth]{Rprime_plot_piecewise.eps} \\
\vspace{5mm}
2c.) \includegraphics[width=0.4\textwidth]{Rplot_piecewise.eps} \hfill 2d.) \includegraphics[width=0.4\textwidth]{Sprime_plot_piecewise.eps} \\
\vspace{5mm}
2e.) \includegraphics[width=0.4\textwidth]{Iplot_piecewise.eps} \hfill 2f.) \includegraphics[width=0.4\textwidth]{Iprime_plot_piecewise.eps} \\
\end{center}

\vspace{5mm}

\noindent {\bf Exercise 4: Explore Further} 

\noindent Finally, try a more free-form approach. 

\begin{itemize}
	\item What would happen if $\beta (t)$ were constantly decreasing, that is, if $\beta (t)$ were a straight line with negative slope? (Be sure $\beta (t)$ remains nonnegative throughout the time of your outbreak.) 
    \item What would happen if $\beta (t)$ were periodic? Can you construct a periodic function for $\beta (t)$, with a period of seven days, to represent weekly variation in infectivity? Again, keep $\beta (t) >0$.
    \item What other $\beta (t)$ functions could you consider?
\end{itemize}

In all variations, think through what the graphs of $S(t)$, $I(t)$, $R(t)$, $dS/dt$, $dI/dt$, and $dR/dt$ should look like. Reason through the answers first, and explain your reasoning carefully. Then, if you have software available for graphing differential equations and their solutions, test your claims by creating the graphs.

\teacher{
\section*{NOTES FOR TEACHERS}

When describing differential equations, many texts and courses focus on solutions. Numerical solutions take the form of curves, and it is often the case that no analytical solution is shown. (Indeed, there may be no formula for the analytical solution!) This means that students see an equation for the differential equation and a graph for its solution. {\bf This module helps students understand the difference. Which graph shows the differential equation? Which shows its solution? What are the relationships between these graphs?} 

While these concepts may have been discussed in a Calculus I course, we have here a system of differential equations and their solutions, rather than a single differential equation and its solution. This provides an opportunity to revisit and strengthen those calculus skills. 

Experience teaching this topic shows that students can excel at solving differential equations numerically, analytically, or graphically, and students can seem to understand their solutions, as evidenced by classroom discussions, homework, or other assessment. However, when faced with the right-hand sides of both differential equations and their solutions, most students learn that they have not fully understood which was which. An activity like this reminds them of knowledge they studied in earlier courses, strengthens their current knowledge, and pushes them to discern and discuss the relationships between differential equations, their graphs, and their solution curves. The connections to epidemics further push students to interpret the meanings of each curve. Using piecewise $\beta (t)$ functions, especially, causes students to confront misunderstandings about positive and negative values, increasing and decreasing functions, turning points, equilibria, and more.\\

\noindent {\bf Solutions to Exercises}\\

\noindent {\em Exercise 1:} Noting that $dS/dt$ is always negative is useful. Students should then be able to state that $S(t)$ should always be decreasing. Similarly, $dR/dt$ is always positive, and therefore $R(t)$ should always be increasing. Finally, $dI/dt$ can be positive, negative, or zero. The case when $dI/dt=0$ is especially interesting: this happens either with $I=0$, meaning there is no disease in the population, or when $S=\gamma / \beta $. Supposing $S$ starts at a number greater than $\gamma / \beta $, the Infectious population $I(t)$ must grow at first. Only when enough Susceptible people have become infected will $S(t)$ drop to $\gamma / \beta $ or lower. Valuable discussion and model interpretation can stem from the observation that $S=\gamma / \beta $ represents a turning point in the outbreak. This observation presents another useful moment for graphical comparison: when $dI/dt$ transitions from positive, to zero, to negative, the corresponding curve for $I(t)$ transitions from increasing, to level, to decreasing. There continue to be new infections, but at this time, people recover faster than new infections develop. Ultimately the $I(t)$ values drop to essentially zero. 

Regarding the interaction term: be sure students understand that very low values of $S$ or $I$ mean few to no new infections in a time unit. For instance, what if $S=0$ or $I=0$? What if $S=1$ or $I=1$? However, as both $S$ and $I$ become larger, infection spreads quickly. This understanding can help the students discern which graph is which in the exercises.

As an additional note: $\beta SI$ is sometimes referred to as a {\em mass action} term. Mass action is one way to model population interaction; other ways exist and may make more sense in certain populations.

\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}

\noindent {\em Exercise 2:} $\beta$ is constant.\\

\noindent Initial conditions and parameter values used to generate graphs are: 

$S(0)=2999$ 

$I(0)=1$ 

$R(0)=0$ 

$\gamma = 1/3$ 

$\beta = 1.5\gamma /S(0) \approx 0.00017$. \\

\noindent For instructors discussing the basic reproduction number $\mathcal{R}_0$, the value of $\mathcal{R}_0$ used here is 1.5, with $\beta = (\mathcal{R}_0\gamma )/S(0)$. More information about $\mathcal{R}_0$ appears in the comments on Exercise 4.\\

\noindent Solutions to graph identification questions:

1a.) $dI/dt$

1b.) $R(t)$

1c.) $S(t)$

1d.) $dR/dt$

1e.) $dS/dt$

1f.) $I(t)$

\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}

\noindent {\em Exercise 3:} $\beta (t)$ is a piecewise constant function.\\

\noindent Initial conditions and parameter values used to generate graphs are: 

$S(0)=2999$ 

$I(0)=1$ 

$R(0)=0$ 

$\gamma = 1/3$ 

$\beta (t) = \begin{cases} 
      0.0002 & 0\leq t < 25 \\
      0.0001 & 25\leq t\leq 60. 
   \end{cases}$ \\
   
\noindent Instructors will note that a constant value of $\beta $ corresponds to an autonomous system of differential equations, that is, a system that does not depend explicitly on the independent variable $t$. This exercise uses a function $\beta (t)$ that varies with time, resulting in a non-autonomous system. \\

\noindent Solutions to graph identification questions:

2a.) $S(t)$

2b.) $dR/dt$

2c.) $R(t)$

2d.) $dS/dt$

2e.) $I(t)$

2f.) $dI/dt$

\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}


\noindent {\em Exercise 4:} 

With $0 \leq t \leq 60$, $S(0)=2999$, $I(0)=1$, $R(0)=1$, and $\gamma = 1/3$, one possible function for a constantly decreasing $\beta (t)$ is

$$\beta (t) = 0.0002 - (0.0001/60)t.$$

For a periodic $\beta (t)$, with period of 7 days and height oscillating from 0.0001 to 0.0002, a possible function is

$$\beta (t) = 0.00005 \cos \left( \frac{2 \pi}{7}t \right) + 0.00015 .$$

\noindent In these cases and others, students can try many other variations. Instructors may wish to note that the value of $\beta $ has a tremendous impact on the size and duration of the outbreak. The examples shown in this module consider an SIR model for an outbreak of influenza. For this model, $\beta $ should be linked to both $\gamma $ and to $S(0)$. Below are some guidelines to consider sharing with students if they will change $\gamma $ or population size, or if they will create their own $\beta (t)$ functions.

\begin{itemize}
	\item Changing $\gamma$ corresponds to differing lengths of infectiousness: $\gamma = 1/3$ corresponds to an average 3-day infectious period, $\gamma = 1/4$ corresponds to an average 4-day infectious period, and so on. 
    \item Total population size can be larger or smaller than 3000. Total population size is reflected in initial conditions: $S(0)+I(0)+R(0)$.
    \item With an initial Susceptible population $S(0)=2999$ and with $\gamma = 1/3$, the value $\beta \approx 0.00017$ is appropriate for the H1N1 flu outbreak of 2009.
    \item More generally, the value $\beta \approx \frac{1.3\gamma }{S(0)}$ is appropriate for a typical flu season. 
    \item The number 1.3 in the previous bullet point is a typical value of $\mathcal{R}_0$, the basic reproduction number for influenza. The number $\mathcal{R}_0$ describes how many new infections are likely to result from a single Infectious person in an otherwise completely Susceptible population. When $\mathcal{R}_0 >1$, the disease initially spreads. 
\end{itemize}

Table~\ref{table:parameters} shows values of $\gamma $ and $\mathcal{R}_0$ for measles, smallpox, and multiple influenza outbreaks. Using the same SIR model described throughout this module, compute 

$$\beta = \frac{\mathcal{R}_0 \, \gamma }{S(0)}$$

\noindent for each type of outbreak. The resulting value of $\beta $ is typically a good starting point for modeling a specific outbreak.

\begin{table}[hpt]
\centering
\begin{tabular}{c|c|c|c}
Disease & Parameter & Value & Notes \\ \hline
\multirow{2}{*}{Measles} & $\gamma $ & $\frac{1}{8}$ to $\frac{1}{9}$ & 8 to 9 days infectivity \cite{ECDC_Measles} \\
 & $\mathcal{R}_0$ & 12--18 & In some cases, lower than 12 \cite{Guerra} \\ \hline
\multirow{2}{*}{Smallpox} & $\gamma $ & $\frac{1}{14}$ to $\frac{1}{24}$ & 14 to 24 days infectivity \cite{CDC_Smallpox} \\
 & $\mathcal{R}_0$ & 3.5--6 & \cite{Gani} \\ \hline
\multirow{2}{*}{1918 Flu} & $\gamma $ & $\frac{1}{3}$ to $\frac{1}{7}$ & 3 to 7 days infectivity \cite{CDC_Flu} \\
 & $\mathcal{R}_0$ & 1.47--2.27 (median: 1.8) & \cite{Biggerstaff} \\ \hline
\multirow{2}{*}{2009 Flu} & $\gamma $ & $\frac{1}{3}$ to $\frac{1}{7}$ & 3 to 7 days infectivity \cite{CDC_Flu} \\
 & $\mathcal{R}_0$ & 1.30--1.70 (median: 1.46) & \cite{Biggerstaff} \\ \hline
\multirow{2}{*}{Seasonal Flu} & $\gamma $ & $\frac{1}{3}$ to $\frac{1}{7}$ & 3 to 7 days infectivity \cite{CDC_Flu} \\
 & $\mathcal{R}_0$ & 1.19--1.37 (median: 1.28) & \cite{Biggerstaff} \\ \hline
\end{tabular}
\caption{Parameter estimates for a few SIR models}
\label{table:parameters}
\end{table}



\begin{thebibliography}{99}

\bibitem{Biggerstaff} Biggerstaff, M., S. Cauchemez, C. Reed, M. Gambhir, L. Finelli. 2014. ``Estimates of the reproduction number for seasonal, pandemic, and zoonotic influenza: a systematic review of the literature.'' {\it BMC Infectious Diseases} vol. {\bf 14}. \href{https://doi.org/10.1186/1471-2334-14-480}{https://doi.org/10.1186/1471-2334-14-480}.

\bibitem{CDC_Flu} Centers for Disease Control and Prevention. ``Key facts about influenza (flu).'' \href{https://www.cdc.gov/flu/keyfacts.htm}{https://www.cdc.gov/flu/keyfacts.htm}. Accessed 19 July 2018.

\bibitem{CDC_Smallpox} Centers for Disease Control and Prevention. ``Smallpox: signs and symptoms.'' \href{https://www.cdc.gov/smallpox/symptoms/index.html}{https://www.cdc.gov/smallpox/symptoms/index.html}. Accessed 19 July 2018.

%\bibitem{CWB} Coburn, B.~J., B.~G.~Wagner, S.~Blower. 2009. ``Modeling influenza epidemics and pandemics: insights into the future of swine flu (H1N1).'' {\it BMC Medicine} vol. {\bf 7}. \url{https://doi.org/10.1186/1741-7015-7-30}.

\bibitem{ECDC_Measles} European Centre for Disease Prevention and Control. ``Factsheet about measles.'' \href{https://ecdc.europa.eu/en/measles/facts/factsheet}{https://ecdc.europa.eu/en/measles/facts/factsheet}. Accessed 19 July 2018.

\bibitem{Gani} Gani, R., S. Leach. 2002. ``Transmission potential of smallpox in contemporary populations.'' {\it Nature}, vol. {\bf 414}, pp. 748-751. \href{https://doi.org/10.1038/414748a}{https://doi.org/10.1038/414748a}. Accessed 19 July 2018.

\bibitem{Guerra} Guerra, F.~M., S. Bolotin, G. Lim, J. Heffernan, S.~L. Deeks, Y. Li, N.~S. Crowcroft. 2017. ``The basic reproduction number (R$_0$) of measles: a systematic review.'' {\it Lancet Infectious Disease} vol. {\bf 17} pp. 420-428. \href{https://doi.org/10.1016/S1473-3099(17)30307-9}{https://doi.org/10.1016/S1473-3099(17)30307-9}.



\end{thebibliography}
}





\end{document}
