% SIMIODESample.tex and simiode.cls for LaTeX2e
% Version 11 August 2013.
% 
% This class (simiode.cls) is a modification of that used by 
% the journal PRIMUS - Problems, Resources, and Issues in 
% Mathematics Undergraduate Studies. 
% 
% See http://www.tandfonline.com/loi/upri .
% 
% The class was developed by  Marc Frantz with suggestions of the 
% PRIMUS Editorial Board, especially John Thoo.
%
% 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.
%
% For information on using TeX or LaTeX, go to %                 <http://www.tug.org>.

% This file must be processed with version LaTeX2e or higher.
%
\documentclass{simiode}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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. This has been done for you in the document below.  You're welcome. 
% Rename the pdf after you compile each final version.
% added by E. Sullivan:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{epsfig}
%\usepackage{hyperref}
\usepackage{url}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is 
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will 
% look in final form, so that you can better plan your 
% presentation.  To see your manuscript formatted very 
% similarly to the on-line published format of  SIMIODE, 
% comment the following line out by inserting a percent sign % (%) at its beginning.

\renewcommand{\baselinestretch}{1.3}

\newcommand{\pwrt}[2]{$\frac{\partial #1}{\partial #2}$} % Macro for partials

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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}
\bibliographystyle{amsplain}

\newpage
% You only need to change the NAME OF SCENARIO in the next line
\title{\ifnum\TeacherEdition=1 TEACHER VERSION \else STUDENT VERSION \fi\\Simulating the Spread of the Common Cold}


\markboth{Simulating the Spread of the Common Cold}{Simulating the Spread of the Common Cold}



\author{Richard Corban Harwood\\
George Fox University\\
Newberg  OR 97132 USA\\
rharwood@georgefox.edu
}

\makeStitlePDFLaTex


\begin{abstract}
This modeling scenario guides students to simulate and investigate the spread of the common cold in a residence hall. An example floor plan is given, but the reader is encouraged to use a more relevant example. The two-week project presented here uses a hands-on activity followed by solution of a first order differential equation by the separable method (method of separation of variables) \cite{Winkel_Separable} and further graphical analysis using a spreadsheet. In groups, students run repeated simulations, collect data, derive a differential equation model, solve that equation, estimate parameter values by hand and through regression, visually evaluate the consistency of the model with their data, and present their results to the class. The simulation portion can be done in a 50 minute class period and has been successfully implemented on the first day of class. Required supplies include small beans or candy pieces to shake onto the printed floor plan.
\end{abstract}



\section*{SCENARIO DESCRIPTION} %%%%%%%%%%%%%%%%%%%%%%%%%



\subsubsection*{Set-Up Instructions}
A certain number ($x_0$) of residents on a floor of a residence hall (with a total of $N$ residents) have the common cold and have left traces of the virus at various places. In this simulation, beans scattered onto a printed floor plan represent residents susceptible to the cold milling around this floor. Those that come in contact with the virus become infected and leave more traces of the virus. How does the number of residents infected vary with time?
\begin{enumerate} 
\item Get into groups of four and pick up two printed floor plans (see example in Figure \ref{fig:floorplan}), four paper clips, and $N=30$ beans {\em (optional: also pick up two plastic cups, two overhead slide pieces, and two dry erase markers)}. Choose two group members to be ``Recorders" and two to be ``Simulators," one for each printed floor plan.
\item For each floor plan, the Simulator should fold it in a way that lays the rooms flat with raised paper sidewalls. For the example in Figure \ref{fig:floorplan}, fold along the dotted lines in an alternating fashion (in-out-in) to create a `$w$' shape. Then pinch the two floors together and fold in between them to make the second and third floors lay down horizontally. The Recorder should then use two paper clips to fasten the middle ridge at both ends.
\item Each Recorder sets up five tables, each with four rows, to record the results of five simulations. Label the four rows {\em Time} (round number, starting with zero), {\em Susceptible} (number dumped), {\em Infected} (number removed from the board and set aside), and {\em Change in Infected} (number infected in this round and used to get the number {\em Infected} in the next round).
\end{enumerate}

\subsubsection*{In-Class Simulation} \label{sec:simulation}
%Repeat these steps until there are zero susceptibles, each with different starting infected counts ranging between 1 and 20 and distributed randomly as before. 
Each Simulator-Recorder pair will do the following to run and record data from five simulations.
\begin{enumerate}
\item The Recorder chooses a starting infected count, $x_0$, randomly chosen between $1$ and $N-1$ and fills in the table for this simulation with $0$ (Time), $N-x_0$ (Susceptible), $x_0$ (Infected). {\em To aid model development, start the first simulation with $x_0=1$.}
\item The Simulator sets $x_0$ beans to the side as infected and marks with an `$X$'  that many rooms on the second floor chosen at random locations (excluding bathrooms/hallways/stairwells).
\item The Recorder walls off the two ends of the second floor with their hands, while the Simulator shakes and dumps the susceptible beans from their hand/cup onto the center of the floor. If any land outside of the floor, shake and dump them again.
\item The Simulator leaves in place any beans that are more than halfway inside an infected room, and returns all others back to your hand/cup.  For each bean left, find the closest uninfected room to infect and mark it with an `$X$'. Afterwards, add these beans to the infected pile. 
%Optional: Infect the bathroom only when rooms on both sides are infected and infect hallway when all rooms on at least one side are infected. Otherwise, treat these as ordinary rooms.
\item The Recorder counts those the Simulator left behind, tallies this number ($\Delta x$) under {\em Change in Infected}, and then updates the table for the next round by subtracting $\Delta x$ from the number susceptible and adding $\Delta x$ to the number infected.
%\item Update your table for this round with number of infected and added infected. Number of susceptibles is $N$ minus the number infected.
\item Repeat steps 3-5 until there are no more susceptible beans left. When complete, erase all marks from the floorplan (or overhead slide strip).
\end{enumerate}


\subsection*{Model Development}%%%%%%%%%%%%%%%%%%%
As a group, complete the following. This is most easily done on a single computer when the group is together. Otherwise, work on a shareable spreadsheet (such as Google Sheets).
\begin{enumerate}
\item Type all ten simulation tables into a spreadsheet, each table expanded as show below. The {\em Change in Infected} is a rough estimate for the derivative (rate of change in the infected population), and can be improved by taking the average of the current and previous values to compute the {\em Infected Derivative}. Note, this means the leftmost value (at $t=0$) is $\frac{0+\Delta x}{2}$. Once the group model is chosen, its solution is computed in the {\em Model: Infected} row and square errors are computed below it and summed up.
% then the error between the data and modeled infected populations is squared for each time in the {\em Square Errors} row and added up to compute the sum of square errors (SSE).

\begin{tabular}{r|l}
Simulation \# & Parameter values\\ \hline
Time (rounds)& 0\hspace{1in}1\hspace{1in}2\hspace{1in} ...\\ \hline
Data: Susceptible&$N-x_0$\\
Infected&$x_0$\\
Change in Infected&$\Delta x$\\
Infected Derivative&$\frac{0+\Delta x}{2}$\\ \hline
Model: Infected&\\
Square Errors &
\end{tabular}

\item Choosing a simulation with the lowest starting value $x_0$, create a scatter plot with independent variable {\em Time} and dependent variables {\em Susceptible, Infected, Infected Derivative}. 
\item From this scatter plot, individually come up with a possible differential equation model to match the shape of the slope $\frac{dx}{dt}$ (Infected Derivative) using $x$ (Infected), $N-x$ (Susceptible), and $t$ (Time). The instructor may have some suggestions to choose from or leave it open-ended.
\item Get together as a group and compare models. Graph/sketch the slope functions from each and work together to choose/create the model with the most potential. Make sure there is at least one parameter to provide room to fit it to the data. 
\item Summarize why your group's model fits the shape of the data and how the parameters adjust it. Briefly share this with the class and record any feedback. Update your model accordingly.
\end{enumerate}

\subsection*{Analysis}%%%%%%%%%%%%%%%%%%%
%Analysis of your chosen model requires an initial guess to evaluate the model's solution and then an estimation technique to optimize the parameter value(s) and quantitatively evaluate your model. The following options each estimate the optimal values for the parameter(s) in different ways. Choose option A (bisection-like method), B (regular interval comparison), or C (least squares regression of the model). Note: options A and B are similar ways of directly optimizing the model's solution, while option C is a more advanced method for optimizing the model differential equation, which relies on the accuracy of the derivative approximation in {\bf Model Development}.
%For each simulation, estimate the the growth of the infected by the number of added infected at the end of each round. Make a combined graph of Round vs. Growth of Infected for all simulations.
%Each person in the group should come up with a possible differential equation model to match the shape of the added infected data. Try graphing the options and discuss together to derive a good differential equation model with built-in parameter(s) for fitting to data. Summarize why your model fits. 
Your analysis begins with fitting your model equation using a trend line and then a hands-on optimization with the main parameter(s) using either a local search or global search method. 
%Spreadsheets can easily do least squares regression in the following forms: linear $Y=mX+b$, polynomial $Y=a_n X^n+...+a_1 X+a_0$, logarithmic $\ln{Y}=mX+b$, and a few others. For each, $X$ is the component you need to compute from the data. For example, $x'=a\sin{b x}$ is in linear form with $X=\sin{bx}$ where $b$ can be estimated from the period of the oscillation in the data, whereas $x'=a(t-b)(t-c)$ can be rewritten in the polynomial form $x'=at^2-a(b+c)t+abc$ with $X=t$ and each parameter can be estimated through the regression constants $a=a_2, -a(b+c)=a_1, abc=a_0$. This regression optimizes the model differential equation instead of the solution, so there will be room to improve upon it.
\begin{enumerate}
\item[] {\bf Parameter Estimation}
%\item At the bottom of your spreadsheet, create a new aggregate table with rows of {\em Time, Infected, Change in infected,} and {\em Infected Derivative}. Copy and paste values for these rows from each simulation table.
\item Determine the model component X to needed to write your model differential equation as $Y=a_1X+a_0$ (linear) or $Y=a_n X^n+...+a_1 X+a_0$ (polynomial). {\em For example, $x'=a\sin{b x}$ is linear with $X=\sin{bx}$ where $b$ can be estimated from the period of the oscillation in the data}.
\item Choosing an example simulation with the lowest starting value $x_0$, insert a row labeled {\em Model component: X} below the {\em Infected} row and compute the model component, $X$. %, based upon the preceding data rows.
\item Create a scatter plot with independent variable {\em Model component: X} and dependent variable {\em Infected Derivative}. Add a trendline and edit it to use the correct form and display the equation and R-squared value on the chart. Also, set the intercept if you have no constant to solve for. This is your initial estimate for the parameter(s). Note, the R-squared value gives the percentage of the spread in the data explained by a linear relationship and is one way of measuring model fit.
\item Solve your model for the general solution.
\item For each simulation, enter the general solution into the spreadsheet row {\em Model: Infected} using your initial estimate for the parameter(s) from this example simulation. Make a scatter plot with independent variable {\em Time} and dependent variables {\em Infected, Model: Infected}
\item Complete either {\bf Local Optimization} or {\bf Global Optimization } section to optimize model parameter estimates for each simulation. Note how the graphs of the model and data are brought closer together with each improved estimate.
\item Summarize the values for the fitted parameter(s) for all ten simulations by the overall mean, and interval [min, max] for each parameter that was estimated this way. If another method was used, such as estimating the period of oscillation make a note of this.
%\item You may choose to complete the {\bf Challenge: Additional Analysis}, which optimizes the model differential equation instead of the solution. It's solution by least squares regression relies on the accuracy of the derivative approximation in  {\bf Model Development}.
\end{enumerate}
%
\begin{enumerate}
\item[] {\bf Local Optimization}%\\ This local search method is an adaptation of the bisection method \cite{Burden}. At every step,  you compare the sum of square errors (SSE) on the left and right and subdivide your search interval following the lesser error to find the parameter value which minimizes the SSE.
\item For each simulation, compute $(\text{Infected} - \text{Model:Infected})^2$ in the spreadsheet row {\em Square Errors} and sum up the row to compute the sum of square errors: $SSE = \sum (Data - Model)^2$.
%\item Estimate each model parameter with initial estimate $p$ using the following method.
\item Choose the initial interval radius, $\Delta p$, for midpoint $M=p$ and compute the end points $L=p-\Delta p$ and $R=p+\Delta p$. As a rule of thumb, start with $\Delta p = 10^k$ where $k$ the power of ten when $p$ is written in scientific notation. 
%Upon repetition, divide $\Delta p$ by $2$.
\item Compute the SSE at end points $L$ and $R$. \\If $SSE(L)<SSE(R)$, then reset $R=M$ and $M=\frac{L+M}{2}$ to choose the left sub-interval. \\Else, reset $L=M$ and $M=\frac{M+R}{2}$ to choose the right sub-interval.
%\item Select the subinterval with the lowest SSE value on the outer edge and set $p$ equal to the new midpoint. This midpoint is your new parameter estimate, $p$.
%Compare the SSE of the two end values with the SSE for the midpoint. Find the average of $p$ and whichever side had a lower SSE. 
\item Repeat steps 2-3 until you have obtained an $M$ value with three significant digits unchanged from the previous $M$ value. Set $p=M$.
\end{enumerate}
%
\begin{enumerate}
\item[] {\bf Global Optimization}%\\ This is a global search method which evaluates the SSE at a regularly spaced set of values for a given parameter. This set is then centered at the lowest SSE value and compressed for better precision.
\item For each simulation table, copy the pair of rows, {\em Model: Infected} and {\em Square Errors}, and paste this pair ten times below it. 
\item For a chosen parameter with initial estimate $p$, choose an initial radius $\Delta p=\frac12p$ of your search interval. If there are any other parameters, use their initial estimate value. 
\item Divide the interval [$p-\Delta p, p+\Delta p$] into ten sub-intervals and assign each of the eleven points to a different model pair.
\item For each model pair,  compute $(\text{Infected} - \text{Model:Infected})^2$ in the spreadsheet row {\em Square Errors} and sum up the row to compute the sum of square errors: $SSE = \sum (Data - Model)^2$. Choose the parameter value $p^*$ with minimum SSE. \\If $p^*$ is the same as $p$, reset $\Delta p =\frac1{10}\Delta p$ to zoom-in, and repeat steps 3-4 (unless this makes $\Delta p < 1E-14$, in which case go to step 6).
\item If at least three significant digits of $p^*$ agree with $p$, then update $p=p^*$ for the final estimate.\\ %$\frac{\Delta p}{p}$, rounded to the nearest power of ten, $10^{-k}$, has $k\geq3$ then $p^*$ has at least three significant figures of agreement with $p$. 
Otherwise, repeat steps 3-4 with $\Delta p = |p-p^*|$ and $p=p^*$.
\item Repeat this process for each additional parameter.
\end{enumerate}

\subsection*{In-Class Presentation}
\begin{enumerate}
\item Explain the main steps in deriving your model differential equation
\item Explain the main steps needed in solving your model differential equation
\item From the ten simulations, show example graphs of your best and worst fitting models to the data.
\item Explain in what ways your model described the data well and in what ways did it not.
\item How could your model be improved? How could the simulation of the spread of a cold be improved?
\end{enumerate}

\begin{figure}[h!]
 \centerline{\includegraphics[width=4.0in]{1-37-BrandtHallFloorplan.png}}\caption{Example floor plan handout}
\label{fig:floorplan}
\end{figure}

\teacher{
\section*{NOTES FOR TEACHERS}
This project was inspired by an example in \cite{Winkel_DiseaseSpread} which investigates the spread of an infection on an evenly-spaced, two-dimensional grid. If the reader would like to better control variability in infected rooms, such a grid might be preferable. The relevancy of choosing a residence hall (which housed a few of my students), however, provided substantial motivation for this project in my own classes. The following comments go over helpful guidelines for implementation, suggested ways to customize this project, suggested means of assessment, and a transcription of one group's wiki report. An example Excel spreadsheet ``1-37-Simulating Common Cold," is available in the Supplemental Docs section of the Modeling Scenario to demonstrate sample instructions for a class-shared document and one group's data analysis.

\subsection*{Implementation}
The only differential equations knowledge needed for this project is the separable method \cite{Winkel_Separable}, but familiarity with the slope field and differential equations with parameters is helpful. I suggest the following two-week (three days a week) schedule for implementing this project and guiding its completion. 
%Suggested topics are given to align with the project. 

\begin{description}
\item{Day 1} {\bf In-Class Simulation} (Topic: Intro to differential equations)
\item{Day 2} Fill group spreadsheet (Topic: Separable method)
\item{Day 3} Finish {\bf Model Development} (Topic: Slope field)
\item{Day 4} Finish parameter estimation (Topic: Phase line analysis)
\item{Day 5} Finish {\bf Analysis} (Topic: Integrating factor method)
\item{Day 6} {\bf In-Class Presentation} (Topic: Project discussion)
\end{description}

I use this project as a discovery technique to introduce the first two weeks of differential equations. As you can see in the suggested topics above, the {\bf In-Class Simulation} motivates the need for the separable method and develops visual analysis for dealing with slope fields and phase lines. Looking at the graph of the Infected populations across all simulations, students can estimate qualitative features of the governing equation such as the existence (and stability) of equilibrium points and the constancy of slopes at fixed population values to determine if the equation is autonomous. Completion of this project is a great jump-off point for numerical methods and more advanced methods and models.

Before the {\bf In-Class Simulation} activity, it is helpful to have a class discussion about what the simulation represents (spread of a cold throughout a residence hall) and what students think should happen. After groups have gathered their supplies, it is helpful to demonstrate how to fold the paper, decide which of the dropped beans become infected, and how to mark the spread of the infection. This demonstration can be projected with a document camera or onto a printed overhead slide.

A shareable spreadsheet like through Google Sheets is a helpful way for students to collaborate on their own schedule and present together in class. To reduce grading, I suggest a single sheet shared with the whole class with independent tabs for each group. Having access to each other's work is a risk, but this is an opportunity for students to practice respectful sharing of resources. A wiki can also be used to consolidate group work for class presentations. A private wiki, accessed through a university course management system like Moodle (\url{http://www.moodle.com}) or separately like PBWorks (\url{http://www.pbworks.co
m}), is a web environment, similar to Wikipedia, where students can create and link together multiple web pages in a more controlled environment. 

The {\bf Analysis} portion begins with a graphical fitting of the group's model and then a hands-on optimization of the main parameter(s) using either a local or global optimization method. It may be helpful to demonstrate examples of writing a model in a form that spreadsheets can do least squares regression: linear $Y=mX+b$, polynomial $Y=a_n X^n+...+a_1 X+a_0$, logarithmic $\ln{Y}=mX+b$, and a few others. See the example in the student instructions along with the following. Model $x'=a(t-b)(t-c)$ can be rewritten in the polynomial form $x'=at^2-a(b+c)t+abc$ with $X=t$ and each parameter can be estimated through the regression constants $a=a_2, -a(b+c)=a_1, abc=a_0$. Note, this kind of regression optimizes the parameter(s) for the model differential equation instead of the solution of that equation, so there will be room to improve upon the estimate(s).

{\bf Local Optimization} is a basic adaptation of the bisection method for finding roots \cite{Burden} to finding a minimum. At every step,  students compare the sum of square errors (SSE) on the left and right and subdivide their search interval sequentially to better estimate the parameter value which minimizes the SSE. {\bf Global Optimization} is a basic global search method which evaluates the SSE at a regularly-spaced set of values for a given parameter. This set is then centered at the lowest SSE value and compressed for better precision.

After the presentations, I suggest a class discussion of the various models derived and the range of values used for parameter(s) to help wrap up the project. One of the main things I bring up is the difference between our simple simulation for the spread of the common cold and a more realistic SIR model for the spread of the disease. Note that the logistic model (model four below) can be written as $I'=aIS$ since $S+I=N$. This model assumes no recovered population ($R=0$), which can be justified as the recovery time of the common cold is longer than the time it takes for the infection to spread throughout this high-density residence hall. For a week-long cold and a simulation which ends in about seven rounds, this seems realistic. It is helpful to point out that a true SIR model would be a system of differential equations instead of just one and such systems are analyzed later on in the course.

\subsubsection*{Supplies} 
The following supplies are listed for groups of four.
\begin{itemize}
\item Residence hall floor plan. Draw fold lines along outside walls to create a `$u$' or `$w$' shape (see example lines in Figure \ref{fig:floorplan}): print two per group. 
\item Bags of small beans (or candy pieces): N pieces per group, where $N$ is the total number of rooms on the chosen floor, excluding bathrooms, stairwells, hallways, and elevators. The second floor in Figure \ref{fig:floorplan} with $N=30$ rooms is specified in the directions ($N=31$ for the third floor).
\item Paper clips: four per group.
{\em
\item[] Optional Supplies\\
The optional supplies may make it easier for the students to complete the simulation, however, the prep time to set it up is not worth it for first time this is implemented. Instead of the cups, students can use their hands to shake and dump the beans, and they can use pencils with erasers instead of using dry erase markers on strips of overhead slides (that the reader would have to pre-cut to fit the floor plan).
\item Plastic cups: two per group
\item Overhead slides cut into strips the width of the hall in floor plan: two strips per group 
\item Dry erase markers: two per group
\item Dry erasers (shared): about one for every three groups
}
\end{itemize}

\subsection*{Customizations}
The following suggests are offered to tailor the project as the reader sees fit.
\subsubsection*{One-Day Abridged Version}
This project can be abridged to fit one 50-minute class period by doing the following. For this version, I suggest that students be familiar with the separable method beforehand and bring 1-2 laptops per group (or meet in a computer lab).
\begin{enumerate}
\item Have students only do one simulation per pair.
\item Have groups record the data directly into a shared spreadsheet projected for the class to see.
\item Graph the data in front of the class. Lead a class discussion in choosing slope functions which agree with the shape of the derivative data. Choose a model together. I suggest leading them towards the logistics model (model four below).
\item Graph the derivative data against the model component and add a trendline to estimate the parameter.
\item Solve the differential equation model, plug its solution into the spreadsheet using this estimate, and graph the data vs the modeled infected population.
\item Compute the SSE for this parameter and demonstrate the {\bf Local Optimization} to decrease the SSE in finding a better parameter estimate. Point out how the two graphs (Data, Model) converge through this optimization process. 
\end{enumerate}

\subsubsection*{Floor Plan Adaptations}
An example floor plan is given in Figure \ref{fig:floorplan}, but you are welcome to choose one from your own campus. I suggest one which is fairly straight to simplify folding. 

%Optional plastic cups can be replaced by making two piles and shaking with your hands, whereas optional strips cut from overhead slides and dry erase markers can be replaced by marking with pencil and erasing and/or using multiple printouts per group.

One curiosity of infecting only the dorm rooms of the residence hall is the creation of a ``safe-zone'' in the hallways, stairwells, and bathrooms. This is somewhat counter-intuitive as those locations have the most traffic and would likely be the locations where a virus is picked up. One simple modification of the simulation is to consider these common areas as infected from the start (but not counting for the susceptible or infected totals). Any bean landing in them would infect the nearest susceptible room. This would speed up the infection rate. Another possible modification would be to add them to the number $N$ of susceptible rooms and infect them when the rooms on both sides are infected. This modification is less clear for when to infect the hallways, but it can be defined as when rooms across from each other are infected.

\subsubsection*{Guided Modeling}
I tend to guide groups through the final selection of their model using their data comparison graph by pointing out patterns in the data and shapes of their models. A less open-ended approach would be to offer them the following potential models (based upon initial ideas from students). Each of these slope functions can be argued to share a shape with the infected derivative from the change in infected data, but the first two do not match the dependence. Model four is the traditional logistic growth model usually attributed to capacity-limited population growth. The models are all separable, the first three are also linear, and they are ordered with increasing difficulty of their solution. Note, the solution to the fourth model requires partial fraction decomposition, while the fifth is tricky to get into an explicit form. %using the quadratic formula and inverse trig. 
\begin{enumerate}
\item $\frac{dx}{dt}=a\sin(bt)$
\item $\frac{dx}{dt}=a(t-b)(t-c)$
\item $\frac{dx}{dt}=a(N-x)$
\item $\frac{dx}{dt}=ax(N-x)$
\item $\frac{dx}{dt}=a\sin(bx)$
%\item $\frac{dx}{dt}=ae^{(t-b)^2}$
\end{enumerate} 

\subsubsection*{Guided Analysis}
For the initial parameter estimation in the first and fifth models, the angular frequency $b$ should be estimated using the period of oscillation measured from the Infected Derivative. This can be done either as Period = 4 (interval from zero to maximum) or Period = 2 (Interval from zero to zero). All other parameters can be estimated using the linear regression through the trend line on the graph. See the example spreadsheet for a demonstration of this regression on both a single simulation and the aggregate of all simulations together using the fourth model equation (the most popular).

The reader is welcome to encourage students to either all use {\bf Local Optimization} or all use {\bf Global Optimization} for consistency in grading and to reduce the demonstration of each. See the example Excel spreadsheet (1-37-T-Excel-CommonColdSpread-TeacherVersion found in the Supplemental Docs to thie Modeling Scenario) for a demonstration of {\bf Local Optimization} (Option A) on ten simulations and a demonstration of {\bf Global Optimization} (Option B) on one. The analysis completed through either of these options is tedious, but it gives students a hands-on perspective of (crude) optimization techniques. Such quantitative data analysis is helpful in making the model more implementable. Winkel, among others, argues in \cite{Winkel_ParameterEstimation} for having more data analysis in differential equations, especially parameter estimation. For other ways to estimate parameters in spreadsheets, I suggest \cite{Miller_Epidemic} where Miller includes another sample Excel spreadsheet. For more rigorous optimization, students with sufficient programming experience can implement a traditional optimization method such as Newton's method on the derivative of the error function $SSE(p)=\sum (Y_i - Y(t_i; p))^2$ \cite{Burden}.
%The {\bf Challenge} portion of the {\bf Analysis} section of the project is optional (I offer extra credit) and may require additional guidance and demonstration to run the least squares regressions. 

\subsubsection*{Assessment}
When I assign this project, I share with my students a scoring guide or rubric. The following scoring guide for grading the group projects is suggested and the reader is welcome to customize it accordingly.

\begin{itemize}
\item[] Scoring Guide: 20 points
\item[(5)] Collection/Analysis of Data: Organized spreadsheet. Labeled graphs. Data analysis results highlighted.
\item[(5)] Analysis/Solution of Model: Thoughtful analysis and model development. Correct solution.
\item[(5)] Wiki setup and contribution: Individual contribution evident. Good layout and page linkages. 
\item[(5)] Presentation contribution: Presentation is organized, engaging, and time conscious. Individual contribution evident. 
\end{itemize}


%Note, the maximum infected/susceptible of $N=30$ is arbitrarily set and does not fit the number of rooms. I explain this difference as having a certain number of students who will not get infected. For an altered scenario, feel free to cordon off this number of rooms beforehand, or instead increase the maximum infected to fit all the rooms in the hallway. 

\subsection*{Example Student Solution}
% This data was taken from the wiki presentation by group TGKB in section B during the Spring 2016. The original spreadsheet is not recoverable.
\begin{figure}[t!]
 %\centerline{}
 \begin{center}
 \parbox{9.5 true cm}{
 \includegraphics[width=4.0in]{1-37-DataComparison_ModelDevelopment_BCBJF16.png}
 \caption{Graphical comparison of simulation data for susceptible population, infected population, and change in infected population used for model development.}
 \label{fig:data_comparison}
 }
 \end{center}

\end{figure}

\begin{figure}[t!]
% \centerline{}
  \begin{center}
 \parbox{7 true cm}{
 \includegraphics[width=4.0in]{1-37-InfectDataTCKG2.png}
 \caption{Data from ten simulation runs, each at a different initial number of infected.}
 \label{fig:data_infected}
 }
 \end{center}
 
\end{figure}

%\subsubsection*{Model Derivation}
We started the model derivation by brainstorming potential models in class and comparing the graphs, shown in Figure \ref{fig:data_comparison}, of the data for susceptible population ($s=30-x$), infected population ($x$), and change in infected population (which estimated the derivative $\frac{dx}{dt}$). We ultimately chose the equation 
$$\frac{dx}{dt} = ax(30-x)
$$ 
because it made the most sense intuitively in that, the slope (change in infected) starts shallow when there is a small number of infected, and ends shallow when there is a small number of susceptible. The slope is steepest in the middle when there is a large number of both infected and susceptible students. 



To solve this differential equation, we separated the $x$ from the $t$. On the left side we had a denominator with $x(30-x)$, so we had to use partial fractions to make the left side integrable. Eventually we came to a logarithmic growth equation for x, but with an arbitrary constant, C. To resolve the constant, we had to solve for an initial condition, $x(0)=x_0$, to get the general solution
$$ x(t) = \frac{30}{1+\left(\frac{30-x_0}{x_0}\right)e^{-30at}}.
$$

\begin{figure}[b!]
 \begin{center}
 \parbox{9.5 true cm}{
 \includegraphics[width=4.0in]{1-37-ModeledInfectedTCKG.png}
 \caption{Demonstration of best model fit for infected population in first simulation with SSE $=6.56$ (sum of square errors).}
  \label{fig:modeled}}
 \end{center}
\end{figure}


\begin{figure}[b!]
 \begin{center}
 \parbox{9.5 true cm}{
 \includegraphics[width=4.0in]{1-37-ModeledInfectedTCKG2.png}
 \caption{Demonstration of worst model fit for infected population in tenth simulation with SSE $=16.04$ (sum of square errors).}
 \label{fig:modeled2}
 }
 \end{center}
\end{figure}


%\subsubsection*{Summary} 
Our average (growth rate) parameter value was $a=0.0276816$ over the interval of values [0.01695, 0.04025]. We ended up with a poor $R^2=0.46$ value from the model regression (only accounting for 46\% of the spread of the data), but the least-squares parameter value of $a=0.023$ is within the range of optimized values found for all simulations. %Updated
%$a=0.0226$ in the range $[0.0190,0.0300]$. %TCKG %0.0233 with range $[0.019-0.027]$. %CCMJ


The best-fit graph in Figure \ref{fig:modeled} with error $6.56$ and worst-fit graph in Figure \ref{fig:modeled2} with error $16.04$ show that our model can fit the experiment very well. Additionally, most of the plotted data in Figure \ref{fig:data_infected} had the same shape, showing a consistent slope field. We only had one noticeable outlier where the graph of the data from one simulation crossed the graph  of another simulation, since no two solutions to the same differential equation (same model) should cross. In general our model worked well and matched most of our data. The majority of our discrepancies came from human error, especially because the folded paper ``Brandt Hall" in Figure \ref{fig:floorplan} got bent part-way through, making the walls farther away and allowing the bean residents to magically jump out of the windows to escape the infection. We infected rooms before the common areas and tended to focus on the middle section of the floor when dumping our beans so the infection spread from there. 

This makes our model a good approximation for predicting future outbreaks. This model could be used to predict the rate at which the entire group will become infected based on the initial number of infected. This model could be improved by executing more trials to find a better average for the growth rate as well as a more consistent testing mechanism. Also, the model could have perhaps been based on the area contaminated rather than number of people infected. Further improvement would require live test subjects such as mice to better model the rate of spread of the disease.

\begin{thebibliography}{98}
\bibitem{Burden}  Burden, Richard L.~and J. Douglas Faires.  {\em Numerical Analysis}. Boston MA:  Brooks/Cole.
\bibitem{Miller_Epidemic} Miller, Sheila. 2015.   6-1-T-Epidemic. At QUBES SIMIODE Site.
%\bibitem{Winkel2009} % Winkel, Brian(2009)'Population modelling with M\&M's',International Journal of Mathematical Education in Science and Technology,40:4,554 — 558
%Brian Winkel (2015), "Population Modelling with M and M's," https://simiode.org/resources/828.
\bibitem{Winkel_DiseaseSpread} Winkel, Brian. 2015. 1-17-T-DiseaseSpread. At QUBES SIMIODE Site.
\bibitem{Winkel_Separable} Winkel, Brian. 2015. 1-1-S-Text-SeparationOfVariables. At QUBES SIMIODE Site.
\bibitem{Winkel_ParameterEstimation} Winkel, Brian. 2010.  Parameter estimates in differential equation models for chemical kinetics. {\em International Journal of Mathematical Education in Science and Technology}. 42(1): 37--51. DOI: 10.1080/0020739X.2010.500806.
\end{thebibliography}
} 



\end{document}
