4-Stroke Engine

How a petrol engine turns fire into motion, one stroke at a time. A crankshaft drives the piston through the four strokes of the Otto cycleintake draws in the fuel-air mix, compression squeezes it, the spark fires and the power stroke is forced down, then exhaust pushes the burnt gas out — two full turns of the crank for one power cycle. Flip the switch from one cylinder to an inline-four and watch four cylinders share one crankshaft, firing 1-3-4-2 so a power stroke lands every 180° — that is why more cylinders run smoother. Beside the animation, the same cycle traces its loop on a pressure-volume diagram, and the thermal efficiency η = 1 − 1/r^(γ−1) climbs as you raise the compression ratio. It all runs on your device.

You are in the Physics lab.

Watch the valves and spark, then switch to 4 cylinders to see the 1-3-4-2 firing order
Presets
Engine speed
Compression ratio
Thermal efficiency
Power pulse
Four strokes, two turns, one bang. Only one of the four strokes — the power stroke — actually does work; the other three set it up. The engine spends intake and compression preparing the charge, gets its push from power, then clears out on exhaust, all over two crank revolutions. On the PV diagram that is a tall loop whose area is the net work, and squeezing harder before the burn — a higher compression ratio — makes the loop taller and the efficiency η = 1 − 1/r^(γ−1) higher, until knock sets the real-world limit.

Reading the simulation

What the pistons, the colours and the firing order are telling you.

1

The four strokes of one cylinder

Start with a single cylinder. Follow the piston through one full cycle — two turns of the crank, 720°. The label names the stroke and the colour of the gas changes with it: intake is blue as the piston drops and the left valve opens, compression squeezes the charge with both valves shut, power flashes orange as the spark fires at the top and the gas is forced down, and exhaust pushes the burnt gas out through the right valve. Only the power stroke does work; the other three set it up.

2

Four colours, and the 1-3-4-2 firing order

Switch to the inline-four. The four cylinders share one crankshaft but are staggered by 180° of crank, so at any instant they are all on different strokes — read the four colours across the row. They fire in the order 1-3-4-2: cylinder 1, then 3, then 4, then 2, each 180° after the last. Look at the crank throws below: pistons 1 and 4 rise and fall together and 2 and 3 together, but each pair is always in opposite strokes — when 1 is on power, 4 is on intake — which is what balances the engine.

3

Why more cylinders run smoother

A single cylinder fires just once every 720° — one push, then three strokes of coasting on the flywheel, so it lurches. In the inline-four a new power stroke begins every 180°, four times per cycle, and they overlap end to end. The Power pulse readout shows which cylinder is firing right now; watch it hand off 1 → 3 → 4 → 2 so the crank is never without a push. That continuous torque is why engines with more cylinders feel smoother.

How It Works

A crank turns the piston's push into rotation, four strokes feed one power stroke, and the Otto cycle ties it to thermodynamics.

1

The four strokes

Intake: the piston drops with the intake valve open, pulling in fuel and air. Compression: both valves shut and the piston rises, squeezing the mixture. Power: the spark ignites it and the hot, high-pressure gas slams the piston down. Exhaust: the exhaust valve opens and the rising piston pushes the burnt gas out. Then it repeats — one cycle every two crank turns.

2

One crank, more cylinders, smoother power

The piston only moves up and down, but a connecting rod links it to an offset pin on the crankshaft, converting that straight-line push into rotation — the crank-slider drawn here. A single cylinder delivers just one power stroke per 720°, so the flywheel has to carry it through the gaps. An inline-four puts four cylinders on one crankshaft, offset by 180° and firing 1-3-4-2, so a power stroke overlaps every 180° and the torque never drops out — more cylinders, smoother running.

3

The Otto cycle and efficiency

Idealised, each cylinder follows the Otto cycle on the PV diagram: adiabatic compression, constant-volume combustion, adiabatic expansion, constant-volume exhaust. Its area is the net work, and its efficiency is η = 1 − 1/r^(γ−1) with γ ≈ 1.4 for air — higher compression ratios burn the fuel more effectively, which is why raising the ratio here lifts the efficiency, up to the point where the fuel would knock.

What are the four strokes of an engine?
A four-stroke petrol engine completes one power cycle in four movements of the piston, over two turns of the crankshaft. Intake: the piston moves down with the intake valve open, drawing in a fuel-air mixture. Compression: both valves close and the piston moves up, squeezing the mixture. Power: the spark plug ignites it and the expanding gas forces the piston down — the only stroke that does work. Exhaust: the exhaust valve opens and the piston moves up, pushing the burnt gas out. This simulator animates all four with the valves and spark.
What is the Otto cycle?
The Otto cycle is the idealised thermodynamic cycle of a spark-ignition engine, drawn as a loop on a pressure-volume diagram: an adiabatic compression, a constant-volume heat addition (the combustion), an adiabatic expansion (the power stroke), and a constant-volume heat rejection (the exhaust). Its enclosed area is the net work per cycle. This tool shows the piston motion beside that PV loop so you can see how each stroke maps onto the cycle.
How does the compression ratio affect efficiency?
The ideal thermal efficiency of the Otto cycle is η = 1 − 1/r^(γ−1), where r is the compression ratio and γ ≈ 1.4 for air. A higher compression ratio squeezes the mixture more before it burns, so efficiency rises: about 43 percent at 4:1, 56 percent at 8:1 and 60 percent at 10:1. Real engines are limited by knock — the fuel self-igniting if compressed too far — which caps the useful ratio. Slide the compression ratio in this simulator and watch the efficiency climb.
What is the firing order of an inline-four engine, and why is it smoother?
Switch this simulator to 4 cylinders and it runs as an inline-four on a single crankshaft with the firing order 1-3-4-2. Because the four cylinders are staggered by 180° of crank, one cylinder is on its power stroke at every moment — a power pulse arrives every 180°, four times over the two crank turns of the cycle. A single cylinder fires only once every 720°, so it lurches; the overlapping power strokes keep the crank turning smoothly. Pistons 1 and 4 move together and 2 and 3 move together, but each pair is always in opposite strokes, which also balances the engine.

Teaching or blogging about engines or thermodynamics? You can embed this simulator on your own site free — one line of code, no sign-up.