A heat engine takes in heat from a high temperature source and converts some of it to work while expelling the rest to a lower temperature sink. The efficiency of a heat engine, defined as the ratio of work output to heat input, is maximized by the Carnot cycle between the two temperature reservoirs. No engine can exceed the efficiency of an ideal Carnot engine operating between the same reservoirs due to the second law of thermodynamics.