Ideal Atmosphere

(see below for instructions and explanation)


Your browser does not support Java applets, alas.

The Ideal Atmosphere

What's happening?

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

Otherwise you saw a highly simplified simulation of the molecules that make up the Earth's atmosphere. These molecules continuously fall under the influence of gravity and then rebound off of the ground. Each time a molecule bounces off the ground it can absorb energy from the ground or lose energy to the ground. The amount of energy with which a molecule typically rebounds is determined by the temperature of the ground -- if the ground is hot, a molecule is likely to rebound with a lot of energy, while if the ground is cold a molecule is likely to rebound with less energy.

To the right of the main display you saw a bar graph of the average number of molecules as a function of height above ground. This bar graph is constructed simply by looking at the main display at regular intervals and counting the number of molecules at each height. The results are averaged over time, so the graph becomes more and more accurate as the simulation goes on longer.

Take command!

You are not watching a pre-constructed movie -- this simulation is running in real time, on your computer, as you watch. You can control the temperature of the ground with the slider (the thing that looks like a scrollbar). You can also cause half the molecules to become heavier than the other half. You do this by setting the mass of the heavier molecules to some multiple of the mass of the lighter molecules with the other slider. Finally you can control the total number of molecules in the picture with the third slider.


Some notes on performance

Since the simulation is running on your computer, its speed is limited by your computing power. If the simulation is too slow or jerky, you might try quitting other applications or windows. The simulation takes little memory, but the demands on the CPU are higher than for your average applet, since you're doing real physics and not just messing around with images. You may also want to look into the latest version of Netscape Navigator, which with its "Just In Time" compiler will execute this code particularly fast.

To stop the applet from running, you can simply leave the Web page on which it is found or turn off Java on your browser. If the applet doesn't run at all, or fails to reappear after being covered and then uncovered by another window, you can try reloading it by pressing the Reload button on your browser (on Netscape you will normally need to hold down the Shift key at the same time).

Some notes about the atmosphere

Thermal reservoirs

The energy in the atmosphere is not conserved (constant). Every time a molecule in the atmosphere hits the ground, it has an opportunity to pick up energy from the molecules in the ground, or lose energy to the molecules in the ground. Now the ground has, in general, a stupendously larger amount of energy in it than does the atmosphere. Why? Simply because there are so many more molecules in the ground than there are in the atmosphere. The gases in the atmosphere are, after all, very much less dense than the rock and soil that make up the ground.

What this means is that the percentage change in the amount of energy stored in the ground due to transfer to and from the atmosphere is almost zero. Note that the absolute amount of energy transferred is quite large -- it's only the percent or relative change which is small, and that only because the total amount of energy stored in the ground is so much larger.

We then call the ground in this situation a thermal reservoir, because, just as an ordinary reservoir stores lots of water and is used to "even out" fluctuations in water supply, so the ground stores a great deal of thermal energy in this case and serves to "even out" fluctuations in the energy of the atmosphere. As for why the energy the ground stores is called "thermal" energy, check out The Second Law for an illustration of the difference between macroscopically-unobservable energy ("heat") and macroscopically-observable energy ("work").

Statistical Mechanics

How much energy does an molecule in the atmosphere pick up or lose every time it bounces? That's not easy to say. The collision with the ground is quite a complicated process on the microscopic level, as you might imagine. To answer the question exactly we would need to follow the exact trajectory of the molecule and track each and every collision with each and every molecule of the ground on each little bit of dirt and grass and eyelash of uplooking observer.

However without doing all this work we can make what turn out to be quite accurate statements about the probability of an atmosphere molecule picking up a given amount of energy from a collision with the ground. Using this statistical information we can actually predict a number of useful things.

For example, we could argue that the amount of energy each molecule picks up after a collision with the ground determines the altitude to which it rebounds -- molecules with more energy reach higher altitudes before beginning to fall again under the influence of gravity. Therefore the probability of a molecule reaching a given altitude after each bounce is directly proportional to the probability of that molecule picking up the required amount of energy during its collision with the ground.

Furthermore, we can argue that the average density of molecules at a given altitude is roughly proportional to the probability that any given individual molecule will reach that altitude, times the total number of individual molecules in the atmosphere. (This is like noting that the total number of people that arrive for a Giant Carpet Sale is given by the total number of people that go to Giant Carpet Sales when they hear about them times the probability that any particular person heard about this particular sale.)

