Thermo
A Gas in a Box Simulation

E. F. Redish, G. Norkus, and J. B. Harold
University of Maryland, College Park

Brief description

THERMO is a statistical mechanics simulation that allows you to investigate a wide variety of equilibrium and non-equilibrium phenomena. You can display the motion of up to 1100 particles in a box moving under a variety of forces: hard sphere collisions with each other, external fields, and friction when they collide with the wall.

Pedagogical utility

THERMO lets students visualize the motion of particles in a gas. The initialization choices allow the student to see how the system naturally evolves from a regular pattern into the most probable (Maxwell-Boltzmann) distribution. The view of the velocity (or energy) distribution shows that the distribution is not static, but fluctuates in time.

The program allows a wide variety of investigations with different circumstances. In addition, position and velocity data can be written out to files to be analyzed off-line. This makes THERMO valuable as a tool for student independent explorations or projects.

Appropriate for

Screen view

At the top of this page is shown a screen view of THERMO with display of the distribution of particle speeds.

Availability

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

The file is a self-extracting zip file. Place it in the directory in which you want the program, then execute it. The program will run and create the following files in your directory:

Technical information

The program follows the paths of up to 1100 particles moving in a box. When particles enter the same pixel, they are transformed to their CM frame and their velocities are rotated by a random angle. They are then transformed back to the lab frame.

A variety of "mean field" forces may be applied, including gravity, electric, and magnetic. All the field only act on the individual particles. The particles do not interact with each other by any except contact forces. (So particles are assumed to be charged for their interaction with the electric and magnetic fields, but the particle-particle interactions are ignored.)

The path of a single particle can be displayed while all the others remain present but invisible, This is useful for demonstrating the meaning of the mean free path. The mean free path may also be calculated, but the calculation is done by noting at each collision the distance each particle has traveled and averaging. This biases the calculation at the beginning since only one side of the distribution is seen. The MFP approaches the true value from below.

An "ergodic" average may be taken by writing out the velocity data repetitively at times separated by long enough intervals that the distribution re-randomizes itself. The resulting time average shows fluctuations characteristic of the total number of velocities rather than the total number of particles. The distribution may be read from the saved data using the program HISTOGRAM. Note that the Maxwell-Boltzmann distribution in two dimensions has a phase space factor of v instead of v^2!

The left and right sides of the box may be identified to simulate flow in a tube. The parameter FRICTION can be set so that each collision with an upper or lower wall reduces in a loss of some fraction of the particle's horizontal momentum.

Associated materials

A microlab is available that uses THERMO for a one or two hour session. There are also a number of homework problems available that use THERMO. These will be made available through the Web in the near future. In the meantime, contact the

Contact person

E. F. Redish, University of Maryland, College Park, MD 20742; phone: 301-405-6120, fax: 301-405-6114, e-mail: redish@quark.umd.edu

Program help

You can get help by pressing . If a menu or submenu item is selected, the help will give information on that item. Otherwise, it will give general help information.

Select the menu bar at top by using the cursor keys, the highlighted letter, or by clicking on the entry using the mouse.

Select a menu entry or toggle its value by highlighting it and pressing or by clicking on it with the mouse.

The environmental status (forces, etc.) is displayed on the Status bar at the bottom of screen.

The running of the simulation is started and stopped by pressing .

Use or click mouse off the menu - to step back off menus.

When a number is needed by a menu or submenu item

  1. Press to get the value-entry window.
  2. Key in your value.
  3. Press to set it, or to cancel and return to original value.

Menu entries:

Indents indicate menu level.