# Ordinary Differential Equations/Simple Harmonic Motion

Simple Harmonic Motion can be used to describe the motion of a mass at the end of a linear spring without a damping force or any other outside forces acting on the mass. It's best thought of as the motion of a vibrating spring.

## Contents

## Laws of Motion[edit]

There are generally two laws that help describe the motion of a mass at the end of the spring.

- Hooke's Law
- Newton's Second Law

### Hooke’s Law[edit]

To demonstrate Hooke’s Law, we will use a (massless) spring hung from a ceiling. The ceiling is rigid, and offers no effect on the spring’s motion.

If we leave the spring alone, and don’t attach a mass, the spring will remain in an un-stretched state with a total length . Now, if we attach an arbitrary mass () to the free end of the spring, then the spring will stretch a distance () from the original length (). So now .

Eventually, the mass will come to rest at this new total length at a position known as the **Equilibrium Position**. This position is what many of the calculation reference as .

Here is where Hooke's law comes into play. As the spring stretches, when the mass is attached, a force is exerted on the mass in the direction of the original un-stretched position. This force is expressed using the equation: . Where is the force exerted on the mass by the spring, is the spring's **Constant of Proportionality**, often called the **spring constant**, and is the distance the spring stretched from its un-stretched position.

Suppose that any movement by the mass in a downward direction is considered positive and upward is negative. If you take the weight () of the mass, it will be equal to the force exerted by the spring when , or the equilibrium position. Due to this, we now know that . Since and , by substitution, we get . If you set these equal to zero, you'll get .

*Why is negative?* This is because no matter what the mass does, the spring-with-gravity combination will always exert a force opposite to its motion. For example, as the mass travels downward beyond the equilibrium point, the spring will pull it back * upwards* in an attempt to regain equilibrium. When the mass gets above the equilibrium point, the spring contribution is less and the net acceleration is then

*toward regaining equilibrium. It behaves the same as if in an idealized example imagined all far removed from any local gravity effect, and that the spring is alternately stretched and compressed about a completely unstressed state. Some examples invent a horizontal version with the mass sliding over a frictionless surface, the better to then introduce a friction component.*

**downward**#### Examples[edit]

##### Example 1[edit]

A mass of is attached to a spring and stretches it . Calculate the spring's constant of proportionality.

**Solution**

Using the combined equation , we know and

(we omit the vector since we're only looking for a magnitude)

By definition, we know

Plugging everything in, we get .

Solving for , we find

##### Example 2[edit]

An object of unknown mass stretches a spring 10 cm from the ceiling. The spring's original length was 7 cm. Calculate the weight of the object if the spring constant is 5 N/m.

**Solution**

First, we need the distance the spring is stretched after the mass is attached. This can be found using , where and . Plugging everything in and solving for we find .

By definition we know . With that, and , we plug everything in and solve for .

### Newton’s Second Law of Motion[edit]

Now, imagine that we have another mass hanging from a spring, which is attached to the ceiling. This mass is then pulled down a distance , below the equilibrium point, and released. By Hooke's Law, the spring will be pulled back up, and after reaching it's highest point, start to travel back down.

If the mass continues this motion, without any outside influence, it's known as **Free Motion**. During this motion, there is acceleration acting on the mass to keep it in motion. This acceleration can be readily found in Newton's Second Law of Motion using . Where is the force of the spring acting on the mass and is the acceleration of that mass due to the force acting on it.

From Calculus, we know that or . If we substitute this into our equation from the section on Hooke's Law, we find . However, since this motion is always in the direction of the spring's force, our equation becomes . Expanding this, and solving for we get . Knowing that , we can simplify our equation to end with .

## The Differential Equation of Free Motion or SHM[edit]

Finally, if we set the equation above equal to zero, we end up with the following:

Since our leading coeffiecient should be equal to 1, we divide by the mass to get:

If we set , we'll have our final form of this equation:

The above equation is known to describe **Simple Harmonic Motion** or Free Motion.

### Initial Conditions[edit]

With the free motion equation, there are generally two bits of information one must have to appropriately describe the mass's motion.

- The starting position of the mass.
- The starting direction and magnitude of motion.

Generally, one isn't present without the other. For simplicity, we will consider all displacement below the equilibrium point as and above as .

For upward motion , and for downward motion .

### Solution[edit]

Multiplying this equation by gives:

The first and the second addends are exact derivatives, so this equation may be integrated to obtain the following relation:

The first addend of this relation is known as the kinetic energy of the mass and the second — as the potential energy of the spring. The above integral represents the energy conservation law. This is also a first order separable differential equation. It may be rewritten as

The integration of this relation gives

Or, finally rearranging the result, substituting , and solving for we obtain