Deriving Ideal Gas law from Hamiltonian Mechanics

I just don't understand the explanation in Wikipedia. Is there a nice & elegant way of arriving at the Ideal Gas Law from Hamilton's Equations?

• Could you link to "the explanation in Wikipedia" and be more specific about what is unsatisfactory about it? – ACuriousMind May 2 '16 at 10:46

The derivation of ideal gas equation from Hamilton's equations will take the same procedure as what you have seen in Wikipedia. Since you said you haven't understood the way in which the equation is derived I will give you a step by step explanation on it.

So we have a system of perfect gas molecules. Of course they are non-interacting. We are going to deal their motion using Hamiltonian mechanics. So we consider our system in phase space. Let $\textbf{q}=(q_x,q_y,q_z)$ and $\textbf{p}=(p_x,p_y,p_z)$ represent the position and momentum vectors of a particle in the system. Here $q_x$, $q_y$, $q_z$ represent the position coordinates along the three axes and $p_x$, $p_y$, $p_z$ represent the corresponding momentum coordinates. Let a force $\textbf{F}$ acts on the system. Then the potential energy of the particle is given by the work done by this force to displace the particle from , say, origin to the position q.

$$\textbf{q}\cdot\textbf{F}=q_x\frac{dp_x}{dt}+q_y\frac{dp_y}{dt}+q_z\frac{dp_z}{dt} \longrightarrow(1)$$

where the right hand side is given by Newton's second law.

The time average of this potential energy is given by:

$$\langle\textbf{q}\cdot\textbf{F}\rangle=\langle q_x\frac{dp_x}{dt}\rangle+\langle q_y\frac{dp_y}{dt}\rangle+\langle q_z\frac{dp_z}{dt}\rangle \longrightarrow(2)$$

We have from hamilton's equation of motion that
$$\dot{p}=\frac{dp}{dt}=-\frac{\partial{H}}{\partial{q}} \longrightarrow(3)$$

So we write equation (2) as

$$\langle\textbf{q}\cdot\textbf{F}\rangle=-(\langle q_x\frac{\partial{H}}{\partial{q_x}}\rangle+\langle q_y\frac{\partial{H}}{\partial{q_y}}\rangle+\langle q_z\frac{\partial{H}}{\partial{q_z}}\rangle) \longrightarrow(4)$$

Now we are going to invoke the equipartition theorem. According to the equipartition theorem the total kinetic energy of a system is shared equally among all of its independent parts, on the average, once the system has reached thermal equilibrium. Also it predicts that every atom of an ideal gas, in thermal equilibrium at temperature $T$, has an average translational kinetic energy of $\frac{3}{2}k_BT$ where where $k_B$ is the Boltzmann constant. Of these the contribution along each degree of freedom is $\frac{1}{2}k_BT$.

So we have got the kinetic energy of each particle using equipartition theorem. Since we are considering a system of non-interacting particles, we can invoke Virial theorem. By this theorem the potential energy of the system of particles will be twice as the kinetic energy of the particles in the system. This is valid for a single particle in the system also since the energy of all particles are the same at a given temperature. Hence equation (4) becomes

$$\langle\textbf{q}\cdot\textbf{F}\rangle=-(\langle q_x\frac{\partial{H}}{\partial{q_x}}\rangle+\langle q_y\frac{\partial{H}}{\partial{q_y}}\rangle+\langle q_z\frac{\partial{H}}{\partial{q_z}}\rangle)=-3k_BT \longrightarrow(5)$$

Suppose there are $N$ particles in the system. then the total potential energy of the system is given by

$$-\sum_{k=1}^N\langle\textbf{q}\cdot\textbf{F}\rangle= 3Nk_BT \longrightarrow(6)$$

Now, by Newton's third law the force exerted on the particle is equal and opposite to the force exerted by particles on the container walls. This is the pressure of the gas $P$. Since the force acting on each particle is the same, the pressure of the gas at any point is the same. So if we have an elemental surface $d\textbf{S}$ of the container, then the force is given by

$$-\textbf{F}=P\oint_{surface} d\textbf{S}$$
where the negative sign implies it's the reaction force of particles on the container surface that causes pressure. Hence equation (6) becomes

$$-\sum_{k=1}^N\langle\textbf{q}\cdot\textbf{F}\rangle=P\oint_{surface} \textbf{q}\cdot d\textbf{S} \longrightarrow(7)$$

Now, we are going to invoke the Gauss's divergence theorem. According to it

$$\oint_{surface} \textbf{q}\cdot d\textbf{S}=\int_{volume} (\nabla\cdot \textbf{q}) dV$$

where the right hand side implies the volume integral of the divergence of $\textbf{q}$ from an elemental volume. So equation (7) can be rewritten as

$$-\sum_{k=1}^N\langle\textbf{q}\cdot\textbf{F}\rangle=P\int_{volume} (\nabla\cdot \textbf{q}) dV \longrightarrow(8)$$

Now, let's find the divergence of $\textbf{q}$.

$$\nabla\cdot \textbf{q}=\frac{\partial{q_x}}{\partial{q_x}}+ \frac{\partial{q_y}}{\partial{q_y}}+\frac{\partial{q_y}}{\partial{q_y}}=3$$

Hence we write

$$-\sum_{k=1}^N\langle\textbf{q}\cdot\textbf{F}\rangle=3P\int_{volume} dV=3PV \longrightarrow(9)$$
where V is the volume of the gas. Now from equation (6), (9) becomes

$$3PV=3Nk_BT$$ or

$$PV=Nk_BT \longrightarrow(10)$$

Now we are going to do some manipulations. Equation (10) is not that useful in practical case as it requires the total number of gas molecules. But we know that 1 mole of gas contains Avogadro number ($N_A$) of molecules. So $n$ mole of gas contains $N=nN_A$ number of molecules. So we have defined our $N$ number of molecules in terms of $n$ moles. Also, $N_A$ is related to the gas constant $R$ by $R=N_Ak_B$. So finally we get the number of molecules of gas as $N=nR/k_B$. Hence our final equation becomes

$${\color{red} {PV=nRT}}$$

which is the ideal gas equation. Thus our goal is completed.
Hope this helps.