Skip to content

Hooke's Law Interactive Demonstration

Run Hooke's Law MicroSim Fullscreen Edit the Hooke's Law MicroSim Using the p5.js Editor

Copy This MicroSim to Your Website

1
<iframe src="https://dmccreary.github.io/intro-to-physics-course/sims/hookes-law-demo/main.html" width="100%" height="600px"></iframe>

About This MicroSim

This interactive simulation demonstrates Hooke's Law (F = kx) with a vertical spring-mass system. Drag the mass, add data points to the graph, and discover the linear relationship between force and displacement.

How to Use

  1. Drag the mass to stretch the spring to different positions
  2. Click "Add Data Point" to record the current force and displacement
  3. Collect several data points at different displacements
  4. Enable "Show best-fit line" to see the linear relationship
  5. Compare the calculated slope to the actual spring constant

Key Concepts

  • F = kx: Force is proportional to displacement
  • k = spring constant: Measures spring stiffness (N/m)
  • The slope of F vs. x equals k

Controls

  • Spring k slider: Change the spring constant
  • Mass slider: Change the hanging mass
  • Release: Start oscillation from current position
  • Add Data Point: Record current measurement

Lesson Plan

Experiment: Measuring Spring Constant

  1. Set a spring constant value
  2. Add 5-6 data points at different displacements
  3. Compare the best-fit slope to the actual k value
  4. How close is your measurement?

References

  1. Hooke's Law - Wikipedia - Comprehensive overview of Hooke's Law, its history, and applications
  2. Simple Harmonic Motion - HyperPhysics - Educational resource on oscillatory motion and spring systems
  3. p5.js Reference - Documentation for the p5.js library used in this simulation