% SIMIODESample.tex and simiode.cls for LaTeX2e
% Version 11 March 2013.
% 
% 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 the  suggestions of the 
% PRIMUS Editorial Board, especially John Thoo, and is much appreciated.
%
% This template "SIMIODEPaper.tex" is to be used with the 
% class file "simiode.cls".  You may rename the template.  
% The latest version of this class and template files 
% can be found at
% 
%                <http://www.SIMIODE.org> .
%
% For an explanation of using the class file "simiode.cls", 
% see the pdf ``Description and Illustration of Use: 
% A LaTeX Class File for SIMIODE'' found at  
% 
%                <http://www.SIMIODE.org> . 
%
% A "Quick Start Guide" appears below.
%
% For information on using TeX or LaTeX, go to %                 <http://www.tug.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 file must be processed with version LaTeX2e or higher.
%
\documentclass{simiode}

\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.


\newcommand{\AmSLaTeX}{$\cal A$\kern-.1667em\lower.5ex\hbox{$\cal
M$}\kern-.125em $\cal S$-\LaTeX}
\newcommand{\BibTeX}{{\sc Bib}\TeX}
\newcommand{\scls}{{\tt simiode.cls}}
\newcommand{\stemp}{{\tt SIMIODEPaper.tex}}
\newcommand{\SI}{SIMIODE}

\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Top matter is above and 
% the beginning of the document below.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\newpage
\title{TEACHER VERSION\\GUITAR TUNING}



\markboth{Guitar Tuning}{Guitar Tuning}






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


\begin{abstract}
We lead students through a derivation of  a partial differential equation which models the motion of a string held at both ends, a case of the one-dimensional wave equation. We immediately offer  numerical solutions in a computer algebra system (we use Mathematica, but any computer algebra system should do) to get feedback on the reasonableness of our model.  Applying data on a guitar string we then give  students a chance to tune the guitar string to a given frequency and compare the sound of their tuned guitar string to that of a frequency generator using both auditory and visual feedback. We use Mathematica's {\tt Play} command but the tuning can be graphically done, matching the frequency plots over small intervals of time $[0,3/440]$ seconds, say. We do not analytically solve this wave equation here, rather we build meaning and support to what the equation is and can do. At another time we solve the wave equation analytically. There too we do sound and an immediate application. Finally, we acknowledge the ideal nature of this first wave equation model and suggest some damping, again with numerical validation using  sound and graphic output.
\end{abstract}



\section*{SCENARIO DESCRIPTION}

\subsection*{A few words about tuning musical instruments}

How does an acoustic guitar make sound?  The guitarist plucks or strums the strings, giving each string a displacement from its initial at rest or equilibrium position and the tension in the string causes the string to seek to regain its equilibrium position. The string does not just settle to rest; rather it overshoots the at rest position, then comes back and overshoots again (albeit, realistically, with a bit less amplitude, as it is losing energy), and then overshoots again, and so forth until it settles into quiet. 

Of course, in music, especially Rock'n'Roll or Andre Segovia's renditions of Bach, the guitarists are rapidly on to many other string pluckings and other notes. However, if we were to just listen to one string plucking we would hear a pure sound of one frequency which could be identified. The guitarist could adjust the frequency by increasing or decreasing the tension on the string. This is done by tightening the tuner for that string which is on the head stock at the end of the neck of the guitar. Turning the tuner one way tightens the string and increases the tension (thus increasing the frequency) while turning it the other way decreases the tension (thus decreasing the frequency). This is the way all string instruments (violin, cello, bass violin, guitar, mandolin, banjo, etc.) are tuned. 

Quite often the instrumentalist plucks a string and  tunes ``on the fly,'' i.e.  tightens the tuner as the string is vibrating and listens as the pitch of the sound changes to the desired one for that string. Most good musicians can do this in isolation (even while the band plays on) so they tune each string on their instrument in a manner which makes them all compatible for the instrument and for the musical ensemble in which they play. 

In a symphony orchestra often the musicians  common tune their instrument to a note struck by the concert master on a well-tuned piano if one is available, as when a piano piece is used in the concert. Otherwise, the concert master calls on the oboist to play a given note to which they will audibly tune, as the oboe has the sharpest or most piercing sound and is hence most easily heard and the oboe holds its tuning nicely for all to hear.  Some musicians use a small tuning device which they place near their ear as they pluck a string so they can recall  the frequency to which they tune. Others have perfect pitch.
 
