% 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{url}
%\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 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\\PARAMETER ESTIMATION\\ THROUGH STEADY STATE}




\markboth{Parameter Estimation Through Steady State Data}{Parameter Estimation Through Steady State Data}






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

\makeStitlePDFLaTex




\begin{abstract}
We offer  the opportunity to estimate parameters in a second order, linear, constant coefficient, non-homogeneous,ordinary differential equations through analysis of of the steady state solution. This means by applying a driver of our chose we can collect data in terms of the unknown parameters and from this data we can estimate these parameters.
\end{abstract}


\section*{SCENARIO DESCRIPTION}



We attempt to estimate parameters for a spring-mass-dashpot model differential equation (\ref{eq:spd}) in which the mass is known ($m = 4$ kg) but the spring constant, $k$ N/m, and the resistance coefficient, $c$ N/(m/s), are unknown.    We will subject the device/system to a driver force we control and use the output steady state data to estimate parameters $c$ and $k$.  This is a form of input output analysis in which we input a driver, analyze the output, and tell something about the device or model.


\begin{equation}\label{eq:spd}
4\cdot  y''(t) + c\cdot y'(t) + k\cdot  y(t) = f(t)\, , \quad y(0)= 0 {\quad} {\rm and} \quad y'(0) = 0
\end{equation}


You will do this with the following process. Apply  a driver, say $f(t) = \sin(2t)$ and collect data on the steady state output of our system. See Table~\ref{table:SSdata}. From these observations in the steady state time period  recover $c$ and $k$.



We render plots of  data taken from a system with unknown $c$ and $k$ and known $m = 4$ that is driven by $f(t) = \sin(2t)$ with initial conditions $y'(0) = 0$ and $y(0) = 0$ in Figure~\ref{fig:4-35-Para1} and Figure~\ref{fig:4-35-Para2}. In Figure~\ref{fig:4-35-Para2} we see the oscillating motion of the steady state more clearly than in Figure~\ref{fig:4-35-Para1}.

In Table~\ref{table:SSdata} we offer the  data. In whatever software you use you should plot this data set to see that you get a reasonable plot of the steady state phenomena. 

\begin{table}[h]
\begin{center}
\small
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline
$t$ s &20.0 &20.5 &21.0 &21.5 &22.0 &22.5 &23.0 &23.5 &24.0 &24.5 &25.0\\ \hline 
 $y(t)$ m &0.006 &0.038 &0.036 &0.001 &-0.033&-0.037&-0.006&0.031 &0.040 &0.013&-0.026\\ \hline \hline
 $t$ s&25.5 &26.0 &26.5 &27.0 &27.5 &28.0 &28.5 &29.0 &29.5&30.0 & \\ \hline 
 $y(t)$ m &-0.040&-0.017&0.022 &0.041 &0.023 &-0.016&-0.040&-0.027&0.011 &0.039&\\ \hline \hline
\end{tabular} 