So if we can predict the probability that a given molecule picks up a certain amount of energy in a collision with the ground, we should also be able to predict the average density of the atmosphere as a function of altitude, that is, exactly what the bar graph on the right side of the simulation shows. Atmospheric pressure is also directly related to the average density of the air. Thus we will arrive at a very useful description of the atmosphere -- its average density and pressure as a function of height above the ground. That will tell us, for example, how high our airplanes can fly.

By giving up a completely accurate view of the motion of each and every molecule in the atmosphere, and instead seeking a rough, statistical description of the mechanics of the atmosphere we are plunging into the science of statistical mechanics. The point of statistical mechanics is that it takes utterly impractical problems (predict the locations of the billion billion billion molecules in the atmosphere) and offers solutions which are correct "on average" (predict the average number of molecules at a certain height above the ground.) Furthermore these statistical solutions tend to become more and more reliable as the numbers of "degrees of freedom" (in this case, number of molecules) becomes larger and larger, much in the way that it is very difficult to predict whether any individual person will be sick in a given year, but quite easy to predict -- if you are, say, an insurance company -- the average number of people who get sick each year in some large population. In dealing with the atmosphere we have an enormous number of molecules, so many in fact that the solutions offered by statistical mechanics are far more precise than one could ever possibly need.

The canonical ensemble

The particular situation where a system of interest (the atmosphere in this case) is in "contact" (can exchange energy with) a thermal reservoir has a special name. Because this is the situation most frequently encountered in reality, it was named the canonical ("natural") ensemble by Josiah W. Gibbs, the astonishingly gifted American scientist who completed the mighty edifice of modern equilibrium statistical mechanics in the last quarter of the nineteenth century. The term "ensemble" arises because we want to consider the properties of our simulation of the atmosphere averaged over time, or, equivalently, the average properties of a set ("ensemble") of trial runs of the simulation all measured at the same instant of time.

Why so? Recall we are only going to be able to predict the behaviour of the atmosphere on average. Thus our results will only be meaningful when we consider the averaged outcome of many trial runs of our simulation. Any one, specific simulation is perfectly capable of not following our predictions of what the "average" behaviour should be. (As an analogy: the observation that your next-door neighbor is both a vegetarian and a member of the Democratic party says essentially nothing about the average tendency of Democrats toward vegetarianism, and, conversely, the fact that adult women are on average shorter than adult men by no means guarantees that the next man you see -- if you are a woman -- will be taller than you.)

Let's imagine roughly what happens when a molecule hits the ground. We've noted that the ground is a lot more dense than the air. Thus each atmosphere molecule crashing into the ground will typically interact with a very large number of ground molecules before it escapes back up into the atmosphere. Let's assume for the sake of argument that it interacts with N ground molecules, and that in doing so it can end up with a "quantum" of energy e from each. Let's say the probability that it gets a quantum of energy from any given ground molecule is some fixed (unknown) number q, e.g. if q = 0.5 there's a 50hance the air molecule picks up a quantum of energy from each ground molecule.

Now what is the result of a large number of interactions? The probability P that the air molecule picks up N quanta of energy is given by q q q . . . q, that is, just N factors of q multiplied together. (For example, supposing q = 0.5, the probability that the air molecule picks up one quantum of energy is 0.5, the probability that it picks up two quanta of energy is 0.5  0.5 = 0.25, and so on.) We may write our general result as:

P = q N = (e log q) N = e N log q

where we've taken advantage of these two facts about powers and logarithms:

e log q = q


( ab)c = ab c

