### Further Reading

- Example: Oscillator calculations
- Example: Oscillator graphs
- Hanging mass on a spring
- Reading the content in the harmonic oscillator solution

# Mass on a spring

#### Prerequisites

- Overview: Motivating the harmonic oscillator
- Reading the content in Newton's 2nd law
- The derivatives of trig functions
- Springs -- Hooke's law

The oscillatory motion of a system around a stable point is one of the most important single examples in physics. It is the basis for understanding a wide range of systems and phenomena including mechanical oscillations, electrical circuits, resonance, and is even at the heart of the basic theory of photons — quantum field theory.

In this page, as usual, we will start with the simplest example of an oscillating system — a mass and a spring. While this is a toy model of little interest in itself, it has the advantage that you can not only work out all the math in great and gory detail, you can match that math to what's happening physically in order to build the story of the motion. And recall the principle from the page Overview: Motivating the harmonic oscillator:

*If the equations are the same, the analogy is good.*

This makes the mass on a spring of great value in studying any kind of oscillations.

## What's going on in an oscillation

There are three core ideas to the idea of oscillation:

- There is a
to motion of the object. If put there, it will stay, so there is no net force at that point.*stable point* - If the object is displaced in any direction from the stable point there is a growing
acting to bring it back to the stable point.**restoring force** - As the object approaches the stable point it gains speed. Since the force on the object vanishes at the stable point, there is nothing to stop it and it keeps on going through; so it
the stable point and the force begins to build to bring it back.*overshoots*

The combination of *stable point, restoring force*, and *overshoot* are the components needed to create an oscillation.

## The horizontal mass/spring system

The essence of an oscillation is a restoring force and the overshoot arising from inertia. As a result, the simplest example we can construct is *a spring* — that provides a linear restoring force that vanishes at the stable resting point — and *a mass* — that provides the inertia that keeps the mass going. To set this up physically, we will imagine a small massive cart rolling on (those famous) frictionless wheels attached to a (n equally famous) massless spring.* We show a representation of the system in the figure at the right.

* We are OK to ignore the mass of the spring if the cart is much more massive than the spring. Also, it helps conceptually to separate the force idea and the inertia idea in separate objects. We could in fact include the mass of the spring, but it makes the problem mathematically rather difficult and what we are looking for here is a simple example that helps us think about what's happening when a system oscillates.

In order to make our model as simple as possible (while still retaining the 3 key elements of oscillation), we'll assume that the mass of the cart is much greater than the mass of the spring, that the wheels have negligible friction, and that the spring is well approximated (at least for the stretches we intend to consider), by Hooke's law: *T = k*Δ*L*, where Δ*L* is the amount the spring is stretched away from its rest length. To simplify the math, we will choose our coordinate system so that the 0 of our position coordinate is when the cart is at the rest length.

Now we have to create the equation that provides a mathematical model for our motion — building an equation from the physics. Here's what we have to do:

- Pay careful attention to time. As the cart moves, everything changes. Newton 0 tells us that to figure out what is happening, we have to look at each particular instant.
- At each instant of time the cart has a position $x$ and a velocity $v$.
- At that instant of time, the way the velocity changes is controlled by Newton 2, $a = F^{net}/m$, , so we have to figure out the net force the cart feels. At this point, $F^{net}$ is just the force of the spring, since the vertical forces (normal and weight) cancel and we are ignoring friction (for now).
- At that instant of time, $F^{net}$ causes the velocity to change according to Newton's second law (from motion in 1D):

$$v = \frac{dx}{dt} \quad \quad a = \frac{F^{net}}{m}$$

Think through a situation in which the cart is pulled out to a positive position where $x > 0$ but $v = 0$. When the cart is released, what happens? Follow it through one full oscillation.

## The math of the harmonic oscillator

The basic principle is N2, so we need make a free-body diagram for our cart. The vertical forces (weight and normal force) cancel leaving only the force of the spring acting on the cart. This force is proportional to the amount the spring is stretched or squeezed. And the way we have set up the coordinate system gives us that $F^{net} = -kx$ with the negative sign indicating that when the cart is extended to the right (spring is stretched) the force is to the left and vice versa. The result is that N2 becomes the equation

$$a = \frac{F^{net}}{m} = -\frac{kx}{m} = -\bigg(\frac{k}{m}\bigg) x$$

or, since the acceleration is the second derivative of the position,

$$\frac{d^2x}{dt^2} = -\bigg(\frac{k}{m}\bigg) x$$

So this tells us that the second derivative of $x$ is proportional to $-x$ times a constant.

What kind of object is this constant? We can see from the structure of the equation that it has to look like the product of two inverse times: the second derivative of $x$ is an acceleration so it is a rate of change of velocity — a change in (change in position per unit time) per unit time. We expect it to have a dimensionality 1/T^{2}. Let's check to see that this works. Here are the dimensionalities of the various quantities involved:

[$m$] = M

[$k$] = [$F/x$] = [$ma/x$] = ML/(LT^{2}) = M/T^{2}

[$k/m$] = M/(MT^{2}) = 1/T^{2}

In physics we often give quantities names that clue us in as to what kind of quantity a parameter looks like, that is, what dimensions it has. We have a couple of choices here -- we could define a time period, but it turns out to be more convenient to treat this combination like the square of an angular velocity. An angular velocity has units of radian/sec (dimensionality of 1/T). Angular velocity is often given the symbol "omega" ($ω$) so we will define

$$\omega_0 = \sqrt{\frac{k}{m}}$$

