Thermodynamics describes the transfer of energy and the natural tendency of systems to move towards lower energy states. A system and its surroundings are defined, and changes in a system are associated with energy transfer. Gibbs free energy (G) is a measure of a system's chemical energy and all systems naturally move towards minimum G states. G depends on enthalpy (H), temperature (T), and entropy (S). The phase or reaction with lowest G is the most stable under a given set of conditions. Phase diagrams can be constructed using G to predict stability fields with changing P and T.