Devlog #68 – Wave 48: Electrolysis, Liquid Crystal & Magnetic Levitation

Wave 48 fills the three most underrepresented simulation categories on the platform — electrochemistry, soft matter, and magnetism — each gaining a second simulation with qualitatively different physics: driven electrode reactions, orientational ordering, and quantum-mechanical flux expulsion. Platform total reaches 517 live simulations.

Wave 48 at a Glance

3
New simulations
6
HTML files (EN+UK)
517
Total simulations
3
Blog posts

Electrolysis

Faraday's laws: m = MIt/nF. Watch H₂ and O₂ bubble from electrodes, switch between water, brine, and copper-plating presets.

Launch →
🔮

Liquid Crystal

Nematic director field with Frank elastic relaxation. Fréedericksz transition switches the cell transparent above the threshold field.

Launch →
🧲

Magnetic Levitation

Meissner effect: superconductor below Tc expels field lines and levitates a magnet. Force-height curve shows the stable equilibrium point.

Launch →

Electrolysis — Faraday's Laws Made Visible

Electrolysis was the first quantitative evidence that matter is made of discrete charged particles — Michael Faraday published his two laws in 1832–1833 before the electron was even named. The core equation is deceptively simple:

m = M · I · t / (n · F)

where m is the mass deposited or evolved (g), M is the molar mass (g/mol), I is current (A), t is time (s), n is the number of electrons transferred per mole, and F = 96485 C/mol is the Faraday constant.

Three Preset Reactions

The simulation ships with three chemically distinct presets:

Animation Approach

The single 860×360 canvas draws a cross-section of the electrolytic cell. Animated ions (cyan for cations, pink for anions) drift from left to right representing current flow. Bubble particles spawn from each electrode surface at a rate proportional to the current, rise with a slight horizontal random walk, and vanish at the solution surface — giving an immediate visual feedback of reaction rate when you change voltage or concentration. For the copper preset, solid deposition dots form on the cathode instead of rising bubbles.

Pedagogical note: The minimum voltage slider is set at 1.2 V (slightly below E° for water). Students who try to electrolyse water below 1.23 V will see zero current and no bubbles — a direct demonstration of the thermodynamic threshold.

Liquid Crystal — Order Between Solid and Liquid

Liquid crystals occupy a fascinating middle ground: they flow like liquids but maintain orientational long-range order like crystals. In a nematic phase, rod-shaped molecules point preferentially along a local average direction called the director . The degree of alignment is captured by the order parameter:

S = ½ ⟨3cos²θ − 1⟩

S = 1 means perfect alignment; S = 0 is the isotropic liquid above the clearing temperature Tc. The simulation uses the mean-field approximation S(T) ∝ (1 − T/Tc)^0.36.

Frank Elastic Energy and Director Relaxation

Director distortions cost energy described by the Frank elastic free energy density (one-constant approximation):

f = ½K[(∇·n̂)² + (n̂×∇×n̂)²]

On a 28×22 grid, each director angle θ is updated each frame toward the weighted average of its neighbours (a discrete Laplacian), plus a thermal noise term proportional to T/Tc, plus an electric field torque that activates above the Fréedericksz threshold. The result is a visually satisfying texture that slowly coarsens, with sharp disclination cores persisting indefinitely in the "Defects" preset.

Fréedericksz Transition and LCD Switching

The critical field is:

Ec = π√(K / ε₀Δε) / d

Below Ec the planar alignment is stable; above it, an increasing fraction of directors reorient toward the field direction. This is the operating principle of every IPS/TN LCD screen. The transmittance plot (T = sin²(πΔnd/λ) × field factor) shows how combining birefringence and field tilt makes a voltage-controlled optical shutter.

Magnetic Levitation — The Meissner Effect

In 1933, Meissner and Ochsenfeld discovered that superconductors do something more fundamental than merely having zero resistance: they actively expel all magnetic flux from their interior (B = 0), a phenomenon that cannot be explained by perfect conductivity alone. This Meissner effect is what makes passive magnetic levitation possible without any active feedback — circumventing Earnshaw's theorem, which forbids stable levitation by static fields in free space.

Levitation Force Model

The simulation uses a dipole model for the magnet field decay and an image-dipole repulsion for the Meissner force:

F(h) = A · B(h)² / (2μ₀)

where B(h) = B₀/(1 + (h/h₀)²) is the field at the superconductor surface, A is the effective cross-sectional area, and μ₀ = 4π×10⁻⁷ H/m. Three material presets cover high-temperature YBCO (Tc = 93 K, levitates in liquid nitrogen), low-temperature Nb (Tc = 9.2 K), and an active electromagnet (no Tc threshold).

Visual Design

The visualisation cross-section draws the superconductor disk with a colour gradient that shifts from deep blue (T ≪ Tc) to grey (T > Tc). Field lines are bent around the superconductor surface when active (Meissner screening), and pass through normally when the material is in the normal state. Blue upward and pink downward force arrows scale with F and mg in real time. The second canvas plots F(h) from h = 0 to 80 mm with a dashed horizontal line showing the gravitational load — the green dot marks the stable equilibrium height.

Technical Notes

Electrolysis Current Model

Current is computed as I = (V − E° − η_ohm) × A × σ(c) with a linear approximation for electrolyte conductivity. This is intentionally simplified — a full Tafel + mass-transport model would require ODE integration. The result is accurate to order-of-magnitude for educational purposes.

Director Field Performance

The 28×22 director grid runs at 60 fps with updates every other frame. The bottleneck is the nested loop (616 iterations) with 4-neighbour stencil — fully synchronous, no web worker needed. On slower devices the tick % 3 draw gate keeps the canvas render from dominating CPU time.

The ctx.roundRect() method used in the electrolysis canvas requires Chrome 99+/Firefox 112+/Safari 15.4+. The simulation falls back gracefully (no visible error) on older browsers since roundRect calls are inside fill operations — the corners simply appear square.

What's Next — Wave 49

With electrochemistry and soft matter now at two simulations each, Wave 49 will target the next tier of underrepresented categories. Current candidates include quantum optics (photon entanglement / Bell test), biophysics (membrane potential / Hodgkin-Huxley), and geophysics (seismic wave propagation). As always, category balance and educational value guide selection.

electrolysis Faraday's laws liquid crystal Fréedericksz transition magnetic levitation Meissner effect superconductor Wave 48

← Devlog #67 — Wave 47 All posts ↑