KineticGas Applet
Pressure of an Ideal Gas (Kinetic Gas Theory)
Enter a number of atoms (n_atoms), a temperature (T) in Kelvin and see what happens. Be sure to press <enter> or <return> after you have typed a number.
The number of atoms is limited to 1 <= n_atoms <= 10000.
The temperature is limited to T >= 0 K. If you have entered a new temperature, all atoms get new speeds according to the maxwellian velocity-distribution. Because this is a probability-law, the new mean temperature may slightly differ from what you have entered.
A number of diagnostic variables are calculated and displayed after each new entry:
The mean temperature is calculated from the actual velocities. Enter the temperature T in quick succession to get a feeling for the fluctuations.
The pressure is the averaged force per area resulting from the elastic reflections of the atoms off the walls. It is calculated from the actual velocities too.
The volume is 1000 cubic-nanometers (10 nm x 10 nm x 10 nm).
The steps per frame indicates the number of steps in the numerical integration per displayed frame. A new frame is displayed, if this number reaches 100 or if 10 ms have elapsed. If the steps per frame is smaller than 100, the computational burden has slowed down the simulation. The applet "sleeps" 20 ms after each frame to allow other processes (e.g. the operating system) to accomplish their tasks.
The simulation is 3-dimensional. The displayed square box is 10 nm wide. Atoms in the foreground are plotted full size (71 pm radius, the value for gaseous Argon). The size shrinks, if the atoms move into the background. If atoms hit the walls, they are elastically reflected. The atoms do not interact.
The time step is 1 fs. For small number of atoms, the positions are displayed after 100 time steps, i.e. after 0.1 ps (see the number of steps per frame).
And here is the source-code: KineticGas.java
Note: If the image flickers, try the following application, that runs without browser: KineticGas.jar (8 kByte).
Created with BlueJ 3.0.4 (Java version 1.6.0_24) running on Mac OS X 10.6.7
June 13th, 2011, Martin Lieberherr