% SIMIODETemplate-TeacherORStudent.tex and simiode.cls for LaTeX2e
% Version 29 July 2015.
% 
% This class (simiode.cls) is a modification of that used by 
% the journal PRIMUS - Problems, Resources, and Issues in 
% Mathematics Undergraduate Studies. 
% 
% See http://www.tandfonline.com/loi/upri .
% 
% The class was developed by  Marc Frantz with suggestions of the 
% PRIMUS Editorial Board, especially John Thoo.
%
% 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.
%
\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.
%
% Basically the 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 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.
% This option was created  by Eric Sullivan, Carroll College, Helena MT.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE regarding double spacing %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Manuscripts should be submitted doubled spaced.  This is 
% accomplished via the \baselinestretch command below.
% However, you may obtain an idea of how your article will 
% look in final form, so that you can better plan your 
% presentation.  To see your manuscript formatted very 
% similarly to the on-line published format of  SIMIODE, 
% comment the following line out by inserting a percent sign % (%) at its beginning.

\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.
\title{\ifnum\TeacherEdition=1 TEACHER VERSION
\else STUDENT VERSION \fi\\ONE MASS SPRING}



\markboth{One Mass Spring}{One Mass Spring}

 

\author{
\begin{minipage}[t]{7.8 true cm}\normalsize
Eric Ahlstrom, Mathematics\\
 Itasca Community College\\
Iron Range Engineering\\
Grand Rapids MN 55744 USA\\
eric.ahlstrom@itascacc.edu
\end{minipage}\ \
\begin{minipage}[t]{7.8 true cm}\normalsize
Swarn Singh
Sri Venkateswara College\\
University of Delhi\\
New Delhi INDIA\\
sswarn2005@yahoo.co.in
\end{minipage}\\ \\
\begin{minipage}[t]{7.8 true cm}\normalsize
John T. Sieben, Mathematics\\
Texas Lutheran University\\
Seguin TX 78155 USA\\
jsieben@tlu.edu\\
\end{minipage}\ \
\begin{minipage}[t]{7.8 true cm}\normalsize
Tiernan Fogarty\\
Oregon Institute of Technology\\
Klamath Falls OR USA 97601\\
Tiernan.Fogarty@oit.edu
\end{minipage}\\ \\  \normalsize
  J. B. Thoo\\  \normalsize
Yuba College\\  \normalsize
Marrysville CA 95901 USA\\  \normalsize
jthoo@yccd.edu
}
\makeStitlePDFLaTex



\begin{abstract}
  In this modeling scenario, we lead students through building a mathematical model for a single mass (bob)-spring system that is hanging vertically.  Later, not knowing the spring constant, we also lead the students through using data that they collect together with their model to approximate the value of the spring constant; we also provide a set of data if the students are not able to collect their own data.
\end{abstract}




\section*{SCENARIO DESCRIPTION}



We are interested in the motion of a mass (bob)-spring system that is hanging vertically as shown in Figure~\ref{fig:3-90-singlespringsetup}.  The goal is to come up with a mathematical model of the motion (vertical position) of the bob as a function of time.


\begin{figure}[ht]
\centering
\includegraphics[width=5cm]{3-90-singlespringsetup.eps}

\parbox{7.5 true cm}{\caption{\label{fig:3-90-singlespringsetup}
A set up of a single mass (bob)-spring system.  You can see the motion detector sitting on the stool in the photograph.  Here, the bob has a mass of 200 grams, but the spring constant is unknown.}}
\end{figure}


In Figure~\ref{fig:3-90-singlespringsetup}, we see a bob hanging from a spring vertically, and below it is a motion detector that was used to collect data (vertical position of the bob and time) for the motion of the bob.  This data was then compared against the mathematical model for the motion.


