Simple Harmonic Motion and Mechanical Resonance (Part 1)

In the first project of the quarter, you studied the pendulum. A pendulum is an example of an oscillator – a system which moves back and forth from one state to another with some period – but oscillators are common throughout nature and it is useful to recognize what features of oscillators are common across all types in general.

In the first part of this two-part lab, we will do the following:

  • build our own oscillators and try to measure and characterize their oscillation period,
  • look at features of simple harmonic motion and attempt to determine whether our oscillators meet that definition, and
  • study the specific system of a mass on a spring in order to observe the main features of simple harmonic motion.

In the second part of this lab, we will do the following:

  • look at the effects of driving and damping forces on a simple harmonic oscillator,
  • explore the general features of mechanical resonance, and
  • measure characteristics of our resonant system such as the amplitude-vs-frequency resonance curve and the Q-factor.

Begin by opening up this project's lab notebook template, and sharing the lab notebook with everyone in the group.

Task 1: Building your own oscillator

Hooke's law and simple harmonic motion

In lecture and in your homework, you have dealt with motion which resulted from the application of a constant force, i.e., uniformly-accelerated motion. In the present experiment, we will consider a system where the force is not constant. One of the simplest (and most important) non-constant forces is one which varies directly proportional to the displacement from equilibrium. For motion in one-dimension, the force $F$ may be represented by

$F = -kx$ (1)

where $x$ is the displacement from equilibrium and $k$ is the spring constant.

Equation (1) implies a force whose magnitude increases as one gets further from the origin, and whose direction is always toward the origin. Note that if $x$ is positive then the force is negative (and vice versa). Such a force is called a restoring force. The term restoring force, however, does not uniquely specify a force of the type specified in Eq. (1), since, for example, $F = - kx^3$ is also a restoring force. A restoring force varying as the first power of the displacement (as in Eq. (1)), is called a Hooke's law force.

If we construct a system with a Hooke’s Law restoring force applied on a mass, then, by application of Newton’s second law and conservation of energy, it can be shown that the equation of motion is

$m\dfrac{d^2 x}{dt^2} + kx = 0$. (2)

The solution of Eq. (2) is

$x = A\cos\bigg(\sqrt{\dfrac{k}{m}}t + \delta\bigg)$ (3)

where $A$ is the amplitude of the motion and $\delta$ is the phase (i.e., the time offset when the oscillation goes through zero.)

The general form of this oscillatory function is

$x = A\cos(\omega t + \delta)$, (4)

where $\omega = 2\pi f$ is the angular frequency. (Period is equal to the inverse of frequency: $T = 1/f = 2\pi/\omega$.) Thus, by comparison of Eqs. (3) and (4), we see that the frequency of oscillation is

$\omega = \sqrt{\dfrac{k}{m}}$, (5a)

and the period of oscillation is

$T = 1/f = 2\pi/\omega = 2\pi\sqrt{\dfrac{m}{k}}$. (5b)

An oscillation of this form – i.e. an oscillation caused by a Hooke's law force with a frequency that is independent of amplitude – is called simple harmonic motion. This type of motion is extremely common in physics. In fact, almost anything which is disturbed a small amount from a stable equilibrium point behaves like a simple harmonic oscillator.

What if it isn't that simple?

If there is any force acting on the system other than the restoring force, then the oscillator is no longer characterized as simple.

If we can't characterize the motion with a single frequency, then the oscillator is not classified as harmonic.

An example: The simple pendulum

The simple pendulum which you built in the first lab was clearly an oscillator; when you pulled the mass bob away from equilibrium, it began to swing back and forth with some period. You found that at small angles – say 5 or 10 degrees – the period was independent of the amplitude of oscillations. Therefore, the simple pendulum in the small angle limit is a harmonic oscillator.

However, you likely found that as you increased the amplitude of oscillation, the period changed. In this limit, the system is still an oscillator (because it moves back and forth with some period), but it is no longer a simple harmonic oscillator (because the period is not independent of amplitude, which means that the restoring force is not proportional to displacement).

Building your own oscillator

You have a number of different parts and pieces of equipment available in the lab. Your task for this first step of the experiment is to build any type of oscillator that you can imagine. Your oscillator doesn't have to be pretty or useful for an specific task… it doesn't even have to be “good”! But your oscillator should move on it's own after to you “displace” (or “push” or “start”) it, and it should repeat that cycle of motion periodically.

Once you have your oscillator built, your group should do the following:

  • Measure the period of oscillation.
  • Try to do something to the oscillator to change the period (e.g. change mass of something, change length of something, change the tension of something…)
  • Challenge: Can you think of a mathematical relationship between the thing you change and the period?
  • Challenge: Is your oscillator a simple harmonic oscillator? Why do you think so (or why not)?

After groups have explored their own systems, the TA will ask groups to share their findings. You should keep your setup built until this discussion takes place.

Task 2: A mass on a spring

