% 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\\Models Motivating Second Order}




\markboth{Models Motivating Second Order}{Models Motivating Second Order}

\author{Brian Winkel, Director SIMIODE\\
Chardon OOH 44024 USA\\ 
BrianWinkel@SIMIODE.org
}

\makeStitlePDFLaTex


\begin{abstract}
We introduce several basic, but substantial, approaches to modeling the motion of a spring mass system using a standard second order, linear, constant coefficient differential equation obtained from Newton's Second Law of Motion and a Free Body Diagram. We do this using a set of data collected from an oscillating mass on a spring in a home office setting using off the shelf motion detection device. Estimating parameters in the models is emphasized with validation rendered by comparing model prediction and data.
\end{abstract}




\section*{SCENARIO DESCRIPTION}



Ordinary differential equations involve second derivatives and second derivatives appear in many contexts, chief among them are the study of forces and resulting motion. This is principly because of Newton's Second Law of Motion which says, that the sum of the forces acting on a body are equal to the product of the body's mass and acceleration.
\begin{quote}

\end{quote}


Consider the  diagram for the mass at the end of the spring in Figure~\ref{fig:3-2-FBD}. We will presume that the mass is settled into a static equilibrium in which the force due to gravity is countered by the restoring force of the spring to contract or expend depending upon whether the mass is below or above this static   equilibrium point, respectively, and hence, pull up or push down, respectively, the mass.  Suppose we let $y(t)$ be the distance the mass is from static equilibrium and $y(t)>0$ for when the mass is below the static equilibrium, i.e. when the spring is extended, and  $y(t)<0$ for when the mass is above the static equilibrium, i.e. when the spring is compressed.

\begin{figure}[h]
\centering
\includegraphics[width=3cm]{3-2-FBD.eps}


\parbox{13.8 true cm}{\caption{\label{fig:3-2-FBD}  Base diagram for constructing a Free Body Diagram showing  the forces on a mass at static equilibrium, excluding gravity and its counteracting restoring force of the spring to contract or expand depending upon whether the mass is below or above the static equilibrium point.}}


\vspace*{-.4 true cm}
\end{figure}




Newton's Second Law   of Motion states that the sum of the forces acting on a body are equal to the product of the body's mass and acceleration.  

\begin{equation}\label{eq:FBD}
m \, y''(t) = \rule{5 true cm}{.01cm}
\end{equation}


We need to identify these acting forces. Remember the force due to gravity has been offset by the restoring force of the spring  to contract or expand, thus putting the mass at static equilibrium. Now then,  the two forces we need to consider are (1) the force to restore the spring to the static equilibrium value  and (2) the force of resistance to motion due to friction and resistance.

The restoring force of the spring  to restore (contract or expand) the spring can be modeled by Hooke's Law which says that ``\ldots that the force needed to extend or compress a spring by some distance is proportional to that distance. This is a constant factor characteristic of the spring and is often referred to as its {\it stiffness\/}. The law is named after 17$^{\rm th}$ century British physicist Robert Hooke.''\cite{WikiHooke2014} We offer the following historical information.

\begin{quote}
In physics, Hooke's Law of elasticity states that the extension of an elastic spring is linearly proportional to its tension.

The law holds up to a limit, called the elastic limit, or limit of elasticity, after which springs suffer plastic deformation up to the plastic limit or limit of plasticity, after which they break down.

It is named after the 17$^{\rm th}$ century physicist Robert Hooke, who initially published it as an anagram {\it ceiiinosssttuv\/}, which he later revealed to mean {\it ut tensio sic vis\/}, or ``as the extension, the force.''\cite{WikiHooke2014}
\end{quote}

The force of resistance to the motion of the mass is often just proportional to the velocity of the mass and is due to internal friction in the spring and external resistance due to the medium, in this case air with flat index card surface in opposition to the motion.

We will be modeling a spring mass system and seeing how well it describes data taken from an experiment.  Use  (\ref{eq:FBD})    in building a differential equation model using Newton's Second  Law of Motion.
\subsection*{Activity 1}
Draw these acting forces in Figure~\ref{fig:3-2-FBD} and incorporate them into (\ref{eq:FBD}) according to Newton's Second Law of Motion.



\begin{figure}[h]
\centering
\includegraphics[width=3cm]{3-2-FBD.eps}


\parbox{13.8 true cm}{\caption{\label{fig:3-2-FBD}  Base diagram for constructing a Free Body Diagram showing  the forces on a mass at static equilibrium, excluding gravity and its counteracting restoring force of the spring to contract or expand depending upon whether the mass is below or above the static equilibrium point.}}

\end{figure}


