Test volume method
An alternative to the virial pressure route to calculating the pressure, there is a method which consists on evaluating the change in internal energy, produced by a small change in the volume of the system . It can be shown that
where is the Boltzmann constant and is the temperature.
The method is clearly inspired by the Widom test-particle method to obtain the chemical potential.