\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{framed}
\usepackage[margin=1in]{geometry}
\usepackage{enumerate}
\usepackage{fancyhdr,lastpage}
\usepackage{cclicenses}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{fancy}
\setlength{\parindent}{0pt}

\pdfinfo{
   /Author (CU-Boulder PER: Marcos D Caballero Steven J Pollock)
   /Title  (Computational Modeling Questions)
   /CreationDate (27 February 2012)
   /Subject (Computational Modeling)
   /Keywords (homework;classical mechanics; physics;computation;modeling)
}

\lhead{Computational Modeling Questions for Sophomore-Level Mechanics}
%\rhead{Version 2.2}
\lfoot{\cc University of Colorado {\bf Boulder}, PER@C}
\cfoot{}
\rfoot{{\bf Page \thepage \hspace*{0.4em}of \pageref{LastPage}}}

\newcommand{\week}[1]{\Large \textcolor{blue}{Week #1}\normalsize \\}

\begin{document}

\week{1}

Obtain a computational tool and start using it:\\

Please install Mathematica 8.0  on your computer, or find a computer that you can regularly use that has it installed already (e.g. in the computer room). Other software, e.g. Python with Numpy, is also OK, but Mathematica is what physics faculty in future courses will probably assume you have some familiarity with.  \\

As a registered CU student, you can obtain a (free) student license for Mathematica: 
\url{http://oit.colorado.edu/software-hardware/site-licenses/mathematica}.
Students interested in using Python can download the Enthought Python Distribution for free:
 \url{http://www.enthought.com/products/edudownload.php}.
%Students interested in using MATLAB can obtain it from the CU bookstore:
% \url{http://www.cubookstore.com/}
{\it All future problem sets will require some use of a computational tool.}
If you have never used Mathematica before, you might want to watch a couple of short (5-6 minute) screencasts developed for this class:\\
\url{http://www.youtube.com/compphysatcu} 

{\it Getting help:} Mathematica users may contact either Prof. Pollock or Dr. Caballero for assistance.
Python users may Dr. Caballero for assistance.

\begin{enumerate}[(a)]
\item Once you download the computational tool of your choice, try using it as a calculator. Search online or use built-in help for a few of your computational tool's built-in functions. Perform some simple operations using these built-in functions. Print out your code and include this print-out as part of your homework set.
\end{enumerate}

\week{2}

A soccer player kicks the ball  with a velocity $v_0$ at an  angle $45^{\circ}$ (to reach maximum range). She wants to kick it in such a way that it  barely passes  on top of two opposite team players of height $h$.

\begin{enumerate}[(a)]
 \item Show that if the separation between the two opponents is $d\leq\frac{v_0}{g}\sqrt{v_0^2-? gh}$, the soccer player succeeds.  (What is the numerical value of the ? in this formula?) 
 \item Use a computational tool of your choice (Mathematica or Python) to plot $d$ as a function of $v_0$,  setting $h=2.0\  m$. To do this, write the equation as a function rather than ``hard-coding'' the equation into the plot function.\\Additional help on writing functions in Mathematica is available here: \url{http://youtu.be/1A4f91yMVhA}
  
 %{\it Hint: If you want to plot a function $f[x]$ vs $x$ with $x_0<x<x_1$ with Mathematica you can use the instruction ${\rm Plot}[f[x],\{x,x_0,x_1\}]$. Sqrt[] is the syntax for square roots. Note  that Mathematica can't plot a function with symbolic coefficients (so you have to plug in the values for both  $g$ and $h$) Important: when you type a command into Mathematica, you must hit Shift-return, rather than just return, to have it evaluate what you typed!!}.

     \item Give a physical explanation of any major features in your plot.
     \item What are some benefits of writing functions to plot over ``hard-coding'' plots?
 \end{enumerate}
 

 
Trajectory of a particle. A particle  moves in a two-dimensional orbit defined by

\begin{eqnarray}
x(t)=\rho_0[1  + \cos (\omega t)]\\
y(t)=\rho_0[2 + \sin(\omega t)]
\end{eqnarray}

\begin{enumerate}[(a)]

\item Sketch the trajectory.  Find the velocity and acceleration (as vectors, and also their magnitudes),  and draw the corresponding velocity  and acceleration vectors along various points of your trajectory.  Discuss the results physically - can you relate your finding to what you know from previous courses? Finally: what would you have to change if you want the motion to go the other way around?
\item Plot the trajectory using your favorite computational tool. For this plot, set $\rho_0 = 1$ and $\omega = 2 \pi$. This is a called a ``parametric plot''.
\item Prove (in general, not just for the above situation) that if velocity, $\vec{v}(t)$, of any particle has constant magnitude, then its  acceleration is  orthogonal to $\vec{v}(t)$. Is this  result valid/relevant for the trajectory discussed in part a? 
     
     {\it Hint  There's a nice trick here -  consider the time derivative of $|\vec{v}(t)|^2 = \vec{v}\cdot\vec{v}$}. 
        \end{enumerate}
     {\it Note: What you have proven in part c is quite general, and very useful. It explains why, e.g., $d\vec{\hat r}/dt$ must point in the $\vec{\hat \phi}$ direction in polar coordinates. Do you see why?\\}         

\week{3}

In Season 1 Episode 4 of Mythbusters (originally aired in 2003), Jamie and Adam considered the myth that a penny dropped from the Empire State building can kill a person walking on the sidewalk below. You can watch a clip from this episode here: \url{http://youtu.be/PHxvMLoKRWg}.  Let's do our own investigation! 

\begin{enumerate}[(a)]
\item Look up the size and mass of a penny.  Using the drag coefficients given by Taylor pp 44-45, which means we are assuming a spherical penny $\ddot\smile$, find the terminal speed of a dropped penny, taking into account both linear and quadratic terms together. Then, write down the differential equation for the motion of a falling penny (Keep both linear and quadratic terms. Clearly articulate your sign conventions) 

\item For what range of speeds will (i) the linear term of air resistance dominate
 over the quadratic term? (ii) the quadratic term dominate over the linear?  Discuss the relative importance of linear and quadratic drag here  - if you had to pick just ONE term (linear or quadratic), which would you use, and why? 

\item If we keep both linear and quadratic terms, we have a non-linear differential equation which we can only solve numerically.  Use your favorite numerical differential equation solver to determine and plot velocity and position of the penny as a function of time, as it falls from the top of the Empire State building (381 m).  Also find the time it hits the ground, and the speed with which it hits.  Include your code and  plots with your homework.\\
Mathematica users might find this screencast on using {\tt NDSolve} (Mathematica's built-in numerical differential equations solver) helpful:
\url{http://youtu.be/zKO6v0w0KdI}\\
{\it {\bf Be Elegant:} You could use Mathematica's {\tt EventLocator} method to stop the integration when the penny hits the ground. Helpful link for that:} \url{http://goo.gl/Mkz3i}

\item Compare the  result for ``final velocity" from your numerical results (part c) with what you got  in part a, and also what you get by assuming JUST the one dominant drag term you chose in part b. Comment. 


 \item  Now for the interesting part - could this penny kill someone? Use basic freshman physics and make crude (but quantitative) estimates to discuss whether you think the myth is busted or not!  {\it (I can think of many physics approaches to evaluate what might injure you  - think about it a bit! Just e.g., you might assume a head applies a constant force to stop the penny during impact. If so, we've got about 1mm of tissue to stop a penny before it drives into the skull. Or, how about this -  ``Wikipedia: hydrostatic shock" says a skull pressure of  $10^7 N/m^2$ can seriously injure you. Could that be useful?) } 
 
 
\end{enumerate}[(a)]

Consider a ball  thrown at an angle $\theta$  above the horizontal ground with an initial speed $v_0$ in a medium with linear drag.  For numerical solutions, computational tools don't deal well with unknown symbols (!), so let's consider a particular case where $v_0=v_{ter}$ and $v_{ter}^2/g=1$. We know that in vacuum the maximum range is at $\theta =\pi/4$.
Let's try to estimate the maximum range (and angle) when we include air resistance:

\begin{enumerate}
\item Plot Eq.(2.37) in Taylor for different values of $\theta$ and try by inspection to figure out the angle at which the range is maximum.  (With the assumptions above, most unit-full quantities become ``one'', but do be careful of the fact that e.g. $v_{0,x}$ is $v_0\cos(\theta)$, not $v_0$), etc. Briefly comment on real-world implications!
\item Use a root finder to find the range when $\theta=\pi/4$. Any root finder will require you to make a guess for the root. This is what is called the ``neighborhood of the root'' or ``bracketing the root''. A screencast showing how to use Mathematica to find roots is available here: \url{http://youtu.be/673IQ6Z-6Yc}
\item Repeat for different values of $\theta$ (homing in on a small range near the angle you estimated in part a). Continue until you know the maximum range and the corresponding angle  to two significant figures. Connect to point a) and compare with the ideal vacuum values.  Briefly, discuss.
    
    
     {\bf Extra credit}  Check what happens in the limit $v_0\gg v_{ter}$ (say $v_0=100 v_{ter}$) and $v_0\ll v_{ter}$ (say $v_0=0.01 v_{ter}$). Discuss if your results make sense. (+4 points)
\end{enumerate}
 
{\bf Note:} Judiciously use ``print selection" on a minimalist subset  of your MMA notebook so we can see your results, and discussion, without having to wade through pages of preliminary plots and calculations.\\

\week{4}

Find the regulation size (and mass, while you're at it) for a soccer ball. 
\begin{enumerate}
\item The drag coefficient $c_D$  for a soccer ball is about 0.25.  (Note: the c in $c v^2$ is given by  ${1\over2} c_D \rho D^2$) Calculate the numerical value of the quadratic drag constant ``c"  for a soccer ball traveling in air at STP, and write down the 
equations of motion required to solve for x(t) and y(t)  with (just) quadratic drag. 
\item On our course calendar, right next to this homework, you can find a sample Mathematica notebook that solves for trajectory with {\it linear air drag. }Modify that code so that you have {\it quadratic} drag.  For simplicity and concreteness, set the kick angle to 45 degrees, and pick an initial speed of  90 mi/hr (converted to SI metric, of course)  Plot the trajectory. What is the ideal (drag-free) range in this case, and what does your code tell you the range is with quadratic drag? (Don't hunt for the optimum range like last week, stick with a 45 degree angle)  Also, calculate what fraction of the initial {\it speed} is lost from when you first hit the ball (at 45 degrees) to when it lands.  (Where does the lost energy go?) 
\item A few years ago, there was big controversy when the Soccer Federation banned international soccer competitions in cities above 2500 m elevation
(This was out of concern about players' health, and has since been eliminated.) But, what about the impact on the physics of the game? Use your code to estimate how much farther that same kick would take a soccer ball in La Paz, Bolivia (elevation, 3000 m) compared to a game at sea level (which your code was assuming.) Do you think this difference might be measurable/noticeable?  {\it Note: The air density at 3000 m is about 70\% what it is at sea level.}

\end{enumerate}

Consider a familiar horizontal spring-mass system. Recall that the the solutions for both the velocity and position of the mass are oscillatory. 

\begin{enumerate}[(a)]
\item Write down the second-order differential equation which describes the position of the mass. Then,  as we did in the numerical integration tutorial in class, write this differential equation as two first order differential equations (one for dx/dt, one for dv/dt) {\it (That in-class Tutorial is also  available for review/download on this week's course calendar) }
\item Assume the oscillator starts from rest at $x$ = +1 m, with  $m=0.1$ kg and   $k=10$ N/m.  Recalling that the period of oscillations is given by $T = 2 \pi \sqrt{m/k}$, let's pick the time step for our numerical integration to be 10\% of T (so 1 period has 10 time steps). Using the computational tool of your choice, you will be writing a {\tt for} loop to numerically integrate these equations for several periods. (For help writing {\tt for} loops in Mathematica, review the numerical integration tutorial, use the documentation or check out this screencast: \url{http://youtu.be/UpkcScYeQTc}.)\\ {\bf IMPORTANT:}\\ 
 We'd like you to write TWO codes: (code 1, ``Euler-Cromer'' method) Compute the force at an instant, update the velocity (using that force), then update the position (using that {\it updated} velocity!) and then repeat.  Alternatively, (code 2, ``Simple Euler method'') Compute the force at an instant, update the position first, then update the velocity (and repeat.)   See the difference? (Compare these two methods by using each of them to integrate the spring mass system and plot the position of the mass as a function of time.) What do you notice? \\{\it One anecdote claims the Euler-Cromer method was discovered by a high school physics student. The story is given in this paper: \href{http://ajp.aapt.org/resource/1/ajpias/v49/i5/p455_s1?&login}{[AJP link]}.}
\item Try decreasing your integration time step by an order of magnitude. What changes do you have to make to your code? What happens to your solutions? When numerically integrating, what would help you pick the time step? (Why not, say, choose a billionth of a period in this case, to get super accuracy?) 
\item Several good integration algorithms are built in to a lot computational tools (e.g., Runge-Kutta, Dorman-Prince, etc.). Use one of these built-in integration methods to integrate the equations of motion and compare the results to those in part (b) or (c). Mathematica users can use NDSolve, a function which attempts to select the best method given the equation of motion. For help using NDSolve, check out this screencast: \url{http://youtu.be/zKO6v0w0KdI}. Notice, you don't have to pick a time step!
\end{enumerate}

\week{5}

Test Week - No Computational Problem; Exam Review Homework\\

\week{6}

A particle (in 2D) has a potential energy function given by $U(\vec{r}) = - e^{-(x^2+2y^2)}$.  (Assume all the numerical constants have implicit correct SI metric units so that x and y are in meters, and U in Joules) 
\begin{enumerate}[(a)]
\item Using your favorite computational tool, make an equipotential plot (``ContourPlot[ ]" in Mathematica. Use the built in help to find out the syntax and arguments, it's pretty simple) and a 3D plot (``Plot3D" in Mathematica). Include a copy of both plots with your homework. Now stare at these images.  Describe in words how you would interpret this potential physically (For instance - is this attractive, repulsive, both, neither?    Can you invent some physical system for which this might be a crude model? Would a  particle be ``bound" here?) Which is more informative for you -  the countour plot or the 3D plot? Why?  If you put a particle at, say, ${\vec r = (1,1)}$, use your intuition and the plots to describe very clearly in words (without calculation) the approximate direction of the force there. 
\item Analytically compute the force on the particle. Then, use a computational tool to plot the force field (``VectorPlot[ ]" in Mathematica. If you name your plots ``p1 = ContourPlot[É]", p2=VectorPlot[É]" and make sure the x and y range is the same, then you can plot TWO different plots on top of each other using ``Show[p1,p2]".)  Produce a single plot that shows  the contours and the force field together. Now, what is the magnitude and direction of the force at (1,1)?  Discuss whether your plots agree with your expectation in part a (and resolve any discrepancies)
\item What changes could you make to $U(\vec{r})$ to make the potential well  i) centered at the point (1,1) instead of (0,0)     ii) stronger? iii) repulsive? (You might want to use your computational tool to visualize your claims here.) 
%What change would you have to make to have TWO attractive centers instead of one? Do that (picking the second center to be at (1,1), and plot the new force field. Is there anywhere (more than one place) in your plot where the force vanishes? (Briefly, discuss)  

\end{enumerate}

\week{7}

A simple pendulum consists of  a point mass $m$ fixed  to the end of a massless rod (length $l$), whose other end is pivoted from the ceiling to let it swing freely in the vertical plane. The pendulum's position can be identified simply by its angle  $\phi$ from the equilibrium position.
\begin{enumerate}[(a)]
\item  Write the equation of motion  for $\phi$ using Newton's second law.  Assuming that the angle $\phi$ remains small throughout  the motion, solve for $\phi(t)$ and show that the motion is periodic. What is the period of oscillation?
\item Show that the pendulum's potential energy  (measured from the equilibrium level ) is
$ U(\phi)=A (1-\cos \phi)$. Find A in terms of $m$, $g$ and $l$. Then,  write down a formula for the {\it total energy} as a function of $\phi$ and $\dot{\phi}$.
\item Show that by differentiating the energy with respect to $t$ you can recover  the equation of motion you found in (a).  (What basic principle of physics are you using, here?) 

\item Picking simple values for parameters (e.g, $m=l=1, g=10$), use your favorite computational environment (e.g., NDSolve in Mathematica) to solve for $\phi(t)$ given a fairly small starting angle $\phi_0$. Provide output that clearly shows that the period of oscillation is very close to the theoretical prediction from part d. Repeat with $\phi_0=1$ rad (which is quite large), and show that the period now deviates from ideal.  (Does the period get {\it larger} or {\it smaller} as $\phi_0$ increases?) 
\item Using your numerical solution to part (d) and your formulas for energy from part (b), generate a single plot which graphs KE, U, and total E as a function of time, for one period, in the case where $\phi_0=1$ radian is NOT small. Briefly, comment! (Do we still conserve energy when we cannot use the small angle approximation any more?)  
\end{enumerate}

\week{8}

A particle is under the influence of a force $\vec{F}=(-ax+ bx^3) \hat{x}$, where $a$ and $b$ are constants.
\begin{enumerate}[(a)]
\item What are the units of $a$ and $b$? Assuming a and b are positive, find $U(x)$ (assuming $U(0)=0$) and sketch it.  (Sketch means hand-drawn, not plotted with Mathematica. Include all features you consider interesting in your sketch, including e.g. zero crossings, behavior at large x, ``scales" of your axes, etc)
\item  Find all equilibrium points and determine if they are stable or unstable.
\item Qualitatively describe the motion  of an object  in this force field released from rest at  $x=(1/2) \sqrt{a/b}$. 

Then, qualitatively describe the motion  of an object  in this force field released from rest at  $x=2\sqrt{a/b}$.
\item  Now suppose a and b are both negative.  Repeat parts b and c, commenting on what has changed. 
\item Setting a=b=-1 (with appropriate units), Taylor expand the  potential of part d {\it around the outermost stable equilibrium point} (not around x=0!!) Truncate your series after the first ``nontrivial" term. Plot the resulting approximate potential that a particle near that point feels, on top of the ``real" potential.   (Note this time I ask you to ``plot", not ``sketch", so use a computer) Discuss the range of x for which you think this approximation would be reasonable.
\end{enumerate}
 
 {\it Note that this potential, or small variants of it, occurs in various physics situations. This is a more accurate form of the true force on a pendulum  than our usual approximation, can you see why? Part d is the (famous!) case of the ``Higgs potential" in particle physics, which is being actively investigated at CERN's  LHC collider.}\\

\week{9}
%Let's look again at the simple pendulum problem.
%Remember it consists of a point mass m fixed to the end of a massless rod (length l), whose other end is pivoted from the ceiling to let it swing freely in the vertical plane. The pendulum's position can
%be identified by its angle $\phi$ from the equilibrium position. 
Last week you showed that
a pendulum's potential energy (measured from the equilibrium level ) is $U(\phi) = mgL (1 -\cos\phi)$ (where L is the pendulum length) and that  under the small angle assumption the motion is periodic with period $\tau_0=2\pi\sqrt{L/g}$. In this problem we will find the period for large oscillations as well:
% \begin{figure}[htc]
%\centering
%{\includegraphics[width=1.2 in]{Hom9fig3c.pdf}}\caption{}
%\end{figure}
\begin{enumerate}
\item Using conservation of energy, determine $\dot{\phi}$ as a function of $\phi$, given that the pendulum starts at rest at a starting angle of $\Phi_0$.  Now use this ODE to find an expression for the time the pendulum takes  to travel from $\phi=0$ to its maximum value $\Phi_0$. (You will have a formal integral to do that you cannot solve analytically! That's ok, just write down the integral, being very explicit about the limits of integration) Because this time is a quarter of the period,  write an expression for the full period, as a multiple of $\tau_0$. 

% Show it is given by
  %  \begin{equation}
    %\tau=A \tau_0 \int_0^{\Phi} \frac{d\phi}{\sqrt{\sin^\alpha [\Phi/2]-\sin^\beta [\phi/2]}}\end{equation}
   % Determine $A$, $\alpha$ and $\beta$.
   % \item  Use the substitution $\sin(\phi/2)= K u$ and show that \begin{equation}
   % \tau=2A \tau_0 \int_0^1 \frac{d\phi}{\sqrt{1-u^\alpha}\sqrt{1-K^\beta u^\beta}}\end{equation}
   
   
   
 \item  Use your favorite computational environment to evaluate the integral and plot $\tau/\tau_0$ for $0\leq \Phi_0\leq 3$ rad. For small $\Phi_0$, does your graph look like that you expect? (Discuss - what value DO you expect?)   What is $\tau/\tau_0$ for $\Phi_0=\pi/2$ rad? (Give us several significant figures)  
 \item  What happens to  $\tau$ as the amplitude of the oscillation approaches $\pi$? Discuss the physics here!  What can you say about how well simple harmonic motion approximates the behavior of a real pendulum? 
 
{\it Note: You may see some curious numerical pathologies if you use MMA. If your plot has little gaps, it's because MMA is generating tiny imaginary terms added to the result. You might just try plotting the real part of the integral, using Re[ ].  If it gives you symbolic results, you might fix that by using N[ ], which forces MMA to evaluate the expression as a number, if it can! By the way, this integral is called the ``complete elliptic integral of the first kind''.}

\item A real grandfather clock has a length of about half a meter, and you pull the pendulum, oh, a few cm to the side (let's say $\sim 10$ cm, for a decent sized clock). Use your code from the previous part to compute $\tau/\tau_0$ for this clock.   When designing the clock for practical use, would the clockmaker be safe in making the ``small angle" approximation? Don't just look at the number you got and say ``well, that looks pretty close to 1, so we should be ok". What we mean here is to {\it justify your answer with a calculation} that tells you whether this clock (calibrated assuming the small angle approximation) would be annoying or useful to have in your house!  Can you be concrete about what you would consider ``annoying" about a clock? (I was surprised by the result - are you?)  
\end{enumerate}

\week{10}
Exam week

\week{11}

Consider the motion of a 2D non-isotropic oscillator, in which the
spring constant in the x direction ($k_x$) is not equal to the spring constant in the y direction
($k_y$). Each trajectory below depicts the possible motion of a unique non-isotropic
oscillator.
% All three oscillators, share the property that the angular frequencies $\omega_x$ and $\omega_y$ for the motions along the x- and y-axes are commensurate, i.e., that the angular frequencies satisfy the following relationship: $\frac{\omega_x}{n_1}=\frac{\omega_y}{n_2}$ where $n_1$ and $n_2$ are integers.
%\begin{figure}[htc]
%\centering
\begin{center}
{\includegraphics[width=3.5in]{Hom11Fig3.pdf}}%\caption{}
%\end{figure}
\end{center}
 \begin{enumerate}
\item determine the (simplest possible) ratio of $\omega_x$ /$\omega_y$.  Explain your reasoning.
\item Use your favorite computational environment to generate the three Lissajous plots shown above (ParametricPlot may be handy in Mathematica) We said in class that you can always choose your ``x" phase angle to be zero. Can you do that for all 3 figures?  Briefly, explain why or why not. 
%\item  If  $\omega_x=\omega_y$  what is  the relative phase required for  the trajectory to be  an ellipse? What determines the semimajor and semiminor axes?
\end{enumerate}

{\bf In the following pair of problems} you will compare our model for a damped harmonic oscillator to real data collected from a video of a spring-mass system immersed in viscous oil. The video from which this position vs time data is collected is here: \url{http://www.youtube.com/watch?v=ZYFVKZPut9w}.
Data was obtained using free video tracking software (Tracker) and saved in a comma-separated variables (CSV) file.

 First, you will describe a few properties of a damped oscillator to assist you in your analysis of the data.

\begin{enumerate}[(a)]
\item Write down the differential equation for a damped harmonic oscillator with undamped natural frequency, $\omega_0$, and damping parameter, $\beta$.  Write down the general solution for this differential equation for the underdamped case ($\beta < \omega_0$). Then, consider the following sketch of a solution to this differential equation for a particular choice of $\beta$ and $\omega_0$ when the oscillator was displaced and let go. 

\begin{center}
\includegraphics[width=0.7\linewidth]{sample_oscillator.pdf}
\end{center}

You can obtain an estimate for $\omega_1 = \sqrt{\omega_0^2 - \beta^2}$ using the time between successive zero crossing. Estimate  $\omega_1$ in the figure above and explain how you obtained your result.

\item You can also obtain an estimate for $\beta$ using successive maxima or minima from the plot. Estimate  $\beta$ and $\omega_0$. Explain how you obtained your result.

\item If $\omega_0$ were kept constant but $\beta$ were increased (but still below $\omega_0$), sketch how the plot above would change. What physical change to a spring-mass immersed in oil can be done to increase $\beta$? Answer both questions for the case where $\omega_0$ is kept constant but $\beta$ is decreased. What property of the sketch does $\beta$ appear to control?

\item If $\beta$ were kept constant but $\omega_0$ were decreased (but still above $\beta$), sketch how the plot above would change. What physical change to a spring-mass immersed in oil can be done to decrease $\omega_0$? Answer both questions for the case where $\beta$ is kept constant but $\omega_0$ is increased. What property of the sketch does $\omega_0$ appear to control?

\end{enumerate}

You will now analyze a real spring-mass system immersed in viscous oil for which position versus time data was collected for the oscillator.

\begin{enumerate}[(a)]

\item The position versus time data appears in a comma-separated variables (CSV) file on our course home page and also our D2L page. Importing this data is straight-forward in Mathematica using the \texttt{Import} command. You'll need to store the data in a variable, so you can plot it.\\ 

For example, \texttt{data = Import["/file/to/datafile.csv"]} will import the values in the CSV file into the variable {\tt data}.
 (You will use Insert $\rightarrow$ Filepath to generate the right file path on your computer - if you need a little more help, a video describing how to import data into Mathematica is located here: \url{http://youtu.be/MmS3JNk7JE4} .)

Plot this data using the {\tt ListPlot} command,\\{\tt experiment = ListPlot[data[[All, \{1, 2\}]], PlotRange -> All]}.\\
You are storing this plot (as {\tt experiment}) for later, so you can display the experimental data and the results from your model on the same plot.\\

\item Using the plot of the data, estimate values for $\omega_1$, $\beta$, and $\omega_0$. Determine the initial position and initial velocity for the oscillator. This oscillator was displaced and released from rest.\\

\item Plot the particular solution to damped harmonic oscillator for your model parameters ($\omega_1$, $\beta$, and $\omega_0$) and initial conditions. You should store this plot (e.g., {\tt model = Plot[...]}).

\item Plot the result of your model and the experimental data on the same axes using the {\tt Show} command. This is why you stored the plots earlier (e.g., {\tt Show[experiment, model]}). How does your model match the experimental data? Can you tweak your model parameters to make the fit better? 

\item Why did we do this? Experimental physicists collect data and often attempt to fit a model of that system to their data. It's likely that you got pretty good but not great agreement with the data that was collected. Can you identify at least 3 aspects of the physical system (spring mass immersed in oil) that might have improved the model? Can you identify at least 2 aspects of the data collection procedure (video tracking software) that might have helped you better estimate your model parameters ($\omega_1$, $\beta$, and $\omega_0$)?

\end{enumerate}


\week{12}

 \begin{enumerate}[(a)]
\item  Solve Boas Problem 8.6.12 (That's chapter 8, section 6, problem 12, on page 423).  We just want the general solution here. 

Please also tell us {\it  explicitly} if the associated (complementary) homogenous problem is (choose one) \{over-damped, under-damped, undamped, critically damped\} How do you tell? 


\item Now, given that the system starts with $y(0)=0$, $y'(0)=0$, solve that problem completely. There should be no undetermined coefficients left!

\item Sketch the homogeneous {\it piece} of the solution in part b) above (by itself). Also sketch the particular solution {\it piece} (by itself). Finally add them to sketch the full solution - noting any important aspects of the sketch.  (Don't worry about precision, this is a sketch, not a plot. We want to know the {\it features}.) Then, use a computer to plot the actual solution. Print it out and discuss - in particular, discuss if it did not exactly match with your sketch.  (The differences may or may not be subtle, depending on the care of your initial sketch)

\item Let's change the problem slightly. Suppose the middle term (the``4D" term) is {\it quadratic} rather than {\it linear} drag.  Write down the new ODE (don't use the ``D" notation, just write it out as an ODE) This is no longer analytically solvable! But that needn't stop us - keeping all numerical coefficients the same as Boas had, just replacing linear with quadratic drag, use your favorite computational environment to solve and plot the new solution (with the same initial conditions). Did changing linear for quadratic drag change any qualitative aspects? Briefly, comment.  

\item Invent two {\it physics} problems, for which the ODEs are the ones used in parts a and d respectively. Be explicit - what are the values of all relevant physical parameters, in SI units? What physics would induce you to choose the ODE of part d instead of part a? 
 \end{enumerate}


\week{13}

{\it Since not all of you had a chance to look at a recent tutorial extra-problem, here it is again!} 

A harmonic oscillator with a restoring force $25m\alpha^2x$ is subject to a damping
force $3m\alpha v$ and a sinusoidal driving force $F_0 \cos(10 \alpha t)$.

  \begin{enumerate}
     \item 	Write down the differential equation that governs the motion of this oscillator.
   	Show that if the driving force were removed the oscillator would become underdamped, and express the frequency of the oscillator in terms of the given quantities. Explain your reasoning.


     \item 	 Each x vs. t graph below illustrates the actual motion (transient plus steady state) of a damped, driven oscillator starting at $t = 0$. For each case, is the frequency of the steady-state motion greater than, less than, or equal to that of the transient motion? Explain.
         
          \begin{figure}[htc]
\centering
{\includegraphics[width=5in]{Hom13Fig1.pdf}}\caption{}
\end{figure}
     \item (2 pts) Identify which graph (1 or 2) would better correspond to the damped, driven  oscillator described in parts a)  of this problem. Explain your reasoning.  
     
{\it \bf Extra credit}  ``Reverse engineer" this problem:  - write a Mathematica code which produces the plot you chose here. (Taylor's Eq's 5.68 and 5.70 will help! )

    \end{enumerate}
    
    You've gotten a summer job interning as an audio engineer. Audio software produces periodic tones by summing pure frequencies (each with its own amplitude) -  it's just summing up a Fourier series!  Your boss has asked you to generate a tone with the following properties: It should have a fundamental frequency of 440 Hz  (Middle A).  On each cycle (i.e. 1/440th of a second), instead of being a pure cos or sin wave, your wave should start with a given amplitude $A$, ramp down {\it linearly} (rather than sinusoidally) to $-A$ in half a period, then ramp back up linearly back to $+A$, and repeat this pattern indefinitely.  

\begin{enumerate}[(a)]
\item Sketch the function you are trying to build (over a couple of periods). Clearly label your horizontal axis. Do you expect any of the terms (cosines or sines?) in the Fourier series to vanish? Briefly, why? 

\item Compute the Fourier series for your waveform (which means coming up with a formula for the amplitude of each Fourier term.) 
\item To check your solution, use a computer to plot the sum of the first 3 non-zero terms in your series (over  a range of several periods.) It should resemble the sketch that you drew in part a.  If you're using Mathematica, there is a function called ``Play", try it out! (Set A=1)  Compare it to Play[Cos[440 * 2 Pi t], {t,0,1}] and describe in words how your tone is similar, and how it differs, from the pure tone.
\end{enumerate}

\week{14}

For the periodic function $f(t)=A (t^2-1/3)$  for $-1<t\leq 1$ (with A a given constant)
\begin{enumerate}
\item Compute Fourier coefficients $a_n$ and $b_n$.  (Some vanish - predict which ones {\it before} doing any integrals) 
\item Suppose this force drives a weakly damped oscillator with damping parameter $\beta=0.05$ and a natural period $T=2$. Find the long time motion $x(t)$ of the oscillator. Discuss your answer. Use Mathematica to plot  $x(t)$ using the first  four non-zero terms of the series, for $0< t\leq 10$.  (Set A=1 for this)
\item Repeat part b) for the same damping parameter, but with natural period $T=1$. Briefly discuss any major differences between this result and what you had in the previous part.
\item  For most of the possible natural frequencies the response of this particular driven oscillator is going to be weak. However, there are some particular natural frequencies at which you are going to see an enhanced response - determine which those are. \end{enumerate}
%\hrule

\begin{center}
{\includegraphics[width=2.8in]{Hom14Fig1.pdf}}\end{center}

You are a summer engineering-physics intern, working on a modified Rayleigh-Bernard convection (\url{http://goo.gl/Itbi2}) experiment, and the edges of the rectangular bottom plate of the system are held at the temperatures as shown in the figure above.  
\begin{enumerate} 

\item Your advisor has asked you to determine the steady state temperature distribution T(x,y) for the plate, so another student can put that boundary information into a computational model for the convective flow she's constructed. The boundary condition on the top surface is given by
\begin{equation}
f(x)=\left \{\begin{array}{c}
        0  \quad \quad 0<x\leq a/2 \\
      2T_0  \quad \quad  a/2 < x \leq a
     \end{array}\right.
\end{equation}

  \item 
You want to check that your solution makes sense. Code up your formula, adding up 30 terms in your sum to find T(x,y). For concreteness, please set a=1, b=2, and $T_0$=100. The very first thing I would want to do to check this code would be to set y=2, and do a simple plot of T[x,2] (from x=0 to 1), to make sure that the Fourier sum is giving what you expect. (What DO you expect? Sketch it first, then plot it. Comment on any interesting or surprising features you observe about this plot, is it exactly what you expected? )


{\it  Some Mathematica reminders: if, for instance, $T(x,y) = \Sigma_{n} 2n\  sin(n \pi x) e^{-n \pi y}$, the Mathematica syntax for that might be}

t[x\_,y\_] := Sum[2n Sin[n Pi x] Exp[-n Pi y],\{n,1,30\}]

{\it Watch out for the underscores for variables x and y on the left side (they do NOT appear again on the right side), and the colon before the equals sign. Don't capitalize functions that you invent, caps are reserved for MMA built-in functions.}


\item
Now that you are more confident your (nasty!)  Fourier work is probably ok, plot your full T(x,y) using a 3D plot function (MMA users will find Plot3D useful. See the documentation center for the basic syntax of Plot3D.) Briefly, discuss/document the key features of your plot. Please tell us explicitly what does the height of this graph represent, physically? Given these results, and the goal of your summer internship project, do you have any comments for your advisor?   {\it Plot3D is very cool. You can rotate the resulting curve with your mouse to really get a good look at your result. }

\end{enumerate}

\end{document}