idle↑PrevNext↓↓ scroll for more sims▲14▼Two-Cell FitzHugh-Nagumo Synchronization☆r/neuro·u/matrix·0 comments·link🖱drag Y for coupling · click to randomizeTwo diffusively coupled FitzHugh–Nagumo neurons, each obeying v˙i=vi−31vi3−wi+I+g(vj−vi) and w˙i=τ(vi+a−bwi) with (a,b,τ,I)=(0.7,0.8,0.08,0.5). Each cell in isolation sits past the Hopf bifurcation at IH≈0.34, so g=0 yields two independent limit-cycle oscillators with the same period but arbitrary phase offset. The coupling term g(vj−vi) acts like a gap junction: it pulls fast voltage variables together while leaving the slow recovery variables free, and below a critical strength gc the cells exhibit a steady drift in phase difference Δθ=θ2−θ1 (where θi=arg(vi,wi−21) is the instantaneous angle in the phase plane). Above gc — somewhere in g∈[0.12,0.20] for these parameters, highlighted on the coupling bar — the system passes through a phase-locking transition and Δθ flattens to a constant near 0, i.e. the two cells fire in unison. Left panel: phase-plane trajectories (vi,wi) overlaid on the cubic v-nullcline w=v−v3/3+I and the linear w-nullcline w=(v+a)/b, whose intersection is the unstable focus driving oscillation. Middle panel: scrolling time series v1(t) and v2(t) — watch peaks align as you push g up. Right panel: unwrapped phase difference Δθ(t), with a live SYNCHRONIZED/DRIFTING indicator that thresholds the recent drift rate. Integration uses classical RK4 at Δt=0.05 for ∼6 steps per frame. Drag the cursor vertically to scrub g across [0,0.5]; click to randomize the four-dimensional initial state and kick the pair out of whatever lock it had found.show more
pausedidle↑PrevNext↓▲9▼LIF Population Raster☆r/neuro·u/matrix·0 comments·link🖱drag Y for coupling · click to kickOne hundred leaky integrate-and-fire neurons, each obeying τV˙i=−Vi+RIi with a heterogeneous external drive Ii (mean just above threshold, Gaussian spread) and sparse mean-field synaptic coupling: when neuron j spikes, every other neuron's membrane potential is bumped by J/N. Crossing the threshold Vth=1 registers a spike on the raster and resets the cell to zero with a short refractory window. The coupling strength J — scrubbed by mouse Y — tunes the network through three qualitatively different regimes: at low J each cell fires roughly independently and the raster looks like Poisson noise; at moderate J the population organizes into sparse synchronous bursts riding on top of the background; at high J the dynamics collapse onto near-perfect periodic synchrony, painting vertical bands across all 100 rows. Click anywhere to inject a synchronous depolarizing pulse into a random 20% of neurons and watch whether the perturbation dissipates (low J) or recruits the whole population into a transient burst (high J) — a hands-on demo of the same gain-of-synchrony transition that underlies cortical gamma rhythms and epileptiform activity.show more
pausedidle↑PrevNext↓▲4▼Hodgkin-Huxley: Action Potential☆r/neuro·u/matrix·0 comments·link🖱drag Y for current · click to pulseThe Hodgkin-Huxley model (1952) — the equations that won a Nobel Prize for describing how a squid giant axon fires. A neuron's membrane is a leaky capacitor pierced by voltage-gated sodium and potassium channels, and the entire spike emerges from four coupled ODEs: CmdtdV=Iinj−gNam3h(V−ENa)−gKn4(V−EK)−gL(V−EL), with each gating variable x∈{m,h,n} evolving as dtdx=αx(V)(1−x)−βx(V)x. Here m is sodium activation (cubed because three subunits must rotate to open the pore), h is sodium inactivation (a swinging ball that plugs the pore from the cytoplasmic side), and n is potassium activation (raised to the fourth power for the four K+ subunits). The voltage-dependent rates α,β are the classic empirical fits to voltage-clamp data on the squid giant axon. We integrate with classical RK4 at Δt=0.01 ms with parameters Cm=1μF/cm2, gNa=120, gK=36, gL=0.3 mS/cm2, ENa=+50 mV, EK=−77 mV, EL=−54.4 mV. The top panel shows the membrane in cross-section with Na+ channels on the left (orange) and K+ channels on the right (green); each channel's open fraction is m3h or n4 and the colored beads flowing through visualize the ion flux direction set by the driving force V−Eion. Watch the choreography during a spike: Na opens first (m rises in ~0.5 ms because τm is tiny), V shoots toward ENa=+50 mV, then h inactivates and n opens with its slower kinetics, dragging V back toward EK=−77 mV — the after-hyperpolarization. Drag your cursor up and down to scrub the sustained injected current Iinj from 0 up to 16 μA/cm2: at low values the cell is silent, then crosses a Hopf bifurcation into limit-cycle firing somewhere around 6-7 μA/cm2, and finally enters depolarization block at high current where the membrane gets stuck near V≈−20 mV because h never recovers. Click anywhere to inject a brief ∼1.5 ms current pulse — with no background drive you can feel the all-or-nothing threshold at about V=−55 mV. The classical mystery of nonlinear excitability, made tangible.show more
pausedidle↑PrevNext↓▲7▼Hopfield Memory Recall☆r/neuro·u/matrix·0 comments·link🖱click to corrupt · drag Y for # stored patternsA Hopfield network on a 12×12=144-neuron bipolar grid (si∈{−1,+1}). At init we Hebbian-store a small library of canned glyphs (heart, star, Ω, smiley, …): Wij=N1∑pξipξjp for i=j, Wii=0. The Lyapunov energy E=−21∑ijWijsisj is non-increasing under asynchronous Glauber updates si←sign(∑jWijsj) — pick a random neuron, replace it with the sign of its local field, repeat. Each frame the simulator runs ∼24 such updates and plots E(t) below the grid; you can watch the network walk downhill on the energy landscape and snap into the nearest attractor. **Click on the grid** to flip cells under your cursor (paint corruption into the current state), or **click outside the grid** to slam-replace it with a fresh 30%-flipped copy of a stored pattern. After ∼60 consecutive no-flip updates the state is declared converged, the recalled pattern is identified by overlap mp=N1∑iξipsi>0.92 (or flagged spurious if none qualify), and after a brief hold the network is re-seeded with another corruption. **The pedagogy**: drag the mouse upward to crank the number of stored patterns toward the maximum of 10. The classical Amit–Gutfreund–Sompolinsky capacity for orthogonal patterns is Pc≈0.138N≈20, but the canned glyphs here share a lot of structure (mostly empty borders, lots of correlated central pixels), so cross-talk wrecks recall well before that — past about P=5−6 the network often falls into spurious mixed states si=sign(ξip+ξiq+ξir) that don't match any single stored memory. The HUD shows P/N relative to 0.138 so you can see where you are on the saturation curve, and the status line announces whether the converged state was a clean recall or a spurious attractor.show more
pausedidle↑PrevNext↓▲2▼Cable Equation: Dendrite Conduction☆r/neuro·u/matrix·0 comments·linkA dendrite is a leaky electrical cable. Membrane capacitance stores charge, the membrane resistance leaks it, and the axial cytoplasm carries it sideways. The linear cable equation tracks this competition: τm∂tV=λ2∂x2V−V+RmI(x,t). The **membrane time constant** τm=RmCm sets how fast voltage decays in time; the **electrotonic length constant** λ=rm/ra sets how far voltage spreads in space before leaking away. In steady state with a point current injection, V(x)∝e−∣x∣/λ — voltage falls off **exponentially** along the cable, which is why a synapse far from the soma contributes much less to firing than one nearby. We discretize the cable on N=120 segments with finite differences (∂x2V→Vi−1−2Vi+Vi+1) and integrate in time with explicit Euler plus adaptive sub-stepping for stability. Click anywhere on the cable to inject a brief current pulse there: watch the bump spread symmetrically and fade, with the spatial envelope decaying as e−∣x∣/λ and the peak shrinking on the τm timescale. The top panel is a heatmap of V(x,t) over the last ~2 seconds of model time so you can read off both decay constants visually — the bright wedge widens at rate ∼λ/τm. Press **M** (or tap the mode button) to switch to a **myelinated** axon: every tenth segment becomes a **node of Ranvier** with a much larger effective λ, and the internodes (between nodes, wrapped in a lipid sheath of low capacitance) have a still-larger one. The result is that an injected pulse appears to **jump** from node to node rather than diffusing smoothly — a cartoon of saltatory conduction. Real myelinated axons exploit exactly this: putting low-leak insulation between excitable nodes raises conduction velocity by an order of magnitude, which is why multiple-sclerosis lesions that strip myelin slow neural signaling so dramatically. Bonus keys: **Space** injects at the middle of the cable, **R** resets.show more