LOREN HEPLER's MAGIC JUMPING BEANS

Gary L. Bertrand    University of Missouri-Rolla

Monte Carlo Animation

(SuperCardWeb plugin required)

Download the SuperCard Plugin

This is an animated simulation of a limited number (50) of "magic beans" randomly jumping around in boxes.  The shapes and sizes of the boxes may be changed, the "beans" may be started on either side, and one side of the box may be made "sticky" so that the "beans" cannot jump around in it.  The program randomly selects a position within the boxes.  If that position is occupied by a "bean" the program selects a random direction and initial velocity for the jump.  If the jump will be sufficient to move the bean, the flight of the bean is shown.  The position where the bean will land is completely determined by its initial position, the direction and initial velocity of the jump.  The "equilibrium" condition for this system is not well-defined because of the small number of "beans", so the distribution continues to fluctuate substantially around the "equilibrium" value.

The program starts in a default configuration, showing both side and top views of the "box". There is a button to hide or show the top view (hiding the top view speeds up the Windows operation considerably).  Click on "start" and the "beans" start jumping around.  Some will cross the barrier to the other side.  Counters display the numbers of beans in the left and right compartments.  Eventually, some will start to jump back to the original side.

There is a "pause/resume" button to stop and resume the action. The action may be set to "faster" or "slower" mode for Macintoshes (actually, all of the action is painfully slow under Windows).  There is a "100 jumps" button to speed up equilibrium observations by hiding the action for 100 jumps, and giving the average of the ratio of the number of beans on the right to the number on the left over those 100 jumps.

The "setup" button shows a diagram so that you can re-configure the box.


 

Click the mouse on the red triangle and drag it up to raise the box on the left:


 

The height of the box on the left may be adjusted with the blue triangle, and the height of the barrier may be adjusted with the violet triangle.  The location of the barrier may also be adjusted with the violet triangle.  The relative areas of the two compartments are shown.


The 50 beans may be started on the left or right side by dragging the "balls" button to the desired side.



 

Finally, the bottom of the box opposite to where the "beans" start off may be made "sticky" so that the rates of the left-to-right or right-to-left jumps may be studied individually.  Click on "Return" to go back to the animation.

The "sticky" facility has a feature to simplify kinetic studies.  When operated in this mode (whether "faster" or "slower"), information is retained regarding the time at which the count changes, so that this "data" may be processed to determine a "rate constant" for this first-order process.  After observing the transfer, click on "setup" and a table of the data will be presented.  Click on "Calculate", and a regression is performed to obtain the slope of a graph of ln(N) vs time.  This slope may be considered as a rate constant IF the areas of the boxes are always the same.  Otherwise, see the discussion at the bottom of the Kinetics page.  The ratio of the forward rate constant to the reverse rate constant can be related to the equilibrium constant.

Back to Top          Thermodynamics         Kinetics      Monte Carlo Animation