are stated below for a 3-dimensional ideal gas of particles, each with mass , confined in a thermally isolated container that is infinitely long in the z-direction and has constant cross-sectional area . The gravitational field is assumed to act in the minus z direction with strength . The phase volume is where is the total energy, kinetic plus gravitational. The gas density as a function of height can be obtained by integrating over the phase volume coordinates. The result is: Similarly, the distribution of the velocity magnitude (averaged over all heights) is The analogues of these equations in the canonical ensemble are the barometric formula and the Maxwell–Boltzmann distribution, respectively. In the limit , the microcanonical and canonical expressions coincide; however, they differ for finite . In particular, in the microcanonical ensemble, the positions and velocities are not statistically independent. As a result, the kinetic temperature, defined as the average kinetic energy in a given volume , is nonuniform throughout the container: By contrast, the temperature is uniform in the canonical ensemble, for any . See also Isolated system Ergodic hypothesis Loschmidt's paradox Notes References Statistical ensembles