Now the probability q must be less than 1000r 1.0, so that the logarithm of q must be negative (as you'll note if you take the log of any number less than 1.0 on your calculator). Using this fact, let's rewrite our probability so that the final total energy E = N e shows up on the right-hand side:

P = e - N e ( | log q | / e )

The vertical bars around log q just mean "absolute value", i.e. | 5 | = | -5 | = 5. Now let's just define

T = e / | log q |

and we can then write our probability simply as:

P = e - E / T

It turns out we've left out some factors in front that should go in because we have "changed dependent variables" in this expression from N to E. But these turn out not to be particularly important -- it's easy to find them just by insisting that the sum of all P be equal to 1 (i.e. if we add up the probabilities of all possible final energies we have to get 1000ur molecule has to have some energy!).

The important result is that the probability of finding an air molecule with energy E after it rebounds from the ground is proportional to e - E / T. This (famous) probability distribution is called the Boltzmann distribution after Ludwig Boltzmann, another giant nineteenth-century scientist. (For more information about Boltzmann's contributions, consider visiting the happy molecules)

Incidentally our derivation of the Boltzmann distribution does not rely on the original assumption we made that the air molecule could only pick up a fixed "quantum" of energy e during each collision with each ground molecule, with a fixed and constant probability q. We could fancy the argument up considerably by allowing for a range of possible energies to be picked up with a range of different probabilities. This would force us to employ integral calculus in our derivation but not, in the end, change anything at all about our conclusion.

The important limiting assumption actually turns out to be our assumption that the probability of picking of a certain amount of energy on each collision is independent of the probability of picking up a given amount of energy on any of the previous collisions. This is what underlies the Boltzmann distribution. That this assumption should hold is in turn dictated by our characterization of the ground as a thermal reservoir -- the amount of energy available for transfer to the air molecule is so large that it is essentially unchanged by any amount already transferred. If the ground were not a thermal reservoir, then our conclusions would be different.


What is this mysterious quantity T that appears in the Boltzmann distribution? No more or less than the temperature of the ground! Thus the temperature is in our way of thinking intimately related to the probability q of getting a quantum of energy from each interaction with a ground molecule, as expressed by this equation:

T = e / | log q |

If the probability of acquiring energy during the collision is high (q close to 1.0, hence log q close to zero, hence the inverse of log q big) then the temperature is high, and if the probability of acquiring energy is low (q close to 0.0, hence log q very large, hence inverse of log q small) then the temperature is low.

Thus the temperature can be considered to be the availability, per ground molecule, of energy to be transferred to an air molecule. That is in complete agreement with our intuitive understanding of temperature as the "intensity" of energy stored in a body.

Density and pressure profile of the atmosphere

The Boltzmann distribution now tells us the probability of any given molecule having an energy E. Now if it has energy E, then the greatest altitude h to which it can rise is determined by when all of this energy is in the form of gravitational potential energy. The formula for gravitational potential energy is simply:

E = m g h

where m is the mass of the molecule and g is a constant called the "acceleration due to gravity" which describes the strength of gravity. Near the Earth's surface g equals 9.8 meters per second per second, or 32 feet per second per second.

Taking the above expression we can rewrite our Boltzmann distribution in terms of the maximum height a molecule can reach:

P = em g h / T

Now let's assume that the molecule spends most of its time at or near its maximum possible height. We could argue that this is the case because the molecule will be moving the slowest then, as it slows down and just starts to fall, while it will be found at much lower altitudes only when it is nearing the end of its fall and is moving very rapidly. Then we can conclude that the probability of a given molecule being found at a height h is simply given by the above expression. Recalling our earlier comments that the total density is just this probability multiplied by the total number of molecules in the atmosphere (a large but constant number), we conclude that the density of the atmosphere must fall off exponentially. That is, the density d as a function of height h must be approximately:

d = e - m g h / T

The air pressure will have the same form, since the pressure is proportional to the density, within our approximations.

What does this function look like? If you plug in a few numbers on your calculator, or plot the function e-x if you have a graphing calculator, you will see that the function looks like this:

Which is to say, a function that rapidly decreases and then trails off into a long tail. Thus we expect to see atmospheric density and pressure initially dropping rapidly with altitude, and then trailing off thinly up to considerable heights.

And indeed if you watch the simulation long enough you will see just this. That is, the bar graph on the right-hand side that measures the average density of the bouncing molecules on the left-hand side will eventually look just like the graph above (turned onto its side). You will also note the molecules on the left staying pretty close to the ground, except occasionally taking long leaps up into the top of the picture.

Your experience may also suggest the exponential form of the atmosphere's density to you. You will of course know that atmospheric pressure decreases rapidly with height. Even at a few thousand feet above sea level the air is noticeably thinner, and moving to Denver, about a mile above sea level, requires significant acclimatization. At the top of Mt. Everest, still only six miles above sea level, the atmospheric pressure is so low (about two-thirds normal) that it is impossible for all but the most highly-trained mountain climbers to survive for long without oxygen masks (actually until the Austrian mountaineer Reinhold Messner accomplished this very feat it was not believed possible that anyone could climb Everest without an oxygen mask.)

Yet you are probably also aware that the atmosphere trails off to a considerable height above ground, persisting for hundreds of miles above the Earth's surface. Military airplanes, after all, such as the U-2 and SR-71 fly at altitudes above 15 miles. You probably recall from the news that Skylab and various Soviet satellites have fallen to the ground because of friction exerted on them by the atmosphere, even at their orbiting altitudes of a 100 to 200 miles. The Space Shuttle typically orbits at around 150 nautical miles and can easily detect traces of the atmosphere. The standard U.S. Air Force definition of the "end" of the atmosphere and the "beginning" of outer space is 50 miles altitude, which is quite far up. Note, by the way, that as you can see from the simulation and the resulting bar graph there isn't really a definitive, sharp "end" to the atmosphere, just a gradual trailing off.

The effect of temperature & mass

Notice that the Boltzmann distribution falls off more slowly as the temperature increases. (You may have to plot it with a few values of T to see this quite clearly, but you can also guess it roughly in your head by asking yourself what happens to the distribution curve as T becomes very small and very large.)

Thus if you increase the ground temperature in the simulation you will see the rate at which the atmosphere becomes less dense with altitude, as shown by the bar graph, decreases. That is, the atmosphere expands upward as the ground gets hotter, and correspondingly contracts downward as the ground cools. (If you bring the temperature all the way down to zero, all the molecules will fall out of the atmosphere onto the ground and form a liquid, and the poor inhabitants of this simulation Earth will suffocate. Be responsible.)

By looking at the simulation, you can see once again the intimate correspondence between temperature and the probability of energy transfer to air molecules during collisions with the ground. For you will undoubtably notice that when you drop the temperature the reason the air starts getting thinner at high altitudes is that the bouncing molecules are much less likely during a collision with the ground to receive a lot of energy, and much more likely to receive only a little and therefore rebound weakly.

Notice also that the Boltzmann distribution falls off more rapidly as the mass of the molecules increases. That's simply because the same amount of energy will heft a heavier molecule to lower altitudes, when working against gravity. You can confirm this with the simulation by manipulating the slider to make half the molecules heavier than the other half. The bar graph will now include separate graphs of the heavy and light molecules, and you will indeed see that the heavy molecules stick closer to the ground.

You might then conclude that the heavier molecules in the Earth's atmosphere should also be more likely to be found closer to the ground. Thus one might think that the air closer to the ground is richer in oxygen molecules (weight 5.3 10-24 grams) than in nitrogen molecules (weight 4.7 10-24 grams).

But in fact the influence of winds (which we've ignored here) pretty much wipes out the influence of the small difference in mass between nitrogen and oxygen, and no such difference is actually observed.

Nevertheless an interesting and important point emerges when we consider the lightest gases such as helium (0.6 10-24 grams apiece) and hydrogen (0.3 10-24 grams each). Given that these two gases are actually the most common elements in the Universe, why is it that they are extraordinarily rare in the Earth's atmosphere? (Helium was in fact first detected [by its light emission under intense heating] on the surface of the Sun, whence its name, "helios" being Greek for "sun". The principle source of helium today is the underground radioactive decay of uranium.)

The reason for the rarity of the light gases in the Earth's atmosphere arises out of the discussion above: these gases are in fact so light that they can reach enormous altitudes at the typical temperatures of the Earth. So high can they go, actually, that they reach altitudes where the force of gravity becomes too weak to pull them back down at all and they escape into outer space. All the (large) amounts of hydrogen and helium on the Earth when it was formed escaped in this manner, and only the heavier gases such as oxygen, nitrogen, carbon dioxide, argon, etc. are now left in the atmosphere.

This turns out to be the case for all the small planets, moons and asteroids in the solar system, Venus, Mars, Mercury, etc. The giant planets (Jupiter, Saturn, Uranus and Neptune), however, do have sufficient gravity to hold even the light gases, and hydrogen and helium therefore make up a significant fraction of their mass, which gives them the common appellation of "gas giants".

So what makes it "ideal"?

Why do we call this a simulation of the "ideal" atmosphere? Because among other things we have neglected any and all interactions between the molecules making up the atmosphere. You'll see in the simulation that they pass right through each other like ghosts. We are treating the atmosphere as if it was what is called an "ideal gas", which is a gas made up of genuine point particles which can only bounce off walls (and in this case, the ground). Real molecules have a finite size, of course, and so they do bump into each other, and attract and stick to one another, and many of these "nonidealities" contribute to the more complex and interesting behaviour of the real atmosphere. We have also ignored the chemical reactions that go on in the atmosphere, which are of enormous importance.