University of Maryland Physics Education Research Group

Resources on the Web for Teaching Physics

Physics Software from the UMd PERG:
StWave -- A Standing Wave on a String Simulation

I. D. Johnston, M. A. Oldfield, University of Sydney
E. F. Redish, University of Maryland

Download File (39 KB)

Brief description

This program displays and solves for the motion of up to 50 identical masses connected by identical springs and tied down at both ends. The system is started by displacing the masses according to the shape of a standing wave. The program displays an animation of the masses and spring and either time graphs of the position and/or velocity of specified masses or an animated display of the energy localized in each mass and spring.

Pedagogical utility

The program allows the student to view the standing waves. The separation of inertial and force characteristics into masses and springs allows the student to learn to separate the motion of the mass elements of the string from the motion of the wave pattern. It helps the student make the link between the ideas of Newtonian mechanics and the concept of waves in mechanical systems. It provides a good introduction to the idea that in a normal mode, all parts of the string oscillate with the same frequency.

Appropriate for

Screen views

Fig. 1: Display of pulse with the time display of two masses.

Fig 2: The display of the pulse with local kinetic and potential energies shown.


The code may be downloaded by clicking here. (46K)

The file is a zip file. Unpack it using WinZip. You will then find the following files in your directory:

If you are running under Windows, be certain the computer knows where the file is and what directory it is in. To check this, right click on the program icon and choose "Properties." On the tab "program" make sure the full address of the program is correct. The "start-up directory" should be the directory containing the program.

Technical information

The initial condition for the j-th mass (out of N) is chosen to be zero velocity and displacement A sin(njpx/NL) with the value of n adjustable by the user.

The equations of motion are solved using either the Euler or half-step method (user's choice). The user may also change the value of the mass and spring constant. Values may be read off the graphs.

Program help

The menu items on the menu you see first (the main menu) do the following things:

Allows you to set the parameters of the problem
Plots the graphs.
Allows you to change what is displayed or the solution method.
Brings up a screen describing what the menu items do.
Ends the program.

Select SET DATA and press . The first time you do this you will see the option screen. It allows you to change the numerical method by which the equations are solved (This feature is not implemented in the current version.) change whether you display graphs of the time dependences of the postions or velocities of two of the masses or an animated energy display.

If you choose time dependences (the default value) you can choose which masses' properties you want displayed and whether you want to look at their position or their velocity.

If you press from the options screen, you will now see the data-entry screen. The parameters of the problem are shown on this screen. The numbers the program is currently using are shown in the black boxes. You can change any of them by typing over the numbers that are there. Use the arrow keys to change your position on the data-entry screen. For now, just look at the numbers. Press to accept this data.

Notice that there are now three graph windows. The bottom one displays an animation of the motion of the springs. The top two graphs plot the position of two of the masses. You set which ones in the OPTIONS screen described below.

Also notice that the menu has changed. This is the graph menu. The entries are selected and activated in the same way as those of the main menu, by highlighting them with the arrow keys and pressing . The entries do the following things:

Starts the animation. Pause it by pressing .
Moves a paused animation by one time step.
Allows you to read a point off a graph using the mouse cursor.
Brings you back to the data entry screen.
Brings up a screen describing what the menu items do.
Returns to the main menu.

Contact person

E. F. Redish,
University of Maryland,
College Park, MD 20742;
phone: 301-405-6120,
fax: 301-314-9531,
Information about PERG Resource materials from PERG PERG Homepage PER elsewhere on the web Resource materials for teachers

Maintained by University of Maryland PERG
Comments and questions may be directed to E. F. Redish
Last modified February 16, 2001