«

»

Nov 20 2012

Thermo for Normals (part 26): A gas in detail

A molecule in a gas is being knocked into by lots of surrounding gas molecules. This is a very complex, almost random-seeming process. And yet we know that at higher temperatures the gas molecules simply must be moving faster on average. There must be a relationship between the temperature and the average energy. Moreover, we should be able to get some idea of how fast these molecules are moving.

The molecule is in a gas at temperature T, and so its probability of having energy E at some time is proportional to e^{-E/k T}. But let's stop to think about what this means for a minute. The thing is, there are lots of ways to have a given energy E. Suppose we choose E=1 eV. An oxygen molecule would have 1 eV of energy if it was traveling to the right at 2454 meters per second. But it would also have 1 eV if it were traveling to the left at 2454 m/s. If it could only move to the left and right, then, the probability of having 1 eV would have to be counted twice. That's in contrast to having zero energy. There's only one way to have zero energy. We would only count that once.

Once we let atoms start to move in 3 dimensions, now suddenly there are a lot of ways to have a certain energy. There are a bunch of different angles, all with the same speed, that would have energy E. Even though the probability of having a certain energy is e^{-E/kT}, we actually have to add up a bunch of the probabilities for every energy, since there are lots of ways to have a certain energy. That is, except for 0. At 0, there is only one way, no matter how many dimensions there are. So even though the probability initially looked large at E=0, there's actually only a very small chance of having 0 energy.

