A single engine cylinder, cut away, running one real four-stroke cycle at a time
Cylinder One is a single-cylinder, four-stroke engine testbed shown in cutaway: a piston inside a cylinder, joined by a connecting rod to a crankshaft, with a cam-driven intake and exhaust valve overhead and a spark plug at the top. The ring road running around it is not a road at all -- it is the crank angle, laid out as a loop, because the four-stroke cycle really is one: 720 degrees, two full turns of the crank, intake then compression then power then exhaust then back to intake. The glowing token travelling that loop is the gas charge itself; its colour and size are its own phase and pressure, read straight out of the model.
Press Run and a virtual starter kicks the crank over; whether it catches and settles into a steady speed, runs weakly, knocks, or stalls depends entirely on the Throttle and Spark advance dials. Or turn the crank-angle slider by hand -- your own virtual starter handle -- to step through the cycle one degree at a time and watch the piston, valves and pressure trace follow.
Genuinely computed, live, in your browser: the piston position and cylinder volume,
from the exact slider-crank equation for an 80 mm bore, 80 mm stroke and 130 mm rod (not a small-angle
approximation); the cam-driven valve lift; the cylinder pressure and temperature, stepped one crank
degree at a time from a first-law energy balance (dU = dQ − P·dV) with a Wiebe heat-release function
for combustion and polytropic compression/expansion elsewhere; the indicated work, which is the actual
trapezoidal area of that pressure trace, not a formula standing in for it; torque, power and the
"percent of best-case" efficiency reading, all derived from that same work; and the engine's own
speed, which is integrated frame by frame from indicated torque minus a friction torque through a
flywheel inertia -- which is why it can accelerate, settle, or stall, rather than simply following a
slider. All of it lives in js/model.js, in well under 300 lines, and every one of those
lines is arithmetic, not a lookup table.
Scaled: one generic 402 cc cylinder standing in for a production engine, so the whole cycle fits on one screen and the numbers stay easy to watch.
Assumed: the charge behaves like air (specific gas constant 287 J/kg·K, constant specific heats); a stoichiometric 14.7:1 air-fuel ratio and 44 MJ/kg gasoline at 95% combustion efficiency; a Wiebe burn shape spread over 50 crank degrees; polytropic exponents of 1.30 standing in for real in-cylinder heat transfer during compression and expansion; manifold pressure a simple linear function of throttle position; valve events aligned exactly to the stroke boundaries, with none of the overlap real camshafts use near top dead centre; exhaust-stroke pressure held at a flat back-pressure rather than a time-resolved blowdown; and a simple speed-proportional friction torque with a flywheel inertia tuned so a spin-up or a stall plays out over a few watchable seconds rather than a real engine's actual response time.
Faked: "knocking" is a timing proxy -- this model flags it once more than half the charge has burned before top dead centre -- not a simulation of end-gas autoignition chemistry. Real knock is caused by unburned mixture ahead of the flame front detonating on its own; this model does not have a flame front or end-gas at all, only a single average pressure and temperature for the whole chamber. Treat the knock flag as pointing at the right cause (too much heat released too early) rather than the literal mechanism.
Scenery: the workshop, the scope board's casing, the throttle body and muffler shapes, the trees and lamps. They exist so the mechanism has somewhere to stand. The pressure trace drawn on the scope board is not scenery, though -- it is plotted live from the same array the work integral uses.
The first time the charge reaches a stroke it holds there for as long as that stroke's write-up takes to read -- between 9 and 26 seconds -- and a progress bar under the panel text shows how much of the stop is left. Once all four strokes have been explained there is nothing new to read, so later laps run at a watchable pace instead of a readable one. Space holds any stop indefinitely, S steps one stroke at a time, and the Speed slider scales everything, reading stops included. Reset (⟲) replays the slow tour; Run keeps what you have already read.
Built from the isometric-explainer skill. All code and copy original.