Ideal Gas Simulation and the Maxwell–Boltzmann Distribution

Kinetic Energy (Joules)

Slider energy: unset

idk

Temperature (Kelvin)

idk


Maxwell-Boltzmann Distribution for a microcanonical ensemble with no potential energy


Equation for 3d elastic collissions of spheres from here.


We start with the Boltzmann Distribution. For a "system" lightly coupled to a "bath" of infinite heat capacity, it gives an ensemble average that is equal to the time average under the assumption of ergodicity. We assume position and momentum q,p and Hamiltonian H. We look at the state of one particle, the "system", in contact with all the other particles, the "bath". Note that here we have a finite number of other particles in the bath, so the assumption of infinite heat capacity is wrong, but it's pretty close, and becomes exact in the limit of infinite particles. The distribution says probability of the particle being in any state q,p is:

ρ(q,p)=eH(q,p)kBTVeH(x,p)kBTdqdp=eH(q,p)kBTZ

If the Hamiltonian has no potential energy, then for a non-relativistic particle it would simply be:

H(q,p)=p22m=pp2m=px2+py2+pz22m

Because q isn't in the expression, we focus just on the probability over the momentum:

ρ(p)=epx2+py2+pz22mkBTZ

The partition function Z is

Z=epx2+py2+pz22mkBTdpxdpydpz

It's is just a 3D gaussan and we know what that integral is.

=(τmkBT)3/2

Then substituting Z into the Boltzmann equation gives.

ρ(p)=(τmkBT)3/2epx2+py2+pz22mkBT=(τmkBT)3/2ep22mkBT

The above is almost the Maxwell-Boltzmann distribution but it's in terms of momentum instead of velocity/speed. We first do a change of variable into velocity on the probability distribution. Momentum is a function of velocity where p(v)=mv.

ρ(v)=ρ(p(v))(dpxdvxdpydvydpzdvz)=m3ρ(p(v))
ρ(v)=(mτkBT)3/2emv22kBT

Now if we want to convert it to speed instead of velocity we have to do another change of variables. We first bijection velocity into spherical coordinates:

s=vx2+vy2+vz2
θ=arccos(vzs)
ϕ=arctan(vyvx)

The determinate of the Jacobian of the inverse function is:

s2sin(θ)

So we can do the change of basis on the probability distribution.

ρ(s,θ,ϕ)=ρ(v=ssin(θ)cos(ϕ),ssin(θ)sin(ϕ),scos(θ))s2sin(θ)

Then to find the probability of a speed you just integrate the marginal over the unwanted variables.

ρ(s)=0τ0τ/2ρ(v=ssin(θ)cos(ϕ),ssin(θ)sin(ϕ),scos(θ))s2sin(θ)dθdϕ

Each velocity coordinate is independent so we can split the probability distribuion.

0τ0τ/2ρ(vx=ssin(θ)cos(ϕ))ρ(vy=ssin(θ)sin(ϕ))ρ(vz=scos(θ))s2sin(θ)dθdϕ

And since all orientations of v are equally likely, the probability only depends on the magnitude.

0τ0τ/2ρ(v2=s2)s2sin(θ)dθdϕ

We can then move it out of the integral.

ρ(v2=s2)0τ0τ/2s2sin(θ)dθdϕ

And the integral is now just the surface area of a sphere which we know.

ρ(s)=2τs2ρ(v2=s2)

Then put in the probability and we get the Maxwell Boltzmann distribution.

=2s21τ(mkBT)3/2ems22kBT

Finding the temperature

To find the temperature of a microcanonical system (NVE ensemble) of a bunch of particles with only kinetic energy, we look at the manifold of all states where the Hamiltonian equal to a constant energy H(q,p)=E. Since there is only kinetic energy, the positions of the particles q don't matter.

H(q,p)=ipi22m=E

The definition of temperature in a microcanonical ensemble is

1T=S(N,V,E)E

where the entropy is S=kBiρ(xi,pi)ln(ρ(xi,pi)=kBln(1W(E))=kBln(W(E)) and W(E) is the number of accessable states accessable at E. First re-arrange the equation for the energy.

ipi2=2mE

If we want to find W(E) then assuming all particles are indistunguishable, means it has a factorial. Then we use Plank's constant as a measure of the phase space density.

W(E)=1h3NN!Vδ(H(q,p)E)d3Npd3Nq

With no potential energy the position doesn't matter and can be factored out

=V3Nh3NN!δ(H(q,p)E)d3Npd3N

First switch to "hyperspherical" coordinates where s=p2. All the the angles are just integrated over the surface of the hypersphere, since the radius is fixed, so we can just multiply it by the suface area of a 3N dimensional sphere 2(τ/2)3N/2Γ(3N/2)s3N1.

=V3Nh3NN!2(τ/2)3N/2Γ(3N/2)0δ(s22mE)s3N1ds

And the Dirac measure just chooses the one point.

=V3Nh3NN!2(τ/2)3N/2Γ(3N/2)(2mE)3N12

And we just plug it in to the temperature definition.

1T=kBln(W(E))E=kB1W(E)W(E)E

Substituting gives:

=kBXEV3Nh3NN!2(τ/2)3N/2Γ(3N/2)(2mE)3N12V3Nh3NN!2(τ/2)3N/2Γ(3N/2)(2mE)3N12

Then almost everythign cancels.

=kB3N12E3N121E3N12

Simplifying means:

1T=kB3N21E

this tempeature is:

kBT=E3N21

This equation is consistent with the equipartition theorem as each of the 3N1 degrees of freedom contribute 32kBT to the total energy.