\documentclass{beamer}
%\usetheme{AnnArbor}
\usepackage{hyperref}


\begin{document}




\begin{frame}
\vspace*{-.5 true cm}
\begin{figure}
\centering
\includegraphics[width=10cm]{simiode-wordheader-Color}
\end{figure}
\vspace*{.5 true cm}

\begin{center}
{\Huge \bf Spread of Oil Slick}

\vspace*{.9 true cm}

Brian Winkel, Director@simiode.org

\vspace*{.4 true cm}
SIMIODE, Cornwall NY USA
\end{center}

\end{frame}

\begin{frame}
\frametitle{Overview}
%\tableofcontents
\vspace*{-1 true cm}
\centerline{\Large \bf Spread of Oil Slick}
\vspace*{.4 true cm}
We present data on size of an oil slick from photographic data during intermittent fly overs.

\vspace*{.4 true cm}

\begin{enumerate}
\vspace*{.1 true cm}\item Data
\vspace*{.1 true cm}\item Plots, differencing,  and inferences
\vspace*{.1 true cm}\item Difference equation and differential equation
\vspace*{.1 true cm}\item  Solutions, estimate parameters,   validate model
\vspace*{.1 true cm}\item Discussions
\end{enumerate}

\vspace*{.4 true cm}
Source: 

\hspace*{.5 true cm} {\bf \href{https://qubeshub.org/community/groups/simiode/publications?id=2984\&v=2}{1-005-OilSlick-Modeling Scenario}}
\vspace*{.1 true cm}

Brian Winkel (2022). 1-005-OilSlick-ModelingScenario. SIMIODE, (Version 2.0). QUBES Educational Resources.  doi:10.25334/HHF9-GM75 .

\end{frame}




\begin{frame}

\noindent \Large Observation data on oil slick on fly over imagery.

\vspace*{.2 true cm}

\begin{table}[h]\large

\begin{center}
\begin{tabular}{|c|c|} \hline
\multicolumn{2}{|c|}{Size of Slick (square miles)}\\ \hline \hline
Initial Observation & 10 min.~later \\ \hline
1.047 & 1.139 \\ \hline
2.005 & 2.087 \\ \hline
3.348 & 3.413 \\ \hline
5.719 & 5.765 \\ \hline
  7.273 & 7.304 \\ \hline
  8.410 & 8.426 \\ \hline
  9.117 & 9.127\\ \hline
\end{tabular}

\end{center}

\end{table}
\vspace*{.2 true cm}\normalsize 
\noindent Take 2 minutes to think about  how we could build a model for  size of oil  slick over time.

\vspace*{.2 true cm}
\noindent What is missing? How do we proceed?
\end{frame}

\begin{frame}

\begin{table}[t]\large

\begin{center}
\begin{tabular}{|c|c|} \hline
\multicolumn{2}{|c|}{Size of Slick (square miles)}\\ \hline \hline
Initial Observation & 10 min.~later \\ \hline
1.047 & 1.139 \\ \hline
2.005 & 2.087 \\ \hline
3.348 & 3.413 \\ \hline
5.719 & 5.765 \\ \hline
  7.273 & 7.304 \\ \hline
  8.410 & 8.426 \\ \hline
  9.117 & 9.127\\ \hline
\end{tabular}

\end{center}

\end{table}


\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelData}
\end{figure}
\end{frame}

\begin{frame}



\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelData}
\end{figure}


\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelDataPlot}


\end{figure}

\end{frame}

\begin{frame}
\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelPlot}


\end{figure}


\large
\begin{equation*}
\frac{s(t + 10) - s(t)}{10} = -0.001 s(t) + 0.0102
\end{equation*}



\end{frame}
\begin{frame}

\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelPlot}


\end{figure}


\large
\begin{equation*}
\frac{s(t + 10) - s(t)}{10} = -0.001 s(t) + 0.0102
\end{equation*}


\large
\begin{equation*}
\frac{s(t + \Delta t) - s(t)}{\Delta t} = -0.001 s(t) + 0.0102
\end{equation*}

\end{frame}

\begin{frame}

\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelPlot}


\end{figure}


\large
\begin{equation*}
\frac{s(t + 10) - s(t)}{10} = -0.001 s(t) + 0.0102
\end{equation*}


\large
\begin{equation*}
\frac{s(t + \Delta t) - s(t)}{\Delta t} = -0.001 s(t) + 0.0102
\end{equation*}