\normalsize
\parbox{12.6 true cm}{\caption{\label{table:SSdata} Steady state data from a  a system with unknown $c$ and $k$ and known $m = 4$ that is driven by $f(t) = \sin(2t)$ with initial conditions $y'(0) = 0$ and $y(0) = 0$.}}
\end{center}
\end{table}

\begin{figure}[h]
\begin{center}

\begin{minipage}[t]{7 true cm}
\begin{center}\includegraphics[width=6.6cm]{4-35-Para1.eps}\end{center}
\parbox{6.6 true cm}{\caption{\label{fig:4-35-Para1} Plot of steady state data over entire time domain.}}
\end{minipage}
\ \hspace*{.5 true cm} \ 
\begin{minipage}[t]{7 true cm}

\begin{center}\includegraphics[width=6.6cm]{4-35-Para2.eps}\end{center}
\parbox{6.6 true cm}{\caption{\label{fig:4-35-Para2} Plot of steady state data well into the steady state time frame.}}
\end{minipage}

\vspace*{-.3 true cm}
\end{center}
\end{figure}







\begin{itemize}
\item [a)] Consider the steady state or nonhomogeneous solution, which must be of the form, $ys(t) = A \sin(2t) + B \cos(2t)$ for our driver is $\sin(2t)$.
\item [b)] Put $ys(t)$ into (\ref{eq:spd}) and collect like terms, i.e. all the $\sin(2t)$ and $\cos(2t)$ terms on the left hand side of the resulting equation.
\item [c)] Equate the coefficients from $\sin(2t)$ and $\cos(2t)$ on both sides of our equation. You should get the following:
\begin{eqnarray}\nonumber\label{eq:equate}
2 A c + B k - 16 B &=& 0\\ 
-2B c + A k - 16 A &=&  1
\end{eqnarray}
\item [d)] Solve (\ref{eq:equate}) for $A$ and $B$. Call your solutions for $A$ and $B$, $As$ and $Bs$ respectively. These will be fractions in terms of $c$ and $k$.
\item [e)] Replace $A$ and $B$  in $ys(t) = A \sin(2t) + B \cos(2t)$  with $As$ and $Bs$ into respectively and obtain a steady state solution in terms of  $c$ and $k$. Call this solution $yss(t)$. It will have $t$, $c$, and $k$,   as variables.
\item [f)] Form the sum of square errors function, $SS(c,k)$, as offered in (\ref{eq:SSE}), between the model prediction at each data point and the observed data,
\begin{equation}\label{eq:SSE}
SS(c,k) = \sum_{i=1}^n(ys(t_i) - \hat{y}_i)^2\, , 
\end{equation}
where $t_i$ is the time of the $i^{\rm th}$ observation, $ys(t_i)$ is the value of our steady state solution at time $t_i$, and $\hat{y}_i)$ is the observed dependent variable $y$ for the $i^{\rm th}$ observation.
\vspace*{.2 true cm}
\noindent Figure~\ref{fig:4-35-ParamContourPlot} shows a contour plot of the sum of square errors function in which you can see the region to best hunt for candidates for $c$ and $k$ which will produce a minimum $SS(c,k)$.

\begin{figure}[!h]
\begin{center}
\includegraphics[width=9.6cm]{4-35-ParamContourPlot.eps}


\vspace*{-.1 true cm}
\parbox{12.2 true cm}{\caption{\label{fig:4-35-ParamContourPlot} Contour plot of the sum of squares function $SS(c,k)$ in which showing the region to best hunt for candidates for $c$ and $k$ which will produce a minimum  $SS(c,k)$. }}
\end{center}
\vspace*{-.3 true cm}
\end{figure}

\item [g)] Find the minimum  value of $SS(c,k)$   using reasonable guesses for $c$ and $k$ for initial estimates of $c$ and $k$, based on the contour plot in Figure~\ref{fig:4-35-ParamContourPlot}.
\item [h)] Take your parameter values from (g), call them, $c_{\rm best}$ and  $k_{\rm best}$ and place them in differential (\ref{eq:spd}) to form differential (\ref{eq:opt}):

\vspace*{-.3 true cm}
\begin{equation}\label{eq:opt}
4\cdot  y''(t) + c_{\rm best}\cdot y'(t) + k_{\rm best}\cdot  y(t) = f(t)\, , \quad y(0)= 0 {\quad} {\rm and} \quad y'(0) = 0
\end{equation}
\item [i)] Solve differential Equation~(\ref{eq:opt}) and plot your solution over the data plot you rendered above. Comments are in order. 
\end{itemize}


\teacher{
\section*{NOTES FOR TEACHERS}

We offer a Mathematics notebook 4-035-T-Mma-ParEstSteadyState-TeacherVersion.nb and an accompanying pdf version for those who do not read Mathematica files in which we walk through this analysis.

For students in a differential equations course this shows them how engineers test the nature of a device by inputting information, in this case the driver, and analyzing the output data in order to see what the device really is and estimate the parameters in the device. We have seen students' eyes light up when they see how they can control a differential equation and get information out of data to estimate parameters. This is a very nice example of using sum of square errors and of recognizing that you can get information about a system from steady state data lone using a driver of one's choice. 

A slightly different take on this appears in \cite{GrahamLerch2007}.




\begin{thebibliography}{99}


\bibitem{GrahamLerch2007} Graham, J. and M. Lerch. 2007. Parameter Recovery for a Differential Equation Model. {\it PRIMUS\/}. 17(2): 148-156.


\end{thebibliography}
}





\end{document}




