A steam engine is a heat engine that performs mechanical work using steam as its working fluid. The steam engine uses the force produced by steam pressure to push a piston back and forth inside a cylinder. This pushing force can be transformed, by a connecting rod and flywheel, into rotational force for work. The term "steam engine" is generally applied only to reciprocating engines as just described, not to the steam turbine. Steam engines are external combustion engines, where the working fluid is separated from the combustion products. The ideal thermodynamic cycle used to analyze this process is called the Rankine cycle. In general usage, the term steam engine can refer to either complete steam plants, such as railway steam locomotives and portable engines, or may refer to the piston or turbine machinery alone, as in the beam engine and stationary steam engine.
Although steam-driven devices were known as early as the aeolipile in the first century AD, with a few other uses recorded in the 16th and 17th century, Thomas Savery is considered the inventor of the first commercially-used steam powered device, a steam pump that used steam pressure operating directly on the water.