Spring Motion Applet

This applet calculates and animates the position of a spring in motion.

Back to Final Version

If your browser is having problems displaying this applet, make sure you have the latest version of Java installed on your computer.

History

This spring motion applet was created by student Malcolm Kotok, as part of an interdisciplinary directed study, under the guidance of professors Aaron Heap (Mathematics) and Doug Baldwin (Computer Science) at SUNY Geneseo. The ultimate goal of the directed study was to create an applet that illustrates the motion of a spring, modeled by a second-order differential equation known as the Model of Harmonic Motion:
m x'' + d x' + k x = f(t)

If an object of mass m > 0 is attached to a spring and set in motion, its vertical position x(t) at any time t is affected by several forces. In addition to gravity, there is the spring force, damping force (such as air resistance), and a possible external force. Controlling these forces are the spring constant k > 0, the damping constant d ≥ 0, and an external forcing function f(t).

This is the original version of the program, where there is no external forcing term. Setting f(t) = 0 leads to a homogeneous differential equation that is easily solved. This version of the applet has an extra feature of actually providing an explicit formula for the solution to the differential equation, which is a function representing the displacement of the object hanging from the spring as time goes by. The final version does not have this feature.

To use the applet, simply input the constants m > 0, d ≥ 0, and k > 0. You may also input almost any type of function (using t as a variable) in the text box on the right-hand side of the differential equation. You can also change the initial conditions t0, x0, and v0 or the window size for the graph. After inputting the values you want to use, hit the 'SOLVE' button to plot the solution and hit the 'Animate' button to set the spring in motion.