Steam engines are external combustion engines, where the working fluid is separated from the combustion products. Non-combustion heat sources such as solar power, nuclear power or geothermal energy may be used. The ideal thermodynamic cycle used to analyze this process is called the Rankine cycle. In the cycle, water is heated and changes into steam in a boiler operating at a high pressure. When expanded using pistons or turbines mechanical work is done. The reduced-pressure steam is then exhausted to the atmosphere, or condensed and pumped back into the boiler.
In general usage, the term steam engine can refer to either complete steam plants (including boilers etc.) 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. However, a more detailed look at the steam locomotive referred to the engine as only that part where the heat in the steam was turned into motion of the piston, and hence enabled separate statements for boiler efficiency and engine efficiency. Specialized devices such as steam hammers and steam pile drivers are dependent on the steam pressure supplied from a separate boiler.
The use of boiling water to produce mechanical motion goes back over 2000 years, but early devices were not practical. The Spanish inventor Jerónimo de Ayanz y Beaumont obtained a patent for a rudimentary steam-powered water pump in 1606. In 1698 Thomas Savery patented a steam pump that used steam in direct contact with the water being pumped. Savery's steam pump used condensing steam to create a vacuum and draw water into a chamber, and then applied pressurized steam to further pump the water.
Thomas Newcomen's atmospheric engine was the first commercial true steam engine using a piston, and was used in 1712 for pumping flood water from a mine. 104 were in use by 1733. Eventually over two thousand of them were installed.
In 1781 Scottish engineer James Watt patented a steam engine that produced continuous rotary motion. Watt's ten-horsepower engines enabled a wide range of manufacturing machinery to be powered. The engines could be sited anywhere that water and coal or wood fuel could be obtained. By 1883, engines that could provide 10,000 hp had become feasible. The stationary steam engine was a key component of the Industrial Revolution, allowing factories to locate where water power was unavailable. The atmospheric engines of Newcomen and Watt were large compared to the amount of power they produced, but high-pressure steam engines were light enough to be applied to vehicles such as traction engines and railway locomotives.
Reciprocating piston type steam engines remained the dominant source of power until the early 20th century, when advances in the design of electric motors and internal combustion engines gradually resulted in the replacement of reciprocating (piston) steam engines in commercial usage, and the ascendancy of steam turbines in power generation. Considering that the great majority of worldwide electric generation is produced by turbine type steam engines, the "steam age" is continuing with energy levels far beyond those of the turn of the 19th and 20th century.