Now, we can easily change energy into velocity, providing there's no potential energy. Energy is just one-half times mass times the velocity squared. A given particle can travel in all 3 directions, which we call x, y, and z. Then it travels along the x direction with velocity v_x, along y with v_y, and along z with v_z. If v_x, for instance, is positive, that means it moves to the right, and if v_x is negative it's moving to the left. The energy is (1/2) m (v_x^2 + v_y^2 + v_z^2) and the speed is \sqrt{v_x^2 + v_y^2 + v_z^2}. So now what we want to know is, what is the probability of having speed v in a gas? (Note: you can read Wikipedia's entry on this if you want. Their derivation is bullshit.)

To make it simpler, we'll assume that velocity only comes in certain units (this is actually true). And we'll just form a grid and look at it. Here it is drawn in only two dimensions.
Each point represents a velocity the molecule can have. The one in the very center is v_x = 0 and v_y = 0. You can see the tiny circle drawn around it. That circle represents zero speed. And it only holds one point, because, after all, there is only one way to have speed 0: the velocity in each dimension has to be zero. Now, the next circle going out from that is a bigger speed. All of the points enclosed by the next circle, but outside of the first one, are at a slightly higher speed. There are about 8 of them. The probability of having that energy is proportional to e^{-E/k T}, and E = (1/2) m v^2. But that probability applies to every point in there. So the probability of having speed one step above zero goes down because of e^{-(1/2) m v^2/k T}, but goes up because we multiply by 8. Then we increase v again; that's the third circle. The probability of having that speed is e^{-(1/2)m v^2/k T} times the number of points in that circle (I count 36). The circles get a bigger radius, and so they form strips of more and more speed/energy every step.

But you might see what's happening. Even though the number of points is going up, the probability e^{-(1/2)m v^2/k T} is going down every step.

So now all we have to do to form the probability of a certain speed is to count the number of points between one circle and the circle inside that, and multiply that by e^{-E/k T}. If I do that for all the speeds (in three dimensions, even though the above graph only shows two), and then divide by the total, I get the probability as a function of v:
So the probability of having no energy is not a maximum at zero. In fact, it's tiny! Then it rises to a maximum, and then it tails off to the right. At 300 K, the peak is at pretty low energy, and it tails off kind of quickly. At 900 K, though, the peak happens at a higher energy, and there are lots of molecules at higher energies. Duh! Of course, that's what we expect for a gas. If the temperature is higher more atoms are running around faster.

The graph shown above is called the Maxwell-Boltzmann distribution. It tells you, for a gas, how many of the gas molecules have a certain speed, based only on what kind of gas it is (the mass of the molecules) and the temperature. That is a hell of a lot of information from just those two things! Imagine trying to guess how many people made $25,000 per year just by knowing that the country is the United States and the GDP is 12 trillion dollars. How accurate do you think your guess would be?

If I'm going to want to get averages and stuff, we'll want an actual mathematical expression for the distribution, so I'll derive it here. As always, skip past it if you like.

Important!

The density of points we can call \rho. The volume between concentric spheres is 4 \pi v^2 \, dv. Thus, the probability is

P(v) dv = A \rho 4 \pi v^2 e^{-m v^2/2 k T} \, dv.


Let's absorb all constants into A, since they don't really matter.

P(v) dv = A v^2 e^{-m v^2/2 k T} \, dv.


As always, we have to normalize this so that the probability of having some speed at all is 1. That also tells us what A is. This is not an elementary integral, but it can be done with Feynman's trick of differentiating under the integral sign, and then using another handy trick for integrating a Gaussian. If we let \alpha = m/2 k T, then

P(v) dv = A v^2 e^{-\alpha v^2} \, dv = -A \left(\frac{\partial}{\partial \alpha}\right) e^{-\alpha v^2} \, dv.


Now we integrate from 0 to \infty and set that equal to 1:

 1 = -A \left(\frac{\partial}{\partial \alpha}\right) \int_0^\infty e^{-\alpha v^2} \, dv.


We can't find the anti-derivative of the function e^{-\alpha v^2}, since it's not an elementary function. But we can do the definite integral

 I = \int_{-\infty}^\infty e^{-\alpha x^2} \, dx,


except we'll actually do I^2.

 I^2 = \int_{-\infty}^\infty \int_{-\infty}^\infty e^{-\alpha x^2} e^{-\alpha y^2}\, dx \, dy = \int_{-\infty}^\infty \int_{-\infty}^\infty e^{-\alpha (x^2+ y^2)}\, dx \, dy.


Convert this to polar coordinates, so that x^2 + y^2 = r^2 and dx \, dy = r \, dr \, d\theta. Then, r goes from 0 to \infty and \theta goes from 0 to 2\pi, so

 I^2 = \int_{0}^\infty \int_{0}^{2\pi} r e^{-\alpha r^2} \, dr \, d\theta.


This integral is elementary; just make a substitution u = \alpha r^2, so that du = 2 r \alpha \, dr. Then,

 I^2 = \frac{\pi}{\alpha} \int_{0}^\infty e^{-u} \, du = \frac{\pi}{\alpha} \left[e^{-u}\right]^{0}_\infty = \frac{\pi}{\alpha}.


Thus, I = \sqrt{\pi/\alpha}. Going back to our integral, we are only integrating from 0 to \infty, so we take half of this:

 1 = -A \left(\frac{\partial}{\partial \alpha}\right) \frac{1}{2}\sqrt{\frac{\pi}{\alpha}}.


Differentiating gives

 1 = A \frac{\sqrt{\pi}}{4} \alpha^{-3/2},


so

 A = 4 \pi \left(\frac{\alpha}{\pi}\right)^{3/2},


and finally

 A = 4 \pi \left(\frac{m}{2\pi k T}\right)^{3/2}.


Therefore the actual distribution, properly normalized, is

 P(v) dv = 4 \pi \left(\frac{m}{2\pi k T}\right)^{3/2} v^2 e^{-m v^2/2 k T} \, dv.

With this, now we can tell all the important statistics of a gas. How fast are the molecules moving on average? We can calculate that! I'll do it later, but the answer is

 v_\text{avg.} = \sqrt{\frac{8 k T}{\pi m}}.

That's it. So, for argon gas at room temperature, the average speed is 398 meters per second, or about 890 miles per hour. Oxygen atoms in the air are traveling about 995 miles per hour. That is damn fast.

What about the average energy? For that we need to find the average of v^2 (which we usually write \overline{v^2}. A line over it means "average"). We can calculate that too. The answer is that the average of v^2 is \frac{3 k T}{m}. So the average energy of a gas molecule, so long as it only has kinetic energy, is

 E_\text{avg.} = \frac{1}{2} m \overline{v^2} = \frac{3}{2}k T.


The average energy of a gas molecule in a monatomic gas is just three-halves k T. This will not work for diatomic gases like oxygen or certainly for something like steam. This is because diatomic or polyatomic gases have more ways of having an energy E: they have ways to rotate, and the chemical bonds can vibrate. So being at a temperature T would imply that there was more energy in the gas. We'll come back to that.

Now, a monatomic gas is made up of a lot of atoms, and not all of them have the same energy. But since they have (3/2) k T on average, the internal energy of the gas is just the number of gas molecules N times this, or

 U = \frac{3}{2} N k T.


If you look at that, since we know that heat is added as energy, we see that if we want to increase the temperature by 1 K then we have to add (3/2) N k of heat. That means that, by definition, the heat capacity of a monatomic gas is (3/2) N k. Let's look at the heat capacities of 1 mole (N = 6.02 \times 10^{23} atoms) of some monatomic gases:

Heat capacities at constant volume for monatomic gases.

Gas C_V (J/mol K)
He 12.5
Ar 12.5
Ne 12.7
Kr 12.3

And what do we think it should be?

 \frac{3}{2} N k = \frac{3}{2} \times 1.3806503 \times 10^{-23}\text{ J/K} \times 6.02 \times 10^{23} = 12.4614 \text{ J/K}


Pretty damn good!

All of this came from one simple result, that (at least for one dimension), the probability that a molecule in a gas at temperature T has energy E is e^{-E/k T}. Everything else was just figuring out how many ways there were to be at that energy, and this told us how the speeds are distributed. It's quite amazing.

Important!

I promised to calculate the average of v and of v^2, so here it is. The average value is the weighted sum, just like before. We multiply each speed by the probability of that speed and sum over all possible speeds.

 v_\text{avg.} = \int_0^\infty v P(v) dv = \int_0^\infty 4 \pi \left(\frac{m}{2\pi k T}\right)^{3/2} v^3 e^{-m v^2/2 k T} \, dv.


That can be done pretty easily. Let's go back to \alpha=m/2 k T, and we'll make a substitution u = v^2, so that du = 2 v \, dv. Then

 v_\text{avg.} = \frac{4 \pi \alpha^{3/2}}{2 \pi^{3/2}} \int_0^\infty u e^{-\alpha u} \, du.


The latter integral can be done by parts:

 \int_0^\infty u e^{-\alpha u} \, du = \left[-\frac{u}{\alpha} e^{-\alpha u} - \frac{1}{\alpha^2} e^{-\alpha u}\right] = 1/\alpha^2.


Then,

 v_\text{avg.} = \sqrt{\frac{8 k T}{\pi m}}.


For the average of v^2, we take

 \overline{v^2} = \int_0^\infty v^2 P(v) dv = \int_0^\infty 4 \pi \left(\frac{m}{2\pi k T}\right)^{3/2} v^4 e^{-m v^2/2 k T} \, dv.


We have to use Feynman's derivative trick again.

 \overline{v^2} = \int_0^\infty v^2 P(v) dv = \frac{4 \pi \alpha^{3/2}}{\pi^{3/2}} \left(\frac{\partial^2}{\partial \alpha^2}\right) \int_0^\infty e^{-\alpha v^2} \, dv.


The integral is just (1/2)\sqrt{\pi/\alpha}. So,

 \overline{v^2} = \frac{4 \pi \alpha^{3/2} \sqrt{\pi}}{2 \pi^{3/2}} \left(\frac{\partial^2}{\partial \alpha^2}\right) \alpha^{-1/2} = \frac{3 k T}{m}.