\subsection*{Modeling the motion of a string of a musical instrument}

We begin our inquiry and discovery of a mathematical model for vibration of a taut  string, held at two ends, and plucked. Think about what you expect to happen after we lift the string, say in the center, and release it. One view is that it just snaps back to its straight line, taut position - its at rest position. Another view is that it snaps beyond that straight line  position, then snaps back from that new extended position, through the straight line position, and again snaps back, doing this until - until what? Well, if it is some kind of ideal string, i.e.  not subject to certain natural forces such as friction caution loss of energy, it just might bounce back and forth, or vibrate, forever. However, we know from   experience that it does not vibrate forever. We also know that it does vibrate, for it disturbs the air around it, which in turn disturbs our ear drums, which disturbs the cilia in our inner ear, and causes us to experience sound. Then it stops.

So we pluck the string (i.e. pull it and release it), it vibrates, and it comes to rest. How does this happen?  Could we build a mathematical model to explain this and use the model to predict a string's behavior?

We will attempt to build a model of an ideal string, i.e.  one which vibrates forever, as damping is a more complex phenomenon to model and the notion of frequency of a vibrating string is the same in either damped or undamped vibration. Upon successfully building a model of an ideal string we shall then incorporate damping.

Let us consider a taut string of length $L$  centimeters lying on the $x$-axis of a two dimensional coordinate system. Denote by $x$, the distance in centimeters along the string from one end, where $x = 0$ to the other end where $x = L$. We will denote  the displacement of the string at distance $x$ along the length of the string and time $t$ in seconds from its at rest equilibrium, i.e. from the straight line connecting both ends,  as $u(x,t)$.  There is some tension in the string. Thus it does not noticeably droop. Of course, there is the force of gravity acting on all parts of the string, but in view of the tension forces the gravitational force will be presumed to be negligible. 

We assume the string is clamped or tied down  at each end, i.e. $u(0,t) = u(L,t) = 0$ for $t \geq 0$. These are called  {\it boundary conditions\/}. Now somehow we have to denote the fact that the string is plucked, i.e. originally displaced as described by $u(x,0) = f(x) \neq 0$, otherwise $u(x,t) = 0$ for $0 \leq x \leq  L$ and $t \geq 0$ and nothing happens; no motion in the string  and thus no sound.

We have got to start thinking of the motion of the string, not just a description of where each piece is at any moment. So reflect on this statement.

\begin{quote}Assumption:  The motion of the string is transversal, i.e. each point on the string keeps a constant $x$ coordinate and the only motion of each point on the string is vertical or perpendicular to the line of the string and  the motion always stays in one plane.
\end{quote}
\begin{itemize}\item [1)] Explain the reasonableness and advantages  of this assumption  as we begin to build a model. It will be good to come back to this assumption as we begin to develop our model for the motion of the string.
\end{itemize}  
 
Now let us consider the forces acting on the   string, in particular in a small region of the string over the interval $[x, x + \Delta x]$.

Since we know that the string  vibrates up and down a small amount and from our assumption we have no motion horizontally along the $x$ axis, we can assume any horizontal tension or other horizontal forces in the string at any point along  the string cancel out and we need to find our model by looking at vertical forces only.  
    

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


\includegraphics[width=15cm]{9-12-PieceString.eps}


\parbox{9.1 true cm}{\caption{\label{fig:9-12-PieceString} Tension diagram for small piece of string, identifying the main forces - tangential and vertical, acting on the string. A convention to use is $u(x,t)>0$ is up and $u_t(x,t)>0$ is upward.}}
\end{center}

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

Consider the situation depicted in Figure \ref{fig:9-12-PieceString}   in which we represent the tension forces $T(x,t)$ and $T(x+ \Delta x,t)$ acting tangentially on both ends of a small piece of our string from $x$ to $x + \Delta x$. Note that technically $T(x,t)$ is a vector. However, in Figure \ref{fig:9-12-PieceString} we depict the direction of the vector and use $T(x,t)$ to denote the amplitude only.  Recall that 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. We  apply this Law  to the vertical motion of the string. These vertical forces are depicted at each end of the small piece of string shown in Figure  \ref{fig:9-12-PieceString}.
\begin{itemize}
 \item [2)] From the diagram in Figure \ref{fig:9-12-PieceString} and considering one other force acting (Hint:  call it $F_g$.) in the vertical direction determine the sum of the forces acting on a small element of mass of the wire of length $\Delta x$. It is reasonable to assume a constant cross sectional area $A$ and constant density $\rho$. 
 \item  [3)] Apply Newton's Second Law of Motion to this little element of mass of string producing an expression for  $\rho A u_{tt}$. Hint:  Apply the Law only to the vertical forces. 
 \item [4)] Explain why we can reasonably ignore the force $F_g$, due to gravity acting on the little piece of mass of the string. Hint:  think of the force of tension in the string to make it usable in a musical instrument compared to the force in  $F_g$.