After either raising the bob or pulling it down from its rest position or static equilibrium, and then letting go, it moves up and down like clockwork.  Let us assume that there are only two forces acting on the bob: the force that is due to gravity and the force produced by the spring.  We will not assume there is resistance force.  The force that is due to gravity is given by \( \text{mass} \times \text{gravity} \) (\( m g \)), and the force produced by the spring is proportional to the amount (length) that the spring has been stretched or compressed (\( k x \)) from its rest position (this is called \emph{Hooke's law} \cite{hooke}).  The constant \( k \) in the spring force is called the \emph{spring constant}, and it has units \( \text{dyne} / \text{cm} \).


%%%%%%%%
\section{Mathematical Model}

A bob is attached to a spring that is hanging vertically.  See Figure~\ref{fig:3-90-singlespringsetup}.


%%%%%%%%%%%
\subsection{Activity 1}

Drawn in Figure~\ref{fig:3-90-FBD} is a free-body diagram to analyze the forces that are acting on the bob.  Take the positive direction to be down for convenience.

\begin{figure}[t]
\centering
\includegraphics[width=12cm]{3-90-FBD.eps}

\vspace*{-10 true cm}

\parbox{8.5 true cm}{\caption{\label{fig:3-90-FBD}
A free-body diagram to analyze the forces that are acting on bob that is hanging on the end of a spring.}}
\end{figure}


\bigskip
The hanging spring without a bob attached has length \( L~\textrm{cm} \), and the spring with a bob attached (but not in motion) has length \( (L + a)~\textrm{cm} \).  Fill in the blanks below.

\bigskip\noindent
Do we need to make any assumptions about the dimensions of the bob?  Explain.

\noindent
\rule{15cm}{.01cm}


\bigskip\noindent
At rest or static equilibrium, the spring force equals weight force and this implies $ k x  =$ \rule{2cm}{.01 cm}




\medskip
Now the bob is moving (straight up and down, with no side to side swaying), and at time \( t~\textrm{s} \) it is at position \( x(t)~\textrm{cm} \) or just \( x~\text{cm} \).  Let the spring constant be \( k \) and the acceleration due to gravity be \( g \).  

\bigskip\noindent
What are the units for the acceleration due to gravity?  \rule{3cm}{.01cm}

\noindent
What are the units for the spring constant?  \rule{3cm}{.01cm}

\noindent
How might you calculate \( k \) if it is not known to you?  \rule{6.65cm}{.01cm}

\noindent
\rule{15cm}{.01cm}

\noindent
\rule{15cm}{.01cm}

\noindent
\rule{15cm}{.01cm}

\bigskip
According to Newton's second law of motion, the equation of motion of the bob is

\begin{align*}
  \text{mass} \times \text{acceleration of the bob} &= \text{total forces acting on the bob}  \\[1ex]
  m x'' &= \rule{8cm}{.01 cm}
\end{align*}

\noindent
What happened to the term with \( g \), the acceleration due to gravity?  Does this make sense?

\noindent
\rule{15cm}{.01cm}

\noindent
\rule{15cm}{.01cm}


%%%%%%%%%%%
\subsection{Activity 2}

The equation of motion for the bob is then
%%
\begin{equation}
  m x'' = - k x.
  \label{eqn.activity2:shm}
\end{equation}
%%
Can you justify this differential equation in your own words?

\medskip\noindent
To simplify what is to come, divide through the equation by \( m \) and bring all the terms to the left-hand side of \eqref{eqn.activity2:shm}:
%%
\begin{equation}
  x'' + \frac{k}{m} x = 0  \quad\text{or}\quad
  x'' + \omega^2 x = 0,
  \label{eqn.activity2:shmstandardform}
\end{equation}
%%
where \( \omega = \sqrt{k / m} \) (taking the positive square root).

Remember that \( x = x(t) \) is a function of \( t \).  What might be a solution of the equation?  Think about the motion of the bob: how might you describe the motion in one word?



\medskip\noindent
The bob moves up and down like clockwork; the motion of the bob is \rule{3cm}{.01 cm}.

\medskip\noindent
If you suggested that the motion of the bob is periodic, what periodic function comes to mind immediately?

\medskip\noindent
When someone says, ``periodic function,'' I think \rule{2.6cm}{.01 cm} or \rule{2.6cm}{.01 cm} immediately.

\medskip\noindent
So, let us assume that the solution of the equation of motion is
%%
\begin{equation}
  x(t) = c_1 \cos (\omega t) + c_2 \sin (\omega t),
  \label{eqn.activity2:shmsolution}
\end{equation}
%%
where \( c_1 \) and \( c_2 \) are arbitrary constants.  Verify that \eqref{eqn.activity2:shmsolution} is indeed a solution of \eqref{eqn.activity2:shmstandardform}, \( x'' + \omega^2 x = 0 \).  Show that the frequency terms must be \( \omega t \) for this motion.

To see why the solution \eqref{eqn.activity2:shmsolution} is a combination of a cosine function and sine function, describe the position of the bob at time \( t = 0 \) in the following cases.



\begin{eqnarray*}
  &c_1 = 0, c_2 \neq 0:  &  \rule{12cm}{.01cm}  \\
  &c_1 > 0, c_2 = 0:  &  \rule{12cm}{.01cm}  \\
  &c_1 < 0, c_2 = 0:  &  \rule{12cm}{.01cm}
\end{eqnarray*}

\medskip\noindent
Remark: One may use a computer algebra system, such as Mathematica or Maple or Sage, to solve the equation of motion.  We will also learn how to solve such ``second-order'' equations by hand very soon, but not in this activity.

\medskip
You can see that to solve the equation \( x'' + \omega^2 x = 0 \) one might require two integrations because of the second derivative, which would result in two constants of integration.  This is why we have two unknowns, \( c_1 \) and \( c_2 \), in the solution.  The constants would be determined by some known ``initial conditions'' (that might be measured in the experiment).  The initial conditions are some known information about the mass (bob)-spring system at a particular time (usually at time 0 seconds, whence \emph{initial} conditions).

\medskip\noindent
What are some reasonable initial conditions that would help us determine \( c_1 \) and \( c_2 \)?

\begin{itemize}
  \item  room temperature
  \item  time of the day
  \item  date
  \item  position of the bob
  \item  velocity of the bob
  \item  humidity in the room
\end{itemize}

We take as initial conditions the position and the velocity.  Find \( c_1 \) and \( c_2 \) if we suppose that
%%
\[
  x(0) = x_0,  \quad
  x'(0) = x_1.
\]
%%
The values will be in terms of \( x_0 \) and \( x_1 \).
%
\[
  c_1 = \rule{2cm}{.01 cm},  \quad
  c_2 = \rule{2cm}{.01 cm}
\]

Now, using trigonometric identities, we may rewrite the solution \eqref{eqn.activity2:shmsolution} of \eqref{eqn.activity2:shmstandardform} as
%%
\[
  x(t) = A \cos \bigl( \omega (t - \tau) \bigr).
\]
%%
Use trigonometric identities to obtain \( A \cos \bigl( \omega (t - \tau) \bigr) \) from \( c_1 \cos (\omega t) + c_2 \sin (\omega t) \), and verify that this is indeed a solution of \( x'' + \omega^2 x = 0 \).  Here, \( A \) is the amplitude, \( \omega \) is the frequency, and \( \tau \) is the shift in time when the ``clean data'' starts (at a peak).  (By ``clean data'' we mean that the first several entries of the collected data that appear to be spurious have been deleted if necessary due to unsure release of the bob with the hand.)  Thus, \( k \) is unknown for this activity.  We shall try to approximate \( k \) from the data.


%%%%%%%%%%%
\subsection{Activity 3}

Set up an experiment similar to the one that is shown in Figure~\ref{fig:3-90-singlespringsetup} to collect some data for the position of the bob of mass \( m \) at time \( t \) for, say, 20 or 30 seconds.  (That should be more than enough data.)  Record the data in a spreadsheet, for example, and clean it up. 

If you are unable to set up an experiment, you may use the data that we collected; it is available in the accompanying file \texttt{3-90-rfcut2.csv}.  Note that this data has been cleaned up.  In our experiment, the bob has mass 200~g.  This data is plotted in Figure~\ref{fig:3-90-rfcut2plot1}.

\begin{figure}[ht]
\centering
\includegraphics[width=12cm]{3-90-rfcut2plot1.eps}

\vspace*{-8 true cm}

\parbox{12 true cm}{\caption{ \label{fig:3-90-rfcut2plot1}
The plot of the data that is contained in the file 3-90-rfcut2.csv. The data points are marked as stars.  By tracing the red graph that connects consecutive data points, we can see the periodic motion of the hanging bob.}}

\end{figure}

Unfortunately, the student who conducted the experiment (not you, of course) forgot to note the spring constant \( k \) before putting away all of the equipment, tossing the spring into a box that contains several similar-looking springs.  Describe (in words) how you might approximate \( k \) using the data collected and the mathematical model:
%%
\[
  x(t) = A \cos \biggl( \sqrt{\frac{k}{m}} \bigl( t - \tau \bigr) \biggr).
\]

\bigskip\noindent
\rule{15cm}{.01 cm}

\noindent
\rule{15cm}{.01 cm}

\noindent
\rule{15cm}{.01 cm}

\bigskip\noindent
Now do it: Approximate \( k \), and then plot the solution from the mathematical model and compare it to a plot of the collected data.  Did your model do a good job of reproducing the data?  Define ``good'' here.  You will have to estimate \( \tau \).  To do this, you may plot your data, note when it becomes approximately periodic, and let \( \tau \) be a time at a peak of this periodic part.



\begin{thebibliography}{98}

\bibitem{hooke}%
  Wikipedia.  Hooke's Law \href{https://en.wikipedia.org/wiki/Hooke\%27s\_law}{https://en.wikipedia.org/wiki/Hooke\%27s\_law}.  

\end{thebibliography}


\teacher{
\section*{NOTES FOR TEACHERS}


This modeling scenario assumes that the students have been introduced to differential equations and have solved first-order equations, but that they may not have yet been introduced to second- or higher-order equations.  The activity provides an opportunity to build a mathematical model that leads to a simple second-order ordinary differential equation, namely, \( x'' + \omega^2 x = 0 \), where \( \omega = \sqrt{k / m} \); here, \( k \) is the spring constant and \( m \) is the mass of the hanging bob.

In this scenario, the spring constant \( k \) is unknown, and the students are led through approximating \( k \) using experimental data and the model---that is the culmination of the activity.  The students, after devising a strategy for approximating \( k \), may use a computer algebra system (like Mathematica or Maple or Sage) or numerical computation software (like Matlab or Octave) to carry out the calculations.  However, how the students actually approximate \( k \) is left somewhat open-ended.  We used the following method, ourselves, and you might go over something like this (or some other way that you prefer) after the students have approximated \( k \).


%%%%%%%%%%%
\subsection{Na\"{\i}ve Approach}

We first solve the model solution for \( k \):
%%
\[
  k = m \biggl[ \frac{\cos^{-1} (x / A)}{t - \tau} \biggr]^2 = 200 \biggl[ \frac{\cos^{-1} (x / A)}{t - \tau} \biggr]^2;
\]
%%
recall that \( m = 200 \) in the provided data, but it could be something else if you were to carry out the experiment yourself.  Our data is available in the accompanying file \texttt{rfcut2.csv}.

Looking at the data, we neglected the first few data points so that we could ``start'' with clean data at the maximum of a period.  We found this at 22.0 seconds, so we let time shift \( \tau = 22 \).  Thus, we used 340 data points from 22.0 seconds to 55.9 seconds at 0.1-second intervals in our calculations.  Denote the sequence of data points \( \{ (t_i, x_i) \}_{i = 1}^{340} \).  We found that \( \max \{ x_i \} = 0.1050 \) and \( \min \{ x_i \} = -0.1050 \).  We defined \( A = (\max \{ x_i \} - \min \{ x_i \}) / 2 \) and found that \( A = 0.0150 \).  Finally, we calculated \( k_i \) for each data point.

A na\"{\i}ve approach to finding \( k \), then, is to define
%%
\[
  k = {\rm mean} \{ k_i \},
\]
%%
where \( {\rm mean} \{ \,\cdot\, \} \) is the arithmetical mean.

But, watch out!  If the mean is found over \( i = 1 \) to \( i = 340 \), then it is way off.  This is because the \( k_i \) decrease as \( i \) increases, for \( t_i - \tau \) increases as \( t_i \) increases.  To get a meaningful \( k \) by averaging the \( k_i \), we need to limit \( t_i \) to an interval of length \( \pi \) because the domain of the arccosine function is \( [0, \pi] \).  Figure~\ref{fig:3-90-onespringdest} compares the graph of the collected data with the model using \( k = {\rm mean}\{ k_i \} = 6459.4 \).

\begin{figure}[ht]
\centering
  \includegraphics[width=13 true cm]{3-90-onespringdest.eps}

\vspace*{-9 true cm}
\parbox{13 true cm}{\caption{\label{fig:3-90-onespringdest}
Comparing the graph of the data with the graph of the model using \( k = {\rm mean} \{ k_i \} \).  In the top graph, we see that, while the model produces the right qualitative behavior, it does not quite match the data.  The bottom graph shows the difference between the data and the model.}
}  
\end{figure}


%%%%%%%%%%%
\subsection{Sophisticated Approach}

Defining \( k \) to be the mean of the \( k_i \) (restricted to a time interval of length \( \pi \)) results in a somewhat crude value of \( k \); nevertheless, it is a relatively simple calculation.  For a ``better'' value of \( k \), we may seek to minimize the error between the collected data and the model data.  To be specific, if the
%%
\[
  \text{collected data} = (t_i, x_i)  \quad\text{and}\quad
  \text{model data} = (t_i, x(t_i; k)),
\]
%%
where
%%
\[
  x(t) = A \cos \biggl( \sqrt{\frac{k}{m}} (t - \tau) \biggr),
\]
%%
let the sum of the squared errors be
%%
\[
  {\rm SSE}(k) = \sum_{i} (x(t_i; k) - x_i)^2.
\]
%%
Then, define the approximate spring constant to be
%%
\[
  \hat{k} = \min_k {\rm SSE}(k).
\]

%%
This would then be a first-semester calculus problem; however, we used Matlab to assist us in finding \( k \).  Of course, one may use another computer system, such as Mathematica or Maple, or even do this by hand.  Our Matlab code is available as file \texttt{3-90-runfitoneF.m}.  Figure~\ref{fig:3-90-onespringdfiddle} compares the graph of the collected data with the model using \( \hat{k} = \min_k {\rm SSE}(k) \).

\begin{figure}[ht]
\centering
\includegraphics[width=13 true cm]{3-90-onespringdfiddle.eps}

\vspace*{-12 true cm}
\parbox{13 true cm}{\caption{\label{fig:3-90-onespringdfiddle}
Comparing the graph of the data with the graph of the model using \( \hat{k} = \min_k {\rm SSE}(k) \).  In the top graph, we see that the model both produces the right qualitative behavior and it matches the data well.  The bottom graph shows the difference between the data and the model.  The apparent sinusoidal nature of the difference is curious.}
}
  
\end{figure}


\section*{EDITOR's NOTE}

We have added several files to this material:

\begin{enumerate}
\item \text{3-90-rfcut2EditorDataVersion.xls} contains the data found in the authors' file \text{3-90-rfcut2.cvs} with comments and shifts to make the data more friendly.
\item 3-90-T-Mma-OneMassSpring-TeacherVersion.nb and an accompanying .pdf version for those who do not read Mathematica files contains complete analyses and comments on the several approaches offered by the authors.
\end{enumerate}


All five authors were funded by SIMIODE to attend a developer workshop at Carroll College, Helena MT USA, during the summer of 2015.

\begin{thebibliography}{99}
\bibitem{hooke}%
  Wikipedia.  Hooke's Law \href{https://en.wikipedia.org/wiki/Hooke\%27s\_law}{https://en.wikipedia.org/wiki/Hooke\%27s\_law}.  


\end{thebibliography}
}





\end{document}
