# Inert gas
## Microsim
### Live player
<div class="microsim-player">
<iframe src="https://editor.p5js.org/sciencenibber/full/DlHdNWEGS" width="100%" height="620" frameborder="0" sandbox="allow-scripts allow-same-origin"></iframe>
</div>
<div class="microsim-fallback">
<img src="Microsims/thumbs/Inert_gas.png" alt="Inert_gas microsim poster" style="width:100%;border:1px solid #4445;border-radius:6px;">
<p><em>Live microsim (desktop) · <a href="https://editor.p5js.org/sciencenibber/sketches/DlHdNWEGS">open sketch in the p5.js editor</a></em></p>
</div>
**Editor URL:** https://editor.p5js.org/sciencenibber/sketches/DlHdNWEGS
**Description (100 words):**
Two side-by-side chambers run the same Boltzmann thermostat. On the left, blue closed-shell atoms ricochet off one another forever — no bond ever forms, no matter how hot you turn the temperature slider. On the right, orange open-shell atoms run identical kinematics, but every close approach is tested against an activation barrier; collisions that clear it snap into a yellow bonded pair that drifts as a rigid molecule. Three sliders drive the experiment: temperature (100–1500 K), activation energy (0–50 kJ/mol), and the reactive partial-pressure mix. A live readout shows the Arrhenius rate k = A · exp(−Ea / RT) and the cumulative reaction count, making the inert/reactive distinction quantitative.
```js
// =====================================================================
// Inert_gas.js -- Wikitube microsim
// Article: Inert_gas en.wikitube.io/wiki/Inert_gas
// Room: Helium Pattern: E (particle system)
// ---------------------------------------------------------------------
// Idea: a 2D chamber of bouncing gas atoms with two species side by
// side -- inert (closed shells, never bond) and reactive (open shells,
// can bond on energetic collision). The reader controls temperature,
// mix ratio, and the activation barrier. As temperature rises, more
// collisions clear the barrier and reactive particles pair into
// bonded products. Inert particles never bond, regardless of energy.
//
// Canonical relation -- the Arrhenius equation:
//
// k = A * exp(-Ea / (R * T))
//
// k is the rate constant, A is the pre-exponential factor (collision
// frequency * orientation), Ea is the activation energy, R is the gas
// constant, T is absolute temperature. The exp(-Ea/RT) term is the
// Maxwell-Boltzmann tail -- the fraction of collisions energetic
// enough to react. For a noble gas, Ea is effectively infinite under
// ordinary conditions, so k -> 0 regardless of T. For molecular
// nitrogen, Ea is set by the 945 kJ/mol N=N triple bond, so the gas
// is "inert" at room temperature but reacts above ~1000 K. The
// microsim makes these two regimes visible side-by-side.
//
// Key inert-gas landmarks:
// * Helium: highest first ionization energy in the periodic table,
// 24.59 eV. Filled 1s shell.
// * Argon: 15.76 eV, most abundant inert gas in the atmosphere
// (0.93%), workhorse industrial purging / welding shield gas.
// * Krypton, Xenon, Radon: 14.00, 12.13, 10.75 eV. Form a small
// handful of compounds (XePtF6, Neil Bartlett 1962).
// * Molecular nitrogen: not a noble gas, but "industrially inert"
// because of the triple-bond strength.
//
// Visual layout (720 x 520 canvas):
// * top-left: HUD title + en.wikitube.io/wiki/Inert_gas subtitle
// * top-right: reaction count + species legend
// * left: inert chamber (closed-shell atoms, always blue)
// * right: reactive chamber (open-shell atoms, green + bonded
// pairs once they react)
// * bottom: three sliders (T, Ea, mix) + Arrhenius rate readout
// * bottom-right: canonical equation k = A * exp(-Ea / (R * T))
//
// Conventions (Wikitube Betterfire Standard v0):
// * single ARTICLE constant at the top, single quotes
// * p5.disableFriendlyErrors = true to keep the editor console clean
// * non-ASCII (Greek delta, dots, arrows) lives in COMMENTS ONLY;
// every text() string literal is pure ASCII
// * Energy-room palette (P5_JS_EDITOR section 4): dark BG, HOT/COLD
// tones, STRUCT grey, TRAJ accent
// * all createSlider calls carry .position(...).size(...)
// =====================================================================
const ARTICLE = 'Inert_gas';
const TITLE = ARTICLE.replace(/_/g, ' ');
p5.disableFriendlyErrors = true;
// ----- Energy room palette (P5_JS_EDITOR section 4, line 165) --------
const BG = 18;
const FG = 240;
const DIM = [240, 240, 240, 140];
const HOT = [220, 110, 60]; // warm: reactive species
const COLD = [60, 130, 220]; // cool: inert species
const STRUCT = [120, 130, 150]; // chamber walls, axis lines
const TRAJ = [240, 220, 80]; // bonded-pair (product) marker
const GAUGE = [120, 220, 140]; // rate / readout color
const SCRATCH = [120, 120, 120, 90];
// ----- Physical constants and reference data ------------------------
// Arrhenius pre-exponential: chosen so a "warm" T (300 K) and an
// "easy" barrier (~5 kJ/mol) give k near 1 reaction/sec -- visible
// at the sim's wall-clock pace.
const A_PRE = 1.0e2; // 1/s, dimensionless for the visual
const R_GAS = 8.314; // J / (mol * K), molar gas constant
// First ionization energies (eV) for the noble gases -- referenced
// in comments only; the visual is not a bar chart of these values,
// they appear in the legend strip.
const IE_HE = 24.59;
const IE_NE = 21.56;
const IE_AR = 15.76;
const IE_KR = 14.00;
const IE_XE = 12.13;
const IE_RN = 10.75;
// ----- Chamber geometry (set in setup) -------------------------------
let chamberInert; // { x, y, w, h }
let chamberReactive;
let plotBottomY; // top of slider region
// ----- Particle populations -----------------------------------------
// Each particle: { x, y, vx, vy, r, species, bondedTo (idx or -1) }
// species: 'inert' or 'reactive'
let particlesInert = [];
let particlesReactive = [];
// ----- Sliders -------------------------------------------------------
let tSlider; // temperature, 100..1500 K
let eaSlider; // activation energy, 0..50 kJ/mol
let mixSlider; // mix ratio reactive : inert, 0..100 (% reactive)
let resetBtn;
// ----- Counters ------------------------------------------------------
let reactionCount = 0; // products formed since last reset
let stepCount = 0; // for periodic things
let pauseChecker = 0; // throttle expensive checks
// =====================================================================
// setup() -- canvas, sliders, populate chambers
// =====================================================================
function setup() {
createCanvas(720, 520);
pixelDensity(2);
textFont('system-ui');
// Two chambers, side by side, with a margin for HUD and sliders.
const margin = 40;
const chamberY = 60;
const chamberH = 320;
const chamberW = (width - 3 * margin) / 2;
chamberInert = { x: margin, y: chamberY, w: chamberW, h: chamberH };
chamberReactive = { x: margin * 2 + chamberW, y: chamberY, w: chamberW, h: chamberH };
plotBottomY = chamberY + chamberH + 20;
// Sliders along the bottom -- always positioned, always sized.
tSlider = createSlider(100, 1500, 350, 10).position(60, plotBottomY + 6 ).size(180);
eaSlider = createSlider(0, 50, 15, 1 ).position(60, plotBottomY + 36).size(180);
mixSlider = createSlider(0, 100, 50, 5 ).position(380, plotBottomY + 6 ).size(180);
resetBtn = createButton('reset').position(580, plotBottomY + 6);
resetBtn.mousePressed(populateChambers);
populateChambers();
}
// =====================================================================
// Populate both chambers from a fresh start.
// Total particles fixed; mixSlider determines how many of the
// inert chamber's right-side analog go to the reactive chamber.
// Visually each chamber holds the same TOTAL count -- the sim
// contrasts "all-inert" vs "all-reactive" at the same density.
// =====================================================================
function populateChambers() {
particlesInert = [];
particlesReactive = [];
reactionCount = 0;
stepCount = 0;
const N = 40;
for (let i = 0; i < N; i++) {
particlesInert.push (spawnParticle(chamberInert, 'inert'));
particlesReactive.push(spawnParticle(chamberReactive, 'reactive'));
}
}
function spawnParticle(box, species) {
const r = (species === 'inert') ? 8 : 9;
return {
x: random(box.x + r + 2, box.x + box.w - r - 2),
y: random(box.y + r + 2, box.y + box.h - r - 2),
vx: random(-1, 1),
vy: random(-1, 1),
r: r,
species: species,
bondedTo: -1
};
}
// =====================================================================
// draw() -- main loop. Read sliders once, integrate, draw.
// =====================================================================
function draw() {
background(BG);
// ----- read slider state once per frame ----------------------------
const T = tSlider.value(); // temperature, K
const EaKJ = eaSlider.value(); // activation energy, kJ/mol
const Ea = EaKJ * 1000; // J/mol, for Arrhenius
const mix = mixSlider.value() / 100; // fraction reactive in mix slider
const k = arrheniusRate(T, Ea); // dimensionless rate constant
// Velocity scaling: vRms ~ sqrt(T). Reference: T = 300 K -> base 1.0.
// Cap the per-frame distance at a fraction of the particle radius so
// collisions stay reliable at the highest temperatures.
const vScale = sqrt(T / 300);
// ----- integrate both chambers -------------------------------------
stepParticles(particlesInert, chamberInert, vScale);
stepParticles(particlesReactive, chamberReactive, vScale);
// ----- run reactive collision tests in the reactive chamber -------
// Mix-slider controls per-frame probability that an eligible
// collision is checked -- low mix means few reactive partners
// available, high mix means many. This is a visual proxy for
// partial pressure of the reactive component.
pauseChecker++;
if (pauseChecker >= 1) {
pauseChecker = 0;
checkReactions(Ea, T, mix);
}
// ----- render --------------------------------------------------
drawChambers();
drawParticles(particlesInert);
drawParticles(particlesReactive);
drawSliderLabels(T, EaKJ, mix, k);
drawLegend();
drawHUD();
drawEquation();
}
// =====================================================================
// Arrhenius rate constant: k = A * exp(-Ea / (R * T)).
// Returns a dimensionless visual rate (the A_PRE we chose is just a
// scaling factor for the readout).
// =====================================================================
function arrheniusRate(T, Ea) {
return A_PRE * Math.exp(-Ea / (R_GAS * T));
}
// =====================================================================
// Step a chamber: integrate velocity, bounce off walls, handle
// intra-chamber elastic collisions (cheap O(N^2) sweep -- N=40).
// =====================================================================
function stepParticles(list, box, vScale) {
// 1. ballistic step + wall bounce
for (const p of list) {
p.x += p.vx * vScale;
p.y += p.vy * vScale;
if (p.x < box.x + p.r) { p.x = box.x + p.r; p.vx = abs(p.vx); }
if (p.x > box.x + box.w - p.r) { p.x = box.x + box.w - p.r; p.vx = -abs(p.vx); }
if (p.y < box.y + p.r) { p.y = box.y + p.r; p.vy = abs(p.vy); }
if (p.y > box.y + box.h - p.r) { p.y = box.y + box.h - p.r; p.vy = -abs(p.vy); }
}
// 2. elastic collision between every pair (skip bonded molecules
// so a formed product moves as a rigid pair)
for (let i = 0; i < list.length; i++) {
const a = list[i];
for (let j = i + 1; j < list.length; j++) {
const b = list[j];
const dx = b.x - a.x;
const dy = b.y - a.y;
const d2 = dx * dx + dy * dy;
const rad = a.r + b.r;
if (d2 < rad * rad && d2 > 0.0001) {
elasticBounce(a, b, dx, dy, d2);
}
}
}
}
// Idealized elastic collision between equal-mass disks. Swap velocity
// components along the line of centers; tangential components are
// preserved. Pull the particles apart so they don't overlap on the
// next frame and trigger the same collision again.
function elasticBounce(a, b, dx, dy, d2) {
const d = Math.sqrt(d2);
const nx = dx / d;
const ny = dy / d;
// velocity components along normal
const vaN = a.vx * nx + a.vy * ny;
const vbN = b.vx * nx + b.vy * ny;
// swap normal components
a.vx += (vbN - vaN) * nx;
a.vy += (vbN - vaN) * ny;
b.vx += (vaN - vbN) * nx;
b.vy += (vaN - vbN) * ny;
// separate
const overlap = (a.r + b.r - d) * 0.5;
a.x -= overlap * nx;
a.y -= overlap * ny;
b.x += overlap * nx;
b.y += overlap * ny;
}
// =====================================================================
// Reaction check: in the reactive chamber, for every unbonded pair
// whose closing-speed kinetic energy clears Ea, form a bond. Bonded
// particles share velocity (a crude rigid-pair approximation) and
// drift together. The "inert" chamber never enters this routine.
//
// Collision energy proxy: E_coll = 0.5 * m_red * v_rel^2.
// We treat each particle's mass as 1, use velocity magnitude (with
// the same vScale used for drawing motion), and convert to "J/mol"
// via an empirical scaling so the slider range maps reasonably.
// =====================================================================
function checkReactions(Ea, T, mixFrac) {
const list = particlesReactive;
// Empirical kinetic-to-Ea mapping. Tuned so that with T = 350 K,
// Ea = 15 kJ/mol, mix = 0.5, a few reactions per second occur.
const kineticToJoulesPerMol = 80000; // J/mol per (vRel^2 * vScale^2)
for (let i = 0; i < list.length; i++) {
const a = list[i];
if (a.bondedTo >= 0) continue;
for (let j = i + 1; j < list.length; j++) {
const b = list[j];
if (b.bondedTo >= 0) continue;
const dx = b.x - a.x;
const dy = b.y - a.y;
const d2 = dx * dx + dy * dy;
const rad = (a.r + b.r) * 1.05;
if (d2 > rad * rad) continue;
// closing-speed squared
const dvx = b.vx - a.vx;
const dvy = b.vy - a.vy;
const vRel2 = dvx * dvx + dvy * dvy;
const vScale = sqrt(T / 300);
const eColl = 0.5 * vRel2 * vScale * vScale * kineticToJoulesPerMol;
// partial-pressure proxy: skip with probability (1 - mix)
if (random() > mixFrac) continue;
if (eColl > Ea) {
a.bondedTo = j;
b.bondedTo = i;
// average velocities so the pair drifts as one
const ux = (a.vx + b.vx) * 0.5;
const uy = (a.vy + b.vy) * 0.5;
a.vx = ux; a.vy = uy;
b.vx = ux; b.vy = uy;
reactionCount++;
}
}
}
}
// =====================================================================
// Drawing
// =====================================================================
function drawChambers() {
push();
noFill();
stroke(STRUCT);
strokeWeight(2);
rect(chamberInert.x, chamberInert.y, chamberInert.w, chamberInert.h, 4);
rect(chamberReactive.x, chamberReactive.y, chamberReactive.w, chamberReactive.h, 4);
noStroke();
fill(...DIM);
textSize(12);
textAlign(CENTER, BOTTOM);
text('Inert (closed shells)', chamberInert.x + chamberInert.w / 2, chamberInert.y - 6);
text('Reactive (open shells)', chamberReactive.x + chamberReactive.w / 2, chamberReactive.y - 6);
pop();
}
function drawParticles(list) {
// First pass: bonded pairs as a stick-and-ball "molecule" -- draw
// the bond stroke first so the atoms paint over it.
push();
strokeWeight(3);
stroke(...TRAJ);
for (let i = 0; i < list.length; i++) {
const a = list[i];
if (a.bondedTo < 0) continue;
const b = list[a.bondedTo];
if (!b || a.bondedTo < i) continue; // draw each pair once
line(a.x, a.y, b.x, b.y);
}
pop();
// Second pass: atoms
noStroke();
for (const p of list) {
if (p.species === 'inert') {
// closed-shell atom: solid disc with a dim outline halo
fill(...COLD);
ellipse(p.x, p.y, p.r * 2);
noFill();
stroke(...COLD, 80);
strokeWeight(1);
ellipse(p.x, p.y, p.r * 2 + 6);
noStroke();
} else {
// reactive atom: hotter color when unbonded, fades to TRAJ when bonded
if (p.bondedTo < 0) {
fill(...HOT);
} else {
fill(...TRAJ);
}
ellipse(p.x, p.y, p.r * 2);
}
}
}
// Slider labels + Arrhenius rate readout sit immediately under the
// chambers. The exact slider DOM elements live at the positions we set
// in setup -- we only paint the captions here.
function drawSliderLabels(T, EaKJ, mixFrac, k) {
push();
noStroke();
fill(...DIM);
textSize(11);
textAlign(LEFT, CENTER);
text('T [K]: ' + nf(T, 1, 0), 245, plotBottomY + 14);
text('Ea [kJ/mol]: ' + nf(EaKJ, 1, 0), 245, plotBottomY + 44);
text('mix (% reactive): ' + nf(mixFrac * 100, 1, 0), 565, plotBottomY + 14);
// live Arrhenius rate readout
fill(...GAUGE);
textSize(12);
textAlign(LEFT, CENTER);
const kTxt = (k < 1e-6) ? '~0' : k.toExponential(2);
text('k = A * exp(-Ea / RT) = ' + kTxt + ' reactions formed: ' + reactionCount,
60, plotBottomY + 70);
pop();
}
// Legend strip across the top-right: species color key + a small list
// of representative noble-gas ionization energies for context.
function drawLegend() {
push();
textSize(11);
noStroke();
const lx = width - 220;
const ly = 14;
// Inert swatch
fill(...COLD); ellipse(lx + 8, ly + 6, 12);
fill(...DIM); textAlign(LEFT, CENTER);
text('inert atom (filled shell)', lx + 20, ly + 6);
// Reactive swatch
fill(...HOT); ellipse(lx + 8, ly + 22, 12);
fill(...DIM); text('reactive atom (open shell)', lx + 20, ly + 22);
// Bond swatch
stroke(...TRAJ); strokeWeight(3);
line(lx + 2, ly + 38, lx + 14, ly + 38);
noStroke();
fill(...DIM); text('product (bonded pair)', lx + 20, ly + 38);
pop();
}
// Top-left HUD strip per Betterfire Standard.
function drawHUD() {
push();
noStroke();
fill(0, 180);
rect(8, 8, 360, 38);
fill(255);
textSize(16);
textAlign(LEFT, TOP);
text(TITLE, 14, 14);
fill(...DIM);
textSize(11);
text('Wikitube microsim . en.wikitube.io/wiki/' + ARTICLE, 14, 32);
pop();
}
// Bottom-right canonical equation in ASCII per Betterfire Standard.
function drawEquation() {
push();
noStroke();
fill(...DIM);
textSize(12);
textAlign(RIGHT, BOTTOM);
text('k = A * exp(-Ea / (R * T))', width - 16, height - 8);
pop();
}
```
## Links (Wikipedia order)
<!-- injected from _registry/childlinks/Inert_gas.json (2026-07-30T02:09:12Z) -->
`Air-free_technique` · `Air_separation` · `Antimicrobial` · `Antioxidant` · `Arc_welding` · [[Argon]] · `Bleed_air` · [[Breathing_gas]] · `Butylated_hydroxytoluene` · `Carbon_dioxide` · `Chemical_compound` · `Chemical_reaction` · `Decompression_sickness` · `Electron_shell` · `Food_packaging` · `Gas` · `Gas_metal_arc_welding` · [[Helium]] · `High-pressure_nervous_syndrome` · `Hydrocarbon` · `Hydrolysis` · `Industrial_gas` · `Inerting_system` · `International_Union_of_Pure_and_Applied_Chemistry` · [[Krypton]] · [[Natural_gas]] · [[Neon]] · [[Nitrogen]] · [[Nitrogen_narcosis]] · [[Noble_gas]] · [[Oganesson]] · [[Oxygen]] · `Passivation_(chemistry)` · [[Radon]] · `Scrubber` · `Sodium_benzoate` · `Tank` · `Tank_blanketing` · `Ullage` · `Underwater_diving` · `Valence_electron` · [[Xenon]]
## From the vault media library
!Inert gas thumb.png
*Inert Gas — from the vault's own media holdings, placed 2026-07-09. MTN / Wikitube.io original · CC BY-SA 4.0.*
<!-- LOCAL-MEDIA-PASS:END -->
> **Room:** [[Helium]] · **Status:** ✅ shipped
## Overview
An inert gas is a gas that does not undergo chemical reactions under a specified set of conditions. The term is context-dependent: helium, neon, argon, krypton, xenon, and radon — the noble gases — are inert in nearly all ordinary conditions because their valence [[Electron|electron]] shells are full, giving them very high first ionization energies (helium tops the periodic table at 24.59 eV) and essentially no driving [[Force|force]] to bond. Other gases such as molecular nitrogen are routinely treated as inert in industrial settings: the N≡N triple bond is so strong (945 kJ/mol) that it resists reaction at room temperature, even though nitrogen forms many compounds when activated.
The defining property is bond dissociation [[Energy|energy]] versus available collision energy. At a given temperature, the Maxwell–Boltzmann tail determines what fraction of molecules can clear an activation barrier ΔE_a, and inert gases simply present barriers that are inaccessible at ordinary conditions. Neil Bartlett shattered the dogma of absolute noble-gas inertness in 1962 by synthesizing XePtF6, and a small family of krypton, xenon, and radon compounds has since been catalogued.
Industrially, inert gases dominate where oxidation must be suppressed: argon and helium shield arc-welding pools (TIG, MIG); nitrogen and argon purge semiconductor process lines and pharmaceutical reactors; nitrogen blankets bulk storage of grains, wine, and pharmaceuticals; helium pressurizes liquid-oxygen rocket tanks; and ultra-pure argon fills the cover gas of single-crystal silicon furnaces. The choice between species trades cost (nitrogen cheapest) against reactivity (argon and helium for the highest-temperature pools and the most demanding [[Electronics|electronics]]).
## See also
- Room hub: [[Helium]]
- p5.js Editor conventions: P5 JS EDITOR
- Wiki root: MAIN
---
*Scaffolded by `generative-microsim` from row 148 of the Helium sheet on 2026-05-14T16:51:19Z.*
<!-- LOCAL-MEDIA-PASS:START -->
<!-- CRAFT-LINK:START g12 -->
*Built to the [[WT!P5_js_Microsim_Master_Class|p5.js Master Class]].*
<!-- CRAFT-LINK:END -->
## Wikipedia : Wikitube
**Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Inert_gas) : [Wikitube](https://en.wikitube.io/wiki/Inert_gas)
## Previous hub tags
Tree parent: [[Helium]].
Legacy hubs: none.
---
*Sources: 1 legacy note. Minted wave 1, 2026-07-30 (v1.6 order).*