  We extend and successfully apply a recently proposed microstate
nonequilibrium thermodynamics to study expansion/contraction processes. Here,
the numbers of initial and final microstates are different so they cannot be
connected by unique Hamiltonian trajectories. This commonly happens when the
phase space volume changes, and has not been studied so far using Hamiltonian
trajectories that can be inverted to yield an identity mapping between initial
and final microstates as the parameter in the Hamiltonian is changed. We
propose a trick to overcome this hurdle with a focus on free expansion in an
isolated system, where the concept of dissipated work is not clear. The trick
is shown to be thermodynamically consistent and can be extremely useful in
simulation. We justify that it is the thermodynamic average of the internal
microwork done by a microstate that is dissipated; this microwork is different
from the exchange microwork with the vacuum, which vanishes. We also establish
that the microwork is nonnegative for free expansion, which is remarkable,
since its sign is not fixed in a general process.
