Presets
Playback
Brain-state model
View
Camera
Layers
Quality
Model check
The science
What you see. The cortex is split into 24 patches. Each patch is a neural mass: a population-level model with pyramidal cells and excitatory and inhibitory interneurons (Jansen and Rit, 1995). The scalp electrodes record a distance-weighted mix of the patch potentials. The rhythm you see is produced by the excitation-inhibition feedback loop, not by sine waves added together.
Equations (per patch). Post-synaptic potentials obey second-order kernels, y'' = A a S(input) - 2a y' - a2 y:
y0'' = A a S(y1 - y2) - 2a y0' - a2 y0
y1'' = A a [ p + C2 S(C1 y0) ] - 2a y1' - a2 y1
y2'' = B b C4 S(C3 y0) - 2b y2' - b2 y2
with the sigmoid S(v) = 2 e0 / (1 + exp(r (v0 - v))). The patch output is v = y1 - y2. Standard values: A = 3.25 mV, B = 22 mV, 1/a = 10 ms, 1/b = 20 ms, C = 135, C1 = C, C2 = 0.8 C, C3 = C4 = 0.25 C, e0 = 2.5 /s, v0 = 6 mV, r = 0.56 /mV. The drive p (default 220 pulses/s) plus noise models input from the rest of the brain. With these values one patch settles on a limit cycle near 11 Hz, which is the alpha range.
Why the bands move. Every kernel time constant is divided by the synaptic speed s. The equations are exactly covariant under this rescaling of time, so the frequency of the rhythm is f = s f1, where f1 is the rhythm at s = 1. Slow synapses give delta and theta, fast ones give beta and gamma. Real brain states change many things at once (neuromodulators, thalamic input, connectivity); this single knob is a teaching device, not a physiological dial. Lowering p below about 110/s removes the oscillation and leaves a steady state; raising B or p changes the shape and amplitude of the wave.
Coupling and synchrony. Patch i receives an extra input g C Σj Wij (Sj - mean) from the other patches, with weights Wij decaying exponentially with the distance on the cortex. Patches also differ in speed by up to +/- the detuning setting. Coupling pulls the phases together (Kuramoto-like locking). The synchrony r = |mean of exp(i phi)| uses a phase read from the (v, dv/dt) plane, a rough substitute for a Hilbert-transform phase: r near 0 means unrelated phases, r near 1 means one common rhythm. Large synchronised sources produce larger scalp signals, which is why strong rhythms such as alpha appear in real EEG.
Scalp read-out. Electrode k shows the sum over patches of Kki vi with Kki proportional to 1/(d2 + 0.25), normalised. A real head needs a volume-conductor model (skull, CSF, folded cortex); this kernel only gives plausible blurring and a polarity map. Electrode sites are the approximate international 10-20 positions. Amplitudes are in model millivolts, not microvolts.
Spectrum. The dominant frequency comes from a 2048-point FFT (4.1 s window, Hann taper, 0.24 Hz bins, parabolic peak interpolation) averaged over all 19 channels. Bands: delta 0.5-4, theta 4-8, alpha 8-13, beta 13-30, gamma 30-100 Hz.
Checks (run in the page). (1) The RK4 time stepping relaxes to the steady state of one patch found by an independent bisection root-finder. (2) The FFT of a pure 10 Hz sine returns 10 Hz, the reference patch rhythm is in the alpha range, and doubling s doubles the frequency (x2.000). (3) Halving the integration step leaves the rhythm and amplitude unchanged to well under 1 %.
What this model is not. It is a classical, simplified neural-mass model. It reproduces how a feedback loop can generate band-limited rhythms and how coupling synchronises them; it does not model individual neurons, cortical layers, thalamus, real anatomy, or any disease. It is an educational illustration only and gives no medical or diagnostic information.
What to try
- Run the presets in turn and watch the dominant frequency move through delta, theta, alpha, beta and gamma. The last graph shows frequency against synaptic speed: the line is f = s f1.
- Set coupling to 0 with detuning 0.25, then raise coupling slowly: synchrony r climbs and the scalp amplitude grows because the patches add up.
- Press "Flash stimulus" to give every patch a 40 ms pulse and see the evoked wave and ringing.
- Lower the drive p below 110/s: the rhythm stops (steady state). Raise it above 300/s and the wave shape changes.
- Click an electrode to see its own trace and its position in the topographic map.