Simulation of a Chaotic Pendulum

Send questions or comments about the Pendulum Program to Jan Tobochnik jant@kzoo.edu

Click on PendulumProgram to see an example of a simulation of a pendulum which does not make the small angle approximation and includes the possibility of adding drag and a driving force. With appropriate choice of parameters this pendulum exhibits chaotic behavior. For example, trya driving frequency = 2, drag coefficient = 0.2, and driving force amplitudes between 0.7 to 1.2. (See Gould and Tobochnik, "An Introduction to Computer Simulation Methods," Chapter 6.8 for more details.) This program is also a good example of how to do graphics using the simphy Package which I have written.

In the following files you can find all the code used to create this Java Applet as well as the code to convert to a Java Application. The Applet uses the simphyPackage. The classes RunPendulumApplet (for the Applet) and RunPendulum (for the application) set up the simulation by providing direction to any buttons pressed or numbers entered into any TextField. Also, this class takes care of the animation. The class ChaoticPendulum then does all the work of updating the position and angle for the pendulum.

The Applet does not work on my version of Netscape for the Macintosh, but works fine using Internet Explorer and Netscape for Windows. Below are the source listings.

RunPendulumApplet Class

ChaoticPendulum Class

RunPendulum Class(Application version)