Interactive three-dimensional simulations & visualizations

Visualizing the beauty in physics and mathematics


Project maintained by zhendrikse Hosted on GitHub Pages — Theme by mattgraham

Ball on a spring


๐Ÿ”ง This ball_on_spring.js uses Three.js

Background info

๐Ÿง  Note that the energy oscillates with a higher frequency than the position, namely twice as fast.

๐Ÿ‘‰ The bal goes up/down with frequency ฯ‰
๐Ÿ‘‰ The energy oscillates with frequency 2ฯ‰

Why does this happen?

Consider an ideal harmonic vibration. The position is given by:

\[y(t) = A \cos(\omega t)\]

The velocity is given by:

\[v(t) = -A \omega \sin(\omega t)\]

๐Ÿ”ด The kinetic energy is:

\[E_k = \tfrac12 m v^2 = \tfrac12 m A^2 \omega^2 \sin^2(\omega t)\]

where we have used the trigonometric identity: \(\sin^2(\omega t) = \tfrac12 (1 - \cos(2\omega t))\)

From this it follows that:

โžก๏ธ Frequentie = 2ฯ‰


๐Ÿ”ต The potential spring energy is given by:

\[E_p = \tfrac12 k y^2 = \tfrac12 k A^2 \cos^2(\omega t)\]

where

\[\cos^2(\omega t) = \tfrac12 (1 + \cos(2\omega t))\]

โžก๏ธ Also 2ฯ‰


โšช The total energy

\[E = E_k + E_p = \text{constant (zonder demping)}\]

With damping:

๐Ÿ“ Intuitively

The ball:

The energie:

โžก๏ธ So two peaks per cycle

๐Ÿงช What do we observe?

Entity Frequency
Position ฯ‰
Velocity ฯ‰
Energy (KE/PE) 2ฯ‰
Total energy ~ constant (or slowly diminishing)

โœ”๏ธ Exactly in accordance with theory!


Share on: