Jarzynski equality for the Jepsen gas

We illustrate the Jarzynski equality on the exactly solvable model of an ideal gas in uniform expansion or compression. The analytical results for the probability density P(W) of the work W performed by the gas are compared with the results of molecular dynamics simulations for a two-dimensional dilute gas of hard spheres, a prototype for a real, slightly non-ideal gas.