// ─────────────────────────────────────────────────────────────────────────────
// Arrhenius explorer
//
// Two knobs, E_a and T, driving k = A exp(-E_a/RT), drawn twice: k against T, which is a
// hockey stick, and ln k against 1/T, which is the straight line the linear form promises.
// The same state sits on both plots, so the student watches one transformation turn a curve
// into a line. A second temperature switches on the two-point form and feeds the widget's
// own k1 and k2 back through it, recovering the E_a that generated them.
//
// The readout carries the two numbers the chapter argues about: f = exp(-E_a/RT), the
// fraction of collisions clearing the barrier, and k(T+10)/k(T), which shows that "the rate
// doubles every ten degrees" holds only near E_a = 56 kJ/mol at room temperature.
//
// Every preset reproduces a rate constant already printed in the book; verified before the
// build. Sources:
// no2 E_a = 112.551 kJ/mol, A = 2.0e9 L/mol/s this page's practice problem
// n2o5 E_a = 103.0, A back-solved from k = 5.2e-3 s^-1 at 65 C (order explorer)
// c4h8 E_a = 261.0, A back-solved from k = 9.2e-3 s^-1 at 500 C (practice-14)
// h2o2-* E_a = 75 / 56 / 8 kJ/mol, shared A = 1.27e7 s^-1 rate-law.qmd parameters box,
// the shared A being what catalysis.qmd's practice problem stipulates
//
// Plain DOM and hand-drawn SVG, no D3, so the whole widget is one cell that
// dev/tests/arrhenius-harness-build.cjs can lift into a standalone page for testing.
// Theme is handled entirely in CSS (SVG parts carry classes), so there is no dark-mode flag.
// ─────────────────────────────────────────────────────────────────────────────
arxWidget = {
const MINUS = "−"; // real minus sign for SVG text and readouts
const R = 8.3145; // J mol^-1 K^-1, the book's value
// ── presets ──────────────────────────────────────────────────────────────
// Ea in kJ/mol, A in the units belonging to the order. tLo/tHi bound both the slider and
// the plotted range; tDef is the temperature the book quotes.
const RXN = [
{ id: "no2", tag: "2 NO₂ → 2 NO + O₂", order: 2,
Ea: 112.551, A: 2.0e9, tLo: 500, tHi: 900, tDef: 600, t2Def: 800,
eq: "2 NO<sub>2</sub>(g) → 2 NO(g) + O<sub>2</sub>(g)",
cond: "gas phase",
note: "The reaction this page works through. <i>E</i><sub>a</sub> is the 112.551 kJ mol<sup>−1</sup> the practice problem gets from the measured pair <i>k</i>(600 K) = 0.3176 and <i>k</i>(800 K) = 89.42. <i>A</i> is the page's 2.0 × 10<sup>9</sup>, carrying only two significant figures, so <i>k</i> here lands a couple of tenths of a percent off those measurements." },
{ id: "n2o5", tag: "2 N₂O₅ → 4 NO₂ + O₂", order: 1,
Ea: 103.0, A: 4.229e13, tLo: 290, tHi: 400, tDef: 338.15, t2Def: 370,
eq: "2 N<sub>2</sub>O<sub>5</sub>(g) → 4 NO<sub>2</sub>(g) + O<sub>2</sub>(g)",
cond: "gas phase",
note: "The classic first-order gas-phase decomposition. <i>E</i><sub>a</sub> is the literature value; <i>A</i> follows from it and the <i>k</i> = 5.2 × 10<sup>−3</sup> s<sup>−1</sup> at 65 °C used in the Reaction Order Explorer, which is why the two widgets agree." },
{ id: "c4h8", tag: "C₄H₈ → 2 C₂H₄", order: 1,
Ea: 261.0, A: 3.951e15, tLo: 650, tHi: 900, tDef: 773.15, t2Def: 850,
eq: "C<sub>4</sub>H<sub>8</sub>(g) → 2 C<sub>2</sub>H<sub>4</sub>(g)",
cond: "gas phase",
note: "Cyclobutane splitting into two ethylene molecules. The stiffest barrier here at 261 kJ mol<sup>−1</sup>, though it runs hot enough that ten more degrees still only multiplies <i>k</i> by about 1.7. Sensitivity to temperature goes as <i>E</i><sub>a</sub>/<i>RT</i><sup>2</sup>, so a tall barrier cleared at high temperature responds less than a modest one near room temperature: the uncatalyzed peroxide route above gains a factor of 2.7 over the same ten degrees." },
{ id: "h2o2-un", tag: "2 H₂O₂ → 2 H₂O + O₂, uncatalyzed", order: 1,
Ea: 75.0, A: 1.27e7, tLo: 273, tHi: 373, tDef: 298.15, t2Def: 333.15,
eq: "2 H<sub>2</sub>O<sub>2</sub>(aq) → 2 H<sub>2</sub>O(l) + O<sub>2</sub>(g)",
cond: "aqueous, no catalyst",
note: "The bare reaction, with the roughly 75 kJ mol<sup>−1</sup> barrier quoted in Catalysis. Its <i>A</i> is shared with the two catalyzed routes below, as the catalysis practice problem stipulates, so the pre-exponential factors cancel in the ratio." },
{ id: "h2o2-i", tag: "2 H₂O₂ → 2 H₂O + O₂, over I⁻", order: 1,
Ea: 56.0, A: 1.27e7, tLo: 273, tHi: 373, tDef: 298.15, t2Def: 333.15,
eq: "2 H<sub>2</sub>O<sub>2</sub>(aq) → 2 H<sub>2</sub>O(l) + O<sub>2</sub>(g)",
cond: "aqueous, iodide catalyzed",
note: "Iodide opens a lower route, about 56 kJ mol<sup>−1</sup>. These are the parameters the Rate Law page runs on, so this preset returns its <i>k</i>(25 °C) = 1.96 × 10<sup>−3</sup> s<sup>−1</sup>, or 7.06 h<sup>−1</sup>. Switch to the uncatalyzed route and back to see the factor of two thousand." },
{ id: "h2o2-cat", tag: "2 H₂O₂ → 2 H₂O + O₂, over catalase", order: 1,
Ea: 8.0, A: 1.27e7, tLo: 273, tHi: 373, tDef: 298.15, t2Def: 333.15,
eq: "2 H<sub>2</sub>O<sub>2</sub>(aq) → 2 H<sub>2</sub>O(l) + O<sub>2</sub>(g)",
cond: "aqueous, catalase catalyzed",
note: "The enzyme takes the barrier to roughly 8 kJ mol<sup>−1</sup>. Against the uncatalyzed route that is a factor near 5 × 10<sup>11</sup>. Holding <i>A</i> fixed across all three is an assumption, not a measurement: a real enzyme changes the pre-exponential factor too, so treat the ratio as what the barrier alone buys." }
];
const CUSTOM = "custom";
// ── model ────────────────────────────────────────────────────────────────
const rateK = (A, Ea, T) => A * Math.exp((-Ea * 1000) / (R * T));
const fraction = (Ea, T) => Math.exp((-Ea * 1000) / (R * T));
// Ea recovered from two rate constants, the page's two-point form
const twoPointEa = (k1, k2, T1, T2) =>
(R * Math.log(k2 / k1)) / (1 / T1 - 1 / T2) / 1000;
const kUnits = (order) => order === 2 ? "L mol<sup>−1</sup> s<sup>−1</sup>" : "s<sup>−1</sup>";
const kUnitsPlain = (order) => order === 2 ? "liters per mole per second" : "per second";
// ── number formatting ────────────────────────────────────────────────────
function sci(v, sig) {
if (!isFinite(v)) return "not defined";
if (v === 0) return "0";
const neg = v < 0; const a = Math.abs(v);
const e = Math.floor(Math.log10(a));
const useSci = e < -2 || e >= 4;
const sign = neg ? "−" : "";
if (!useSci) return sign + a.toPrecision(sig).replace(/\.?0+$/, m => m.includes(".") ? "" : m);
const mant = (a / Math.pow(10, e)).toPrecision(sig);
return sign + mant + " × 10<sup>" + String(e).replace("-", "−") + "</sup>";
}
// same number spoken rather than marked up, for the live region
function sciPlain(v, sig) {
if (!isFinite(v)) return "undefined";
if (v === 0) return "0";
const a = Math.abs(v);
const e = Math.floor(Math.log10(a));
const sign = v < 0 ? "minus " : "";
if (e >= -2 && e < 4) return sign + a.toPrecision(sig);
return sign + (a / Math.pow(10, e)).toPrecision(sig) + " times ten to the " + e;
}
// ── state ────────────────────────────────────────────────────────────────
// State is authoritative and the inputs are only controls, so a preset can carry a value
// that does not sit on a slider step (E_a = 112.551) without the step rounding it away.
const HANDOFF_KEY = "chemacademy.arrhenius-explorer.handoff.v1";
const VIEWER_URL = "/files/ojs/arrhenius-explorer-viewer.html";
const isViewer = !!window.__arxViewer;
const first = RXN[0];
const state = {
rxnId: first.id, Ea: first.Ea, A: first.A, order: first.order,
T: first.tDef, T2: first.t2Def, twoPoint: false,
tLo: first.tLo, tHi: first.tHi
};
function readHandoff() {
try {
const raw = localStorage.getItem(HANDOFF_KEY);
if (!raw) return null;
localStorage.removeItem(HANDOFF_KEY);
const h = JSON.parse(raw);
if (!h || h.v !== 1 || !h.state || Date.now() - h.t > 10 * 60 * 1000) return null;
return h.state;
} catch (e) { return null; }
}
if (isViewer) {
const s = readHandoff();
if (s && typeof s.Ea === "number" && isFinite(s.Ea)) Object.assign(state, s);
}
// ── DOM helpers ──────────────────────────────────────────────────────────
const el = (tag, cls, html) => {
const n = document.createElement(tag);
if (cls) n.className = cls;
if (html != null) n.innerHTML = html;
return n;
};
const svgEl = (tag, attrs) => {
const n = document.createElementNS("http://www.w3.org/2000/svg", tag);
for (const k in attrs) n.setAttribute(k, attrs[k]);
return n;
};
const root = el("div", "arx-widget" + (isViewer ? " arx-viewer" : ""));
if (!isViewer) {
const open = el("button", "arx-open-btn", "⛶");
open.type = "button";
open.title = "Open in new tab (projector view)";
open.setAttribute("aria-label", "Open in new tab, projector view");
open.addEventListener("click", (e) => {
e.preventDefault();
try { localStorage.setItem(HANDOFF_KEY, JSON.stringify({ v: 1, t: Date.now(), state })); } catch (err) {}
window.open(VIEWER_URL, "_blank");
});
root.append(open);
}
root.append(
el("div", "arx-title", "Arrhenius Explorer"),
el("div", "arx-subtitle", "The same rate constant on two axes: exponential in <i>T</i>, straight in 1/<i>T</i>.")
);
// ── controls ─────────────────────────────────────────────────────────────
const controls = el("div", "arx-controls");
// reaction picker
const rxnWrap = el("div", "arx-field arx-field-wide");
const rxnLab = el("label", "arx-label", "Reaction");
rxnLab.htmlFor = "arx-rxn";
const rxnSel = el("select", "arx-select");
rxnSel.id = "arx-rxn";
for (const r of RXN) {
const o = document.createElement("option");
o.value = r.id; o.textContent = r.tag;
rxnSel.append(o);
}
const customOpt = document.createElement("option");
customOpt.value = CUSTOM; customOpt.textContent = "Custom (sliders only)";
rxnSel.append(customOpt);
rxnSel.addEventListener("change", () => {
const r = RXN.find(x => x.id === rxnSel.value);
if (r) {
state.rxnId = r.id; state.Ea = r.Ea; state.A = r.A; state.order = r.order;
state.tLo = r.tLo; state.tHi = r.tHi; state.T = r.tDef; state.T2 = r.t2Def;
} else {
state.rxnId = CUSTOM;
}
syncInputs();
render(true);
});
rxnWrap.append(rxnLab, rxnSel);
// Ea slider
const eaWrap = el("div", "arx-field arx-f-ea");
const eaLab = el("label", "arx-label", "Activation energy, <i>E</i><sub>a</sub>");
eaLab.htmlFor = "arx-ea";
const eaIn = document.createElement("input");
eaIn.type = "range"; eaIn.className = "arx-slider"; eaIn.id = "arx-ea";
eaIn.min = 5; eaIn.max = 300; eaIn.step = 0.5;
const eaVal = el("span", "arx-value");
eaIn.addEventListener("input", () => { state.Ea = +eaIn.value; toCustom(); render(); });
eaWrap.append(eaLab, eaIn, eaVal);
// log A slider
const aWrap = el("div", "arx-field arx-f-a");
const aLab = el("label", "arx-label", "Pre-exponential factor, log<sub>10</sub> <i>A</i>");
aLab.htmlFor = "arx-a";
const aIn = document.createElement("input");
aIn.type = "range"; aIn.className = "arx-slider"; aIn.id = "arx-a";
aIn.min = 0; aIn.max = 18; aIn.step = 0.1;
const aVal = el("span", "arx-value");
aIn.addEventListener("input", () => { state.A = Math.pow(10, +aIn.value); toCustom(); render(); });
aWrap.append(aLab, aIn, aVal);
// T slider
const tWrap = el("div", "arx-field arx-f-t");
const tLab = el("label", "arx-label", "Temperature, <i>T</i>");
tLab.htmlFor = "arx-t";
const tIn = document.createElement("input");
tIn.type = "range"; tIn.className = "arx-slider"; tIn.id = "arx-t";
tIn.step = 1;
const tVal = el("span", "arx-value");
tIn.addEventListener("input", () => { state.T = +tIn.value; render(); });
tWrap.append(tLab, tIn, tVal);
// Second temperature. The checkbox is this field's own enabler rather than a control
// floating beside it, so the slider it switches on is obvious and nothing reflows when
// it is toggled: the slider stays in place and greys out.
const t2Wrap = el("div", "arx-field arx-f-t2");
const t2Head = el("div", "arx-label arx-label-row");
const modeBox = document.createElement("input");
modeBox.type = "checkbox"; modeBox.id = "arx-twopoint";
// the visible label beside it names the slider, so the checkbox carries its own name
modeBox.setAttribute("aria-label", "Add a second temperature");
modeBox.addEventListener("change", () => { state.twoPoint = modeBox.checked; render(true); });
const t2Lab = el("label", null, "Second temperature, <i>T</i><sub>2</sub>");
t2Lab.htmlFor = "arx-t2";
t2Head.append(modeBox, t2Lab);
const t2In = document.createElement("input");
t2In.type = "range"; t2In.className = "arx-slider"; t2In.id = "arx-t2";
t2In.step = 1;
const t2Val = el("span", "arx-value");
t2In.addEventListener("input", () => { state.T2 = +t2In.value; render(); });
t2Wrap.append(t2Head, t2In, t2Val);
controls.append(rxnWrap, eaWrap, aWrap, tWrap, t2Wrap);
root.append(controls);
// ── plots ────────────────────────────────────────────────────────────────
const plotArea = el("div", "arx-plot-area");
root.append(plotArea);
// ── readout ──────────────────────────────────────────────────────────────
const readout = el("div", "arx-readout");
root.append(readout);
// A slider drag fires on every pixel, so the visible readout updates immediately while a
// separate hidden region announces the settled value. Putting aria-live on the readout
// itself would make a screen reader recite every intermediate number.
const live = el("div", "arx-sr");
live.setAttribute("aria-live", "polite");
root.append(live);
let liveTimer = null;
function announce(text, now) {
if (liveTimer) clearTimeout(liveTimer);
if (now) { live.textContent = text; return; }
liveTimer = setTimeout(() => { live.textContent = text; }, 550);
}
// ── two-point panel ──────────────────────────────────────────────────────
const twoPanel = el("div", "arx-twopoint-panel");
root.append(twoPanel);
// ── identity ─────────────────────────────────────────────────────────────
const idPanel = el("div", "arx-id-panel");
root.append(idPanel);
// ── data table ───────────────────────────────────────────────────────────
const tableWrap = el("details", "arx-table-wrap");
tableWrap.append(el("summary", null, "Data table"));
const tableHost = el("div", "arx-table-host");
tableWrap.append(tableHost);
root.append(tableWrap);
// ── drawing helpers ──────────────────────────────────────────────────────
function niceTicks(lo, hi, count) {
const span = hi - lo || 1;
const raw = span / count;
const mag = Math.pow(10, Math.floor(Math.log10(raw)));
const norm = raw / mag;
const step = (norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10) * mag;
const out = [];
for (let v = Math.ceil(lo / step) * step; v <= hi + step * 1e-9; v += step) {
out.push(Math.abs(v) < step * 1e-9 ? 0 : v);
}
return out;
}
// SVG text cannot carry entities or markup, so powers of ten use the Unicode
// superscript digits rather than a <sup>
const SUP = { "0": "⁰", "1": "¹", "2": "²", "3": "³", "4": "⁴",
"5": "⁵", "6": "⁶", "7": "⁷", "8": "⁸", "9": "⁹", "-": "⁻" };
const supStr = (n) => String(n).split("").map(c => SUP[c] || c).join("");
function tickText(v, step) {
const a = Math.abs(v);
if (a < (step || 1) * 1e-9) return "0";
const sign = v < 0 ? MINUS : "";
const big = Math.max(a, step || 0);
if (big >= 1e4 || big < 1e-3) {
const e = Math.floor(Math.log10(a));
const mant = Number((a / Math.pow(10, e)).toPrecision(3));
return sign + (mant === 1 ? "10" : mant + " × 10") + supStr(e);
}
const dec = Math.max(0, Math.min(6, -Math.floor(Math.log10(step || a))));
return sign + a.toFixed(dec);
}
const N_CURVE = 160;
// SVG text takes no markup, so an italic quantity symbol needs its own tspan. Parts are
// [text, italic?] pairs; the book sets quantity symbols italic and units upright.
function svgLabel(attrs, parts) {
const t = svgEl("text", attrs);
for (const p of parts) {
const ts = svgEl("tspan", p[1] ? { class: "arx-var" } : {});
ts.textContent = p[0];
t.append(ts);
}
return t;
}
// one chart. kind is "kt" (k against T) or "lnk" (ln k against 1/T)
function drawPlot(kind) {
const W = 400, H = 300;
const M = { l: 74, r: 26, t: 30, b: 48 };
const lo = state.tLo, hi = state.tHi;
const pts = [];
for (let i = 0; i <= N_CURVE; i++) {
const T = lo + ((hi - lo) * i) / N_CURVE;
pts.push({ T, k: rateK(state.A, state.Ea, T) });
}
const xOf = (p) => kind === "kt" ? p.T : 1 / p.T;
const yOf = (p) => kind === "kt" ? p.k : Math.log(p.k);
const xs = pts.map(xOf), ys = pts.map(yOf);
let xLo = Math.min(...xs), xHi = Math.max(...xs);
let yLo = Math.min(...ys), yHi = Math.max(...ys);
const yPad = (yHi - yLo) * 0.1 || Math.abs(yHi) * 0.1 || 1;
yHi += yPad;
// k has a meaningful zero, so the exponential plot keeps it: a floating baseline
// exaggerates how steeply a shallow curve rises. ln k has no such zero.
yLo = kind === "kt" ? 0 : yLo - yPad;
const X = v => M.l + ((v - xLo) / (xHi - xLo)) * (W - M.l - M.r);
const Y = v => H - M.b - ((v - yLo) / (yHi - yLo)) * (H - M.t - M.b);
const svg = svgEl("svg", {
viewBox: "0 0 " + W + " " + H, class: "arx-chart",
preserveAspectRatio: "xMidYMid meet", "aria-hidden": "true"
});
svg.style.maxWidth = W + "px";
const yTicks = niceTicks(yLo, yHi, 5);
const yStep = yTicks.length > 1 ? yTicks[1] - yTicks[0] : Math.abs(yHi - yLo);
for (const tv of yTicks) {
svg.append(svgEl("line", { class: "arx-grid", x1: M.l, x2: W - M.r, y1: Y(tv), y2: Y(tv) }));
const tx = svgEl("text", { class: "arx-tick", x: M.l - 8, y: Y(tv) + 4, "text-anchor": "end" });
tx.textContent = tickText(tv, yStep);
svg.append(tx);
}
const xTicks = niceTicks(xLo, xHi, 4);
const xStep = xTicks.length > 1 ? xTicks[1] - xTicks[0] : Math.abs(xHi - xLo);
for (const tv of xTicks) {
// a tick sitting on either edge is anchored inward, or its label overhangs the chart
const px = X(tv);
const anchor = px < M.l + 18 ? "start" : px > W - M.r - 18 ? "end" : "middle";
const tx = svgEl("text", { class: "arx-tick", x: px, y: H - M.b + 20, "text-anchor": anchor });
tx.textContent = tickText(tv, xStep);
svg.append(tx);
}
svg.append(svgEl("line", { class: "arx-axis", x1: M.l, x2: W - M.r, y1: H - M.b, y2: H - M.b }));
svg.append(svgEl("line", { class: "arx-axis", x1: M.l, x2: M.l, y1: M.t, y2: H - M.b }));
const d = pts.map((p, i) => (i ? "L" : "M") + X(xOf(p)) + " " + Y(yOf(p))).join(" ");
svg.append(svgEl("path", { class: "arx-curve", d: d, fill: "none" }));
// the marked temperatures
const marks = state.twoPoint ? [state.T, state.T2] : [state.T];
marks.forEach((Tm, i) => {
const p = { T: Tm, k: rateK(state.A, state.Ea, Tm) };
const px = X(xOf(p)), py = Y(yOf(p));
const lineCls = "arx-marker-line" + (i ? " arx-marker-2" : "");
// leaders to both axes, so the value can be read off either scale
svg.append(svgEl("line", { class: lineCls, x1: px, x2: px, y1: py, y2: H - M.b }));
svg.append(svgEl("line", { class: lineCls, x1: M.l, x2: px, y1: py, y2: py }));
// shape, not color alone, separates the two marked temperatures: T1 is a disc and
// T2 a diamond, so the chart still reads without color vision
if (i) {
svg.append(svgEl("rect", {
class: "arx-marker arx-marker-2", x: px - 4.6, y: py - 4.6, width: 9.2, height: 9.2,
transform: "rotate(45 " + px + " " + py + ")"
}));
} else {
svg.append(svgEl("circle", { class: "arx-marker", cx: px, cy: py, r: 5.5 }));
}
// with two markers up, say which is which rather than leaving it to the legend-less
// shape difference; near the right edge the label flips to the other side
if (state.twoPoint) {
const flip = px > W - M.r - 26;
svg.append(svgLabel({
class: "arx-mlabel" + (i ? " arx-mlabel-2" : ""),
x: px + (flip ? -8 : 8), y: py - 9, "text-anchor": flip ? "end" : "start"
}, [["T", 1], [i ? "₂" : "₁", 0]]));
}
});
const xAttrs = { class: "arx-axis-label", x: (M.l + W - M.r) / 2, y: H - 10, "text-anchor": "middle" };
svg.append(svgLabel(xAttrs, kind === "kt"
? [["T", 1], [" / K", 0]]
: [["(1/", 0], ["T", 1], [") / K⁻¹", 0]]));
const yAttrs = {
class: "arx-axis-label", x: 14, y: (M.t + H - M.b) / 2, "text-anchor": "middle",
transform: "rotate(-90 14 " + ((M.t + H - M.b) / 2) + ")"
};
// a logarithm takes a pure number, so the log axis divides by the unit inside the ln
const uPlain = state.order === 2 ? "L mol⁻¹ s⁻¹" : "s⁻¹";
svg.append(svgLabel(yAttrs, kind === "kt"
? [["k", 1], [" / " + uPlain, 0]]
: [["ln(", 0], ["k", 1], [" / " + uPlain + ")", 0]]));
const headAttrs = { class: "arx-plot-head", x: M.l, y: M.t - 12 };
svg.append(svgLabel(headAttrs, kind === "kt"
? [["Exponential form: ", 0], ["k", 1], [" vs ", 0], ["T", 1]]
: [["Linear form: ln ", 0], ["k", 1], [" vs 1/", 0], ["T", 1]]));
return svg;
}
function buildTable() {
const rows = 9;
const t = el("table", "arx-table");
t.append(el("caption", null,
"Rate constant across the plotted temperature range, with the two transformed columns that straighten it."));
const thead = el("thead"); const hr = el("tr");
["<i>T</i> / K", "(1/<i>T</i>) / K<sup>−1</sup>",
"<i>k</i> / " + kUnits(state.order), "ln(<i>k</i> / " + kUnits(state.order) + ")"]
.forEach(h => { const th = el("th", null, h); th.scope = "col"; hr.append(th); });
thead.append(hr); t.append(thead);
const tb = el("tbody");
for (let i = 0; i < rows; i++) {
const T = state.tLo + ((state.tHi - state.tLo) * i) / (rows - 1);
const kv = rateK(state.A, state.Ea, T);
const tr = el("tr");
const th = el("th", null, T.toFixed(1)); th.scope = "row";
tr.append(th, el("td", null, sci(1 / T, 4)), el("td", null, sci(kv, 4)),
el("td", null, sci(Math.log(kv), 4)));
tb.append(tr);
}
t.append(tb);
return t;
}
// ── keeping the inputs in step with state ────────────────────────────────
function toCustom() {
if (state.rxnId !== CUSTOM) { state.rxnId = CUSTOM; rxnSel.value = CUSTOM; }
}
function syncInputs() {
rxnSel.value = state.rxnId;
eaIn.value = state.Ea;
aIn.value = Math.log10(state.A);
tIn.min = state.tLo; tIn.max = state.tHi; tIn.value = state.T;
t2In.min = state.tLo; t2In.max = state.tHi; t2In.value = state.T2;
modeBox.checked = state.twoPoint;
}
// ── render ───────────────────────────────────────────────────────────────
function render(immediate) {
const k1 = rateK(state.A, state.Ea, state.T);
const f = fraction(state.Ea, state.T);
const slope = -state.Ea * 1000 / R;
const tenUp = rateK(state.A, state.Ea, state.T + 10) / k1;
// slider labels, and the spoken value for each
eaVal.innerHTML = state.Ea.toFixed(state.Ea % 1 === 0 ? 0 : 3) + " kJ mol<sup>−1</sup>";
eaIn.setAttribute("aria-valuetext", state.Ea.toFixed(1) + " kilojoules per mole");
aVal.innerHTML = sci(state.A, 3) + " " + kUnits(state.order);
aIn.setAttribute("aria-valuetext", sciPlain(state.A, 3) + " " + kUnitsPlain(state.order));
tVal.innerHTML = state.T.toFixed(state.T % 1 === 0 ? 0 : 2) + " K";
tIn.setAttribute("aria-valuetext", state.T.toFixed(0) + " kelvin");
t2Val.innerHTML = state.T2.toFixed(state.T2 % 1 === 0 ? 0 : 2) + " K";
t2In.setAttribute("aria-valuetext", state.T2.toFixed(0) + " kelvin");
t2In.disabled = !state.twoPoint;
t2Wrap.classList.toggle("arx-field-off", !state.twoPoint);
// plots
plotArea.innerHTML = "";
const row = el("div", "arx-plot-row");
row.append(drawPlot("kt"), drawPlot("lnk"));
plotArea.append(row);
// readout
const tShown = state.T.toFixed(state.T % 1 === 0 ? 0 : 2);
const groups = [
["At <i>T</i> = " + tShown + " K", [
["rate constant, <i>k</i>", sci(k1, 3) + " " + kUnits(state.order)],
["ln <i>k</i>", sci(Math.log(k1), 4)],
["fraction past the barrier, <i>f</i>", sci(f, 3)]
]],
["Across temperature", [
["slope, −<i>E</i><sub>a</sub>/<i>R</i>", sci(slope, 5) + " K"],
["intercept, ln <i>A</i>", sci(Math.log(state.A), 4)],
["rate constant per 10 K rise", tenUp.toFixed(2) + "×"]
]]
];
readout.innerHTML = groups.map(g =>
"<div class='arx-stat-group'><div class='arx-group-head'>" + g[0] + "</div>" +
g[1].map(r => "<div class='arx-stat'><span>" + r[0] + "</span><b>" + r[1] + "</b></div>").join("") +
"</div>").join("") +
"<div class='arx-readout-note'><i>f</i> is the share of collisions carrying at least " +
"<i>E</i><sub>a</sub>, the exponential term itself. The 10 K figure is the old rule that " +
"rates double for every ten degrees: it lands near 2 only for a barrier near " +
"56 kJ mol<sup>−1</sup> at room temperature. Across the six reactions here, at the " +
"temperatures each is quoted at, it runs from 1.11 to 2.86.</div>";
// two-point panel
if (state.twoPoint) {
const k2 = rateK(state.A, state.Ea, state.T2);
if (Math.abs(state.T2 - state.T) < 0.5) {
twoPanel.innerHTML = "<div class='arx-two-warn'>The two temperatures are the same, so " +
"<i>k</i><sub>2</sub>/<i>k</i><sub>1</sub> = 1 and the two-point form divides by zero. " +
"Separate them to recover <i>E</i><sub>a</sub>.</div>";
} else {
const rec = twoPointEa(k1, k2, state.T, state.T2);
twoPanel.innerHTML =
"<div class='arx-two-head'>Two-point form</div>" +
"<div class='arx-two-stats'>" +
"<div class='arx-stat'><span><i>k</i><sub>1</sub> at " + state.T.toFixed(0) + " K</span><b>" +
sci(k1, 3) + " " + kUnits(state.order) + "</b></div>" +
"<div class='arx-stat'><span><i>k</i><sub>2</sub> at " + state.T2.toFixed(0) + " K</span><b>" +
sci(k2, 3) + " " + kUnits(state.order) + "</b></div>" +
"<div class='arx-stat'><span><i>k</i><sub>2</sub>/<i>k</i><sub>1</sub></span><b>" +
sci(k2 / k1, 3) + "</b></div>" +
"<div class='arx-stat'><span>recovered <i>E</i><sub>a</sub></span><b>" +
rec.toFixed(3) + " kJ mol<sup>−1</sup></b></div>" +
"</div>" +
"<div class='arx-two-note'>Those two rate constants came out of the exponential form " +
"above. Feeding them back through the two-point equation returns " + rec.toFixed(3) +
" kJ mol<sup>−1</sup>, the barrier they were generated from. Two rate constants " +
"at two temperatures are enough to measure <i>E</i><sub>a</sub> without ever knowing " +
"<i>A</i>.</div>";
}
twoPanel.hidden = false;
} else {
twoPanel.hidden = true;
twoPanel.innerHTML = "";
}
// identity
const r = RXN.find(x => x.id === state.rxnId);
if (r) {
idPanel.innerHTML =
"<div class='arx-id-eq'>" + r.eq + "</div>" +
"<div class='arx-id-meta'>" + (r.order === 2 ? "second" : "first") + " order · " +
r.cond + "</div>" +
"<div class='arx-id-note'>" + r.note + "</div>";
} else {
idPanel.innerHTML =
"<div class='arx-id-eq'>Custom parameters</div>" +
"<div class='arx-id-note'>No reaction has these constants. <i>A</i> is shown in the units " +
"of the last reaction selected, since the units of <i>A</i> follow the order and the " +
"order is not something a slider can set. Pick a reaction above to return to measured " +
"values.</div>";
}
// table
tableHost.innerHTML = "";
tableHost.append(buildTable());
announce("k is " + sciPlain(k1, 3) + " " + kUnitsPlain(state.order) + " at " +
state.T.toFixed(0) + " kelvin. Fraction of collisions clearing the barrier, " +
sciPlain(f, 3) + ". Ten degrees warmer multiplies k by " + tenUp.toFixed(2) + ".", immediate);
}
syncInputs();
render(true);
return root;
}Arrhenius Equation
The Arrhenius equation relating the rate constant, temperature, and activation energy, including its linear form.
We have already seen how temperature affects the rate of reaction via the rate constant. The relationship between temperature, activation energy, and rate constant is given by the Arrhenius equation.
Exponential Form
\[k = A\exp\left( \dfrac{-E_{\mathrm{a}}}{RT} \right)\]
The equation splits the rate constant into two pieces. Ea, the activation energy, is the energy a collision has to supply before the reactants can become products, so the exponential term is the fraction of collisions carrying at least that much. The pre-exponential factor A accounts for the rest, meaning how often the particles meet and how often they meet in an arrangement that lets the reaction proceed. Both terms are taken up in Collision Theory.
As temperature increases, the rate constant increases and therefore the rate of reaction (as seen with the rate law). Temperature sits in the exponent, so a small warming can change a rate sharply.
The Arrhenius equation has a similar form to the Clausius–Clapeyron equation and can therefore be written in a linear and two-point form.
Linear Form
\[\ln k = \dfrac{-E_{\mathrm{a}}}{R} \left (\dfrac{1}{T}\right) + \ln A\]
Two-point Form
\[\ln \left ( \dfrac{k_2}{k_1} \right ) = \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\]
The explanations for these equations are similar to the Clausius–Clapeyron equations except here we relate rate constant with temperature.
We can numerically determine a set of rate constants for a range of temperatures and then plot these via the linear form (ln k vs 1/T). The resulting slope allows us to determine the energy of activation. The pre-exponential factor, A, is discussed in Collision Theory.
\[\mathrm{slope} = \dfrac{-E_{\mathrm{a}}}{R}\]
Additionally, we can determine the energy of activation by evaluating the two-point Arrhenius equation. Within the Arrhenius model the activation energy is treated as independent of temperature, so the plot of ln k vs. 1/T comes out straight. Measured across a wide enough range many reactions show slight curvature in that plot, so an Ea obtained this way is an average over the temperatures fitted.
Seeing All Three Forms
The three forms above describe one reaction, so the explorer below draws them together. Raising the barrier or the temperature redraws both plots at once. However steeply the curve on the left climbs, the plot on the right stays straight, and its slope is −Ea/R. Adding a second temperature runs the two-point form on the widget’s own rate constants and returns the activation energy they were generated from.
Two readouts sit underneath. The first is f, the fraction of collisions carrying at least Ea, taken up in Collision Theory. The second is the factor by which k grows over a further ten kelvin, worth watching against the common claim that reaction rates double for every ten degrees. That factor depends on both the barrier and the temperature you start from, and it sits near two only for a barrier near 56 kJ mol−1 at room temperature.
Solving for Each Variable
You should be able to solve for any variable in these equations. The algebra for isolating each term is given below.
Ea
\[\begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{1}{T_1} - \frac{1}{T_2}} &= \dfrac{E_{\mathrm{a}}}{R} \\[2ex] R\left (\dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{1}{T_1} - \frac{1}{T_2}} \right ) &= E_{\mathrm{a}} \\[2ex] E_{\mathrm{a}} &= R\left (\dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{1}{T_1} - \frac{1}{T_2}} \right ) \end{align*}\]
k1
\[\begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \ln k_2 - \ln k_1 &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] - \ln k_1 &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right ) - \ln k_2\\[2ex] \ln k_1 &= -\dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right ) + \ln k_2\\[2ex] \mathrm{e}^{\ln k_1} &= \exp\left( -\dfrac{E_{\mathrm{a}}}{R} \left ( \frac{1}{T_1} - \frac{1}{T_2} \right ) + \ln k_2 \right)\\[2ex] k_1 &= \exp\left( -\dfrac{E_{\mathrm{a}}}{R} \left ( \frac{1}{T_1} - \frac{1}{T_2} \right ) + \ln k_2 \right) \end{align*}\]
k2
\[\begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \ln k_2 - \ln k_1 &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \ln k_2 &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right ) + \ln k_1\\[2ex] \mathrm{e}^{\ln k_2} &= \exp\left( \dfrac{E_{\mathrm{a}}}{R} \left ( \frac{1}{T_1} - \frac{1}{T_2} \right ) + \ln k_1 \right)\\[2ex] k_2 &= \exp\left( \dfrac{E_{\mathrm{a}}}{R} \left ( \frac{1}{T_1} - \frac{1}{T_2} \right ) + \ln k_1 \right) \end{align*}\]
T1
\[\begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} &= \dfrac{1}{T_1} - \dfrac{1}{T_2} \\[2ex] \dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \dfrac{1}{T_2} &= \dfrac{1}{T_1} \\[2ex] \dfrac{1}{\left ( \frac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \frac{1}{T_2} \right )} &= T_1 \\[2ex] T_1 &= \dfrac{1}{\left ( \frac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \frac{1}{T_2} \right )} \end{align*}\]
T2
\[\begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right )\\[2ex] \dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} &= \dfrac{1}{T_1} - \dfrac{1}{T_2} \\[2ex] \dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} - \dfrac{1}{T_1} &= -\dfrac{1}{T_2} \\[2ex] -\dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \dfrac{1}{T_1} &= \dfrac{1}{T_2} \\[2ex] \dfrac{1}{\left ( -\frac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \frac{1}{T_1} \right )} &= T_2 \\[2ex] T_2 &= \dfrac{1}{\left ( -\frac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{E_{\mathrm{a}}}{R}} + \frac{1}{T_1} \right )} \end{align*}\]
Practice
Practice
As seen previously, the following reaction has a rate constant of 0.3176 M−1 s−1 at 326.85 °C (or 600 K).
\[2~\species{nitrogen-dioxide}{\mathrm{NO_2}}(\mathrm{g}) \longrightarrow 2~\species{nitric-oxide}{\mathrm{NO}}(\mathrm{g}) + \species{oxygen}{\mathrm{O_2}}(\mathrm{g})\]
At 526.85 °C (800 K), the rate constant is 89.42 M−1 s−1.
What is the energy of activation (in kJ mol−1)?
Solution
We have two rate constants and two temperatures. We can solve the Arrhenius two-point form.
\[ \begin{align*} \ln \left ( \dfrac{k_2}{k_1} \right ) &= \dfrac{E_{\mathrm{a}}}{R} \left ( \dfrac{1}{T_1} - \dfrac{1}{T_2} \right ) \longrightarrow\\[2ex] E_{\mathrm{a}} &= R\left (\dfrac{\ln \left ( \frac{k_2}{k_1} \right )}{\frac{1}{T_1} - \frac{1}{T_2}} \right ) \\[2ex] &= 8.314\bar{5}~\mathrm{J~mol^{-1}~K^{-1}} \left (\dfrac{\ln\left (\frac{89.4\bar{2}~\class{mjx-molar}{\mathrm{M}}^{-1}~\mathrm{s^{-1}}}{0.317\bar{6}~\class{mjx-molar}{\mathrm{M}}^{-1}~\mathrm{s^{-1}}}\right )} {\frac{1}{600.~\mathrm{K}} - \frac{1}{800.~\mathrm{K}}} \right ) \left ( \dfrac{\mathrm{kJ}}{10^3~\mathrm{J}} \right ) \\[1.5ex] &= 112.\bar{5}51~\mathrm{kJ~mol^{-1}} \\[1.5ex] &= 112.6~\mathrm{kJ~mol^{-1}} \end{align*} \]
Math String: 8.3145 * ln(89.42/0.3176) / (1/600 - 1/800) / 1000
Rationalize
The energy of activation for this reaction is quite high. Many reactions that take place at around room temperature have activation energies of less than 80 kJ mol−1. This reaction is very fast at high temperatures (300+ °C) and is very slow at low temperatures (such as room temperature).
Extend
Estimate the rate constant for this reaction at room temperature (25 °C). The pre-exponential factor for the reaction is 2.0 × 109 M−1 s−1.
Solve
\[ \begin{align*} k &= A\exp\left ( \dfrac{-E_{\mathrm{a}}}{RT} \right ) \\[1.5ex] &= \left ( 2.\bar{0} \times 10^{9}~\class{mjx-molar}{\mathrm{M}}^{-1}~\mathrm{s^{-1}} \right ) \exp\left ( \dfrac{-\left ( 112.\bar{5}51~\mathrm{kJ~mol^{-1}} \right )\left ( \frac{10^3~\mathrm{J}}{\mathrm{kJ}} \right )} {\left ( 8.314\bar{5}~\mathrm{J~mol^{-1}~K^{-1}} \right )\left ( 298.15~\mathrm{K} \right )} \right ) \\[1.5ex] &= 3.\bar{8}28 \times 10^{-11}~\class{mjx-molar}{\mathrm{M}}^{-1}~\mathrm{s^{-1}} \\[1.5ex] &= 3.8 \times 10^{-11}~\class{mjx-molar}{\mathrm{M}}^{-1}~\mathrm{s^{-1}} \end{align*} \]
Math String: 2.0e9 * exp(-112.551 * 1000 / (8.3145 * 298.15))
The reaction is ten orders of magnitude slower at room temperature!
Plot
Above we’ve solved for two data points on a k vs. T plot. Let’s plot the rate constant vs. T from 600 K to 2000 K (326.85 °C to 1 726.85 °C).
Show data table
This reaction is FAST at higher temperatures.
Let’s transform the data to give a straight line as the linear-form of the Arrhenius equation is set up to do. We simply plot ln k vs. 1/T.
The resulting slope is
\[\mathrm{slope} = -13\,537~\mathrm{K}\]
The energy of activation (in kJ mol−1) can be determined.
\[ \begin{align*} \dfrac{-E_{\mathrm{a}}}{R} &= \mathrm{slope} \longrightarrow \\[1.5ex] E_{\mathrm{a}} &= -R~\mathrm{slope} \\[1.5ex] &= - (-13\,537~\mathrm{K}) \left ( \dfrac{8.314\bar{5}~\mathrm{J}}{\mathrm{mol~K}} \right ) \left ( \dfrac{\mathrm{kJ}}{10^3~\mathrm{J}} \right ) \\[1.5ex] &= 112.\bar{5}53~\mathrm{kJ~mol^{-1}} \\[1.5ex] &= 112.6~\mathrm{kJ~mol^{-1}} \end{align*} \]
Math String: 13537 * 8.3145 / 1000