[Thumb-nail of Swinging Spring] [Thumb-nail of Swinging Spring]

The Lagrange Applet

The Swinging Spring Java Applet is an application of the Lagrange Applet, a cool Java program written by Peter Selinger of Dalhousie University. There is a description of the applet, and clear instructions on how to modify it, at Peter Selinger's site.

The applet implemented here computes a solution of the Swinging Spring dynamical system, integrating the equations numerically with a fourth-order Runge-Kutta method, and displays the results graphically. A vertical cross-section (in the x-z plane) is shown on the left and a horizontal projection (the x-y plane) on the right. The size of the bob indicates distance from the viewer. Physical parameters and initial conditions are set in the loading page. Default values of the parameters ensure that the spring is in resonance (spring frequency is twice swing frequency).

Some examples of the applet are given here [you must have a Java-enabled browser]:

Physical parameters can be changed using the right-hand button and entering new values in the table. However, if you want to do serious experiments using the applet, and have control of the initial conditions, you should download the Class Files in a gzipped tar file, and also a loading page such as this page, in which default initial conditions are specified and may be changed. Many beautiful patterns can be generated by experimenting.

The Java Source Code of the Swinging Spring Applet, which includes the Runge-Kutta solver, is yours for a click. However, you may prefer to work from the original source code of Peter Selinger, using the Documentation provided by him.

Here are some other applications of the Lagrange Applet originally written by Peter Selinger. The Java Source Code of the original applet is available. There is also an excellent description of the applet, and clear instructions on how to modify it, at Peter Selinger's site.

Double Pendulum

Double Spring

Spring Pendulum with Toggle

Back to Swinging Spring Home Page

Updated December 3rd, 2002.