setup button to set up the box and the molecules.
Click the go button to start the simulation.
The size slider controls the width of the left section of
the box. (The total width of the box is 100 units.) The
number slider controls the number of gas molecules. (Note:
Changes in the sliders do not take effect until the next
setup.)
The color-count blue monitor reports the number of molecules
in the left section of the box. The color-count violet
monitor reports the number of molecules in the right section
of the box.
size slider is set to 10, then roughly 10% of the
molecules should be in the left section of the box after a
while.The program adds a slight "wiggle" to the movement of the molecules to make sure that they do not get "trapped" in a repetitive cycle of motion.
The molecules bounce off of the walls and partitions of the box, but they do interact with one another. Obviously, this is a very simplified model.
Allow molecules to have different velocities (use the JUMP primitive). Make molecules collide with one another. Make sure to conserve energy and momentum.
color-count primitive).The box is drawn in two different shades of red: one shade for the vertical walls, a slightly lighter shade for the horizontal walls. The reason: when a molecule bounces off a wall, different formulas are used to calculate the molecule's change in heading, depending on whether the wall is vertical or horizontal.
