---
title: "Mass–spring motion, period and energy | Sandbox Physics"
description: "A displaced mass accelerates toward equilibrium. Predict the period from mass and spring stiffness and follow the exchange of kinetic and potential energy."
canonical_url: "https://sandboxphysics.com/learn/oscillations-and-waves/mass-spring-oscillation/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/learn/oscillations-and-waves/mass-spring-oscillation/"
last_modified: "2026-11-24"
---

[Volume 2 · Oscillations and Waves](https://sandboxphysics.com/learn/oscillations-and-waves/)

# Why does a mass on a spring oscillate?

A displaced mass accelerates toward equilibrium. Predict the period from mass and spring stiffness and follow the exchange of kinetic and potential energy.

Before you start: [Volume 1 Chapter 1](https://sandboxphysics.com/learn/mechanics/describing-motion/), [Chapter 6](https://sandboxphysics.com/learn/mechanics/forces-and-motion/), [Chapter 9](https://sandboxphysics.com/learn/mechanics/work-and-kinetic-energy/) and [Chapter 10](https://sandboxphysics.com/learn/mechanics/conservative-forces-and-potential-energy/) on motion graphs, forces, work and energy.

After this chapter you can: Read amplitude, phase and period from a motion record, predict the result of changing mass or stiffness, and check the energy balance over a cycle.

A stretched spring pulls the mass back toward equilibrium. The mass is still moving when it reaches equilibrium, so it crosses to the other side. The compressed spring then pushes it back. For a linear spring with negligible friction, this motion repeats at a period set by the mass and the spring stiffness.

Volume 1 introduced motion graphs, Newton's laws, work and potential energy in Chapters 1, 6, 9 and 10. We use them here to predict the time for one cycle, work out where the mass moves fastest and see which changes leave the period alone.

## 1.1 A linear restoring force gives a repeating motion

Take a point mass $m$ on a horizontal frictionless track. Measure displacement $q$ from the position where the mass can rest, with rightward positive. The equilibrium displacement is zero. A linear spring exerts the signed force $-kq$, where the stiffness $k$ is measured in newtons per metre. The minus sign means the force always points toward equilibrium.

The spring's force becomes zero at equilibrium, but it has already accelerated the mass on its way there. On the other side, the force opposes the motion and brings the mass to a stop. It then accelerates the mass back toward equilibrium. Newton's second law gives

$$
m\frac{\mathrm d^2q}{\mathrm dt^2}=-kq.
$$

A cosine has exactly this property. Its second time derivative is the original cosine multiplied by a negative constant. Write $A$ for the amplitude, the greatest distance from equilibrium, and use a constant phase angle $\varphi$ to choose where in the cycle the mass starts. Substitution gives the motion and its angular frequency $\omega_0$:

$$
q(t)=A\cos(\omega_0t+\varphi),\qquad
v(t)=-A\omega_0\sin(\omega_0t+\varphi),\qquad
\omega_0=\sqrt{\frac{k}{m}}.
$$

The phase inside the cosine increases with time. It advances by $2\pi$ radians in one period $T$. Ordinary frequency $f$ counts cycles each second and is measured in hertz:

$$
T=\frac{2\pi}{\omega_0}=2\pi\sqrt{\frac{m}{k}},
\qquad
f=\frac{1}{T}.
$$

A greater mass responds more slowly to a given force. A stiffer spring produces more acceleration for a given displacement. The ratio $k/m$ has units of inverse seconds squared, which gives the period in seconds. Changing amplitude or initial phase leaves this ratio, and therefore the period, fixed for the linear model.

### 1.1.1 Phase gives both position and direction

A reference point moving steadily around a circle makes the phase visible. Draw the circle with radius $A$. Its horizontal coordinate is the cosine expression for $q$. If the point starts on the right and moves counterclockwise, $\varphi=0$. After a quarter turn, the horizontal coordinate is zero and decreasing, corresponding to the mass crossing equilibrium with negative velocity.

Two different phases can give the same position with opposite velocities. Look at the slope of the position graph to tell which direction the mass is moving. For example, $\varphi=\pi/2$ starts the mass at equilibrium with a leftward velocity, and $\varphi=3\pi/2$ starts it at the same place moving right.

## 1.2 Kinetic and potential energy take turns

Choose the mass and spring together and set the elastic potential to zero at equilibrium. The spring force and the signed area relation from Volume 1 give the stored energy $U=\tfrac12kq^2$. The kinetic energy of the mass is $K=\tfrac12mv^2$.

$$
E=K+U=\tfrac12mv^2+\tfrac12kq^2=\tfrac12kA^2.
$$

The total $E$ stays constant because there is no friction and no work from outside. At a turning point all of it is stored in the spring. At equilibrium all of it is kinetic. This gives a check on the motion from a different calculation. Set $q=0$ in the energy equation, equate the remaining kinetic energy to the initial spring energy and find the maximum speed $v_{\max}=A\sqrt{k/m}$. It matches the amplitude of the velocity in the time-domain solution.

The energy curves repeat after half a displacement period. At the two opposite turning points, the displacement signs differ and the potential energy depends on their squares. The full motion repeats only when displacement and velocity both return to their starting values.

## 1.3 Predict one cycle and measure its period

Release a $0.50\,\mathrm{kg}$ mass from rest at $q=+0.120\,\mathrm m$ on a spring of stiffness $8.00\,\mathrm{N\,m^{-1}}$. The period is $T=\pi/2\,\mathrm s\approx1.571\,\mathrm s$. The quarter period is about $0.393\,\mathrm s$. The mass first passes equilibrium moving left at $-0.480\,\mathrm{m\,s^{-1}}$. The starting elastic energy is $0.0576\,\mathrm J$. Dividing twice that energy by the mass and taking a square root also gives the crossing speed $0.480\,\mathrm{m\,s^{-1}}$.

- Kinetic energy
- Spring potential energy

**Figure 1.1** Displacement and energy over one ideal cycle of the mass–spring model. The upper panel gives the position relative to equilibrium. In the lower panel the kinetic energy is greatest at the equilibrium crossings and the elastic energy is greatest at the turning points. The two energies add to the same total throughout.

### 1.3.1 Read the motion a quarter period at a time

Open the [Mass–Spring Oscillator](https://sandboxphysics.com/labs/mass-spring/) and select “Energy exchange.” Before scrubbing the replay, predict the direction of the first crossing and the energy at the first turning point after launch. Move through the cycle with “Replay time.” Record the signs of displacement and velocity and compare the energies at the quarter-period marks.

**Table 1.1** Model values for the first cycle of the horizontal spring. The times are rounded, and the rows refer to the exact fractions of the period.

| Time (s) | Displacement (m) | Velocity (m/s) | Kinetic energy (J) | Elastic energy (J) |
| --- | --- | --- | --- | --- |
| 0 | +0.120 | 0 | 0 | 0.0576 |
| 0.393 | 0 | −0.480 | 0.0576 | 0 |
| 0.785 | −0.120 | 0 | 0 | 0.0576 |
| 1.178 | 0 | +0.480 | 0.0576 | 0 |
| 1.571 | +0.120 | 0 | 0 | 0.0576 |

### 1.3.2 Change the clock, then estimate it from positions

Keep the release amplitude and phase fixed. Predict the period when “A heavier carriage” raises the mass to $2.00\,\mathrm{kg}$ and when “A quicker spring” raises the stiffness to $30.0\,\mathrm{N\,m^{-1}}$. Each preset starts from the original setup and changes one of these quantities.

The camera estimate uses position samples from a simulated camera. Choose successive crossings in the same direction. A crossing between two frames can be estimated by joining their positions by a straight line and finding where it reaches equilibrium. The Lab accepts a rising crossing after the mass has gone far enough on the negative side. It estimates the period from the slope of crossing time against crossing number.

**Table 1.2** Model and camera periods with 60 frames per second, position noise of $0.0003\,\mathrm m$ standard deviation, and seed 1701. The representative model record spans nine ideal periods. The period estimator uses the simulated position samples and their times.

| Preset | Mass (kg) | Stiffness (N/m) | Ideal period (s) | Camera estimate (s) |
| --- | --- | --- | --- | --- |
| Energy exchange | 0.50 | 8.00 | 1.57080 | 1.57078 |
| A heavier carriage | 2.00 | 8.00 | 3.14159 | 3.14168 |
| A quicker spring | 0.50 | 30.0 | 0.81116 | 0.81119 |

The heavier mass takes about twice as long per cycle. The spring with greater stiffness takes less time. If you counted both the rising and falling crossings together, adjacent crossings would be half a period apart. A change in the starting phase can move all crossing times without changing their spacing.

## 1.4 Gravity shifts a hanging spring's equilibrium

Turn the spring upright and measure downward as positive. Let $y$ be the extension from the unloaded spring length. Weight contributes $mg$ in the positive direction and the spring contributes $-ky$. Their sum vanishes at $y_{\mathrm{eq}}=mg/k$. Let $q=y-y_{\mathrm{eq}}$ measure displacement from the new equilibrium.

$$
mg-ky=-kq,\qquad
m\frac{\mathrm d^2q}{\mathrm dt^2}=-kq.
$$

The equation has the same stiffness and mass as before. Gravity sets where the mass rests. The period around that point stays the same for this ideal spring. The spring alone stores more energy if the mass moves downward from equilibrium. Gravity's potential decreases by the amount needed to cancel the linear part of that spring-energy change. The combined change relative to equilibrium is still $\tfrac12kq^2$.

Compare “A quicker spring” with “Hang it vertically.” The mass is $0.50\,\mathrm{kg}$ and stiffness is $30.0\,\mathrm{N\,m^{-1}}$ in both. With $g=9.81\,\mathrm{m\,s^{-2}}$, predict a static extension of $0.1635\,\mathrm m$ and the same ideal period of $0.81116\,\mathrm s$. Check both values. A static pull that changes the stiffness, or a force that dissipates energy, would require a different model. Chapter 2 examines what happens when a resistive force makes the oscillation fade.

## 1.5 Exercises and explained answers

1. A $1.00\,\mathrm{kg}$ mass oscillates on a spring of stiffness $4.00\,\mathrm{N\,m^{-1}}$. Find the angular frequency, period and ordinary frequency.
2. A horizontal oscillator passes through equilibrium moving left. Give the signs of its velocity and acceleration there. What sign does the acceleration have just after the crossing?
3. The amplitude of an ideal oscillator doubles with mass and stiffness fixed. How do the period, maximum speed and total mechanical energy change?
4. A mass starts at equilibrium moving right in the cosine description. Give a possible initial phase.
5. An oscillator with amplitude $0.10\,\mathrm m$ has stiffness $20\,\mathrm{N\,m^{-1}}$. Find its elastic energy and kinetic energy when its displacement is $0.06\,\mathrm m$.
6. At three successive rising crossings, a camera records $0.60\,\mathrm s$, $1.40\,\mathrm s$ and $2.20\,\mathrm s$. Estimate the period. How would the answer change if those times were successive crossings with alternating directions?
7. A hanging mass of $0.25\,\mathrm{kg}$ stretches a spring of stiffness $10\,\mathrm{N\,m^{-1}}$. Use $g=10\,\mathrm{m\,s^{-2}}$. Find the equilibrium extension and the period. Repeat if gravity is half as large.
8. A student compares periods measured after small and large releases with the same mass and spring. The large-release period is consistently longer. What should the student check before using the same linear model for both?

Exercise 1

The angular frequency is $\sqrt{4.00/1.00}\,\mathrm{rad\,s^{-1}}=2.00\,\mathrm{rad\,s^{-1}}$. One cycle takes $2\pi/2.00\,\mathrm s\approx3.14\,\mathrm s$. The number of cycles per second is about $0.318\,\mathrm{Hz}$.

Exercise 2

Velocity is negative because left is negative. Acceleration is zero at equilibrium because the net force there is zero. Immediately afterward the displacement is negative and the restoring force points to the right, giving positive acceleration.

Exercise 3

The period stays fixed because $k/m$ stays fixed. Maximum speed doubles because it is proportional to amplitude at a fixed angular frequency. Total energy grows by a factor of four because it is proportional to amplitude squared.

Exercise 4

Choose $\varphi=3\pi/2$. The cosine is zero there, so the mass is at equilibrium. The sine is negative, making velocity positive in the cosine model's velocity equation.

Exercise 5

The total energy is $\tfrac12\times20\times0.10^2\,\mathrm J=0.100\,\mathrm J$. The spring stores $\tfrac12\times20\times0.06^2\,\mathrm J=0.036\,\mathrm J$ at the given position. Subtracting gives a kinetic energy of $0.064\,\mathrm J$.

Exercise 6

The difference between same-direction crossings is $0.80\,\mathrm s$, so that is the period. If directions alternate, $0.80\,\mathrm s$ is only half a period. One full cycle then takes $1.60\,\mathrm s$.

Exercise 7

The equilibrium extension is $mg/k=0.25\,\mathrm m$. The period is $2\pi\sqrt{0.25/10}\,\mathrm s\approx0.993\,\mathrm s$. With half the gravity the extension becomes $0.125\,\mathrm m$. The period stays at $0.993\,\mathrm s$.

Exercise 8

Check that both records compare the same crossing direction and have enough frames to resolve those crossings. Then measure spring force against displacement across both swings. A force graph whose slope varies across the larger swing gives a physical reason for the ideal period prediction to fail.

## Test it in the Lab

Change one setting at a time, then compare what you see with the tables and answers in this chapter.

[Mass–Spring Oscillator → Drag a spring mass and compare energy exchange, the phase-space ellipse and rotating phasor. Time noisy camera crossings and try vertical suspension.](https://sandboxphysics.com/labs/mass-spring/)

## Sources and reading scope

1. [OpenStax, University Physics Volume 1, §15.1 Simple Harmonic Motion](https://openstax.org/books/university-physics-volume-1/pages/15-1-simple-harmonic-motion)

   The section relates a linear restoring force to sinusoidal motion, defines period and phase, and gives the natural frequency of an ideal mass and spring.

2. [OpenStax, University Physics Volume 1, §15.2 Energy in Simple Harmonic Motion](https://openstax.org/books/university-physics-volume-1/pages/15-2-energy-in-simple-harmonic-motion)

   The section derives elastic potential energy and shows how it exchanges with kinetic energy in the absence of dissipation.

3. [OpenStax, University Physics Volume 1, §15.3 Comparing Simple Harmonic Motion and Circular Motion](https://openstax.org/books/university-physics-volume-1/pages/15-3-comparing-simple-harmonic-motion-and-circular-motion)

   Projection of uniform circular motion onto a line gives a geometric way to read phase and sinusoidal displacement.

[← Volume 2 · Oscillations and Waves](https://sandboxphysics.com/learn/oscillations-and-waves/) [Chapter 2 · How does a free oscillation die away? →](https://sandboxphysics.com/learn/oscillations-and-waves/damped-oscillations/)

Chapters in this volume

- [1. Why does a mass on a spring oscillate?](https://sandboxphysics.com/learn/oscillations-and-waves/mass-spring-oscillation/)
- [2. How does a free oscillation die away?](https://sandboxphysics.com/learn/oscillations-and-waves/damped-oscillations/)
- [3. Why does a periodic push build a large oscillation?](https://sandboxphysics.com/learn/oscillations-and-waves/driven-oscillation-and-resonance/)
- [4. How do coupled oscillators exchange energy?](https://sandboxphysics.com/learn/oscillations-and-waves/coupled-oscillators/)
- [5. How does a wave carry a phase from place to place?](https://sandboxphysics.com/learn/oscillations-and-waves/travelling-waves/)
- [6. How do boundaries select standing waves?](https://sandboxphysics.com/learn/oscillations-and-waves/standing-waves-and-fourier/)

## Keep reading

Interactive Physics Textbook · Reading path

### Oscillations and Waves

1. [You are here **Why does a mass on a spring oscillate?**](https://sandboxphysics.com/learn/oscillations-and-waves/mass-spring-oscillation/)
2. [Article **How does a free oscillation die away?**](https://sandboxphysics.com/learn/oscillations-and-waves/damped-oscillations/)
3. [Article **Why does a periodic push build a large oscillation?**](https://sandboxphysics.com/learn/oscillations-and-waves/driven-oscillation-and-resonance/)
4. [Article **How do coupled oscillators exchange energy?**](https://sandboxphysics.com/learn/oscillations-and-waves/coupled-oscillators/)
5. [Article **How does a wave carry a phase from place to place?**](https://sandboxphysics.com/learn/oscillations-and-waves/travelling-waves/)
6. [Article **How do boundaries select standing waves?**](https://sandboxphysics.com/learn/oscillations-and-waves/standing-waves-and-fourier/)
