Energy per unit volume has the same physical units as pressure and in many situations is synonymous. For example, the energy density of a magnetic field may be expressed as and behaves like a physical pressure. Likewise, the energy required to compress a gas to a certain volume may be determined by multiplying the difference between the gas pressure and the external pressure by the change in volume. A pressure gradient describes the potential to perform work on the surroundings by converting internal energy to work until equilibrium is reached.