In thermodynamics, thermal energy refers to the internal energy present in a system by virtue of its temperature. The average translational kinetic energy possessed by free particles in a system of free particles in thermodynamic equilibrium (as measured in the frame of reference of the center of mass of that system) may also be referred to as the thermal energy per particle. Microscopically, the thermal energy may include both the kinetic energy and potential energy of a system’s constituent particles, which may be atoms, molecules, electrons, or particles. It originates from the individually random, or disordered, motion of particles in a large ensemble. In ideal monatomic gases, thermal energy is entirely kinetic energy. In other substances, in cases where some of thermal energy is stored in atomic vibration or by increased separation of particles having mutual forces of attraction, the thermal energy is equally partitioned between potential energy and kinetic energy. Thermal energy is thus equally partitioned between all available degrees of freedom of the particles. As noted, these degrees of freedom may include pure translational motion in gases, rotational motion, vibrational motion and associated potential energies. In general, due to quantum mechanical reasons, the availability of any such degrees of freedom is a function of the energy in the system, and therefore depends on the temperature (see heat capacity for discussion of this phenomenon). Macroscopically, the thermal energy of a system at a given temperature is proportional to its heat capacity. However, since the heat capacity differs according to whether or not constant volume or constant pressure is specified, or phase changes permitted, the heat capacity cannot be used to define thermal energy unless it is done in such a way as to insure that only heat gain or loss (not work) makes any changes in the internal energy of the system. Usually, this means specifying the “constant volume heat capacity” of the system so that no work is done. Also the heat capacity of a system for such purposes must not include heat absorbed by any chemical reaction or process.