% 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}
\newtheorem{examp}{Example}
\newenvironment{example}{\begin{examp}\rm}{\end{examp}}
%
\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
%\footnote{DELETE THIS FOOTNOTE BEFORE SUBMISSION.  In the \TeX \, source code there is a toggle/option to produce a Teacher Version or a Student Version by ``carving'' out with  $\backslash$teacher\{\} that material which should only appear in the Teacher version. See the source code.}
\else STUDENT VERSION \fi\\A Matter Of Some Gravity}


\markboth{A Matter Of Some Gravity}{A Matter Of Some Gravity}

\author{Kurt Bryan\\
Rose-Hulman Institute of Technology\\
Terre Haute IN  47840 USA\\
kurt.bryan@rose-hulman.edu
}

\makeStitlePDFLaTex


\begin{abstract}

This project introduces the concept of an \textit{inverse problem} (or \textit{parameter estimation}), in the context of the simple linearized pendulum ordinary differential equation (ODE) $\ddot{\theta}(t) + (\sqrt{g/L})\theta(t) = 0$. The theme of the project is that one often has a physical model for a system but in which the model contains unknown parameters or functions. The goal is to use the model along with data collected by observing the actual physical system to estimate the unknown parameter(s). Of particular interest are the questions of ``uniqueness'' (does the data contain the information needed to determine the parameter?), ``stability'' (do small errors in the data result in small errors in the parameter estimates?), and ``reconstruction'' (how can we constructively or explicitly obtain an estimate of the parameter from the data?) The project includes data collection and analysis in class.

\end{abstract}




\section*{SCENARIO DESCRIPTION - THE PENDULUM}

You've been told many times that the gravitational acceleration $g$ at the surface of the earth is roughly $g=9.8$ meters per second squared.
Wouldn't it be nice if you didn't have to take it purely on faith or authority? Why not just measure it yourself
with simple equipment, say a ruler and stopwatch?
One approach is to drop an object from a given measured height and time how long it takes to fall to the ground. The usual
formula $d=\frac{1}{2}g t^2$ (which we won't derive here) for the distance $d$ fallen by an object in a time interval $t$ can be used to solve for $g = 2d/t^2$. The value of $d$ can be measured accurately, but
dropping an object from a modest height (say, one meter) results in a pretty short time interval that's hard to
measure accurately with simple equipment, so the estimate of $g$ would be crude. Dropping from a larger height to lengthen
the time interval brings significant air resistance into the
picture.

But the general approach above can work: we need to conduct an experiment whose basic physics can be modeled mathematically (like $d=\frac{1}{2}gt^2$), and into which the unknown value of $g$ enters, but with other parameters that we can readily and accurately measure. One approach
is to use a pendulum. For a pendulum of length $L$, the differential equation that governs the pendulum's motion is, to good approximation
\begin{equation}
\label{pendeqn}
\ddot{\theta}(t) + \frac{g}{L}\theta(t) = 0
\end{equation}
where $g>0$ is the local gravitational acceleration and $\theta(t)$ is the angle in radians that the pendulum makes with a vertical line. This
model is based the assumption that there is no friction, and that the amplitude
of the pendulum's motion is not ``too big,'' say $|\theta(t)|\leq 0.5$ or so.
Equation (\ref{pendeqn}) is a linear second order ODE. The usual procedure in an introductory ODE course is to specify values for $g$ and $L$, as
well as initial conditions, and then solve for $\theta(t)$. Once we have the solution we can use it to describe the pendulum's motion, for example, that the motion is oscillatory, and find the period or amplitude.

\section*{AN INVERSE PROBLEM}

In this case, however, we're going to turn things around: We'll construct a real pendulum and find $\theta(t)$ by observing the pendulum's motion, and from this information deduce the value of $g$ (we'll just measure $L$ with a meter stick). This is an example of an \textit{inverse problem}:
we have a differential equation that contains some unknown coefficients, and are given information about the solution to the DE. We then seek
to recover the unknown coefficient(s) from this information. The term \textit{parameter estimation} is also often used, and roughly synonymous.
The traditional task of solving the ODE for $\theta(t)$ given $g$ and $L$ is called the \textit{forward problem}.

