The term perpetual motion, taken literally, refers to movement
that goes on forever. However, the term more commonly refers to
any device or system that perpetually (indefinitely) produces more energy than it consumes, resulting in a net output of energy for indefinite time. The law of conservation of energy, which states that energy cannot be created or destroyed, implies that such a perpetual motion machine cannot exist. The most commonly contemplated type of perpetual motion machine is a mechanical system which (supposedly) sustains motion indefinitely, despite losing energy to friction and air resistance. A second type of impossible "perpetual motion machine" is one which does not violate conservation of energy, but produces work by spontaneously extracting heat from its surroundings, thereby cooling them down, and converting the heat energy into mechanical work. Such machines are forbidden by the second law of thermodynamics. A perpetual motion machine of the first kind produces energy from nothing, giving the user unlimited 'free' energy. It thus violates the law of conservation of energy. A perpetual motion machine of the second kind is a machine which spontaneously converts thermal energy into mechanical work. When the thermal energy is equivalent to the work done, this does not violate the law of conservation of energy