An Interactive Treatise
A chemistry simulator looks like it must hide a vast table of answers. It doesn’t. Here is what it does instead — the real engine running, live, beneath every word.
Suppose you had to write a program that knows what happens when chemicals meet. Drop zinc into blue copper-sulfate solution; warm some marble chips in acid; pass a current through salt water. The design that springs to mind — the one almost everyone pictures — is a colossal table: a row for every pair of ingredients, listing what comes out. Reactant A plus reactant B yields product C.
It is a tempting picture, and it is hopeless. A table of pairs alone runs to hundreds of millions of rows, and most of chemistry isn’t pairs — it’s three or four things at once, in proportions that matter. But the deeper problem is that a table answers the wrong question. It can tell you that A and B react. It cannot tell you how fast. It cannot tell you how far — whether the reaction sprints to completion or stalls halfway and sits there. It cannot tell you whether it happens at all at this temperature, this concentration, this acidity. And it cannot tell you how much heat pours out, which is a shame, because that heat changes the temperature, which changes everything else.
A reaction is not a fact you look up.
It is a process you follow.
So the real engine doesn’t store answers. It stores a few hundred substances, each carrying a handful of numbers measured in a lab, plus a long list of which substances can turn into which and the conditions each change needs. That much it looks up — the measured constants, and the catalogue of what’s possible. But everything you actually watch — how far and how fast each reaction really runs, the heat it throws off, the pH, the colour, the fizz — it computes, moment by moment, by stepping those rules forward in time. Even a reaction’s speed isn’t stored anywhere: it’s worked out, instant by instant, from the barrier the molecules have to clear and how warm they are. Lookups for the ingredients and the possibilities; arithmetic for the behaviour.
The rest of this essay is those rules, one at a time, each with the genuine engine wired up so you can turn the knobs. By the end the giant table will look not just wrong but unnecessary — like memorising every sum instead of learning to add.
Open the engine’s data file and you find no reactions-with-answers. You find a card catalogue of substances — about four hundred of them — and each card carries the same short list of measured physical numbers. How much energy is locked inside it. How much disorder it holds. How much heat it takes to warm it by a degree. Its density, its colour, its electrical character.
That’s the whole sleight of hand. These are facts about a thing, not an event. A single number on the water card gets reused in every one of the hundreds of reactions water touches. Store the nouns; compute the verbs. Pick a substance and read its card — this is, verbatim, what the simulator knows about it:
The standout number is the first one — standard enthalpy of formation, the energy banked when one mole of the substance is built from raw elements. Hold onto it; the next instrument is built entirely from it.
Here is the first thing the table couldn’t do, dispatched in one line of arithmetic. Every substance’s card lists how much energy went into forming it. A reaction just rearranges atoms from one set of substances into another — so the heat it releases or swallows is simply the energy of what you end with, minus the energy of what you started with.
That this works at all is a real law — Hess’s law. Energy is a property of a state, not of a journey: it doesn’t matter what convoluted path the atoms take from reactants to products, only where they begin and end. So you never tabulate “this reaction releases X joules.” You subtract two formation energies and the heat falls out. Choose a reaction and watch the ledger balance:
Store one measured number per substance: its standard enthalpy of formation ΔHf, the energy banked when you build one mole of it from raw elements. A reaction’s heat is then pure bookkeeping — the formation energies of what you end with, minus what you started with, each weighted by how many appear:
A negative result means surplus energy escapes as heat. To turn that into a temperature change, divide the heat released by an extent ξ by the mixture’s heat capacity C — itself just the sum of (amount × molar heat capacity) over everything present:
That feedback — heat lifting the temperature, a higher temperature changing the rates in the next step — is precisely why the outcome can’t be looked up. It has to be integrated forward, which is the next instrument.
And that released heat isn’t just a readout — it gets spent. The engine pours it into the beaker, the temperature climbs (by exactly the heat divided by the contents’ heat capacity — another number straight off the cards), and a warmer beaker reacts faster. Energy and speed are already entangled. Which brings us to speed.
This is the heart of it. Instead of ever asking “what is the final answer,” the engine asks a much smaller question, over and over: at this exact instant, how fast is this reaction going right now?
The answer is wonderfully physical. Reactions happen when molecules collide, so the rate is set by how crowded the reactants are — multiply their concentrations together. Twice as much dissolved acid, twice as many collisions, twice the speed. (A solid can only react at its surface, so for solids it’s the surface area that counts — which is why powder reacts faster than a lump.) That’s the rate law: a rate constant times the concentrations.
But that rate constant is not some number filed away for each reaction. It is itself computed — and here the engine cashes the cheque Instrument II wrote when it said a warmer beaker reacts faster. A collision only does something if the molecules hit hard enough to clear an energy barrier; warm them and far more of them make it over, by the exponential margin known since 1889 as the Arrhenius law. Cool, a reaction can be effectively frozen; warm, the very same reaction can run away with itself. The barrier’s height is the one number that matters — and for most reactions the engine doesn’t know it from a textbook; it builds it from the reaction’s own measured heat, on the rule that the more energy a reaction releases, the lower its barrier tends to sit. (A handful of well-studied reactions carry a barrier taken straight from the lab instead.) Either way no speed is stored — it is rebuilt from a barrier and a temperature, every single tick.
Then comes the move that retires the lookup table for good. Take that instantaneous rate and step forward a tiny slice of time — a twentieth of a second. Convert just that much. Update every amount. Recompute the rate, now slightly lower because reactants were used up. Step again. The simulator never solves for the end state; it walks there, one little step at a time. Run it and watch: the curve bends and flattens all on its own, because flattening is the rate falling as the reactants run out.
This is the method everything else hangs off, so it’s worth doing slowly. Give every reaction a rate — how fast it’s going right now, in amount per litre per second. Since reactions happen when molecules collide, that rate is the reactant concentrations multiplied together (each raised to its coefficient), times the rate constant k:
And k is not a stored number — it is the Arrhenius law, computed fresh from the temperature each tick:
That exponential is why a 10 °C rise can roughly double a rate, and why heat feeding back into T can tip a reaction into runaway. The barrier Ea is worth being precise about, because it’s where the honesty lives. A few well-studied reactions (here, hydrogen peroxide and its catalysts) carry an activation energy taken from the literature. Every other reaction — the great majority — gets a Brønsted–Evans–Polanyi estimate: Ea built from the reaction’s enthalpy (itself summed from the measured formation energies on the species cards), on the rule that more exothermic reactions tend to have lower barriers. So the rate is quantitative for the few and a physically-structured guess for the many — but it is always derived from real measured data, never a tabulated fudge, and each reaction is tagged with which it is. A solid only reacts at its surface, so it contributes a 1/size³ term in place of a concentration; a pure liquid or the open air contributes 1.
To make that into a simulation, march time forward in tiny slices Δt (here, a twentieth of a second). The amount that reacts in one slice — the extent ξ — is just the rate scaled back into an amount:
Apply it: each reactant drops by (coefficient×ξ), each product rises by the same. Two guards keep it honest — clamp ξ so no reactant goes negative (the limiting reagent), and never let it fall below zero (a simple reaction runs only forwards). Then recompute every rate from the new amounts and repeat.
That loop is the whole trick — it’s Euler’s method on a rate law. The curve above isn’t drawn anywhere; it’s the amounts plotted as this runs. Move the slider and a genuinely different curve gets solved from scratch, one Δt at a time, because none of it was stored ahead of time.
This stepping-forward is the entire secret of the engine. Everything still to come — equilibrium, precipitation, batteries — is just a richer formula for “how fast, right now,” dropped into the very same loop.
Now put the pieces side by side and let them run together. Each tick of the clock, the engine sweeps every possible reaction and asks its rate; takes the little step; moves the heat and nudges the temperature; lets any gas bubble away; and finally re-reads the colour straight from the cards of whatever is now dissolved. Then it does it again, fifty times a second.
Nothing in that loop knows the word “displacement.” Nobody scripted “fade from blue to colourless.” Drop zinc into copper sulfate and the blue drains away, the beaker warms, a dark crust of copper appears — and all of it is simply what falls out of the rules when copper ions are being consumed. The behaviour is emergent. Watch:
Composing the rules is just running them side by side. Hold the world as a small state — the amount of every species, plus one temperature. Each slice Δt, walk this list in order:
Advance the clock and do it all again, fifty times a second. The behaviour you watch — fading, warming, a crust forming — is the sum of these small updates. Nobody coded “fade blue to colourless”; it falls out of copper ions being subtracted, one tick at a time.
And this is only the first three rules. The same machine — a few measured constants, one physical rule, stepped through time — stretches to cover the rest of chemistry. Some of those rules are strange enough to deserve their own chapter. Here is the strangest.
Every reaction so far has marched in one direction until something ran out. But a great many refuse to. They run forwards and backwards at the same time — products falling back into reactants as fast as reactants become products — and at the point where those two rates match, the whole thing simply stops changing, with plenty of everything still in the beaker. Not finished. Balanced. This is equilibrium, and it is most of chemistry.
The engine doesn’t need new machinery for it — just two rates instead of one, forward and reverse, with each tiny step taking the difference between them. And every substance still carries a single number to say where the truce falls: an equilibrium constant, K. The reaction doesn’t race to the finish; it relaxes to a balance and sits there.
Which, at last, is where pH comes from. Dissolving an acid is itself one of these reversible reactions: each molecule can hand a proton to the water, or snatch it back. A strong acid gives up essentially all of them — the forward direction wins outright. A weak acid reaches a standoff after surrendering only a tiny fraction. Same amount dissolved, wildly different acidity — and pH is nothing but a tally of how many free protons the truce leaves drifting. Dissolve something and see:
A reversible reaction settles where its reaction quotient equals the tabulated constant K. Write that quotient as a function of how far the reaction has run, ξ — products over reactants, each amount adjusted by ±(coefficient×ξ), all over the volume:
Q rises monotonically with ξ, so finding the balance is a one-dimensional root-find: solve Q(ξ) = K. Bracket ξ between “all reactant consumed” and “all product consumed”, then bisect — halve the interval about sixty times until Q lands on K. (The original used a closed-form quadratic where the algebra allowed; bisection gives the same answer for any stoichiometry, with far less to get wrong.)
Apply that ξ. For a dissolved acid it fixes [H+], and pH = −log10[H+]. A strong acid has a huge K, so ξ runs to completion — fully dissociated. A weak acid has a tiny K, so ξ stalls almost at once. Same concentration, K apart on the scale — which is the whole story the widget tells.
Notice the constant K never finishes the job — that’s the entire point of it. A strong acid’s reaction runs effectively one-way and empties out; a weak acid’s settles with most of itself still intact. Same rule, same loop — only the number is different.
Three more rules round out the bench, and each is this same move in a fresh costume. Now that you can read the loop, you can watch them too.
Water can only hold so much of a given salt. Every salt has a ceiling — a maximum for the product of its dissolved ion concentrations — called the solubility product, Ksp. One more number on the card. Stay under it and everything stays dissolved and clear. Push past it — say, by tipping together two clear solutions that between them carry far too much silver and too much chloride — and the surplus has nowhere to go but out, as a solid that clouds the water.
The engine tracks the ion product Q = [Ag⁺][Cl⁻] and compares it to the ceiling. Whenever Q rises above Ksp the salt crystallises out — at just the rate needed to pull Q back down to the ceiling and hold it there. It is exactly the dissolving rule from before, run in reverse. Stir some chloride into a silver solution and watch it cloud:
Dissolving is the same quotient-versus-constant idea as equilibrium, except the constant is the solubility product Ksp and a solid sits on one side. Each step, measure a driving force from the current ion product Q:
If drive > 0 the solution is unsaturated — dissolve a little, at a rate set by the driving force and the solid’s 1/size³ surface. If drive < 0 it’s supersaturated — precipitate, clamped so Q lands exactly back on the ceiling. The very same line runs the reaction either direction, which is why the marker in the widget always slides down to meet Ksp and halts there, never overshooting.
Some reactions give up more than heat — they give up electrons. And if you force those electrons to take the long way round, through a wire, you have a battery. Zinc is hungrier to shed electrons than copper is; the size of that mismatch, measured in volts, is the voltage the cell can push.
Each metal’s eagerness is — of course — a number on its card: its electrode potential. The engine reads both, takes the difference, and adjusts it for how concentrated each ion is (that adjustment is the Nernst equation, the electrical cousin of the equilibrium constant). Wire it up and the reaction drives a current: zinc dissolves at one beaker, copper plates out at the other, ions trickle across the bridge to keep things balanced. As the concentrations drift the voltage sags, and when the copper is used up the needle falls to zero — flat. Connect the cell and run it down:
Each electrode half-reaction carries a standard potential E° — its eagerness to take electrons, measured once. Correct it for the actual ion concentrations with the Nernst equation:
The cell’s voltage is simply the gap between its two electrodes, the greedier one minus the other:
For the Daniell cell that’s about (+0.34) − (−0.76) = 1.10 V, read straight off the table. Then drive a current in proportion to the EMF; as the ions deplete, each Q shifts, each E shifts with it, and the EMF sags to zero — a battery going flat, every digit computed.
A moment ago a reaction made electricity all by itself. Run that bargain in reverse — push electrons in from a battery — and you can force reactions to go uphill, ones that would never happen on their own. You can even tear water apart into the elements it’s made of.
But not for any push. Below a certain voltage — the decomposition voltage — the cell just sits there; the battery isn’t strong enough to pry anything loose. Above it, the current splits the water: hydrogen collects at one electrode, oxygen at the other. And since every water molecule is two parts hydrogen to one part oxygen, you get back exactly twice the volume of hydrogen. The engine scores each electrode for which species is easiest to convert there — its potential, nudged by concentration, the same E ± C rule the galvanic cell used — and drives whichever wins. Turn the voltage up past the threshold:
Electrolysis runs on the same Nernst potentials, but now the move is choosing which half-reaction wins at each electrode — and the choice depends on concentration. Score every candidate and take the extreme at each side:
Combine the two winners by electron balance — the electrons released at one electrode must equal those absorbed at the other — and drive the pair only when the applied voltage clears their gap. That concentration term is exactly why concentrated brine gives chlorine while dilute chloride gives oxygen. And the electron balance is why water splits at precisely 2 H₂ : 1 O₂: two electrons build one H₂, four build one O₂, so twice as much hydrogen must come off.
Heat a block of ice and the thermometer climbs steadily — until it reaches 0 °C, where it sticks. For a while the reading simply refuses to move, even as you keep pouring in heat, while the ice quietly turns to water. Only once the last crystal is gone does the temperature start rising again — and then it stalls a second time at 100 °C while the water boils away.
Pulling a solid apart costs energy even when the temperature isn’t going anywhere. That hidden toll is the latent heat — one more number on the card (and a big one: boiling water’s is nearly seven times its melting). The engine spends incoming heat on temperature only when there’s no phase change to pay for; right at the melting and boiling points it diverts every joule into the conversion itself, pinning the thermometer flat until the job is done. Pour in heat at a steady rate and watch it stall — twice:
Give each transition two numbers: the temperature it happens at, T*, and the latent heat L per mole. Every step, if the temperature has been pushed past T* while some un-converted phase is still there, convert only as much as the surplus heat can pay for:
…then charge the temperature for it, pulling it back by ΔT = −L·ξ / C. While both phases coexist, every joule you pour in is spent on the conversion rather than on warming — so T parks exactly at T* until the last of the phase is gone, then climbs again. The plateau isn’t drawn in; it’s a direct consequence of conserving energy.
One last trick — and a callback to where we began. At Instrument III the speed of a reaction came down to one thing: the height of the barrier its molecules have to clear. But some substances can lower that barrier — offer the reaction an easier path over the hill — just by being in the room, and then walk away afterwards entirely unchanged. They’re called catalysts, and they look very much like cheating.
Hydrogen peroxide is forever on the verge of falling apart into water and oxygen — yet left to itself it barely bothers. Drop in a pinch of manganese dioxide and it erupts into fizzing oxygen… but weigh the manganese dioxide afterwards and not a single atom is missing. To the engine a catalyst is exactly that: a name hung on a reaction that multiplies its rate, while appearing nowhere in the equation, so nothing ever consumes it. Pick one, run it, then check the catalyst is all still there:
A catalyst is named as a separate field on the reaction — never as one of its reactants or products — and each catalyst comes with its own, lower activation barrier for that reaction. Present it, and the reaction takes the easier barrier; absent, the catalysed path is simply unavailable. Since the rate constant is k(T) = A e−Ea/RT, dropping Ea by even a little multiplies k enormously — the whole punch of catalysis lives in that exponential:
Because the catalyst appears nowhere in the stoichiometry, the apply step — which only ever touches reactants and products — can’t add or remove it. So it accelerates the reaction and finishes the step at precisely the amount it began with. Swap MnO₂ (barrier ~58 kJ/mol) for platinum (~49) and the fizz leaps; both leave with every atom they arrived with.
Step back and the ten instruments are a single program — small enough to describe in full. It looks up only two kinds of thing: a few measured constants per substance, and which reactions are possible. Every quantity you actually watch — the heat, the extent, the rate, the pH, the voltage, the colour — it computes.
The only thing that changes between kinetics, precipitation, batteries and boiling is which formula you drop into the “rate” slot — mass-action k·∏[X], a solubility gap 1−Q/Ksp, a Nernst overpotential, a latent-heat budget. One loop, many laws.
The real thing runs to about a thousand lines, but that is its entire shape — and it is the honest answer to how the pictures above move. They are not animations of chemistry. They are that loop, running, with the numbers plotted as they fall out. Predicting what a reaction does was never a lookup. It was an integration all along.
So — is there a lookup table in here after all? Yes — but a smaller, humbler one than the monster we set out to avoid, and not the part you’d guess. The engine looks up exactly two things: a handful of measured numbers for each substance (formation energies, electrode potentials, solubilities — real lab physics), and a catalogue of which reactions are possible, each with the conditions it needs to get going. That dataset is the hand-made heart of the thing, and it is not small. Here it is in full — all 425 species and every one of the 592 reactions. Dig through it:
But look closely at what is in there and what isn’t. Nowhere does the catalogue store what a reaction yields under these conditions, how fast it goes right now, how much it heats, or what colour the result is. And — the thing this whole essay has been building to — nowhere does it store a single speed. There was a time you might have found one here: a hand-tuned number per reaction, the last little fudge standing in for real kinetics. It’s gone. The rates are computed now, like everything else — from each reaction’s barrier and the temperature. A couple of well-studied reactions carry a barrier from the literature; for all the rest the engine builds one from the reaction’s own measured heat. The table says only what can happen and what’s been measured about the ingredients. The behaviour — all of it, how fast included — is derived from there.
A lookup table memorises the world.
This one understands a little of it.
That’s the whole difference. Given a beaker it has never seen, the table has nothing to say. The engine just starts the clock — reads a few numbers off its cards, asks how fast, takes a step — and watches what happens, the same way the world does. Go and turn the knobs yourself:
Open the Sandbox ►