\noindent where $m>0$ is the mass in kg on the spring, $k>0$ is the spring constant with units N/m, and $c>0$ is the resistance coefficient in units N/(m/s). Here $y(t)$ is the displacement in meters from the static equilibrium. Of course, $y_0$ is the initial displacement of the mass from static equilibrium and $v_0$ is the initial velocity of the mass. 

You should have a differential equation that looks like this:

We consider, 
\begin{equation}\label{eq:const}
m y''(t) + c y'(t) + k y(t) = 0\, , \quad y(0) = y_0\, ,\quad y'(0) = v_0\, .
\end{equation}

If you do not have an equation like (\ref{eq:const})  then you may need to redo your Free Body Diagram or rethink your application of Newton's Second Law of Motion. In any case, make sure you can convince yourself that your differential equation is correct for $y(t)$ before proceeding.


 
\subsection*{Activity 2}


We collected data on 9 May 2013  at our home office in Cornwall NY USA.  We set up a spring mass system depicted in Figure~\ref{fig:3-2-MainSetUp} in which a mass was suspended on a spring attached to a rod on a stand. Data was collected on the vertical motion of the mass by using a Vernier  Go!Motion Detector apparatus shown on the floor below. The distance from the detector to the base of the mass was recorded in a file on a PC.  The mass, $m$,  was 0.200 kg and the spring had a spring constant of  $k = 17.306$ N/m. This meant that when 17.306 N of force was applied to the spring the spring would stretch 1 meter, no matter how much it had been stretched already. The spring constant was determined experimentally by plotting force vs.~displacement data for a variety of different masses and determining a linear relationship $F = 17.30\cdot x$, where $x$ is the displacement in $m$ and $F$ is the force in N necessary to obtain that displacement. As mentioned above this relationship is referred to as Hooke's Law. This is effective in a very  small (say 0.3 m) range of the length of the spring beyond its resting position, for if the spring were to be stretched too far it wold lose it restorative power.  



\begin{figure}[h]
\centering
\includegraphics[width=5cm]{3-2-MainSetUp.jpg}


\parbox{10.8 true cm}{\caption{\label{fig:3-2-MainSetUp} The apparatus for collecting data on the bouncing spring mass system with the VernierGo!Motion Detector on the floor.  The spring was pulled down and released and the detector collected data on the changing distance between the mass and the collection head of the detector. }}

\end{figure}

Through the interface between the motion detector and a PC,  data on the position of the mass was sampled for approximately 30 seconds at 50 data points per second for total number of 1,500 observations. The data is offered in the  Excel spreadsheet 3-1-S-SpringMassDataAnalysis-StudentVersion.xls which is in the supplemental files for this Modeling Scenario. 

\subsubsection*{Clean up the data}

Since this data offered has some noise in it initially when the spring was released, you should take a ``chunk'' of the data well into the data set, attempting to get the first point as a high point in the cycle as depicted in Figure~\ref{fig:3-2-CleanData}. For when the mass is at a high (or low) point then the velocity is 0, hence $y'(0) = y_0 = 0$, as it is stopping motion in one direction and preparing to go in the other direction, at least approximately so.


\begin{figure}[h]
\centering
\includegraphics[width=9cm]{3-2-CleanData.jpg}


\parbox{10.2 true cm}{\caption{\label{fig:3-2-CleanData} Plot of the data from some time, well into the motion, but at a high point for the displacement of the mass from static equilibrium.}}

\end{figure}

\section*{Modeling the Motion of the Mass}

We are going to offer several opportunities  to model the motion and, in turn, determine the parameters $m$, $k$, and $c$, albeit we actually know $m$ and $k$ from measurements, namely $m = 0.200$ kg and $k = 17.306$ N/m.

We outline these approaches here and note that these will take some computing power and you should probably be using a computer algebra system. We use Mathematica here, but SAGE and Maple or MatLab will also work well.

\subsubsection*{1.~Modeling based on reasonable shape of the data}

Notice the plot of the full data set in Figure~\ref{fig:3-2-MoreData}  appears to be oscillating and decaying. How might we model this function? Use an exponential decay function of the form $e^{-B\cdot t}$ ($B>0$) and an oscillating function which begins at its high value, i.e.~a cosine function, $\cos(C\cdot t)$.  We conjecture a form of a solution  based on data - KEY ELEMENT - with parameters $A$ and $C$, $C$ to be determined and $A = y_0$, our initial displacement. What would that conjectured form look like? We use $-B$ in our exponential function as we believe the displacement will decay and thus $B$ will be positive.

Somehow estimate the parameters $B$ and $C$. To get a handle on $B$ you might want to extend your data set beyond just a few ups and downs, to see (Figure~\ref{fig:3-2-MoreData}) the amplitude of the spring's motion really decrease. How would you estimate $C$?

\begin{figure}[h]
\centering
\includegraphics[width=9cm]{3-2-MoreData.jpg}


