Thermodynamics is the branch of physics that deals with the relationships between heat and other forms of energy. In particular, it describes how thermal energy is converted to and from other forms of energy and how it affects matter.
Thermal energy is the energy a substance or system has due to its temperature, i.e., the energy of moving or vibrating molecules, according to the Energy Education website of the Texas Education Agency. Thermodynamics involves measuring this energy, which can be "exceedingly complicated," according to David McKee, a professor of physics at Missouri Southern State University. "The systems that we study in thermodynamics … consist of very large numbers of atoms or molecules interacting in complicated ways. But, if these systems meet the right criteria, which we call equilibrium, they can be described with a very small number of measurements or numbers. Often this is idealized as the mass of the system, the pressure of the system, and the volume of the system, or some other equivalent set of numbers. Three numbers describe 1026 or 1030 nominal independent variables."