This is the 2D counterpart to the 3D layer-stack version — identical electrochemistry, viewed instead as a true cross-section through the window: a tungsten-oxide (WO₃) film and a Li⁺-storage counter-electrode (NiO) sandwiching a solid/gel electrolyte, between two transparent ITO conductors. A bias voltage drives Li⁺ ions and electrons across the stack:
WO3 + x Li+ + x e- ⇌ LixWO3 (colored tungsten bronze)
coloring (V < 0) →
← bleaching (V > 0)
Ion insertion relaxes toward a voltage-set equilibrium charge with a diffusion-limited time constant τ (larger τ mimics a thicker film / slower Li⁺ diffusivity D, since τ ≈ d²/D):
dq/dt = (q_eq(V) − q) / τ
q_eq(V) = q_max · 1 / (1 + exp(1.8·V))
Each inserted W⁶⁺ → W⁵⁺ polaron adds visible-light absorption proportional to the charge density, via the coloration efficiency CE (cm²/C):
ΔOD = CE · q (q in C/cm²)
T = T_clear · 10^(−ΔOD)
Both formulas were checked numerically here (scanning V and q across their full slider ranges) — q_eq(V) stays a monotonically decreasing, bounded function of V and OD/T never go negative or blow up, so the 3D source's model needed no correction; this 2D build reuses it exactly.
- Voltage slider — sets the driving bias; negative pulls Li⁺ into WO₃ (coloring), positive pulls it back out (bleaching).
- τ slider — switching speed; a thin film with fast ion diffusion switches in a couple of seconds, a thick film takes tens of seconds.
- CE slider — how dark the film gets per unit of charge moved; higher CE means deeper tint for the same inserted charge.
- Scroll to zoom, drag to pan the cross-section — the electrolyte gap and ion migration front are easiest to see zoomed in.
- The right-hand graph plots live transmittance over time as the stack switches — the same coloration curve real products like SageGlass and the Boeing 787's dimmable cabin windows follow.