The internal energy of a given mass of gas is independent of its volume and pressure, being a function of temperature alone. This law, which was formulated by James Prescott Joule, applies only to ideal gases (for which it provides a definition of thermodynamic temperature) as in a real gas intermolecular forces would cause changes in the internal energy should a change of volume occur. See also Joule–Thomson effect.