Simple Harmonic Motion

Some 14 years ago when learning about second order differential equations, simulating physical systems on computers and simple harmonic motion, I wrote this DOS program which (because it's kind of fun to play with) I have now translated into flash:

The idea is very simple - it's just a mass (the white ball) with a green pen, connected to a point by a piece of elastic (the white line). The point doesn't move except when the mouse button is held down, when it moves to the mouse pointer location. This means that the mouse is essentially the forcing function for a 2D, second-order linear differential equation. Which means that (depending on the parameters) the mass follows the mouse pointer, possibly smoothing out its motion, possibly oscillating around it.

There are two slider controls on the right - the leftmost one (or the + and - keys) controls the tension and the rightmost one (or the < and > keys) controls the friction. Press escape to clear the screen.

Source code.

One Response to “Simple Harmonic Motion”

  1. [...] Reenigne blog Stuff I think about « Simple Harmonic Motion [...]

Leave a Reply