Thermodynamics is the branch of science concerned with the nature of heat and its conversion to any form of energy. In thermodynamics, both the thermodynamic system and its environment are considered. A thermodynamic system, in general, is defined by its volume, pressure, temperature, and chemical make-up. In general, the environment will contain heat sources with unlimited heat capacity allowing it to give and receive heat without changing its temperature. Whenever the conditions change, the thermodynamic system will respond by changing its state; the temperature, volume, pressure, or chemical make-up will adjust accordingly in order to reach its original state of equilibrium. There are three laws of thermodynamics in which the changing system can follow in order to return to equilibrium.
In order for a system to gain energy the surroundings have to supply it, and visa versa when the system looses energy the surroundings must gain it. As the energy is transferred...