Chemical Kinetics Simulation - Instructions

What's happening?

If you saw nothing on the previous page, then your browser does not support Java applets.

Otherwise, you found yourself looking at a computer simulation of a binary chemical reaction. There are four types of molecules in this simulation, red, yellow, green and blue. Each wanders around at random in the box you see. Every time a pair of red and yellow molecules collide they may react to form a pair of green and blue molecules, and vice versa. This chemical reaction can be written like so:

R + Y G + B
The double arrow in this reaction indicates that both the forward (R + Y --> B + G) and the reverse (B + G --> R + Y) reactions are possible. This is true of all chemical reactions. However, as is also true of all chemical reactions, the probability that a reaction will occur during any given collision is not necessarily the same for the forward and reverse cases. The probabilities of reaction per collision are called the reaction rate constants and are abbreviated "k_f" for the forward reaction and "k_r" for the reverse reaction.

Take command!

The simulation itself appears directly in your browser window. Initially everything's frozen, and you need to click your mouse anywhere in the box to get the simulation to start. (If you click again the simulation will freeze again.) If all goes right then when the simulation starts a control panel will also pop up somewhere on your screen. Using this control panel you can change the initial concentrations (expressed as the number of molecules "per box") and the reaction rate constants (expressed as a probability between 0.0 and 1.0). To do so, click your mouse over the appropriate box, delete the old numbers with your DELETE key and type in new numbers. Click the "Restart simulation" button to restart the simulation with your new values.

Note: You are not watching an animation of a pre-computed simulation. This simulation is running in real time, on your computer, as you watch. Every time you restart the simulation, the molecules are distributed randomly in the box and given random velocities.

From the control panel you can also turn on and off a "stripchart" that records the instantaneous concentrations of the four species of molecule as the simulation proceeds. Just click on the button labeled "stripchart ON".

Experiment!

Some notes on performance

  1. The simulation is running on your computer, so the complexity of the simulation is limited by your computing power. If you find the simulation running too slowly or jerkily, you can try quitting any other applications or windows you have open. You can also reduce the workload on your computer by turning off the stripchart and by reducing the total number of molecules in the simulation. The default setting is a total of 40 molecules, but to get the best appearance you'll want to increase that if you can. (There are no airbags in this code, however; if you ask for 6000 molecules you're on your own and please write afterward and say what happened.)

  2. To stop the Applet from running just click on it with your mouse. Click again to restart. The pop-up windows should disappear when the simulation is frozen and re-appear when it is unfrozen.

  3. If the applet doesn't run at all, you can try reloading the page by clicking the RELOAD button on your browser, sometimes while holding the SHIFT key down. Alternatively, check to be sure your browser supports Java applets.

  4. If things are weird or distorted or you have other problems with this applet, please contact the author so he can try to fix things.