\large
\begin{equation*}
\lim_{\Delta t \to 0} \frac{s(t + \Delta t) - s(t)}{\Delta t} = -0.001 s(t) + 0.0102
\end{equation*}

\end{frame}

\begin{frame}

\begin{figure}[!h]
\centering
\includegraphics[width=6cm]{ClassOilSlickExcelPlot}


\end{figure}


\large
\begin{equation*}
\frac{s(t + 10) - s(t)}{10} = -0.001 s(t) + 0.0102
\end{equation*}

\large
\begin{equation*}
\lim_{\Delta t \to 0} \frac{s(t + \Delta t) - s(t)}{\Delta t} = -0.001 s(t) + 0.0102
\end{equation*}

\large

\begin{equation*}
s'(t) = -0.001 s(t) + 0.0102
\end{equation*}
\end{frame}

\begin{frame}
\large
\begin{equation*}
s'(t) = -0.001 s(t) + 0.0102
\end{equation*}

\vspace*{.7 true cm}

\noindent AHA!!!    We have a differential equation model based on a difference equation model.

\vspace*{.4 true cm}
\noindent Remind ourselves of our units!

\vspace*{.4 true cm}
\noindent We seek to solve this differential equation, but we need an initial condition. Where might we get this?

\end{frame}

\begin{frame}
\large 
\begin{equation*}
s'(t) = -0.001 s(t) + 0.0102
\end{equation*}

\vspace*{.5 true cm}

We seek to solve this differential equation and we do have an initial condition $$s(0) = 1.047$$  from first observation.


\vspace*{.5 true cm}

What solution strategies might we employ? One or more?

\large 
\begin{equation*}
s'(t) = -0.001 s(t)\,  +\,  0.0102, \quad s(0) = 1.047
\end{equation*}

\end{frame}

\begin{frame}
\noindent What solution strategies or techniques do we have for solving this differential equation?
\vspace*{.2 true cm}

\noindent Just look at these two forms and identify a strategy for each.

\large
\begin{equation*}
s'(t) = -0.001 s(t)\,  +\,  0.0102, \quad s(0) = 1.047
\end{equation*}


\vspace*{.2 true cm}
\large
\begin{equation*}
s'(t) \, + \, 0.001 s(t) =  0.0102, \quad s(0) = 1.047
\end{equation*}


\vspace*{.2 true cm} \noindent OR we could go to 

