Gas Laws

Here is a simple applet to demonstrate the gas laws.

It works in 2 dimensions rather than 3 but it does clearly demonstrate the effect of volume (area), temperature (speed) and number of particles.  The blue "atoms" in the yellow "box" are truly independent objects called "sprites" in graphic programming.  The resultant "pressure" that is shown is the average of their impacts against the sides of the box over a minute.

You can alter the size of the box.  The units are pixels...the dots on your computer screen.

You can alter the number of atoms.

You can alter the speed of the atoms. (temperature of the gas)

You can use this little model to show that Pressure*Volume = some constant * Temperature * Number of particles.
(or in this case Pressure * Area = constant * Speed * Number of particles).

For example:

Assume each atom weighs one gram.
Assume an atom is oscillating back and forth from left to right.
Since it is traveling  at 50 pixels per second it will have a momentum of 50 grams by pixel per second. [mass * speed]
It will travel 3000 pixels in a minute.  Since the box is 200 pixels wide it will collide with the sides of the box 15 times.  [distance traveled / width].  At each collision it will reverse direction with a change in momentum of 100 grams per pixel per second.

Force equal change in momentum per unit time.
Over a minute there will be a "force" on the box of  1500 grams by (pixel per second) per minute.
This equals 25 grams by (pixel per second) per second.

Pressure equal force per unit area.  In this model we will call it force per unit length.  Given that the overall perimeter length is 800 pixels this produces and average "pressure" of  .03125 grams by (pixel per second) per second per pixel.

Since there are 5 atoms in the default case the total will be 0.15625 
If you leave the default values alone in this model you should get this as the average result..

Play with the values

Halve the area, or double the number of atoms or double the speed and you will double the pressure!
(With a lot of atoms at high speed you may reach the limits of your computer to keep up so there are some maximum values built in.)

 

 
EMAIL: david.sainsbury"AT"adelaide.edu.au  Last Update:02/05/2005