% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
%
% 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.
%
% This file must be processed with version LaTeX2e or higher.
%
\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.
%
% Basically the 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 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.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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
\title{\ifnum\TeacherEdition=1 TEACHER VERSION \else STUDENT VERSION \fi\\[1ex]\uppercase{Modeling the Smoking Process\\of Southern Barbecue}}



\markboth{Modeling the Smoking Process of Southern Barbecue}{Modeling the Smoking Process of Southern Barbecue}




\author{Troy Henderson\\
University of Mobile\\
Eight Mile AL 36613 USA\\
thenderson@umobile.edu
}

\makeStitlePDFLaTex

\begin{abstract} We offer raw data collected from two thermometers used in the smoking process of Southern barbecue.  One thermometer measures the temperature inside of the smoke chamber and the other measures the internal temperature of the meat.  This data can be used to model and predict the amount of time required to smoke meats for barbecue, but it can also be used to justify the existence of and quantify the temperatures that constitute a ``stall'' when smoking large cuts of meat.
\end{abstract}


\section*{SCENARIO DESCRIPTION}
	

\subsection*{Introduction}\label{sec:introduction}

Barbecue is a staple in Southern cuisine, and there are many types of meats as well as preparation and cooking styles among barbecue aficionados.  In most Southern states, pork is the meat of choice while Texans prefer beef.  Whether pork or beef, the cuts of meat used in Southern barbecue are typically high in fat and connective tissues.  As such, these cuts require great care to prepare and thus are usually the most inexpensive of all cuts of meat.


The two primary cuts of pork used in Southern barbecue are ribs and front shoulders.  Being the smaller of the two, ribs are generally desired because of their preparation time compared to shoulders.  Pork ribs used in Southern barbecue include both spare ribs and loin back (or ``baby back'') ribs.  Spare ribs are generally larger and have more fat and connective tissue than loin back ribs which makes them desirable for most barbecue pitmasters.


Pork shoulders can be separated into two categories, namely the picnic ham and the Boston butt.  Boston butts are typically the more desirable cuts from the shoulder since they have more marbled fat (which keeps the meat moist and flavorful).  Boston butts are generally between 5-10 pounds each, and can take between 6-24 hours to cook depending on the target temperatures of both the meat and cooking device.  Boston butts are the typical cuts used to make ``pulled pork'' barbecue.


The primary cut of beef used in Southern barbecue is brisket.  The brisket is a cut from the lower chest of the cow and is extremely tough and fatty due to the fact that it supports about 60\% of the body weight of standing and moving cattle.  Untrimmed beef briskets typically weigh between 8-20 pounds (depending on the size of the cow), and they generally take the longest time to prepare and cook of the meats used in Southern barbecue.


Whether they are cooking pork ribs, Boston butts, or beef briskets, barbecue pitmasters usually have at least one common strategy -- ``low and slow''.  That is, in order to make these fatty and tough cuts of meat desirable, the fat and connective tissues must be rendered away.  This is most easily done by cooking the meat slowly at a low temperature (usually between 225$^\circ$ and 250$^\circ$ degrees Fahrenheit).  This ``low and slow'' process transforms fatty and tough cuts of meat into moist and tender culinary masterpieces.


Ribs, Boston butts, and beef briskets can all be cooked in conventional ovens and slow cookers.  However, authentic Southern barbecue requires one ingredient that these devices cannot provide -- smoke.  True Southern barbecue infuses smoke into the meat while it is being cooked, and this is most easily done using barbecue ``pits''.  The styles, sizes, and prices of barbecue pits are almost endless, but all pits have the common feature of providing smoke to the meat while it cooks.  The smoke provided by these pits comes from burning wood, and there are varieties of hardwoods used by barbecue pitmasters which include, but are not limited to, hickory, pecan, oak, mesquite, apple, cherry, and peach.  Each of these woods has a distinct flavor, and the types of wood used are typically determined by preference and availability.

\subsection*{Data Collection}\label{sec:data}

In order to mathematically model the smoking process of large cuts of meat like Boston butts and briskets, we use the ``Stoker'' by Rock's BBQ \cite{rocksbbq}.  Rock's BBQ generously donated this device to the author in 2008 for the purpose of scientific data collection, and Figure \ref{fig:stoker} illustrates the original (wired) version of the device.
			