\parbox{10.2 true cm}{\caption{\label{fig:3-2-MoreData} Plot of the data from some time, well into the motion, but at a high point for the displacement of the mass from static equilibrium and for a long duration of the motion to see the decaying amplitude.}}

\end{figure}


Once you have estimates of $B$ and $C$ in your model then plot your model over the data and comment on your model's ability to predict the motion of the spring mass system.


\subsubsection*{2.~Modeling based on the differential equation model (\ref{eq:const}) and the shape of the data}


Now do a general analysis to show how $m$, $c$, and $k$ in  (\ref{eq:const}) can be estimated as they  play a role in your model of the form  used in the previous section, i.e.~estimate all three parameters, $m$, $c$, and $k$, using your data and the solution to (\ref{eq:const}) when compared to your form in the previous section, namely $A\cdot e^{-B\cdot t}\cos(C\cdot t)$.

Once you have estimates of $m$, $c$, and $k$ in  (\ref{eq:const}) solve the differential equation, plot the solution over the   data, and comment on your model's ability to predict the motion of the spring mass system.

Hint:  Solve (\ref{eq:const}) in general and compare coefficients of like terms in the solution to your visual model that you used in section (1) above. 

You should ask yourself, ``What are the criteria we use to get the values for $m$, $c$, and $k$, for the best fit for all the data in our model?''

\subsubsection*{3.~Modeling based on the differential equation model (\ref{eq:const}) and the shape of the data}




Now do a general analysis to show how $m$, $c$, and $k$ in  (\ref{eq:const}) can be estimated as they  play a role in this general damping and oscillating model of the form model of the form  

\begin{equation}\label{eq:gen}
\hat{y}(t)= A1 \cdot e^{-B\cdot t}\sin(C\cdot t)+ A2\cdot e^{-B\cdot t}\cos(C\cdot t)\, . 
\end{equation}

Again, since you have estimates of $m$, $c$, and $k$ and hence $A1$, $B$, $C$, $A2$, in  (\ref{eq:const}) and in (\ref{eq:gen}) solve the differential equation (\ref{eq:const}), plot the solution over the   data, and comment on your model's ability to predict the motion of the spring mass system.

\subsubsection*{4.~Modeling based on the differential equation model (\ref{eq:const}) alone using the data}




Now do a general analysis to show how $m$, $c$, and $k$ in  (\ref{eq:const}) can be estimated as they  play a role in this general damping and oscillating model from the solution of (\ref{eq:const}) and the data alone.

Again, nnce you have estimates of $m$, $c$, and $k$  in  (\ref{eq:const})  solve the differential equation (\ref{eq:const}), plot the solution over the   data, and comment on your model's ability to predict the motion of the spring mass system.

\section*{Conclusion}

In all three cases above your model and the data, when compared, ought to look like a good fit as shown in Figure~\ref{fig:3-2-MoreData}.




\begin{figure}[h]
\centering
\includegraphics[width=9cm]{3-2-FinalModelData.jpg}


\parbox{10.2 true cm}{\caption{\label{fig:3-2-FinalModelData} Plot of the data and a good model of the data from any one of the analyses performed above. }}

\end{figure}


\begin{thebibliography}{99}

\bibitem{WikiHooke2014} Wikipedia contributors. 2014. Hooke's law. Wikipedia, The Free Encyclopedia.  \href{http://en.wikipedia.org/w/index.php?title=Hooke\%27s\_law\&oldid=628866252}{http://en.wikipedia.org/w/index.php?title=Hooke\%27s\_law\&oldid=628866252}. 
\end{thebibliography}


\teacher{
\section*{NOTES FOR TEACHERS}

We offer complete analyses of our approaches (1) - (4) and more in a supplemental file, a Mathematica notebook, 3-2-T-Mma-ModelMotivatingSecondOrder-TeacherVersion.nb, and a pdf version for those who do not use Mathematica. This is in the supplemental documents for this Modeling Scenario.

The different approaches do not constitute the only strategies. Often, students will use only a few data points, indeed, as many as the number of parameters they are attempting to estimate. However, this is highly dependent upon their choices and ignores an enormous number of data points which might give added evidence to the value of the parameters.

Basically the first approach (1) is appealing to the shape of the data, namely $A e^{-B t}\cos(C t)$, while the second approach (2) is doing the same thing with the analytic solution to the model differential equation (\ref{eq:const}) and (3) is as approach (2) only with a more general solution candidate. The fourth approach (4)  is  going directly with the analytic solution of the model and the complex expressions containing the parameters $m$, $k$, and $c$. The latter, namely the solution of an analytic model using the minimization of the sum of squared error analysis approach,  is more likely to be a modeler's approach to parameter estimation and hence model validation.

}
\end{document}