\item [5)] Here are some reasonable mathematical and physical facts. Explain what is reasonable about them and be prepared to use them in activity (6) below.
\begin{itemize}
\item [i)]  For very small $\theta$ in our diagram, slope = $\tan(\theta) \approx \theta \approx \sin(\theta)$.
\item [ii)] $\lim_{\Delta x \to 0}\frac{h(x + \Delta x) - h(x))}{\Delta x} = h'(x)$ for differentiable functions $h(x)$.
\item [ii)] The magnitude of the tension $T$ in the string is the same value everywhere in the string.
\end{itemize} 
\item [6)] Use (i) and (ii) to reduce your expression for  $\rho A u_{tt}$ found in activity (3) above to an expression involving $u_{xx}$ and a constant.
\end{itemize} 

What you have just produced is called the {\it wave equation in one dimension\/} and  represents a governing partial differential equation for modeling the motion of a clamped string as it vibrates, hence the name wave.


\subsection*{Plausibility    for the wave equation -- a reward for hard work}

We quote \cite[p. 531]{Farlow1994} a nice plausibility defense of the wave equation,

\begin{equation}\label{eq:Farlow1994}
u_{tt} = c^2 u_{xx} \, , \,\, {\rm where} \,\,\, c = \sqrt{\displaystyle{\frac{T}{\rho A}}}\, .
\end{equation}
\begin{quote}
The partial differential equation (\ref{eq:Farlow1994}) expresses mathematically the physical fact that (at any point $x$ and any time $t$) the  {\it vertical acceleration $u_{tt}$\/} of the string is proportional to the {\it concavity $u_{xx}$\/} of the shape of the string. This statement is plausible if we recall that the second derivative $u_{xx}$ can be approximated by the symmetric difference of the symmetric difference approximation of the first derivative.

\vspace*{-.3 true cm}
\begin{eqnarray}\label{eq: }\nonumber
u_{xx} &\approx&   \frac{\frac{u(x+h,t) - u(x,t)}{h} -  \frac{u(x,t) - u(x-h,t)}{h} }{h} \\ \nonumber
 &=& \frac{u(x+  h,t) - 2 u(x,t) + u(x-h,t)}{h^2}\\
  &=& \frac{2}{h^2}\left( \frac{u(x+ h,t) + u(x-h,t)}{2} - u(x,t)\right)\, .
\end{eqnarray}

This says  $u_{xx}(x,t)$ is proportional to the {\it difference\/} between the{\it average\/} of $u$ at the neighboring points $x+h$ and $x-h$ and  the height of the string $u(x,t)$. So if the height of the string is {\it less\/} than the average height at two neighboring points, then $u_{xx} > 0$, and hence $u_{tt} = c^2 u_{xx}$ implies that the acceleration, $u_{tt}$ of the string is {\it upward\/}. Since the acceleration is proportional to force, the force on the string is also upward. Similarly, if the height of the string is {\it greater\/} than the average height at two neighboring points, then $u_{xx} < 0$, and hence $u_{tt} = c^2 u_{xx}$ implies that the acceleration $u_{tt}$ of the string is downward.\cite[p. 531]{Farlow1994}
 \end{quote}

\subsection*{Some numerical work leading to tuning a steel string using  the wave equation}

Suppose we have a steel string from a guitar and it has mass density $\rho = 7.58$ g/cm$^3$ and a cross sectional area of $A = \pi (0.029)^2 = 0.00264208$ cm$^2$ (i.e. of radius 0.029 cm.)