\centerline{{\bf \href{https://www.wolframalpha.com}{https://www.wolframalpha.com}}}
\vspace*{.4 true cm}

\noindent Syntax:

 \hspace*{1.5 true cm} \{s'(t) = -.001 s(t) + .0102,s(0) = 1.047\}
\end{frame}

\begin{frame}

\noindent {\Large \bf Separation of Variables}

\large
\begin{equation*}
s'(t) = -0.001 s(t)\,  +\,  0.0102, \quad s(0) = 1.047
\end{equation*}


\vspace*{2 true cm}

\noindent {\Large  \bf Integrating Factor}

\large
\begin{equation*}
s'(t) \, + \, 0.001 s(t) =  0.0102, \quad s(0) = 1.047
\end{equation*}

\end{frame}

\begin{frame}

\noindent {\Large  \bf Separation of Variables}
\large \begin{equation*}
s'(t) = -  0.001 s(t)\, + \,   0.0102 
\end{equation*}

\vspace*{.3 true cm}
\noindent Separate the variables by dividing both sides by 

\vspace*{.4 true cm} \hspace*{.9 true cm} $ -0.001 s(t)\,  +\,  0.0102$.



\large
\begin{equation*}
\left(\frac{1}{-0.001 s(t)\,  +\,  0.0102}\right)s'(t) =  1\, .
\end{equation*} 

\vspace*{1 true cm}
\noindent \large  Then what do we do to move on?
\end{frame}

\begin{frame}
\noindent \large We take the antiderivative of both sides with respect to $t$ and do not forget to add the constant of integration $C$.


\large
\begin{equation*}
\left(\frac{1}{-0.001 s(t)\,  +\,  0.0102}\right)s'(t) =  1\, ,
\end{equation*} 


\large
\begin{equation*}
\int \frac{1}{-0.001 s(t)\,  +\,  0.0102}s'(t) \, dt =  \int 1\, dt + C\, .
\end{equation*} 
\vspace*{.2 true cm}

\noindent Identify $$u = -0.001 s(t)\,  +\,  0.0102\, .$$ So $$u' = -0.001 s'(t)$$ and make replacements to obtain
\end{frame}

\begin{frame}
\large \begin{equation*}
\frac{1}{-.001} \int \frac{1}{\underbrace{-0.001 s(t)\,  +\,  0.0102}_{u}}(\underbrace{-0.001 s'(t)) \, dt}_{du} =  \int 1\, dt + C\, .
\end{equation*} 
\vspace*{.1 true cm}


\noindent Do we see $u$ and $du$? Then integrate.




\begin{equation*}
\frac{1}{-.001} \int \frac{1}{-0.001 s(t)\,  +\,  0.0102}(-0.001 s'(t)) \, dt =  \int 1\, dt + C\, ,
\end{equation*} 
\vspace*{.1 true cm}




\begin{equation*}
\frac{1}{-.001}\ln(\vert -0.001 s(t)\,  +\,  0.0102\vert ) =  t + C\, .
\end{equation*} 

\vspace*{.1 true cm}

\noindent Since $-0.001 s(t)\,  +\,  0.0102\ >0$ for our data we  have
\vspace*{.1 true cm}

\begin{equation*}
\frac{1}{-.001}\ln( -0.001 s(t)\,  +\,  0.0102) =  t + C\, .
\end{equation*}

\end{frame}

\begin{frame}
\large We can go after $C$ using initial condition $s(0) = 1.047$.

\vspace*{.1 true cm}
\begin{equation*}
\frac{1}{-.001}\ln( -0.001 s(t)\,  +\,  0.0102) =  t + C\, ,
\end{equation*}

\vspace*{.1 true cm}
\begin{equation*}
\frac{1}{-.001}\ln( -0.001 s(0)\,  +\,  0.0102) =  0 + C\, .
\end{equation*}

\vspace*{.1 true cm}

\noindent Now using $s(0) = 1.047$ we have
 
\vspace*{.1 true cm}


\begin{equation*}
\frac{1}{-.001}\ln( -0.001\cdot 1.047\,  +\,  0.0102) =  C
\end{equation*}
\vspace*{.1 true cm}

\noindent and finally for $C$ we have
\begin{equation*}
4693.97 =  C\, .
\end{equation*}
\end{frame}

\begin{frame}
\large \noindent Now substitute $C = 4693.97$  into

\vspace*{.1 true cm}
\begin{equation*}
\frac{1}{-.001}\ln( -0.001 s(t)\,  +\,  0.0102) =  t + C
\end{equation*}

\vspace*{.3 true cm}
\begin{equation*}
\frac{1}{-.001}\ln( -0.001 s(t)\,  +\,  0.0102) =  t\, +\, 4693.97
\end{equation*}
\vspace*{.3 true cm}

\noindent and solve for $s(t)$ we  find that

\vspace*{.3 true cm}
\begin{equation*}
s(t) = 10.2 - 9.153 e^{-0.001 t} \, .
\end{equation*}
\end{frame}

\begin{frame}
\large
 \noindent There we have it - our solution to the differential equation model
 
 \begin{equation*}
s'(t) = -0.001 s(t)\,  +\,  0.0102, \quad s(0) = 1.047\, ,
\end{equation*}
\vspace*{.3 true cm}

\noindent namely: 

\vspace*{.3 true cm}
 \begin{equation*}
s(t) = 10.2 - 9.153 e^{-0.001 t} \, .
\end{equation*}

\vspace*{1 true cm} 
\noindent {\bf STOP} and  {\bf LOOK} at  $s(t)$. What does this tell us about the long term size of the oil slick? Does this make us comfortable or uncomfortable? We have already learned something from our modeling $s(t)$.
\end{frame}


\begin{frame}

\noindent {\Large   \bf Integrating Factor}



\large
\begin{equation*}
s'(t)\,  +\, 0.001 s(t) = 0.0102, \quad s(0) = 1.047
\end{equation*}
\vspace*{.1 true cm}

\noindent Recall we seek to shape the Left Hand Side of our differential equation as the derivative of a product of two functions. 

\noindent To do this we create an integrating factor 
\vspace*{.3 true cm}

\begin{equation*}
I(t) = e^{\int 0.001\, dt} = e^{0.001 t}
\end{equation*}

\noindent  and multiply both sides of our differential equation by $I(t)$, looking for the derivative of a product using the Product Rule.


\begin{equation*}
e^{0.001 t}(s'(t)\,  +\, 0.001 s(t)) = e^{0.001 t}\cdot 0.0102
\end{equation*}
\end{frame}


\begin{frame}

\noindent\large  If we multiply through we  see the product $u(t)\cdot v(t)$ with identification of 

\vspace*{.1 true cm}
\noindent \centerline{$u(t) = e^{0.001 t}$ and $v(t) = s(t)$.}


\begin{equation*}
e^{0.001 t}(s'(t)\,  +\, 0.001 s(t)) = e^{0.001 t}\cdot 0.0102
\end{equation*}


\begin{equation*}
e^{0.001 t}s'(t)\,  +\, e^{0.001 t}0.001 s(t)) = e^{0.001 t}\cdot 0.0102
\end{equation*}


\begin{equation*}
\underbrace{e^{0.001 t}}_{u(t)} \underbrace{s'(t)}_{v'(t)}\,  +\, \underbrace{s(t)}_{v(t)}\underbrace{e^{0.001 t}0.001}_{u'(t)}) = e^{0.001 t}\cdot 0.0102
\end{equation*}

\vspace*{.2 true cm}
\noindent OR
\begin{equation*}
\frac{d (u(t) v(t))}{dt} = e^{0.001 t}\cdot 0.0102\, .
\end{equation*}

\end{frame}


\begin{frame}
\noindent \large Thus, integrating both sides yields

\centerline{REMEMBER the constant of integration!}

\vspace*{.1 true cm}

\begin{equation*}
\int \frac{d (u(t) v(t))}{dt}\, dt  = \int e^{0.001 t}\cdot 0.0102\, dt + C\, .
\end{equation*}

\vspace*{.1 true cm} 
\noindent From here we see 
\begin{equation*}
e^{0.001 t}\cdot s(t) = u(t)\cdot  v(t)  = e^{0.001 t}\cdot \frac{0.0102}{0.001} + C\, .
\end{equation*}

\vspace*{.1 true cm} 
\noindent Let us use our Initial Condition to ascertain $C$, i.e. $s(0) = 1.047$. 




\begin{equation*}
1.047 = s(0) = e^{0.001\cdot 0}\cdot s(0)  = e^{0.001\cdot 0}\cdot \frac{0.0102}{0.001} + C = 10.2 + C\, .
\end{equation*}

\vspace*{.1 true cm} 
 
\noindent Thus we see that $C = 1.047 - 10.2 = -9.153$. 
\end{frame}


\begin{frame}
\large It then  follows from


\begin{equation*}
e^{0.001 t}\cdot s(t) = u(t) v(t)  = e^{0.001 t}\cdot \frac{0.0102}{0.001} -9.153
\end{equation*}

\noindent that our solution for $s(t)$ is 
\begin{equation*}
s(t) = 10.2 - 9.153 e^{-0.001 t} 
\end{equation*}

\noindent which is exactly what we got with our Separation of Variables technique.
\end{frame}





\begin{frame}
\centerline{\bf Assignment}

\vspace*{.3 true cm}

\begin{enumerate}

\item Write overview of the modeling process to obtain $s(t)$,  size of  oil slick in square miles, at time $t$ hr, using  data.
\item Use your model for $s(t)$ to plot  size of  oil slick over time.
\item With your model ascertain  exact times at which  photographs were taken.
\item Plot  model over  data to affirm or validate your model.
\item Predict  long term behavior of  oil slick.
\end{enumerate}
\end{frame}



\begin{frame}
\noindent {\bf CONGRATULATIONS!!!}   

\vspace*{.2 true cm}
We went from
 
\begin{itemize}
\item seeing  data, 
\item to realizing a difference equation model, 
\item to converting to a differential equation model,
\item to solving  the differential equation,  
\item to comparing your model with the actual data,
\item to filling in observation times of the data,
\item to making predictions.
\end{itemize}


\vspace*{.2 true cm}
We went from confusing data, to discrete difference equation model using differencing, to linear regression (fitting straight line or TrendLine in Excel), to conversion to differential equation, to solution of the differential equation (in several different ways!!!), to finally answering relevant  questions about our oil slick.

\end{frame}




\end{document}