NextNext Page Arrow

PhysLab.net – Simple Simulation

This is a simplified text-only version of the single spring simulation. You can click the start and stop buttons to pause the simulation. The numbers being reported are time t, horizontal position of the spring x, and velocity v. If you don't see the simulation try instructions for enabling Java.



This version is intended for a student wanting to experiment with simulating a system. The text-only output makes the code much simpler. It would be fairly easy to put in a different simulation, by changing the differential equations being used. The student can easily see how the Runge-Kutta algorithm is implemented in the code (see the solve method).

The source code is available here or view the source directory. The code is contained in the single file simple.java. There are instructions in the file about how to compile and run the application. The source code is covered by the GNU General Public License.

This applet can be used in a web browser, or as a stand-alone Java application (which permits debugging with the jdb debugger).