For Nerds

How the sims are made.

Every Eikonium simulation runs on a small set of physics kits: frozen, verified solver modules with one state ontology each. This page explains the architecture and lets you download the solvers themselves.

The architecture

Kits below, stories above.

A kit is a verified, frozen set of physics primitives over a single state representation, plus the contracts that compose them. Each primitive is checked against a closed-form result before the kit freezes, and it is never re-derived per scenario. A scenario is a composition over the kit: it declares its physics and the kit executes it. That is the trust model in one sentence: wrong physics is unexpressible, because the only physics available is the kit's verified primitives.

Everything narrative (the story, the prediction, the knobs, the payoff) lives in a separate scenario layer. Hand-authored scenarios and Studio-generated ones fill the same contract, which is why a single verified kit is enough for both.

The rules

Non-negotiables in every kit.

  • Fixed timestep. 1/240 s, accumulator loop. Frame rate never touches the physics.
  • SI units throughout. No screen-space physics; rendering converts at the edge.
  • Symplectic integration. Velocity Verlet by default; symplectic Euler, semi-implicit damped, and Boris where the physics calls for them. Energy behaves over long runs.
  • Seeded determinism. Every random draw comes from a seeded mulberry32, never Math.random. Same seed, same run, always.
  • No scripted outcomes. There is no code path that knows the answer. The Chain's criticality cliff emerges from offspring counts; no line of code contains the word critical.
The solvers

Download a kit.

Each zip is the kit's TypeScript source verbatim, including its README and its verification tests. The tests are the honest documentation: they state exactly which closed-form results the kit is held to.

Body

Discrete point masses with position, velocity, mass, optional charge.

Verified against: Closed-form trajectories, energy conservation, integrator benchmarks.

All of mechanics.

Download .zip →
Wave 1D

A continuous 1D medium sampled at N points; leapfrog finite-difference wave equation.

Verified against: Pulse speed vs √(T/μ), fundamental period 2L/c, exact superposition, CFL refusal.

Waves: The Duck, The Rope Signal, Head-On, The Guitar String.

Download .zip →
Circuit

A lumped DC network solved by modified nodal analysis.

Verified against: Series dividers, parallel splits, KCL at every node, power ledger summing to zero.

Circuits: The Two Bulbs, The Long Wire, The Third Bulb, The Shortcut.

Download .zip →
Thermal

Lumped energy accounting: nodes hold energy, links conduct, phase stores swallow at a pinned temperature.

Verified against: Exponential relaxation vs τ = C/G, latent plateau vs L/P, adiabatic invariant TV^(γ−1).

Heat & Temperature, Thermodynamic Processes.

Download .zip →
Ray

Straight lines that bend only at surfaces. No dynamics, no time; a trace is pure geometry.

Verified against: Snell against closed-form angles, total internal reflection, thin-lens equation at 2f, apparent depth d/n.

Optics: The Spearfisher, The Mirror Bet, The Burning Glass.

Download .zip →
Stochastic

Events drawn one at a time against exact probability laws; seeded, fully reproducible.

Verified against: Halving on schedule, memorylessness of survivors, Poisson means, histogram convergence.

Nuclear Physics and Quantum: The Last Atom, One at a Time, The Wall.

Download .zip →
Particle

Many identical particles moved by a commanded macroscopic flow plus uncommanded microscopic randomness.

Verified against: MSD against 4Dt, the Loschmidt reversal control, transport extinction below the density cliff.

The Unstir, The Chain.

Download .zip →
Analytic

Physics whose exact solution is known in closed form, evaluated on the sim clock.

Verified against: Doppler plateaus, Mach angle at Mach 2, γ at 0.99c, GPS drift near 38 μs/day.

Sound, Special Relativity, Electrostatics, Magnetism closed forms.

Download .zip →
Using a kit

Three steps to a running solver.

Kits are plain TypeScript with zero dependencies. Unzip into any TS project and import from the kit's index. The body kit, for example:

import { buildSimulation, makeBody, uniformGravity } from './body';

const sim = buildSimulation({
  id: 'toss',
  bodies: [
    makeBody({ id: 'ball', mass: 0.4, pos: { x: 0, y: 20 }, vel: { x: 12, y: 0 } }),
  ],
  params: { gravity: { x: 0, y: -9.81 } },   // SI units throughout
  forces: [uniformGravity()],
  integrator: 'verlet',                       // symplectic velocity Verlet
  dt: 1 / 240,                                // fixed timestep
});

sim.stepper.tick(1 / 60);  // advance one frame; the accumulator substeps
console.log(sim.world.bodies[0].pos);

Each README documents the kit's full surface. Run the included tests with vitest to see every guarantee checked: npx vitest run inside the kit folder.

The kits are free to download for personal and classroom use. Building something bigger on them? Write in first.