Now that we have seen a number of different oscillator examples, we will narrow our focus to a specific system: a mass on a spring. This system is a good model for different real systems and one that we can explore in great detail mathematically.

Measuring the period of oscillation, $T$

Set up the apparatus shown in Fig. 1. You have a spring (of unknown spring constant, $k$), a large mass, and a collection of small mass clips. For now, attach just the large mass to the spring.

Figure 1: Spring in the vertical configuration with hanging mass.

Since this is a simple harmonic oscillator, the system should have a natural frequency (or, equivalently, a natural period, $T = 2\pi/\omega$).

  • Displace the mass a small amount and release. Use a stopwatch to measure several periods of oscillation. Repeat a few times to estimate the uncertainty. What is the measured period of oscillation (with uncertainties)?

Predicting the period, $T$

The predicted period for this system should depend on mass and spring constant, as in Eq. (5). Determining the mass is easy – you can use one of the mass balances in the room – but we have to use Hooke's law – Eq. (1) – to determine the spring constant.

Measuring the spring constant, $k$

Tie a string to the large mass and hang one or more mass clips to the string. As you add more clips, you should observe the spring stretch. Determine the spring constant by measuring and plotting the mass's displacement from equilibrium as a function of hanging weight.

  • What is the equilibrium position?
  • Is your system properly described by the form of Hooke's Law, Eq. (1)?
  • From your plot, determine the spring constant of the system.

To help visualize and fit your data, we provide a Google Colab notebook.

Comparing predication and measurement

Let us now compare our prediction to our measurement. For one of the conditions for which you measured the period above, calculate the predicted period.

  • Is the measured period consistent with the calculated period? Be quantitative and explain.

Details of the motion

We shall study the motion in detail, collecting rotary encoder data on the computer.

Figure 2: Spring in the horizontal configuration with the rotary encoder pulley.

Using the same spring that you just characterized, assemble the apparatus as shown in Fig. 2. This time, you will attach a string to the end of the spring and pass that string over the rotary encoder pulley. Hang the large mass (not the mass clips) to the end of the string. Make sure that the pulley moves smoothly as you pull the mass up and down.

What is a rotary encoder?

A rotary encoder is a device that uses an optical sensor to determine how much a wheel turns around its axis. The encoders we are using today can tell both position and direction of motion, and are connected to the computer through a device called a LabQuest Mini. When read with the Logger Pro software, we can collect rotation versus time data, and visualize, plot, and fit the data.

Does it matter that the mass is connected to a string instead of directly to the spring?

When we separate the mass and the spring by a string, the force on the spring at equilibrium is no longer directly the weight of the mass but instead is the tension in the string. So long as the mass of our string is negligible and the friction on the pulley is negligible, the tension will equal the weight.

Test the software

Find the Logger Pro configuration file titled SHM on the desktop and double-click to open.

If the file isn't there, or if you need a fresh, unedited copy, it is available to download here: shm.cmbl.

Start the data acquisition with the mass at rest in its equilibrium position. Displace the mass some known amount and hold it there for a few seconds. Check to see that the computer correctly shows the correct displacement. To get an accurate measurement of the displacement, click on the graph window and then select Examine from the Analyze menu. Now you can use the mouse cursor to read data points off of the graphs.

NOTE: The rotary encoder should be plugged into the DIG 1 input on the LabQuest Mini. If your software does not recognize the LabQuest mini when you start the SHM configuration file, close the file, unplug and replug the USB connection, and restart the software.

Taking data

When you are satisfied that the system is working, return the mass to its equilibrium position and start data acquisition again. Displace and quickly release the mass.

Above in Eq. (4), we saw that the displacement of a simple harmonic oscillator is given by

$x = A\cos(\omega t + \delta)$, (4, again)

If we are interested in the velocity and acceleration of the oscillatory motion, we can differentiate and find

$v = \dfrac{dx}{dt} = - A\omega \sin(\omega t + \delta)$ (6)


$a = \dfrac{dv}{dt} = -A\omega^2\cos(\omega t + \delta)$. (7)

Looking at the data collected in the software, do you see sinusoidal motion?

  • Comment qualitatively on the relative phases of displacement, velocity and acceleration of the mass as recorded on the computer.
  • How do these phases relate to those implied by Eqs. (4), (6) and (7)?
  • Is your displacement (or velocity or acceleration) a constant sinusoid, or does it decay with time?

Theory predicts that the displacement of the mass should vary sinusoidally with time. The software provided can help us judge how well our data fits the predicted shape and thus test the validity of the theory.

Select the graph of displacement vs. time. From the Analyze menu, select Curve Fit. In the General Equation list box, select Sine. In the equation that appears, the meaning of the constants are as follows:

  • $A$ is the amplitude of the wave;
  • $B$ is $\omega = 2\pi f$;
  • $C$ is the phase; and
  • $D$ is the vertical offset.

Use the mouse to select a range of data, covering just a few cycles of the displacement of the mass. Click Try Fit.

  • Qualitatively, does the best fit sinusoidal function fit your data?
  • What is your best estimate for the period (or frequency) given by the fit? How does this compare with your measured value above and your predicted value?

