Home▸Sound & Music▸Coupled Oscillators 2D — Normal Modes & Beating

Coupled Oscillators 2D — Normal Modes & Beating

Two masses on springs, rendered in plain Canvas2D: excite the symmetric or antisymmetric normal mode, or watch a beating envelope as energy sloshes between the masses, with live mode-frequency, beat-period and energy readouts.

Sound & Music2DModerate60 FPS⇄ 3D version
2d-coupled-oscillators ↗ Open standalone

This 2D companion drives the identical coupled spring-mass equations of motion as the 3D version — m₁ẍ₁ = -k₁x₁ + κ(x₂-x₁) - γm₁ẋ₁ and m₂ẍ₂ = -k₂x₂ - κ(x₂-x₁) - γm₂ẋ₂, integrated with eight semi-implicit-Euler substeps per frame — through a flat top-down Canvas2D view built for reading the mechanics directly: springs are drawn as zig-zag segments that shift from grey to red as they stretch, arrows show each mass's live displacement from equilibrium, and a waveform strip plots x₁ and x₂ over the last few seconds so the beating envelope is visible as a shape, not just implied by motion.

⚙ Under the hood

Canvas2D coupled-oscillators lab: symmetric/antisymmetric normal modes, beating, live mode-frequency and energy readouts, spring-strain colour coding.

coupled oscillatorsnormal modesbeatingspring constantresonance

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

Frequently Asked Questions

Why build a 2D version of an already-simple system?

The 3D version renders the same masses and springs in a Three.js scene you can orbit; this flat view removes the camera and lets the spring-strain colouring and the waveform plot sit side by side with nothing hidden behind perspective.

What causes the beating pattern?

Clicking Beating displaces only mass 1, exciting both the symmetric and antisymmetric modes at once. Because their frequencies differ slightly when κ is small, the two modes drift in and out of phase, so energy sloshes fully from mass 1 to mass 2 and back over one beat period.

Is the physics the same as the 3D version?

Yes — identical equations of motion, identical mode-frequency formula ω₊ = √((k+2κ)/m), and the same energy readout summing kinetic and elastic potential energy across both masses and the coupling spring.

What did you find?

Add reproduction steps (optional)