Some notes about chemistry

  1. If you set the k_r = 0 the reaction goes "to completion." What are the final concentrations (number of molecules in the box) in terms of the initial concentrations? The answer depends on the initial concentrations and on the ``stoichiometry'' (the proportion in which reactants are used up) but not the reaction rate constants. Turn on the stripchart and note the shape of the concentration curves. They will be roughly exponential curves, as you can show with a little calculus. ("Roughly" because of the fluctuations noted below.)

  2. If, on the other hand, neither k_f nor k_r is zero, then after a while things settle down (the system "comes to equilibrium") and the equilibrium concentrations will on average be constant. Chemists denote the value of these concentrations as the symbol for the molecule surrounded by brackets, as in [ R ] for the concentration of R molecules and [ Y ] for the concentration of Y molecules. Any ratio of these constants will of course also be a constant. The particular ratio in which we put products over reactants, like so:
             [ G ] [ B ]
      K  =   -----------
             [ R ] [ Y ]
    
    is called (with great originality) the equilibrium constant. Can you figure out what K will be in terms of the two reaction rate constants k_f and k_r? The answer does not depend on the absolute size of k_f or k_r, or on the initial concentrations of the reactants and products. This is a remarkable and profound statement. Indeed, the experimental fact that this statement is true is one of the main reasons we believe the collision-of-molecules model of chemical reactions at which you are looking is correct.

  3. If you turn on the stripchart you will see that at equilibrium the concentrations are not changing, on average. But you will see instantaneous (moment by moment) fluctuations in the concentrations. You'll note that the relative size of these fluctuations gets smaller as you increase the total number of molecules in the box. This is a very general observation, and is a fact of enormous importance, because it is utterly impractical to do a simulation like this for the enormous numbers of molecules that take part in any real chemical reaction. But since the size of the fluctuations in things you can observe macroscopically (like the concentrations) decreases as the number of particles increases, you don't have to. It is an empirical fact that as the number of particles increases to a very large number the behaviour of anything observable (like the concentrations as a function of time) becomes very simple, and depends only on other macroscopically observable variables, like the temperature and volume of the box. This empirical fact is essentially a statement of the existence of thermodynamics, the science of the consequences of hidden "degrees of freedom", such as molecules the motion of which you cannot see.

    Remarkably, deducing the existence of thermodynamics by directly considering the limit of a simulation like this as the number of molecules is increased to infinity is profoundly difficult, and I am not actually sure it has ever been done. We must accept thermodynamics at present on the basis of experience and intuition alone. (If you would like learn more about thermodynamics, consider visiting The Second Law.)

    The fluctuations have many other important roles and meanings. I will mention just one more: the fluctuations are (1) properties of the equilibrium system, and so can be calculated by relatively simple theory from measurements of the system at equilibrium, but (2) they tell you how the system behaves dynamically when it is not at equilibrium (but fairly close). Perhaps by comparing (in this simulation) how fluctuations away from equilibrium happen, and how the system approaches equilibrium -- watch the strip chart -- you will be able to see intuitively the truth of this fundamental and important observation, which is called the Fluctuation-Dissipation Theorem and is a bit of a trick to prove mathematically.

  4. Note that at equilibrium the chemical reactions are still going on just as fast as during the approach to equilibrium. Equilibrium does not mean nothing is happening! Rather, the average reaction rates of the forward and reverse reactions become the same. The reaction rate is the overall rate at which molecules react, which is not the same as the reaction rate constant because you have to take into account the frequency of collisions. Clearly when there are no red molecules the rate of forward reaction will be zero no matter what the reaction rate constant is. Similarly the forward reaction rate will be higher than the reverse reaction rate, even if k_f < k_r, when there are many R and Y molecules but hardly any G and B molecules. If you think about it, you will probably realize that the statement that the system eventually stops changing ("comes to equilibrium") is equivalent to the statement that the forward and reverse reaction rates must become identical after a while no matter what the reaction rate constants are. This realization in turn allows you to calculate the equilibrium constant in terms of the reaction rate constants.

  5. Reduce both reaction rate constants equally (e.g. divide both by two) and observe (with the stripchart) what happens to the approach to equilibrium. Does it go faster or slower? Why? What happens to the size of the fluctuations at equilibrium? What happens to the equilibrium concentrations? (The answer to the last question is "nothing"!)

  6. Along the same lines, see if you can distinguish the kinetics of this reaction from the thermodynamics. The "thermodynamics" is expressed by whether at equilibrium there are more products or reactants (i.e. whether K is large or small). What determines this? The "kinetics" is whether equilibrium is reached quickly or slowly. What determines this?

    How could you set up this simulation so that the forward reaction would be thermodynamically favorable (K is big, so there'll be a lot of products at equilibrium) but kinetically nearly impossible (equilibrium will take a very long time to be reached)? Try it and see!

    How could you set up the system so that product was often formed (kinetically accessible) but the equilibrium concentration of the product was small (thermodynamically unfavorable)? Would this be useful? Yes! If you had another chemical reaction which started with a product of this reaction, then the overall thermodynamics of the two coupled reactions could be controlled by the second reaction. That is, the net reaction R + Y --> G + B + X --> Y + Z could be favorable because of the second reaction G + B + X --> Y + Z. Since the intermediate products G and B are formed quickly it does not actually matter that very few of them are around at any given moment; quite a lot of the product Y + Z will nevertheless be formed. This illustrates the concept of a reactive intermediate. Notice that it is critical that this intermediate be kinetically accessible.

  7. Suppose you change the density of the reactants. How does the reaction rate change? You can see why the reaction rate constant is a more useful quantity, in a sense, then the reaction rate. But the rate is easier to measure, of course.

    References

    Chemistry 1B, the freshman UCI course that discusses chemical equilibrium.

    Physical Chemistry Faculty at UCI, folks who do research on chemical kinetics, among other things.

     

    credits