Repeat this fit on the velocity and acceleration curves.

  • Do the three curves all show the same frequency?
  • Do the amplitudes of the three curves relate to each other as expected by Eqs. (4), (6) and (7)?

NOTE: Since the data collected by the rotary encoder does not include individual uncertainties on each point, the algorithm that computes the best fit in this software works a little bit differently than the one we use in the Google Colab notebook. It uses the scatter of the data around the best fit line as an estimate of the average uncertainty on each point, and uses these values to estimate the uncertainties on the fit parameters. This is different from the chi-square method we used last project (where uncertainties need to be specified on each point as part of the data to be fit).

You will probably notice that the amplitude of your data is actually decreasing very quickly. If you try to fit your data over too many cycles, then the fit function will struggle… especially with getting an appropriate amplitude. To do better, we can try to fit the data to the provided function called Damped Harmonic. This function multiplies the sine function by a decaying exponential that models the decaying of the amplitude of the oscillation.

Try repeating the fit with this function. In this form, the meaning of the constants are as follows:

  • $A$ is the amplitude of the wave;
  • $B$ is the decay constant of the exponential;
  • $C$ is $\omega = 2\pi f$ (what was previously $B$);
  • $D$ is the phase (what was previously $C$); and
  • $E$ is the vertical offset (what was previously $D$).

Be careful when fitting to select only clean data – after the oscillations start and before they die out completely. If you are having trouble fitting, try one of the following:

  1. Specify better initial guesses for amplitude and frequency when doing the automatic fit. To do this, change the initial guess values of “1.00” in the fit box to something closer to the expected value (e.g. the values from your fit above of from what you might estimate by eye).
  2. Try collecting new data that is free from jumps, spikes, and sudden changes, or try to collect data with less dead time at the beginning of the data run.

After repeating the fit with the addition of the decaying exponential…

  • Do the three curves all show the same frequency?
  • Do the amplitudes of the three curves relate to each other as expected by Eqs. (4), (6) and (7)?

You may find that even with this improved fit, you still have disagreement between your expected amplitude values and your measured amplitude values.

  • Does this fitting method at least provide values which are closer to the expected values?

Conservation of energy

Recall that force and potential energy are related by

$\textbf{F} = -\nabla U$, (8a)

or in one dimension,

$F = -\dfrac{dU}{dx}$. (8b)

For a Hooke's law force, that means that the potential energy is

$U = (1/2)kx^2$. (9)
  • Using the data already obtained, determine the potential energy of the system at the earliest extreme of the mass's displacement.
  • Determine the kinetic energy of the mass at the equilibrium position.
  • Is energy conserved during the oscillation?

As mentioned above, you should see the amplitude of oscillations decay with time.

  • Why does the system not oscillate forever? Does this mean energy is not conserved?

Submit your lab notebook

Make sure to submit your lab notebook by the end of the period. Download a copy of your notebook in PDF format and upload it to the appropriate spot on Canvas. Only one member of the group needs to submit to Canvas, but make sure everyone's name is on the document!

Don't forget to log out of both Google and Canvas, and to close all browser windows before leaving!

Post-lab assignment

Answer the questions/prompts below in a new document (not your lab notebook) and submit that as a PDF to the appropriate assignment on Canvas when you are done. You should write the answers to these questions by yourself (not in a group), though you are welcome to talk to your group mates to ask questions or to discuss.


In about one or two paragraphs, draw conclusions from today's experiment. Address both the qualitative and quantitative aspects of the experiment and feel free to use plots, tables or anything else from your notebook to support your words. (See the last experiment for suggested questions you should ask yourself as you consider the conclusion.)


Today's tasks required you to build some apparatus. Likely, you had to build, rebuild, revise, or modify your constructions as you worked… or perhaps you found that when you were taking data, something you didn't previously consider made the data noisy, fuzzy, confusing, or unstable. This is common in experimental science! And revision in light of new information (to models, theories, and apparatus) is always happening.

As we experiment, we encounter systematic biases (that we may or may not able to eliminate), deviations from our approximations (that may or may not be important), and violations of our predictions (that may or may not be Nobel Prize worthy!)

As you reflect on today's experiment, consider the following questions:

  • When building your own oscillator…
    • what difficulties did you encounter?
    • was it easy to measure the period or was it difficult?
    • was there something about the system that made changing the period difficult?
    • was it difficult to answer the question of “is this a simple harmonic oscillator”?
  • When dealing with the mass on the spring system…
    • what difficulties did you encounter?
    • was it easy to measure the period or was it difficult?
    • was there something about the system that changed the period of oscillation that you didn't expect?

REMINDER: Your post-lab assignment is due 24 hours after your lab concludes. Submit a single PDF on Canvas.

Want to give feedback on this lab? Please use our Digital Suggestion Box. Responses are anonymous and help us improve the course.