% 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}
\usepackage{tabularx}

%
\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
\\Linear Approximation, Always a Reliable Technique?}




%\markboth{Need New Title}{Need New Title}

\author{Don Hickethier\\
Department of Mathematics\\
Flathead Valley Community College\\
Kalispell MT 59901 USA\\
dhicketh@fvcc.edu 
}

\makeStitlePDFLaTex


\begin{abstract}
Linear approximations are often used to simplify nonlinear ordinary differential equations (ODEs) for ease in analysis. The resulting linear approximation produces an ODE where closed form solutions may be obtained. A simple model using Torricelli's Law will compare the exact solution to the nonlinear ODE model with its first order approximation. Students should have seen the derivation of this ODE. (If not, Section \ref{sect:Torricelli} of the Teacher Version gives notes.) The concepts of experimental, approximation, and  computational errors in modeling are explored.
\end{abstract}


\section*{INTRODUCTION}

\begin{center}
\teacher{{\it  Comments for the teacher are interspersed with the text in italics.}}
\end{center}

A mathematical model is a symbolic approximation of a quantifiable event with the goal to accurately predict future and past behaviour. An experiment is an idealized observation of the event where real time data may be collected. Both the model and the experiment are inherently prone to errors. Experimental setup and observational errors occur in every physical experiment. A perfect symbolic model is nearly impossible to create because there are way too many parameters that should be considered. Assumptions must be made to limit the number of parameters in order to create a reasonable mathematical model.

To test a mathematical model one needs to compare symbolic solutions to experimental observations. One way to test the model against the experiment is to compute the sum of square errors, the sum of the squares of the differences between the computed model  and observed data. If the error is too large the symbolic model must be revised.

In order to create a stronger, more realistic model, fewer and fewer assumptions are made.
As a result the mathematical model becomes more complicated. Often the more realistic models are impossible to solve in a closed form solution. One common technique used to analyze complex mathematical models (nonlinear) is to make first order linear approximations. These approximations are often easier to solve (by hand) and lend themselves to nicer qualitative analysis. The question now becomes, how well does the linear approximation reflect the actual physical event?

In this activity you will carryout a physical experiment, derive and solve a mathematical model, and compare the two results using the sum of square errors. Then you will make a first order approximation to the mathematical model, and solve and compare all three results.



\section{Collecting Data}\label{sect:Data}

Two options are provided to collect data for this scenario. The first is a lab experiment with materials provided by your instructor. The second is a SIMIODE YouTube video that allows you to collect the data while watching the video. Whichever method is used, it is important you carefully collect and record the required data.

\subsection{Lab Exercise: Emptying the Tank}

This experiment will record time intervals as a cylindrical tank of liquid is emptied through a small hole near the bottom of a tank.
\begin{enumerate}
    \item Record the initial height of the water in the tank, $h_0=$

    \teacher{{\it  Strongly suggest your students choose $h_0$ to be a perfect square and easily divisible by 10. This will make calculations much easier later in the activity. A tall 100 cm beaker would be great or an initial height of 25 cm in a larger tank would be ideal. }}

    \item Calculate and record the area of the top of the open tank, $A=$

    \noindent Calculate and record the area of the opening of the spigot, $a=$

    \noindent Compute and record the ratio of the two areas, $\dfrac{a}{A}=$

    \item Fill tank with water. Mark depths at 10\% intervals.
    \item Simultaneously open spigot at bottom of tank and start stopwatch.
    \item Record time at each 10\% mark in Table \ref{table:torricelli1}.
    \item Plot height vs time.

    \teacher{{\it This may be done by hand or electronically using software like Excel, Google Sheets or Desmos. While graphing by hand is always encouraged, spreadsheets will make future calculations much easier.}}

    \item What type of function (exponential, linear, quadratic, logistic, \ldots ) do you think best fits this data?

    \item List at least 5 opportunities where experimental error may have occurred in collecting the data.

\end{enumerate}

\subsection{SIMIODE YouTube}
If you are unable, or do not have the time, to set up your own experiment, consider one of several SIMIODE YouTube videos on falling column of water \cite{SimiodeTorricelli}.

Note the following with respect to the reference video:
\begin{itemize}
    \item For the referenced video, the diameter (not radius) is 7/64 inches.
    \item Adjust Table \ref{table:torricelli1} to record the time at every one inch mark.
\end{itemize}

\section{Derive, Solve and Analyze the Mathematical Model}\label{sect:Torricelli}

