% 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{color}
\usepackage{graphicx}
%\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\\Thermometer in Varying Temperature Stream}





\markboth{Thermometer in Varying Temperature Stream}{Thermometer in Varying Temperature Stream}

\author{Norman Loney\\
University of Cincinnati\\
Cincinnati OH  45221 USA\\
normanwloney@gmail.com
}

\makeStitlePDFLaTex


\begin{abstract}
We present a first order differential equation model for the temperature of a mercury thermometer which is sitting in a  stream of water whose temperature oscillates. We suggest a solving strategy which uses Laplace Transforms.
\end{abstract}


\section*{SCENARIO DESCRIPTION}

\subsection*{An Application of Laplace Transform}



Consider a thermometer which is located in a flowing stream of water for 
which the temperature $x$ varies with time. We would like to 
calculate the response or the time variation of the thermometer reading, 
$y$, for a given change in $x$,  the temperature of the fluid in the stream in which the thermometer sits under the following assumptions:

\begin{enumerate}
\item All the resistance to heat transfer resides in the film 
surrounding the bulb (we are neglecting the resistance of the glass and 
mercury).
\item All the thermal capacity is in the mercury. Furthermore, at any 
instant the mercury assumes a uniform temperature throughout.
\item The glass wall containing the mercury does not expand or contract 
during the transient response.
\item The thermometer is initially at steady state. Therefore, before 
time zero, there is no change in temperature with time. 
\item At time $t=0$  the 
thermometer will be subjected to some change in the surrounding 
temperature, $x(t)$.
\end{enumerate}

Now if we apply  the unsteady-state energy balance:

\begin{equation}
{\rm Rate\,\, of\,\, Input\,\,\, - \,\,\,Rate \,\,of \,\,Output \,\,\,=\,\,\, Rate\,\, of\,\, Generation}
\end{equation}


\noindent we obtain

\begin{equation}\label{eq:balance}
h A (x - y) - 0 = m C \frac{dy}{dt}\, . 
\end{equation}

\noindent where


$A$ is  surface area of the bulb for heat transfer, ft$^{2}$,

$C$ is the  heat capacity of mercury, BTU/(lb$_{m}$)$^{o}$F,

$m$ is the  weight  of mercury in bulb, lb$_{m}$, 

$t$ is time, in hr, and 

$h$ is the  film coefficient of heat transfer, BTU/(hr)(ft$^{2}$
)($^{0}$F).





\vspace*{.1 true cm}\noindent We note the following:

 
\begin{enumerate}
\item The coefficient $h$  will depend on the flow rate and 
properties of the surrounding fluid and the dimensions of the bulb. 
Also, $h$ is constant for a particular installation of the 
thermometer.
\item Prior to the change in  $x$, the thermometer is at 
steady state and the derivative, $dy/dt$, is zero. Therefore the 
steady state conditions, $x_s$ and $y_s$,  render (\ref{eq:balance}) to be:

\begin{equation}\label{eq:bal}
h A (x_s - y_s) = 0, \, \,\, {\rm for} \,\, y<0\, .
\end{equation}
\end{enumerate}



Upon subtracting (\ref{eq:bal}) from (\ref{eq:balance}) we get

\begin{equation}\label{eq:next}
h A[ (x - x_s) - (y- y_s)] = m C \frac{d(x-y_s)}{dt} \,  ,
\end{equation}  
 
\noindent or


\begin{equation}\label{eq:nextmore}
h A (X - Y) = m C \frac{dY}{dt} \,  ,
\end{equation}
 

\noindent using this change of variables,  $ X_s = x - x_{s }$ and $Y_s = y - y_{s}$, for  deviation 
variables $X_s$ and $Y_s$.

We can rewrite (\ref{eq:nextmore}) as

\begin{equation}\label{eq:nextB}
(X_s - Y_s) = \frac{m C}{hA}  \frac{dY_s}{dt} = \tau  \frac{dY_s}{dt} \,  ,
\end{equation}
 

\noindent using $\tau = \frac{mC}{hA}$, the time constant.





If we take the Laplace Transform of both sides of (\ref{eq:nextB}) and rearrange the results we can determine, in terms of the transfer functions, $X(s)$ for $X_s(t)$ and $Y(s)$ for $Y_s(t)$, the equation

