Assignment 12 - Aubrey Weese

Data Model - Damped Harmonic Oscillator

The problem of data modeling was introduced in an earlier assignment. In this exercise, we will explore a more robust technique to determine the parameters of interest. As before, the equation of motion (position xth as a function of time t) for a damped harmonic oscillator is given by

xth = A e (-bt/2m) cos(wt + d) + C ,

where A is the amplitude of the oscillator, b is the damping coefficient, m is the mass of the oscillating object, w is the angular frequency, d is the phase shift, and C is the offset.

The following steps provide a guideline for you to find the unknown parameters.


Procedure

  1. FTP the file dhm.dat from /tmp directory of osf1.gmu.edu to your account on osf1.
  2. Start MATLAB and load the data in. (If you don't know how to do this type help load).
  3. Type dhm and hit return. As you notice there are two columns. The first column is the data for time in seconds and the second column is the data for distance. Plot x vs time.
  4. Set the first column to variable T. Set the second column to variable X.
  5. Take the first derivative of the position with respect to time and set it to variable dX. (You may want to type help diff.)
  6. Take the second derivative of the position with respect to time and set it to variable dXX.
  7. Plot X, dX, dXX vs. T.
  8. Determine the times corresponding to the maximum and minimum positions using the information from dX and dXX.
  9. Make a Matrix called MaxMin that contains all the maximum and minimum positions with their corresponding times.
  10. Estimate the value of C from the plot you made in Step 3.
  11. Plot the MaxMin positions vs. MaxMin times and determine the value of b and A given m = 197.27 grams.
  12. From the matrix in Step 6, determine the values of w and d. (Remember that we are using both maximum and minimum positions.)
  13. Calculate the RMS error using the equation

    e = {(1/N) i=1SN [xth(i) - x(i)]2 }1/2

  14. Plot xth vs time and x vs time on the same plot.
  15. Adjust the value of C to make the RMS error minimum.
  16. Comment on how you would change the above procedure to improve the calculations of the parameters.
  17. Post a web page that contains the information regarding the parameters you found and e. Include your comments and the plot from Step 16.

Done. See Dharmonic.htm