Spring Motion Applet

This applet calculates and animates the position of a spring in motion. You will find some input examples below the applet.

Size: | Larger | Large | Default |

(Resolution) | (1150 x 800) | (1000 x 700) | (850 x 600) |

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

The original version of the program (found here) did not allow for an external forcing term, which led to a homogeneous differential equation that is easily solved. That applet had an extra feature of actually providing the solution to the differential equation, which would be a function representing the position of the object hanging from the spring as time goes by. The current version does not provide an explicit formula for the solution to the differential equation, but does provide a graph of the solution.

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 t_{0}, x_{0}, and v_{0}** or the window size for the graph. After inputting the values you want to use, hit the

Here we provide a few simple examples to help you get started. For each of these, you can use the default initial conditions ** t_{0} = 0**,

**Example 1:** Let's begin by using *m* = 5, *d* = 1, *k* = 10, and no external forcing term (*f(t)* = 0.) This is a simple example of ** underdamped** motion. If we change the damping constant to

Now we consider some nontrivial external forces by entering various functions into the box on the right-hand side of the differential equation, creating an inhomogeneous differential equation.

**Example 2:** Use *m* = 5, *d* = 1, and *k* = 10, but this time use an external force ** f(t) = sin t**. Notice how the external force affects the motion of the spring and actually allows the oscillation to continue indefinitely and eventually maintain a steady amplitude. If you check the box labeled "Forcing Term" below the graph, the forcing term will also be plotted, and we can see that eventually the oscillation of the spring coincides with the oscillation of the external force. Now change the spring constant to

We can also have an external forcing term that is a piecewise continuous function. We can obtain the * unit step function* at

**Example 3:** Use *m* = 5, *d* = 1, and *k* = 10. We can use a simple step function such as ** f(t) = 3step(t-25)**, or we can obtain other piecewise continuous functions such as

**Example 4:** Use *m* = 5, *d* = 1, and *k* = 5, and try each of the following external forcing terms:

*f(t) = 6step(t-15) - 11step(t-30)**f(t) = t step(t-15) - t step(t-30)*- Explore some of your own...