\subsection{Derive a Model for the Rate of Change of Height}

\teacher{{\it At this point one may either provide the differential equation for draining the tank $h'(t)= -k\sqrt{h}$, have students reference \cite{Winkel2015} or \cite{Winkel2016}, or derive the equation from fundamental principles.

This is a nice derivation that may be developed early in the course. Using Torricelli's Law for a tank with constant surface area $A$, spigot with area $a$ and  constant acceleration due to gravity, $g$, the ODE is
$$h'(t)=-\frac{a}{A}\sqrt{2gh}\, .$$
This gives some meaning for the proportionality constant $k$. This derivation will also provide the opportunity to revisit the model for non-uniform tanks, $A=A(h)$, as well as other variations to this problem.}


}

\medskip
\noindent \textbf{Torricelli's Law} states

\noindent Water in an open tank will flow out through a small hole in
the bottom with the velocity it would acquire in falling freely from the water level to the hole.


Assuming Torricelli's Law is true, verify that the differential equation for rate of change of height is
\begin{equation}\label{eqn:torricelli}
h'(t)=-\frac{a}{A}\sqrt{2gh}\, ,
\end{equation}
where $A$ is the constant surface area of the tank, $a$ is the area of the spigot opening and $g$ is the constant acceleration due to gravity.

\subsection{Solve for the Height Function}
Equation (\ref{eqn:torricelli}) is a separable first order nonlinear ordinary differential equation (ODE) with parameters $a$, $A$ and $g$. Letting $k=\dfrac{a}{A}\sqrt{2g}$, the ODE \label{ode:torricelli} can be written $$h'(t)=-k\sqrt{h}\, .$$
    \begin{enumerate}


  %      \teacher{When solving the ODE either give the students $k$ ( $k=1/4$ is a nice value) or better yet, leave the parameter $k$ and solve.  Having already found $A$ and $a$, later compute $k=\frac{a}{A}\sqrt{2g}$. (e.g., a circular tank with circular spigot s.t. $r_A =4r_a,\quad k \approx 0.277$)}

        \item With initial height $h_0$, solve the initial value problem (IVP)
        \begin{equation}\label{eqn:torricelliIVP}
        h'(t)=-k\sqrt{h},\quad h(0)=h_0\, .
        \end{equation}
        
    \noindent Note: Solving with the parameters $k$  and $h_0$ will lead to a more general solution to your ODE.
    
        \teacher{{\it Solution: $h(t)=\left(\sqrt{h_0}-\dfrac{k}{2}t\right)^2$}.}

        \item Using the data compiled in Section \ref{sect:Data}, compute and record  the value for $k$.   $$k=\dfrac{a}{A}\sqrt{2g}= \rule{2 true cm}{.1 mm}\, .$$

         \item Finally substitute the values for $k$ and $h_0$ into your solution to (\ref{eqn:torricelliIVP}) and record the result below
        $$h(t) = \rule{2 true cm}{.1 mm}\, .$$

    \end{enumerate}

\subsection{Compare Experimental Date to the Model}
    Now it is time to compare the data collected from the original experiment with the symbolic solution to the model.
    \begin{enumerate}

        \item At each time $t_i$ in Table \ref{table:torricelli1} compute the height, $h(t_i)$. Plot the points on the same graph with the experimental data. Compute and record the difference $e_i=h_i-h(t_i)$ at each time.

        \teacher{This will be much simpler and less time consuming if students are using some form of a spread sheet.
        }

\ifnum\TeacherEdition=1
\begin{table}[h]
       \begin{center}
        \begin{tabular}{c|p{2cm}|p{2cm}|c|c}
        time, $t_i$ & height, $h_i$ & $h(t_i)$ & Error, $e_i=h_i-h(t_i)$ & $e_i^2$\\\hline
         0 & $h_0$ & & &\\\hline
         & $0.9h_0$ & & &\\\hline
         & $0.8h_0$ & & &\\\hline
         & $0.7h_0$ & & &\\\hline
         & $0.6h_0$ & & &\\\hline
         & $0.5h_0$ & & &\\\hline
         & $0.4h_0$ & & &\\\hline
         & $0.3h_0$ & & &\\\hline
         & $0.2h_0$ & & &\\\hline
         & $0.1h_0$ & & &\\\hline
         & $0$ & & &
        \end{tabular}
        \caption{Tank Data/Model Comparison } \label{table:torricelli1}
        \end{center}
        \end{table}
\else
 \begin{table}[h]
       \begin{center}
        \begin{tabular}{c|p{2cm}|p{2cm}|c|c}
        time, $t_i$ & height, $h_i$ & $h(t_i)$ & Error, $e_i=h_i-h(t_i)$ & $e_i^2$\\\hline
         0 & $h_0$ & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         & $0$ & & &
        \end{tabular}
        \caption{Tank Data/Model Comparison } \label{table:torricelli1}
        \end{center}
        \end{table}
\fi



        \item Square Error: Compute $E = \displaystyle\sum_{i=1}^{9} (h_i-h(t_i))^2=\rule{2 true cm}{.1 mm}\, .$

        \noindent Note: Do NOT use the last data point in your computation.
    \end{enumerate}


\section{Revisit the Model with a Linear Approximation}

Even though an exact solution to this model was found, this is not always possible in more complicated applications. One technique to find a closed form solution to the first order ODE, $y'=f(y)$, is to find the linear approximation of $f(y)$.

Recall the linear approximation of $f(y) \text{ at } y=y_0$ is
$$f(y)\approx f(y_0)+f'(y_0)(y-y_0)\, .$$

\subsection{Solve the Linear Approximation IVP}

\begin{enumerate}
\item Verify the linear approximation of $\sqrt{h} \text{ at } h=h_0 $ is

\begin{equation}\sqrt{h}\approx
    \sqrt{h_0}+\dfrac{1}{2\sqrt{h_0}}h,
    \label{eqn:approx}
    \end{equation}

%\teacher{You may have your students calculate the linear approximation at the initial height, $h_0$ or just give it to them. Here is where a perfect square $h_0$ is convenient.}


        \item Substituting the approximation (\ref{eqn:approx}) into the IVP (\ref{eqn:torricelliIVP}) yields
        \begin{equation}\label{eqn:approxIVP}
            h'(t) = -k\left(\sqrt{h_0}+\dfrac{1}{2\sqrt{h_0}}h\right), \quad h(0)=h_0\, .
        \end{equation}
        Notice the new differential equation is both linear and separable. While you may select either solution method, it is good practice to use several methods for solving linear first order ODEs. Which ever method you choose, solve (\ref{eqn:approxIVP}). Record your result below.
        $$h_L =\rule{2 true cm}{.1 mm}\, .$$



  \noindent Note: The subscript ``$L$'' will remind us this is the Linear Approximation solution.
\end{enumerate}

         \teacher{Solution: $h_L(t)=h_0\left(3e^{\frac{-kt}{2\sqrt{h_0}}}-2\right)$ .}

\subsection{Compare Experimental Date to the Approximated Model}
Using the same time values from Table \ref{table:torricelli1} compare the data collected to the solution of the approximated IVP.
\begin{enumerate}
        \item For each time $t_i$ in Table \ref{table:torricelli1} use the solution to (\ref{eqn:approxIVP}) to compute the height, $h_L(t_i)$. Plot these points on your graph. (At this time three should be three sets of points for each $t_i$.) Compute the difference at each time in Table \ref{table:torricelli2}.


\ifnum\TeacherEdition=1
\begin{table}[h]
       \begin{center}
        \begin{tabular}{c|p{2cm}|p{2cm}|c|c}
        time, $t_i$ & height, $h_i$ & $h_L(t_i)$ & Error, $e_i=h_i-h_L(t_i)$ & $e_i^2$\\\hline
         0 & $h_0$ & & &\\\hline
         & $0.9h_0$ & & &\\\hline
         & $0.8h_0$ & & &\\\hline
         & $0.7h_0$ & & &\\\hline
         & $0.6h_0$ & & &\\\hline
         & $0.5h_0$ & & &\\\hline
         & $0.4h_0$ & & &\\\hline
         & $0.3h_0$ & & &\\\hline
         & $0.2h_0$ & & &\\\hline
         & $0.1h_0$ & & &\\\hline
         & $0$ & & &
        \end{tabular}
         \caption{Tank Data/Approximation Comparison} \label{table:torricelli2}
        \end{center}
        \end{table}
\else
 \begin{table}[h]
       \begin{center}
        \begin{tabular}{c|p{2cm}|p{2cm}|c|c}
        time, $t_i$ & height, $h_i$ & $h_L(t_i)$ & Error, $e_i=h_i-h_L(t_i)$ & $e_i^2$\\\hline
         0 & $h_0$ & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         & $0$ &  & &
        \end{tabular}
         \caption{Tank Data/Approximation Comparison} \label{table:torricelli2}
        \end{center}
        \end{table}
\fi

        \item Square Error for Approximation: Compute $E_L = \displaystyle\sum_{i=1}^{9} (h_i-h_L(t_i))^2 =\rule{2 true cm}{.1 mm}\, .$

        \noindent Note: Remember, do NOT use the last data point in your computation.
        \item What assumptions were made in your liner approximation model that may have contributed to the large error?
\end{enumerate}

\section{Comparing Solutions}
Often experimental data is not available, yet one still wants to compare the results of the model with its linear approximation. For this last bit of analysis all of the information is already collected.
\begin{enumerate}
    \item Transfer the data from the previous tables to fill in the first three columns of Table \ref{table:modelapprox}.

    \begin{table}[h]
       \begin{center}
        \begin{tabular}{c|p{2cm}|p{2cm}|c|c}
        time, $t_i$ &  $h(t_i)$ & $h_L(t_i)$ & Error, $e_i=h(t_i)-h_L(t_i)$ & $e_i^2$\\\hline
         0 & $h_0$ & & & \\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         &  & & &\\\hline
         & 0 & & &
        \end{tabular}
        \caption{Model/Approximation Comparison} \label{table:modelapprox}
        \end{center}
        \end{table}

        \item Square Error for Model and Approximation: Compute $E_A =  \displaystyle\sum_{i=1}^{9} (h(t_i)-h_L(t_i))^2=\rule{1.7 true cm}{.1 mm}\, .$

        \noindent Note: Once again, do NOT use the last data point in your computation.
        \item Based on your graph of both solutions to the ODEs and the square error, is Linear Approximation a good technique for this model? Revisiting Toricell's Law explain why one must be very careful using Linear Approximation as a technique to solve complicated nonlinear ODEs.



\end{enumerate}



%


\teacher{
\section*{NOTES FOR TEACHERS}


This scenario may be used at different times during a semester.
If modeling is introduced early in the semester, the draining tank may be a nice topic used to motivate discussion concerning assumptions that must be made in order to derive an IVP. As with any physical model discussion should also include comparing experimental solutions to symbolic or numeric solutions. Possible approaches may be:

\begin{enumerate}
\item Use Torricelli's law to derive the ODE for height in tank. This scenario would not have to be handed out to students. Instead, derive the model in anticipation of the scenario.
\item After introducing separable and linear ODEs, do the experiment. Have students use both methods to solve the two ODEs. Compare experimental to computed results. Also introduce sum  of square errors which will be revisited later in the course.
\end{enumerate}

Spreadsheets should be encouraged to avoid the messy calculations; Excel, Google Sheets, Desmos, GeoGebra will all work. In a followup scenario a numerical solver may be necessary to solve the IVP. Introducing MATLAB, or other numerical analysis software, for these simple computations may be worth the effort in anticipation of numerical solvers used later in the course.

This scenario has been designed so the instructor may substitute a favorite experiment and introductory first order ODE into Sections \ref{sect:Data} and \ref{sect:Torricelli} and still investigate the first order approximation comparison.



\bigskip

Big Questions (probably not for students, but worth thinking about?):
\begin{itemize}
    \item What are the conditions such that linear approximation is appropriate for $y'=f(y)$ as well as $y''=f(y,y')$, i.e.  when does it fail for some given error tolerance?
    \item What are conditions for appropriate use of linear approximation in non-autonomous ODEs, $y'=f(t,y)$ as well as $y''=f(t,y,y')$?
    \item Computing first order approximations can be derived by expanding
$f(y+\delta y,y'+\delta y')$ ignoring higher order terms with $\delta y$ and $\delta y'$. Should this technique be taught in an introduction to differential equations course?
\end{itemize}
}

\begin{thebibliography}{99}
\bibitem{SimiodeTorricelli} SIMIODE. 2019. SIMIODE Torricelli's Law 7 Over 64 Inch Diameter Small Hole Collection Video. \href{https://www.youtube.com/watch?v=k7TSAqRfHgg}{https://www.youtube.com/watch?v=k7TSAqRfHgg}. 

\teacher{
\bibitem{Winkel2015} Winkel, B.  2015.  1-015-S-Torricelli. 



\bibitem{Winkel2016} Winkel, B.  2016. 1-140-S-LeakyBucket.  
}

\end{thebibliography}









\end{document}
