How engines, motors and power plants work
Pistons moving up and down in four strokes, a triangular rotor turning, a motor spun by electricity, and generators that make electricity by turning. Four machines that connect motion and energy.
The four works here are “simplified teaching models” based on real machines. They leave out friction, heat loss and small parts so that only the motion and the flow of energy stay visible.
Four-stroke Engine (the site’s “Four-stroke Engine”)
A piston moves up and down, and a crank (a bent shaft) turns that motion into rotation. A four-stroke engine repeats four strokes:
- Intake: the piston moves down, the intake valve opens, and fuel and air come in.
- Compression: with the valves shut, the piston moves up and squeezes the mixture.
- Power: the mixture is ignited and burns, and the expanding gas pushes the piston down. This is the only stroke that produces force.
- Exhaust: the piston moves up again and pushes the burnt gas out through the exhaust valve.
Going through the four strokes takes two turns of the crank, and only one of the four strokes is a power stroke. This site’s program checked that the four strokes come in order, that one cycle takes two crank turns, and that there is exactly one power stroke (four-stroke-engine/engine.test.ts).
In history, Nicolaus Otto of Germany, together with colleagues, built a four-stroke engine with a compression stroke in 1876. It is regarded as the first commercially successful compression engine, and the “Otto cycle” is named after it. However, in 1862 the Frenchman Beau de Rochas is said to have patented the same four-cycle idea, without building an engine. So it is safer to say that Otto made it practical and spread it, not that he invented the four-stroke cycle.
How hard the mixture is squeezed is given by the compression ratio, the ratio of the largest volume to the smallest volume. In passenger-car petrol engines, roughly 8 to 12 is typical.
In the ideal case, the higher the compression ratio, the higher the thermal efficiency. The ideal formula gives about 60% at a ratio of 10 (four-stroke-engine/engine.test.ts checks the value from the formula and that efficiency rises with the ratio).
But that is the ideal, with no friction and no heat loss. Real petrol engines are said to be around 30%, or somewhere in the 30s to 40s depending on the source.
A diesel engine compresses only air until it is very hot, then injects fuel, which ignites by itself from the heat. That is the difference from a petrol engine, which uses a spark. Its compression ratio is much higher, roughly 15 to 23. Rudolf Diesel took out his patents in 1892, and the engine became practical in the 1890s. In practice the peak efficiency is said to be about 43% for passenger cars, and up to about 55% for very large ship engines. The average over real driving is lower.
Rotary Engine (the site’s “Rotary Engine”)
A rotary engine uses a rounded-triangle rotor instead of pistons. The rotor turns inside a housing shaped like a fat figure eight (an epitrochoid). Each of the rotor’s three tips carries a seal that presses on the housing wall. Between the rotor and the wall there are three chambers, and as the rotor turns, each chamber grows and shrinks. That change in volume carries out intake, compression, combustion and exhaust, staggered from chamber to chamber and all at the same time.
The counting is the fun part. The rotor goes around an off-centre part of the shaft, like a hula hoop. While the rotor turns once, the output shaft turns three times. There are three firings in that one turn of the rotor, so there is exactly one firing per turn of the output shaft.
This site’s program checked that one rotor turn means three shaft turns and three firings (rotary-engine/engine.test.ts). A typical single four-stroke cylinder needs two shaft turns for one firing, so by this count a rotor fires twice as often per shaft turn.
The program also checked, at about 1,400 angles, that the three tips always travel along the curve of the wall.
In history, the German engineer Felix Wankel is said to have designed a rotary compressor in the 1920s and to have received a first patent for a rotary engine in 1934. He worked with a German car company in the 1950s, and the first prototype ran in 1957. Cars with this kind of engine went on sale in the 1960s, and a Japanese maker played a large part in putting it into volume production. Which design is better depends on the purpose and conditions, so we make no claim about that.
Electric Motor (the site’s “Electric Motor”)
When current flows through a wire in a magnet’s field, a force acts on the wire. Make the wire a coil, and one side is pushed up and the other down, so the coil starts to turn. But after half a turn the push would point the other way. To keep turning, you need something that reverses the current every half turn. In a DC motor, a commutator and brushes do this. A brushless motor uses electronic circuits in place of the commutator.
This site’s program checked that even when the current reverses every half turn, the turning force (torque) keeps the same direction. Reverse the battery and the motor turns the other way. In the site’s model, doubling the voltage doubles the speed, and zero voltage stops it (electric-motor/engine.test.ts; this is a teaching simplification, not the performance of a real motor).
In history, Michael Faraday did his “electromagnetic rotation” experiments at the Royal Institution in 1821. A wire carrying current kept turning around a magnet standing in mercury. It is regarded as one of the first experiments to show continuous rotation from current and a magnet. But it was not a practical motor. It is not accurate to say that Faraday invented the electric motor; the story of practical motors continues with the work of other people.
Ways to Generate Power (the site’s “Ways to Generate Power”)
The central idea of a generator is a motor in reverse. When a magnet moves near a coil, so that the magnetic flux through the coil changes, a voltage appears in the coil. This is electromagnetic induction. Michael Faraday is said to have found induction in 1831 (Joseph Henry found it independently in 1832). Soon afterwards he also found that a spinning copper disc gives a steady current. In 1834 Lenz stated the rule for the direction of the induced current. Keep turning a coil and you get a current that keeps reversing (alternating current). A generator is a motor that gives electricity when you turn it.
So what turns the coil? The site’s program lets you follow the paths (power-generation/engine.test.ts).
- Thermal, nuclear and geothermal: in most cases, heat makes steam, and the steam turns a turbine, which turns a generator. These three share the steam and rotation stages. Natural-gas plants may also combine a gas turbine with a steam turbine.
- Hydro and wind: flowing water or wind turns a turbine or rotor directly, without going through heat.
- Solar: when light strikes a solar cell, electrons move inside it and a voltage appears (the photovoltaic effect). There is no coil and no rotation, and it is a different mechanism from induction. Edmond Becquerel first showed the effect in 1839, and Charles Fritts is said to have made the first solar cell in 1884.
Every path ends in electricity. In the heat-based plants, only part of the heat put in becomes electricity and the rest is thrown away. As rough guides, figures of about 33 to 36% for nuclear, about 40% for coal and about 60% for combined-cycle gas are quoted (for the newest plants; existing ones can be lower). Note that this means “the share of heat that became electricity”, which is not the same kind of number as the efficiency of hydro, wind or solar. We do not quote figures for those here.
What they share
- From back-and-forth to rotation, from rotation to electricity: piston strokes, a turning rotor and a turning coil each take energy out by changing the form of motion.
- A motor and a generator are two sides of one idea: give it electricity and it turns; turn it and it gives electricity.
- Heat-based machines can use only part of the heat: the rest has to be thrown away.
All four are simplified teaching models. The detailed chemistry of burning, lubrication, cooling and electrical losses are not considered here.
Sources
- Wikipedia — Four-stroke engine
- Wikipedia — Nicolaus Otto
- Wikipedia — Compression ratio
- Wikipedia — Diesel engine
- Wikipedia — Wankel engine
- Wikipedia — Homopolar motor(Faraday, Quarterly Journal of Science 12, 1821 を引用 / cites Faraday 1821)
- Wikipedia — Electromagnetic induction
- Wikipedia — Photovoltaic effect
- World Nuclear Association — Cooling power plants
- Cogniq Fun — src/lib/games/four-stroke-engine/engine.test.ts(4行程でクランク2回転、出力は1回、理想効率の式 / two crank turns, one power stroke, ideal efficiency)
- Cogniq Fun — src/lib/games/rotary-engine/engine.test.ts(ローター1回転で軸3回転・出力3回 / one rotor turn, three shaft turns, three firings)
- Cogniq Fun — src/lib/games/electric-motor/engine.test.ts(半回転ごとに電流の向きが反転、トルクの向きは変わらない / current reverses every half turn, torque keeps its sign)
- Cogniq Fun — src/lib/games/power-generation/engine.test.ts(熱を使う発電の道すじと、水・風・太陽光の違い / energy paths of each source)
Updated: 2026-10-17