\begin{equation}\label{eq:Trans}
\frac{Y(s)}{X(s)} = \frac{1}{\tau s + 1}\, 
\end{equation}
\noindent or
\begin{equation}\label{eq:Trans1}
Y(s)= X(s)\frac{1}{\tau s + 1}\, 
\end{equation}

\noindent which facilitates a response through the Inverse Laplace Transform of the deviation variable transforms $Y(s)$ to an input $X(s)$. Here $\frac{1}{\tau s + 1}$ is called the {\it transfer function} which takes an input described by $X(s)$ and converts it into an output described by $Y(s)$.









\section*{ACTIVITY}

 A mercury thermometer having a time constant of 
$\tau = 0.1$ min, is placed in a temperature bath at 100$^{o}$F and allowed 
to come to equilibrium with the bath. At time $t = 0$, the temperature of 
the bath begins to vary sinusoidally about its average temperature of 
100$^{o}$F with an amplitude of 2$^{o}$F. If the frequency of 
oscillation is 10/$\pi$ cycles/min, plot the ultimate response of the 
thermometer reading's temperature as a function of time. What is the phase lag?


\subsubsection*{Data}



We are given the data:  $\tau = 0.1$, $x_s = 100^{o}$F, $f \,\, {\rm (frequency)} = (10/\pi)\,\, {\rm cycles\,\, min}$, $\omega = 2 \pi f = 20 \,\,{\rm radians/min}$, $A = 2^{o}$F, with input: $x(t) = x_s + A \sin (\omega t)$. 

We can solve \label{eq:Trans} for $Y(s)$ as in (\ref{eq:Trans1}) and then take the Inverse Laplace Transform to obtain $y(t)$.


   

\begin{enumerate}
\item  Show that 
\begin{equation}\label{eq:tr}
Y(s) = \frac{A \omega}{s^2 + \omega^2}\cdot  \frac{1/\tau}{s+ 1/\tau}\, . 
\end{equation}
\item Take the Inverse Laplace Transforms of  all the parts of (\ref{eq:tr}) to obtain $y(t)$. Show your steps. You should have 
\begin{equation}\label{eq:inv}
y(t) = \overbrace{\frac{A \tau  \omega 
   e^{-\frac{t}{\tau }}}{\tau ^2
   \omega ^2+1}}^{\rm transient}+\underbrace{\frac{A \sin (t
   \omega )}{\tau ^2 \omega
   ^2+1}-\frac{A \tau  \omega  \cos
   (t \omega )}{\tau ^2 \omega
   ^2+1}}_{{\rm steady\,\, state}}\,  ,
\end{equation}
\noindent where the first term is the {\it transient} solution which goes to zero shortly.  While the second and third terms form the  {\it steady state\/} solution which remains and continues to oscillate in response to the varying temperature of the water flowing around the thermometer.

\item Now determine that the amplitude of the steady state response portion of the  function, $y(t)$,  is $\frac{A}{\sqrt{\tau^2 \omega^2 + 1}}$ and the  phase angle of the thermometer's temperature response  is $\phi = \tan^{-1}(-\omega t)$. Hint:  Use the trigonometric identity
$$ \sin(\omega t- \phi) =  \sin(\omega t)\cos(\phi) - \cos(\omega t) \sin(\phi)\, . $$

\item Finally, determine the response of the thermometer to be $Y_s(t) = 0.896 \sin (20t - 63.5) $ or equivalently, $y(t) = 100 + 0.896 \sin(20t - 63.5)$.  
\end{enumerate}

\teacher{
\section*{NOTES FOR TEACHERS}

This problem, as outlined in the Activity section, models the heat in a mercury thermometer when it is submerged in a fluid flow whose temperature oscillates. The goal is to determine the amplitude of the temperature around the fluid's steady state mean temperature of 100$^{o}$F  and the phase shift between  the water's temperature and that of the thermometer.

While using the Laplace Transform approach is not the only way to address this model, we offer it here as one option for a good strategy to determine the desired quantities. Moreover, it gives us an opportunity to introduce the transfer function and its use.

This material would be appropriate AFTER an elementary introduction to Laplace Transform approach to solving simple, first order differential equations and its purpose is to give the flavor of the language engineers would use, while linking the problem and vocabulary to the mathematical, time domain efforts used in mathematics coursework as well.
}


\end{document}