In the present case we'll conduct an experiment in which we deflect the pendulum to an initial angle $\theta_0$ (so $\theta(0)=\theta_0$), let it go with zero initial angular velocity ($\dot{\theta}(0)=0$), and then measure the period of the motion (we won't measure $\theta(t)$ for all $t$).\\\ \\
{\bf Problem 1:} Verify that the solution to (\ref{pendeqn}) with these initial conditions is $\theta(t) = \theta_0\cos(t\sqrt{g/L})$, and
that the period $P$ of the motion is given by
\begin{equation}
\label{period}
P = 2\pi \sqrt{\frac{L}{g}}.
\end{equation}
{\bf Problem 2:} Solve equation (\ref{period}) for $g$ in terms of $P$ and $L$.\\\ \\
{\bf Class Activity:} You and your partner have been given a pendulum of some length. Measure it carefully from the end marked with tape to the
``middle'' of the mass (as best you can estimate). Then measure the period of the pendulum. One person should hold the pendulum firmly
at the marked end (it helps to brace your hand against a desk or such); let it swing back and forth at least $10$ times, while the other
person times the swings. Keep the initial angle under $30$ degrees!\\\ \\
\teacher{{\bf Instructor Note:} I make up pendulums before class, ideally enough to have students pair up and each pair gets one.
My pendulums are made by simply tying a string
to a fishing weight---a fairly substantial weight, e.g., an ounce or two, to minimize the effect of air resistance.
I sometimes fix the length of the pendulum myself by wrapping a piece of tape around the string, the same length for all groups, and
sometimes I let them choose the length. }\\\ \\
{\bf Problem 3:} Use your measured valued for $L$ and $P$ along with the answer to Problem 2 to estimate $g$. Compare your estimated for g to that posted in a reliable source for your area of the world (try an internet search for ``local gravitational acceleration.'')
\section*{INVERSE PROBLEMS QUESTIONS}

There are several essential questions one usually asks concerning an inverse problem (and many other problems in applied mathematics):\\\ \\
{\bf Uniqueness:} Is the available data sufficient to uniquely determine the unknown(s) of interest?\\
{\bf Stability:} Do small errors in the data result in small errors in the estimate of the unknown(s)?\\
{\bf Reconstruction:} How can we reconstruct the unknown(s) from the data?\\

For this inverse problem you answered the ``Reconstruction'' and ``Uniqueness'' problem by finding an explicit formula for $g$
in terms of $P$ (and $L$). In other inverse problems it's not so easy!\\\ \\
{\bf Problem 4:} Suppose the goal here was to find both $g$ \textit{and} $L$. Explain why both of these parameters
cannot be found using only $P$. Could both be found if we knew the actual function $\theta(t)$? Hint: what would happen if we double both $g$ and $L$?\\\ \\
Now let's take a look at the Stability issue: how will small errors in our measurement of $L$ and $P$ affect our estimate of $g$?
First, recall a basic technique from multivariable calculus: Suppose $z=f(x,y)$ for variables $x,y,z$ and a differentiable function $f$.
Let $x_0$ and $y_0$ be some fixed values for $x$ and $y$, and $\Delta x$ and $\Delta y$ be ``small'' changes in $x$ and $y$. Then, to good approximation,
\begin{equation}
\label{erroranalysis}
\Delta z \approx \frac{\partial f}{\partial x}(x_0,y_0) \Delta x + \frac{\partial f}{\partial y}(x_0,y_0) \Delta y.
\end{equation}
where $\Delta z = f(x_0+\Delta x,y_0+\Delta y)-f(x_0,y_0)$. Equation (\ref{erroranalysis}) is an example of \textit{linearization}.\\\ \\
{\bf Problem 5:} Let $L,P,$ and $g$ play the roles of $x,y,z$ respectively in (\ref{erroranalysis}).
Then $g=f(L,P)$ for the function you
found in Problem 2. If $L_0$ is your measured value for $L$ and $P_0$ the measured value for $P$ then $f(L_0,P_0)$ is the value for $g$
you estimated in Problem 3. We can interpret $\Delta L$ and $\Delta P$ as the discrepancy between our measured values and the true values,
that is, as errors. We can then use (\ref{erroranalysis}) to estimate the error $\Delta g$ in our estimate of $g$.
\begin{enumerate}
\item[a.] Make a reasonable ``worst-case'' estimate for $|\Delta L|$ (you measured it with a meter stick---how close do you think you were?) Do the same for $|\Delta P|$.
\item[b.] Use (\ref{erroranalysis}) to find a worst-case estimate for $|\Delta g|$. (Hint: $\Delta L$ and $\Delta P$ may be of the same
sign or opposite signs.) 
Does the local ``official'' value for $g$ fall within the error interval around your estimated interval?

