Thermodynamics is the science dealing with energy transformation between heat and work. It studies systems, which can be open or closed to matter flow, and their surroundings. For a closed system, there is no exchange of mass between the system and surroundings, while an open system allows mass flow. A process is a change in state of a substance, and a cycle occurs when the initial and final states are the same. Thermodynamics analyzes the various forms of energy including work, heat, internal energy, and flow energy. It also examines the properties of pure substances and how they vary with changes in temperature and pressure through different phases like solid, liquid, and gas.