Platform Stats after Wave 22
Wave 22 focus: bridging the abstract mathematics of statistics and linear algebra with concrete physical phenomena — the simultaneity breakdown at relativistic speeds, the voltage shifts in an electrochemical cell, and the geometric meaning of a matrix’s eigenvectors. Each simulation aims to make the equation visible.
Wave 22 Blog Posts
Statistics & Probability: Distributions, Hypothesis Testing, Bayesian Inference and Markov Chains
Differential Equations in Physics: Oscillators, Chaos, PDEs and Numerical Methods
Relative Simultaneity
Einstein’s 1905 thought experiment with a moving train and two simultaneous lightning strikes is one of the most powerful illustrations of special relativity: events that are simultaneous in the platform frame are not simultaneous in the train frame. The simulation makes this concrete with a side-by-side animation of both reference frames.
How the Simulation Works
A train moves at β = v/c from left to right. Two lightning bolts strike the front and rear of the train simultaneously in the platform frame (the bolts are equidistant from the platform observer, so light from both reaches them at the same moment). The simulation shows both frames simultaneously:
- Platform frame (top canvas): both strikes fire at t = 0. Light pulses expand as circles at speed c; the platform observer at centre-track receives both pulses together.
- Train frame (bottom canvas): Lorentz-transformed events using t′ = γ(t−vx/c²) and x′ = γ(x−vt). The rear strike happens first; the front strike happens later. The train observer at the carriage midpoint receives the front pulse first.
Lorentz Transformation Used
t′ = γ(t − vx/c²) x′ = γ(x − vt) γ = 1/√(1−β²), β = v/c Platform-frame events (simultaneous): t₁ = t₂ = 0 Train-frame events (not simultaneous): t′₁ = γ(0 − v·x₁/c²) = −γv·x₁/c² (rear: x₁ < 0) t′₂ = γ(0 − v·x₂/c²) = −γv·x₂/c² (front: x₂ > 0) Δt′ = γv·L/c² where L = train length in platform frame
Controls include a β-slider (0.1 → 0.95), a play/pause/reset button, and a speed multiplier. An information panel below the canvases shows γ, Δt′ (the simultaneity gap in the train frame), and the Lorentz-contracted train length L′ = L/γ.
Relative Simultaneity
Train + lightning thought experiment, two-frame animation (platform / train), Lorentz-transformed flash times, β-slider 0.1–0.95, Δt′ readout.
Twin Paradox
Minkowski spacetime diagram, animated proper-time ticks, β-slider, live age panels (Earth twin / rocket twin / Δage).
Nernst Equation — Galvanic Cell Voltage
The Nernst equation describes how the electromotive force (EMF) of a half-cell or galvanic cell depends on temperature and the concentrations (or activities) of the ionic species involved. It is the fundamental equation of electrochemistry, underpinning batteries, fuel cells, biological ion channels, and analytical chemistry (pH electrodes, ion-selective electrodes).
Simulation Design
The simulation models a complete galvanic cell (e.g., the Daniell cell: Zn | ZnSO4 || CuSO4 | Cu). The user controls:
- Temperature T (273–373 K)
- Reactant and product concentrations for each half-cell
- Number of electrons transferred n (1–4)
- Standard reduction potential E° via a preset selector (8 common electrode pairs)
Nernst Equation
E = E° − (RT/nF) ln Q E = cell potential [V] E° = standard potential (at 298 K, 1 M, 1 atm) [V] R = 8.314 J mol⁻¹ K⁻¹ T = temperature [K] n = moles of electrons transferred F = 96485 C mol⁻¹ (Faraday constant) Q = reaction quotient = [products]/[reactants] At 25°C: RT/F = 0.025693 V ≈ 25.7 mV ⇒ E = E° − (0.05916/n) log₁₀ Q (Nernst at 25°C) Half-cell (reduction half-reaction): Ox + ne⁻ → Red E_half = E°_half − (RT/nF) ln([Red]/[Ox])
The canvas renders a schematic galvanic cell: two beakers connected by a salt bridge, with animated ion migration (cations drifting toward cathode, anions toward anode). An electrode mass indicator shows the anode dissolving (decreasing bar) and cathode plating (growing bar). A live E vs. ln(Q) graph plots the Nernst curve with a moving dot tracking the current operating point. A secondary panel shows ΔG = −nFE and equilibrium constant K = exp(nFE°/RT) for the selected cell.
Nernst Equation
Galvanic cell EMF vs. concentration, animated ion migration, E vs. ln(Q) Nernst curve, ΔG = −nFE, K vs. E° readout, 8 preset electrode pairs, temperature slider 273–373 K.
Acid – Base
pH scale, strong/weak acids and bases, pKa equilibrium, Henderson- Hasselbalch buffer equation, titration curves, indicator colour transitions.
Eigenvectors & Eigenvalues Visualiser
Eigenvectors are the directions in which a linear transformation acts purely as a stretch (by a factor λ, the eigenvalue). They appear everywhere: principal axes of an ellipsoid (the symmetric matrix in an inertia tensor), normal modes of a coupled oscillator (the stiffness matrix), quantum observables (Hermitian operators in Hilbert space), Google’s PageRank (leading eigenvector of the link matrix), and PCA dimensionality reduction (eigenvectors of the covariance matrix).
Characteristic Polynomial
A = [[a, b], [c, d]] (2×2 real matrix) Characteristic polynomial: det(A − λI) = 0 ⇒ λ² − (a+d)λ + (ad−bc) = 0 ⇒ λ² − tr(A)·λ + det(A) = 0 Eigenvalues: λ₁,λ₂ = [tr(A) ± √(tr(A)² − 4·det(A))] / 2 Real if discriminant ≥ 0: tr(A)² ≥ 4·det(A) Eigenvector for λ_i: (A−λ_i I)v = 0 v = [b, λ_i − a] (or any nonzero scalar multiple)
The visualiser draws on a 540×440 canvas: a unit grid, the standard basis vectors î and ĵ alongside their images Aî / Aĵ, the unit circle and its image (an ellipse whose semi-axes are aligned with the eigenvectors and scaled by |λ|), and two eigenvector direction lines. Eight presets cover Identity, x-Scale 3, Rotation 90°, Shear, Symmetric (PCA-like), Reflection, and Saddle cases. An info panel shows trace, determinant, eigenvalues, matrix type, and a note when eigenvalues are complex.
Eigenvectors & Eigenvalues
2×2 matrix sliders a,b,c,d (−3 to +3), unit circle → ellipse animation, 8 presets, characteristic polynomial solver, complex eigenvalue detection.
Matrix Transforms
2×2 matrix visualiser, unit grid / basis / eigenvectors / unit circle layers, animated identity→matrix keyframe, 8 presets, trace/det/λ panel.
Engineering Note: Simultaneous Dual-Canvas Animation
The relative simultaneity simulation renders two canvases side by side
within a single requestAnimationFrame loop. Simulation
time is stored as a single master clock variable tsim (in
units of L/c where L is train length). Each canvas gets its own
coordinate transformation: the platform canvas uses tsim
directly; the train canvas applies Lorentz transforms to all event
coordinates before rendering.
The key implementation detail is that the light pulse radii also expand at c in the transformed frame — confirmed by the fact that c = 1 in natural units is frame-invariant. A small edge-case: when β → 0.999, γ ≈ 22, so the simultaneity gap Δt′ = γvL/c² becomes very large; the animation is automatically scaled so both light pulses remain visible on screen.
What’s Next — Wave 23
Wave 23 will focus on topology and advanced geometry: a Klein bottle and torus genus explorer (Euler characteristic χ = V−E+F), a knot invariant visualiser (Alexander polynomial), and a geodesic Schwarzschild orbit simulator modeling photon and massive-particle paths around a non-rotating black hole. On the content side, Wave 23 will include a Spotlight on General Relativity & Cosmology and a Learning post on Complex Analysis and Conformal Mapping.
Have a simulation idea? The project is open-source. See CONTRIBUTING.md for the contributor guide or open an issue in the repository.