\end{enumerate}


%\begin{figure}[ht]
%\centerline{\includegraphics[width=1\textwidth]{reflect_teles.png}}
%\caption{A typical reflecting telescope.}
%\label{fig1}
%\end{figure}


\teacher{
\section*{NOTES FOR TEACHERS}

I emphasize to our students (mostly engineers) that estimating unknown parameters from data collected from a system governed by an
ODE or PDE model is a very common task, at least as common as the traditional task of solving the DE with known parameters. Yet
this is rarely discussed in most ODE texts or classes.

I do this project after students have seen the basics of homogeneous second order ODEs, and after I've derived the pendulum equation in class. I let them work
on Problems 1 and 2 in pairs in class, then pause to make sure everyone has the correct expression for $g$. I then pass out pendulums and
let them take data. These days virtually every student has a smart phone with the ability to act as a stop watch (I used to bring
stopwatches to class).
I've often made up the pendulums myself, all of the same length, but it's fun to let the students make their own. Just make sure each
pendulum is long enough or the period is hard to measure. If all the pendulums are the same length it can be helpful to take the mean of the period
estimates to ``average down'' the errors.

After we've all compared estimates, I let them work on Problems 4 and 5, and turn the whole project in as homework. The students
never seem to have any particular trouble with the material or class work, although some might need a reminder of how (\ref{erroranalysis})
works for error analysis.




}



\teacher{

\section*{SOME ANSWERS}
\begin{enumerate}
\item Pretty straightforward, but students always have trouble figuring out that the period of $\cos(\omega t)$ is
$2\pi/\omega$.

\item Here $g = 4\pi^2 L/P^2$.

\item Last time I did this I gave out $10$ pendulums, each with nominal length $0.517$ meters. The average of the $10$ group estimates
for the period $P$ was $P=1.46$ seconds. Most let their pendulum swing back-and-forth $10$ to $20$ times. The resulting estimate of $g$
is $g\approx 9.58$ meters per second squared. We also estimated that the error in $L$ typically satisfied $|\Delta L|\leq 0.01$ meter,
and $|\Delta P|\leq 0.01$ seconds (based on a $0.2$ second ``reaction time error'' over $20$ swings of the pendulum.)

\item The ODE (\ref{pendeqn}) can be written $\ddot{\theta} + k\theta = $ where $k=\sqrt{g/L}$, which makes it clear that the
solution $\theta(t)$ (and so the period $P$) depends only on the ratio $g/L$. We can find this ratio, but not $g$ and $L$ individually.

\item It's easy to compute that if $f(L,P) = 4\pi^2 L/P^2$ as in Problem 1 then
$$
\frac{\partial f}{\partial L}(L_0,P_0) = \frac{4\pi^2}{P_0^2}\textrm{  and  }\frac{\partial f}{\partial P}(L_0,P_0) = -\frac{8\pi^2L_0}{P_0^3}.
$$
With $L_0=0.517$ and $P_0=1.46$ as in Problem 3 we find $\frac{\partial f}{\partial L}(L_0,P_0)\approx 18.52$ and
$\frac{\partial f}{\partial P}(L_0,P_0)\approx -13.12$. Then
$$
\Delta g \approx 18.52 \Delta L - 13.12 \Delta P.
$$
With the estimates for $|\Delta L| \leq 0.01$ and $|\Delta P|\leq 0.01$ the worst case for $\Delta g$ is $\Delta g \approx 0.32$ meters per second squared (when $\Delta L=0.01,\Delta P = -0.01$) or $\Delta g \approx -0.32$ meters per second squared (when $\Delta L=-0.01,\Delta P = 0.01$). More generally, $|\Delta g|\leq 18.52 |\Delta L| + 13.12 |\Delta P| \leq 0.32$ meters per second squared by the triangle inequality.
This gives an interval $9.26\leq g\leq 9.89$.
\end{enumerate}
}

%\section*{ACKNOWLEDGEMENTS}

\end{document}


\begin{thebibliography}{99}

\bibitem{berry} Berry, R., 2001. \textit{Build Your Own Telescope}, 3rd Edition. Willmann-Bell, Richmond, VA.

\end{thebibliography}