We would like to tune a $L = 10$ cm long steel  string so that it vibrates at a rate of 440 cycles per second, i.e. has a frequency of 440 Hz (for Herz). 
\begin{itemize}
\item [7)] Use the above parameters with $T = 1,575,000$ dynes of tension on the string, along with initial condition $u(x,0) = \sin\left(\frac{\pi x}{L}\right)$ and boundary conditions $u(0,t) =  u(L,t) = 0$ for $t \geq 0$. Find a numerical partial differential equation solving routine, e.g., in Mathematica it is {\tt NDSolve}, and solve your wave equation for the time interval $t \in [0,1]$ seconds. Incidentally, dynes is not a unit of force we often deal with, but it is perfectly legitimate and the units make sense in this application, for one is the force required to impart an acceleration of one centimeter per second per second to a mass of one gram, whereas a Newton (a more familiar unit) is the force required to impart an acceleration of one meter per second per second to a mass of one kilogram. Of course, the initial condition offered here is but one of many one could use for  the pulling of a string through a pluck might well offer an initial shape like a triangle with the greatest displacement at the point of contact for plucking. We shall address such a condition later, in other scenarios.  
\item [8)] Plot the 440 Hz signal $p(t) = \sin(2 \pi 440 t)$ over a very small time interval, say $[0,3/440]$ seconds and compare the plot of the amplitude of the string at the mid point, i.e.  plot of $u(L/2,t)$ in the same interval $[0, 3/440]$ seconds, i.e 3 cycles. What can you say about your wave solution in this case compared to the 440 Hz signal?
\item [9)] Now, tune the string by changing the tension until the resulting plots of $u(L/2,t)$  and $p(t) = \sin(2 \pi 440 t)$ in the same interval $[0, 3/440]$ seconds look very close, perhaps identical, at least with respect to frequency.
\item [10)] If your software permits playing the sound of functions, as Mathematica does with the {\tt Play} command,  then play both  the resulting $u(L/2,t)$  and $p(t) = \sin(2 \pi 440 t)$ in the same interval $[0, 1.0]$ seconds by adding them and {\tt Play}ing the resultant signal.  If you are in tune then the signal will be clear and at 440 Hz. If you are slightly out of tune you may here beats, i.e. when two signals whose frequencies are close to each other are played together or added there is a vibrato or wavering sound visually depicted by a slower frequency envelope bounding a high frequency signal. Perhaps you can now refine your tuning in light of your plots or sounds. 
\item [11)] Now tune your string to 880 Hz, exactly one octave above the 440 Hz signal discussed in activities (9) - (11). Plot (and play,  if possible) your solved tuned wave equation for 880 Hz over the same time interval, $[0,3/440]$ seconds and if you have sound play both the solved tuned wave equations for 440 Hz and 880 Hz. You should hear what an octave sounds like.
\end{itemize}

You might seek to explore just what tension values $T$ give what frequencies to this string, e.g., if we double the desired frequency (going up by octaves) in our tuning what will the necessary values of $T$ be?  Similarly, if we go down by octaves, by halving the desired frequency?

Incidentally, in playing a guitar the instrumentalist changes the frequency of a given string by holding the string against the fret, effectively changing the length of the string for the same fixed tension. Explore how changing the length alters the frequency.  How could you change the length of a perfectly tuned string of length 10 cm which produced 440 Hz frequency to, say, 880 Hz frequency?

\section*{Moving from ideal string to more realistic string}

The solution to the wave equation (\ref{eq:Farlow1994}) will oscillate forever, indeed, it has no damping force included in the model we built. We know this does not happen, for after we play a guitar string we hear it and then it is quiet - the vibration apparently stops.  When a guitar string vibrates, it expands and shrinks. During this process energy is being lost as heat.  Also, as the string  moves while being held down at each end there is a loss of energy.  

\begin{itemize}
\item [12)] In an early form (\ref{eq:Farlow1994}) looks like this:
\begin{equation}\label{eq:OldFarlow1994}
\rho A u_{tt} = T u_{xx} \, .
\end{equation} 

Recall the left hand side, $\rho A u_{tt}$, of (\ref{eq:OldFarlow1994}) is the mass times acceleration of a small piece of our string and from Newton's Second Law of motion $\rho A u_{tt}$ is equal to  the sum of the forces acting on a body. In addition to the restoration force, $T u_{xx}$ consider  terms which we could use to model decay, to effect resistance to motion in our string as it oscillates back and forth:
\begin{itemize}
  \item [i)] $-c u_t(x,t)$ with $c>0$, or
  \item [ii)] $-c u_t(x,t)^2$ with $c>0$. \end{itemize}