We put a subscript "0" on it to show it is a value, not a variable. With this definition, Newton's second law becomes:

$$\frac{d^2x}{dt^2} = -\omega_0^2 x$$

or

$$\frac{1}{\omega_0^2}\frac{d^2x}{dt^2} = - x$$

So up to a constant, $x$ is a function of $t$ whose second derivative looks like the negative of itself. You've seen this in your calculus course. We can make it look more like calculus by combining the $ω_0$ with the time to get a dimensionless variable, $τ = ω_0t$. (Check the dimensions of this for yourself. Our equation then becomes:

$$\frac{d^2x}{d\tau^2} = -x$$

This is pretty simple. It looks like the calculus equation "$d^2f/dx^2 = -f$" (but with different independent and dependent variables). It tells us we are looking for some function (of tau) whose second derivative is the negative of itself. You should recognize that both the sine and cosine functions satisfy this. We'll work with cosine for now, but in general we could have any sum of the two.

So our first guess at a solution is $x = \cos{τ}$. This doesn't quite work because the left and right side have different units. On the left, $x$ is a distance, while the right side is unitless. This suggests to us that a better answer would be$ x = A \cos{τ}$ where A is some distance. This would give us a final solution to Newton's law of motion:

$$x(t) = A \cos{\omega_0 t}$$

(The "$(t)$" after the $x$ just reminds us that $x$ is being considered as a function of $t$.) This is a satisfactory solution as far as units go: $ω_0t$ is dimensionless so it can be an angle (and you have to take cosine of a dimensionless quantity), and the result is a length. Now let's see how to interpret them physically.

## Interpreting the solution

The result of our analysis gives a graph of the position that looks like this: just a cosine curve (but since $t$ can get arbitrarily large, it doesn't stop at $2\pi$ but keeps oscillating).

But we need to interpret the physical parameters of what the mass is doing.

#### Telling the story of the motion

Clearly, at $t = 0$, $x$ is positive and at its maximum value. And since the slope ($v = dx/dt$) at $t = 0$ is 0, the physical system that this equation is describing must be that the mass has been pulled out, held at rest and released. It then oscillates down to 0, continues through and goes to compress the spring by an equal amount that it was stretched and comes back. Then it continues to repeat. Let's name the various parameters of the motion.

#### The amplitude

From looking at our equation, and knowing that cos oscillates between -1 and +1, we can see that x will vary from A to -A. Our parameter A is therefore the *amplitude* of the oscillation — the maximum extension it travels from rest in both directions.

#### The period

That's the spatial parameter. What about the temporal one? Since cosine continues to oscillate as its argument gets larger and larger (see Trig functions for any value of the argument) it repeats the same motion over and over.

This makes sense since after one oscillation the same initial conditions are repeated and, since we are assuming no friction or loss of energy, once we come back to our starting point the forces will make it do the same thing once again. Therefore, the time it takes to complete one oscillation is an important parameter. This is called the *period* and is marked on the figure at $T$. But we don't have a $T$ in our equation that describes the motion. We'll have to do a little more work to figure how it relates.

For $\cos{θ}$ to go through one full oscillation, $θ$ has to vary from 0 to $2π$ (in radians). Our argument of cosine must do the same thing to go through one full oscillation; so as $t$ goes from 0 to $T$, $ω_0t$ has to go from 0 to $2π$. This tells us that we must have

$$\omega_0 T = 2\pi$$

or

$$T = 2π/ω_0.$$

This tells us what $ω_0$ is really doing for us — it's setting the period of the oscillation. Putting in our value for ω_{0} in terms of the original parameters, we get

$$T = \frac{2\pi}{\omega_0} = 2\pi \sqrt{\frac{m}{k}} $$

This makes good sense, since if we have a bigger mass (bigger $m$), we expect the cart to move more slowly and have a longer period, and if we have a stronger spring (bigger $k$) we expect it to move more quickly and have a shorter period.

#### The phase shift

We have to deal with one more issue: we don't always get to start the mass at its maximum positive displacement at time $t = 0$. Sometimes we have a data collection device with a built-in time delay and we can't start is precisely when we want to. We might wind up with something like the graph below:

In this case, we had the oscillation starting near its negative maximum. We don't get to the maximum $x$ value of $+A$ until the time indicated by $t_0$. How should we write our equation then? The answer is to subtract $t_0$ from $t$, like this:

$$x(t) = A \cos{(ω_0(t - t_0))}.$$

This works the way we want it to since when $t = t_0$ the argument of the cosine becomes 0 and cosine takes on the value +1. So we get $x(t_0) = +A$.

Since both $ω_0$ and $t_0$ are constants, we can combine them by defining $ω_0t_0 = φ$ ("phi") and get

$$x(t) = A \cos{(ω_0(t - t_0))} = A \cos{(ω_0t - ω_0 t_0)} = A \cos{(ω_0t - φ}.)$$

The constant $φ$ is called the *phase shift*.

Thus, the three parameters in our expression for the position of the oscillator as a function of time, $x(t) = A \cos{(ω_0t - φ)}$ tell us:

- $A$ — the
**amplitude**, which tells us how far the oscillator goes in each direction; - $ω_0$ — the
**angular frequency**(determined by the spring constant and the mass),

which tells us the**period**by $T = 2π/ω_0$; - $φ$ — the
**phase shift**, which tells us where the oscillation starts at $t = 0$.

Joe Redish 3/12/12 & 5/16/19

#### Follow-ons

Last Modified: May 27, 2019