\begin{figure}[ht]
\begin{center}
\includegraphics[width=6.0cm]{stoker.eps}


\vspace*{-4.8 true cm}
\caption{\label{fig:stoker} Rock's BBQ Stoker device with attached thermometers.}
\end{center}

\vspace*{-.5 true cm}

\end{figure}

The Stoker was designed to connect a blower to the device in order to stoke the fire when the temperature falls below a minimum value.  It has an easy to use web interface, and it is also accessible using the Telnet protocol over Transmission Control Protocol (TCP).  Using the Telnet protocol, the temperature of both the smoke chamber and the meat can be monitored (virtually) continuously with temperatures updated about every five seconds.  The author has written Perl software to access the temperature data over Telnet, record the data into a data file, and serve the raw and entire session graph of the data in real-time.


The cut of meat used in the collection process for this paper was a 10.7 pound beef brisket.  Figures~\ref{fig:untrimmedbrisket} through \ref{fig:brisketsliced} illustrates the preparation, smoking, and final slicing of the brisket.

		


\begin{figure}[!t]
\begin{center}	
\begin{minipage}[t]{2.5 in}

\begin{center}
\includegraphics[width=2.4in]{brisket1.eps}
\vspace*{-4.1 true cm}

\caption{\label{fig:untrimmedbrisket}Untrimmed Brisket.}
\end{center}
\end{minipage}
 \ \quad \
\begin{minipage}[t]{2.5 in}

\begin{center}
\includegraphics[width=2.4in]{brisket2.eps}

\vspace*{-4.1 true cm}

\caption{\label{fig:trimmedbrisket}Trimmed/Separated Brisket.}
\end{center}
\end{minipage}
\end{center}


\vspace*{-3 true cm}

\begin{center}
\begin{minipage}{2.5 in}
\begin{center} 
\includegraphics[width=2.4in]{brisket3.eps}
\vspace*{-4.1 true cm}

\caption{\label{fig:brisketshoulder} Brisket and Shoulder.}
\end{center}
\end{minipage}
  \ \quad \
\begin{minipage}{2.5 in}
\begin{center}
\includegraphics[width=2.4in]{brisket4.eps}
\vspace*{-4.1 true cm}

\caption{\label{fig:brisketsliced} Sliced Brisket.}
\end{center}
\end{minipage}
\end{center}

\vspace*{.3 true cm}
\begin{center}
\begin{minipage}{2.5 in}
\begin{center}
\includegraphics[width=2.4in]{brisket5.eps}
\vspace*{-4.1 true cm}
\caption{\label{fig:finishedbrisket} Finished Brisket.}


\end{center}
\end{minipage}
\end{center}

\end{figure}






Figure \ref{fig:untrimmedbrisket} shows the untrimmed brisket immediately out of the packaging.  A beef brisket has two components -- a leaner part called the ``flat'' and a fattier part called the ``point''.  Figure \ref{fig:trimmedbrisket} shows the brisket after it has been trimmed and separated.  Figure \ref{fig:brisketshoulder} shows both the beef brisket as well as a Boston butt after being placed in the smoker.  Figures \ref{fig:brisketsliced} and \ref{fig:finishedbrisket} illustrate the finished sliced barbecue brisket.

\subsection*{Assignment}\label{sec:assignment}

The provided data file \cite{stoker} contains three columns of tabular data.  The first column is time $t$ in hours, the second column is the smoke chamber temperature $h(t)$ in degrees Fahrenheit, and the third column is the internal meat temperature $f(t)$ in degrees Fahrenheit.  Use the provided data file to

\begin{enumerate}
\item Graph $f(t)$ and $h(t)$ versus time $t$. \label{assign:graph}
\item Identify the interval where the rate of change of $f(t)$ is small (i.e., the interval where the temperature of the meat stalls).  This partitions the time duration into three intervals $[t_0,t_1)$, $[t_1,t_2)$, and $[t_2,t_3)$ called Stage I, Stage II, and Stage III, respectively where $t_0=0$ and $t_3=11.35$. \label{assign:stages}
\item Explain why the following logistic model is a reasonable model for $f(t)$ on Stage~I and Stage~III.
\vspace*{-.1 true cm}
\[\frac{dy}{dt}=\lambda (y-k)(K-y)\]
\vspace*{-.3 true cm}
\item Verify that
\vspace*{-.1 true cm}
\[ y(t) = k + \frac{K-k}{1+D e^{-\lambda(K-k)(t-\gamma)}}\]
is the general solution to the following differential equation. \label{assign:logistic}
\[\frac{dy}{dt}=\lambda (y-k_1)(K-y)\]
\item Estimate the parameters $k_1$, $K_1$, $D_1$, $\lambda_1$, and $\gamma_1$ for which
\[ g_1(t) = k_1 + \frac{K_1-k_1}{1+D_1 e^{-\lambda_1(K_1-k_1)(t-\gamma_1)}}\]
is a reasonable model for $f(t)$ on Stage I. \label{assign:stage1}
\item Estimate the parameters $k_3$, $K_3$, $D_3$, $\lambda_3$, and $\gamma_3$ for which
\[ g_3(t) = k_3 + \frac{K_3-k_3}{1+D_3 e^{-\lambda_3(K_3-k_3)(t-\gamma_3)}}\]
is a reasonable model for $f(t)$ on Stage III. \label{assign:stage3}
\item Find a linear function $g_2(t)=m_2 t + b_2$ defined on Stage II such that
\[g(t) = \begin{cases}
g_1(t), & t_0 \leq t < t_1 \\
g_2(t), & t_1 \leq t < t_2 \\
g_3(t), & t_2 \leq t < t_3
\end{cases} \]
is continuous on $[0,11.35)$. \label{assign:continuous}
\item Graph $f(t)$ and $g(t)$ versus $t$. \label{assign:modelgraph}
\item Determine the root mean square error between $f(t)$ and $g(t)$ on $[0,11.35)$. \label{assign:rms}
\item Discuss whether or not you would expect the internal temperature of another 10.7 lb beef brisket to behave exactly like $f(t)$.
\end{enumerate}

\subsection*{Conclusion}

Smoking Southern barbecue is a time consuming process, and when executed correctly, transforms fatty and tough cuts of meat into moist and tender masterpieces.  Not only is the finished product delectable, but the cooking process can be modelled mathematically to confirm and explain the existence of a stall (or plateau).  There are several theories as to the cause of meat stalling when cooked slowly, and the stall induces a natural delineation of three stages throughout the cooking process -- namely pre-stall, stall, and post-stall.  This study has demonstrated that the pre-stall and post-stall stages can be modelled by logistic differential equations while the stall itself can be modelled linearly.


\begin{thebibliography}{99}
\bibitem{rocksbbq} Rock's BBQ.2016. Rock's BBQ in Fremont, CA. \url{http://www.rocksbarbecue.com}.
\bibitem{stoker} The data file, bbq.d, is available in the electronic version of this Modeling Scenario.
\end{thebibliography}

\teacher{
\section*{NOTES FOR TEACHERS}


\subsection*{Proposed Solution}\label{sec:solution}

The brisket used for the provided data set smoked for about 11 hours and 21 minutes, and Figure \ref{fig:temperatures} is a graph of the smoke chamber and internal meat temperatures (in degrees Fahrenheit) over this period.  \teacher{Question \ref{assign:graph} from the Assignment requires the student to graph the smoke chamber and internal meat temperatures versus time.}
\begin{figure}[ht]
\begin{center}
\includegraphics[width=\textwidth]{model_0.eps}

\vspace*{-14.8 true cm}
\caption{Smoke Chamber and Internal Meat Temperatures}\label{fig:temperatures}
\end{center}
\end{figure}

\subsubsection*{Stall}

Most all large cuts of meats enter a temperature ``stall'' (which we define below) when cooked at low temperatures.  This is evident in the temperature data illustrated in Figure \ref{fig:temperatures}.  The internal temperature of the meat increases at a much slower rate between about 6.6 and 10 hours.  The internal meat temperature increases at a rate of about 4.5$^\circ$F per hour whereas the temperature increases at a much faster rate prior to 6.6 hours and after 10 hours.  Therefore, the first step in modelling the smoking process is quantifying a temperature ``stall''.  Question \ref{assign:stages} of the Assignment requires the student to determine a reasonable range for the stall.

If we let $f(t)$ be the internal temperature of the meat at any time $t$, then, $f^\prime(t)$ is the rate of change of the meat temperature.  Furthermore, if the magnitude of $f(t)$ is large, then the corresponding magnitude of $f^\prime(t)$ may be large.  Therefore, we define the exponential growth rate of $f(t)$ to be \[ \alpha(t) = \frac{f^\prime(t)}{f(t)}.\]  Since the meat's initial temperature is about 43$^\circ$F, and since it never falls below this temperature, $f(t)$ is, in particular, never 0; therefore, $\alpha(t)$ is well-defined for all $t\geq 0$.

From visual inspection of the plot of the data in Figure \ref{fig:temperatures}, it follows that $\alpha(6.6)\approx 0.03$ and $\alpha(10)\approx 0.03$.  Furthermore, it follows that $|\alpha(t)|\leq 0.03$ for all $t\in(6.6,10)$ and $|\alpha(t)|>0.03$ for all $t\in(0,6.6)\cup(10,11.35)$.  This gives rise to the following empirical definition of a ``stall''.

\begin{center}
We say that the internal temperature of the meat has {\it stalled} whenever $|\alpha(t)|\leq 0.03$.
\end{center}

Figure \ref{fig:stages} illustrates the three intervals and refers to each of these intervals as {\it stages} in the smoking process.

\begin{figure}[ht]
\begin{center}
\includegraphics[width=\textwidth]{model_1.eps}
\vspace*{-14.8 true cm}

\caption{Stages of the Internal Meat Temperatures}\label{fig:stages}
\end{center}
\end{figure}

If we define Stage I to be the period of time before the stall, Stage II to be the stall itself, and Stage III to be the period of time after the stall, then the average rate of change of $f(t)$ in Stage I, Stage II, and Stage III is 16.2$^\circ$F, 4.5$^\circ$F, and 19.9$^\circ$F per hour, respectively.  These quantities confirm the appropriateness of the definition of the stall.

\subsubsection*{Stage I}

We now consider the problem of modelling $f(t)$ in each stage of the smoking process.  Since $f(t)$ resembles an $S$-shaped curve in Stage I, a natural model for $f(t)$ in this stage is the logistic model $g_1(t)$ defined by
\bgroup
\setlength{\arraycolsep}{0.5\arraycolsep}
\begin{eqnarray}
g_1(t) & = & k_1+\frac{K_1-k_1}{1+C_1 e^{-\lambda_3(K_1-k_1)t}} \nonumber\\[1ex]
								 & = & k_1+\frac{K_1-k_1}{1+D_1 e^{-\lambda_3(K_1-k_1)(t-\gamma_1)}} \label{eq:logistic1}
\end{eqnarray}
\egroup
where $k_1$, $K_1$, $\lambda_1$, and $C_1$ are parameters for the model and $C_1 = D_1 e^{\lambda_3(K_1-k_1)\gamma_1}$.  We use the form of $g_1(t)$ in (\ref{eq:logistic1}) for numerical stability, and we use GNU Octave's Levenberg-Marquardt nonlinear regression function {\tt leasqr} to minimize the sum of the square errors between the internal temperature $f(t)$ of the meat and the corresponding model $g_1(t)$.  Octave's {\tt leasqr} function provides the values $k_1\approx 3.3$, $K_1\approx 154.8$, $D_1\approx 0.105$, $\lambda_1\approx 0.0045$, and $\gamma_1\approx 5$.  Thus $K_1-k_1\approx 151.49$, and so $\lambda_1(K_1-k_1)\approx 0.682$; therefore,
\[g_1(t) \approx 3.3 + \frac{151.49}{1+0.105\cdot e^{-0.682(t-5)}}\]
and Question \ref{assign:stage1} of the Assignment requires the student to estimate the parameters $k_1$, $K_1$, $D_1$, $\lambda_1$, and $\gamma_1$.

Functions of the form of (\ref{eq:logistic1}) satisfy the first-order logistic ordinary differential equation
\begin{equation}
\frac{dy}{dt}=\lambda\,(y-k)(K-y) \label{eq:logisticde}
\end{equation}
where $k$ is the ``lower capacity'', $K$ is the ``upper capacity'', and $\lambda$ is the ``growth rate'' for the solution $y(t)$ of (\ref{eq:logisticde}).  Question \ref{assign:logistic} of the Assignment requires the student to show that the form of (\ref{eq:logistic1}) is the general solution to the differential equation (\ref{eq:logisticde}).  There are many theories as to why large cuts of meat stall when cooked at low temperatures, but it is generally agreed that if these meats stall, then they do so around 155 degrees Fahrenheit.  Therefore, the value of $K_1\approx 154.8$ is reasonable for an ``upper capacity'' for $f(t)$.  For this choice of parameters $k_1$, $K_1$, $D_1$, $\lambda_1$, and $\gamma_1$, the root mean square error between $f(t)$ and $g_1(t)$ in Stage I is approximately $0.9$ degrees.

\subsubsection*{Stage II}

In Stage II, the rate of change of the internal temperature of the meat appears to be fairly constant.  Therefore, we assume that during the stall, $f(t)$ can be modeled by a linear function $g_2(t)$ of the form
				\[g_2(t) = m_2\,t + b_2 \]
where $m_2$ is the constant rate of change and $b_2$ is the additional parameter needed to fit $f(t)$.  This form for $g_2(t)$ is the general solution to the most elementary differential equation
				\[\frac{dy}{dt}=m\]
where $m$ is a constant.  We may use Octave's {\tt leasqr} function (as in Stage I) to find $m_2$ and $b_2$, but instead we will fit $f(t)$ in Stage III and linearly {\it connect} the models $g_1(t)$ and $g_3(t)$ in Stages I and III, respectively. Question \ref{assign:continuous} of the Assignment requires the student to determine a linear model $g_2(t)$ for $f(t)$ in Stage II that ensures this {\it connection}.

\subsubsection*{Stage III}

In Stage III, the rate of change of $f(t)$ becomes very small as $t$ approaches 10 hours (from the right).  Also, because of Newton's Law of Warming, we expect the rate of change of $f(t)$ to become very small as $f(t)$ approaches the (ambient) temperature of the smoke chamber.  Thus, we expect $f(t)$ to resemble an $S$-shaped curve in Stage III.  Analogous to Stage I, we choose $g_3(t)$ of the form
				\[g_3(t) = k_3+\frac{K_3-k_3}{1+D_3 e^{-\lambda_3(K_3-k_3)(t-\gamma_3)}}.\]

As in Stage I, we use Octave's {\tt leasqr} to minimize the sum of the square error between the internal temperature $f(t)$ of the meat and the model $g_3(t)$.  Octave's {\tt leasqr} function provides the values $k_3\approx 161$, $K_3\approx 204$, $D_3\approx 0.187$, $\lambda_3\approx 0.0569$, and $\gamma_3\approx 11.6$.  Thus, $K_3-k_3\approx 43$, and so $\lambda_3(K_3-k_3)\approx 2.45$; therefore
\[g_3(t)\approx \ 161.1 + \frac{42.9}{1+0.18\cdot e^{-2.45(t-11.62)}}\]
and Question \ref{assign:stage3} of the Assignment requires the student to estimate the parameters $k_3$, $K_3$, $D_3$, $\lambda_3$, and $\gamma_3$.

For this choice of $k_3$, $K_3$, $\lambda_3$, $D_3$, and $\gamma_3$, the root mean square error between $f(t)$ and $g_3(t)$ in Stage III is approximately 0.23 degrees.  Figure \ref{fig:model} illustrates how closely $g_1(t)$ and $g_3(t)$ model $f(t)$ in Stages I and III, respectively; and it also illustrates how well the linear {\it connection} of $g_1(t)$ to $g_3(t)$ models $f(t)$ in Stage II.  Question \ref{assign:modelgraph} of the Assignment requires the student to graph $f(t)$ as well as $g_1(t)$, $g_2(t)$, and $g_3(t)$ on the same graph versus $t$.  The root mean square error between $f(t)$ and $g(t)$ for all $0\leq t<11.35$ is about 1.35 degrees where
\[g(t) =
\begin{cases}
g_1(t), & t_0 \leq t < t_1 \\
g_2(t), & t_1 \leq t < t_2 \\
g_3(t), & t_2 \leq t < t_3
\end{cases}
\]
and $g_2(t)$ is the line making $g(t)$ continuous on $[t_0,t_3)$.  Question \ref{assign:rms} of the Assignment requires the student to compute the root mean square error between $f(t)$ and $g(t)$.

\begin{figure}[ht]
\begin{center}
\includegraphics[width=\textwidth]{model_2.eps}
\vspace*{-14.8 true cm}

\caption{Temperature model fit in each stage}\label{fig:model}
\end{center}
\end{figure}



}

\end{document}