Defend  (i) and (ii) and the sign conventions established
\item [13)] Use the tension, $T$ dynes, which   gave you a frequency of   440 Hz in the undamped case, but now incorporate (i) into  (\ref{eq:OldFarlow1994}) using $c =2$  and describe the resulting sound of the guitar string in terms of shape, duration, frequency, etc.
\item [14)] Estimate and confirm a value of $c$ so that the amplitude of the damped oscillation is about 1\% of its original amplitude at time $t=4$ second, i.e. the sound of the guitar string wave is just about zero after 4 seconds, but not before. A plucked guitar string can still be heard at 3-4 seconds from the plucking.
\end{itemize}



\teacher{
\section*{NOTES FOR TEACHERS}
 
We are attempting to get students to build the model for a vibrating string from elementary arguments and accounting of forces acting on the string.  There are many variations and narratives of this derivation, indeed, almost all texts, e.g., \cite[pp. 632-635]{Trench2000}, \cite[pp. 114-116]{Haberman1987}, and \cite[pp. 652-654]{GiordanoWeir1988} which address the wave equation feel some compulsion to explain where it comes from, for it is not a difficult argument, and it sets the equation in some reality. We also  give a very nice plausibility argument from \cite[p. 531]{Farlow1994} for the wave equation.

We devoted 2-3 classes to this activity and assign problems and write-up of activities (1) - (14) or some subset thereof over a week's period of time.

With just  a Free Body Diagram and application of Newton's Second Law of Motion students can build a model of motion of each point on a vibrating string. In small groups or as a class students can create and apply or just use, if the instructor offers it up, the diagram in Figure \ref{fig:9-12-PieceString}. We suggest first an ideal string in which no decay occurs, but with some acknowledgment that before we see a solution we should expect it to go forever. Once students have played with and tuned their guitar string model then it is appropriate to put damping  into the model and see the guitar signal dampen out in a reasonable amount of time.

We have found it very exciting for students to actually hear the wave equation model of a guitar string play out in solution and to change the tension on a steel string to change the pitch of the string, indeed, to tune it.  The room is rather chaotic as  students are trying to tune their string and volume levels could run high. So giving some guidance about respecting noise level so all can tune properly is in order.

We stress the fact that we have not analytically solved the wave equation here - we do that elsewhere - but rather have built a model, solved it in a computer algebra system's numerical packages and then played with our solution, changing the tension parameter in order to tune the string. 

Of course, we could change other parameters, e.g., make the string longer or shorter (change $L$) or its cross sectional area $A$ or its mass density $\rho$, but we usually save that until we have an analytic solution in which we can see the roll of each of these physical parameters at work in our closed form solution.

We offer a Mathematica notebook (9-012-T-Mma-PDEGuitarTuning-TeacherVersion.nb and .pdf) with full comments on the analysis so readers can reproduce the flow in any computer algebra system which offers numerical solutions to partial differential equations, plotting, animation plotting, and, if possible, sound reproduction. In this Mathematica notebook we hint at the analytic solution (summarizing details) in order to get the frequencies for the modes from which we can determine the relationship between frequency and tension in our string.  We do not actually build a fully analytic solution here except to hint at it to get to eigenvalues and hence information which gives the relationship between frequency and tension, rather we save that for a text narrative approach.  This then permits us to select the tension in our equation on the wave in order to produce a specific frequency for our string, i.e. tune our string! We do so in several situations and visualize and play the resulting sounds of a 440 Hz signal and an octave higher at 880 Hz signal. Further, we do address the issues of damping in this file. Any user can play with the material in this file to produce other configurations using string density, cross sectional area, or length, as well as tension and frequency.
}

\begin{thebibliography}{99}
\bibitem{Farlow1994} Farlow, S. J. 1994. {\it An Introduction to Differential Equations and Their Applications\/}.  New York: McGraw-Hill, Inc.

\bibitem{GiordanoWeir1988} Giordano, F. R. and M. D. Weir. 1988. {\it Differential Equations:  A Modeling Approach\/}.  Reading MA:  Addison-Wesley Publishing Company.

\bibitem{Haberman1987} Haberman, R. 1987. {\it Elementary Applied Partial Differential Equations with Fourier Series and Boundary Value Problems, Second Edition\/}.  Englewood Cliffs NJ:  Prentice-Hall, Inc.

\bibitem{Trench2000} Trench, W. F. 2000. {\it Elementary Differential Equations with Boundary Value Problems\/}.   Independence KY: Brooks/Cole Thomson Learning. Available at \href{http://ramanujan.math.trinity.edu/wtrench/texts/index.shtml}{http://ramanujan.math.trinity.edu/wtrench/texts/index.shtml}. Accessed  09 October 2013.
\end{thebibliography}






\end{document}

