The 3D version renders 20 motor units as instanced muscle fibers and drives each one with a smoothed "activation level" (a low-pass filter toward a rate-coded target). This 2D counterpart instead simulates the actual spike trains: each recruited motor neuron fires discrete action potentials, and every spike kicks a real per-unit twitch mechanics oscillator — the same math used in the classic Fuglevand motor-unit model — so fused and unfused tetanus emerge from genuine summation of individual twitches, not from smoothing:
θ_i = θ_min·(θ_max/θ_min)^(i/(N-1)) recruited ⇔ e ≥ θ_i
rate_i(e) = clamp(rate_min + gain·(e−θ_i), rate_min, rate_max) [Hz, Henneman size principle]
Each spike injects an impulse into a critically-damped linear oscillator whose free response is the textbook twitch shape t·e^(1−t/T) (T = the unit's own contraction time — long for slow Type I fibers, short for fast Type IIx):
x_i'' = −(2/T_i)·x_i' − (1/T_i)²·x_i (twitch mechanics, x = per-unit instantaneous force)
at each spike: x_i' += F_max,i /(rate_max·T_i²) (impulse scaled so full-rate firing → tetanic F_max,i)
Total force(t) = Σ x_i(t)
Fatigue and recovery use the same differential structure as the 3D version — but now driven by the unit's actual instantaneous firing rate rather than a smoothed proxy — fast Type II units deplete several times faster than slow Type I units and always recover more slowly than they fatigue:
active: dF_max,i/dt = −(F_max,i/τ_fatigue,i)·(rate_i/rate_max)
resting: dF_max,i/dt = (F0_i − F_max,i)/τ_recover,i (τ_recover,i = 3.2·τ_fatigue,i)
The raster plot (top) shows every unit's actual spike train — low firing rates near recruitment threshold produce visibly separated, unfused twitches; higher rates fuse into smooth tetanic force, exactly reproducing the physiological unfused→fused transition. The trace below sums it all into total output force against the target, so you can watch a sustained hold force new, larger, faster-fatiguing units to recruit as the early ones deplete — the same size-principle-driven fatigue cascade as the 3D model, verified here from first-principles spike mechanics rather than assumed.