Inputs
Example data table
| Parameter | Value | Notes |
|---|---|---|
| C | 1.0 uF/cm² | Standard membrane capacitance |
| gNa, ENa | 120 mS/cm², 50 mV | Sodium channel strength and reversal |
| gK, EK | 36 mS/cm², -77 mV | Potassium channel strength and reversal |
| gL, EL | 0.3 mS/cm², -54.387 mV | Leak current baseline |
| Stimulus | Step 10 uA/cm² from 10–40 ms | Usually yields 1–3 spikes |
| Solver | RK4, dt 0.01 ms, sample 0.05 ms | Stable and smooth traces |
Formula used
The model evolves membrane voltage and gating variables using these equations:
- C dV/dt = I(t) − gNa m³h (V−ENa) − gK n⁴ (V−EK) − gL (V−EL)
- dm/dt = αm(V)(1−m) − βm(V)m
- dh/dt = αh(V)(1−h) − βh(V)h
- dn/dt = αn(V)(1−n) − βn(V)n
Rate functions use standard voltage-dependent forms; the solver integrates them with Euler or fourth-order Runge–Kutta while clamping gates to the physical range 0–1.
How to use this calculator
- Enter membrane and channel parameters, or keep defaults.
- Choose the stimulus waveform and timing window.
- Select integration method, time step, and sampling.
- Press Solve to simulate dynamics.
- Inspect charts and the table, then export CSV or PDF.
Professional guide to the Hodgkin–Huxley solver
1) What the solver models
The calculator simulates a small patch of excitable membrane where voltage changes because ionic currents flow through sodium, potassium, and leak pathways. It integrates four coupled differential equations for membrane voltage V and gates m, h, n. This system reproduces action potentials, refractory behavior, and recovery dynamics seen in classical squid-axon experiments.
2) Core membrane balance
Voltage evolves from the capacitance balance C dV/dt equals injected current minus ionic currents. Typical baseline values are C=1.0 uF/cm², gNa=120, gK=36, and gL=0.3 mS/cm² with reversal potentials ENa=50, EK=-77, EL=-54.387 mV. These defaults provide realistic spike amplitude and width.
3) Gating kinetics and time scales
The gates follow first-order kinetics with voltage-dependent rate functions. The sodium activation gate m responds fastest, while inactivation h and potassium activation n evolve more slowly. This separation of time scales is a key reason spikes rise rapidly and repolarize with a delayed outward current.
4) Stimulus waveforms for experiments
The input current I(t) supports step, pulse train, sine, and ramp patterns. As a practical benchmark, a step of 10 uA/cm² from 10–40 ms often produces one to several spikes from a resting voltage near −65 mV. Pulse trains help probe refractory periods, while sine inputs reveal resonance-like subthreshold responses.
5) Numerical method choice
Euler integration is simple but can become unstable when dt is large. RK4 is higher order and usually remains accurate at larger step sizes. For smooth traces, dt around 0.01–0.05 ms is commonly reliable, and the output sampling step can be coarser (for example 0.05–0.2 ms) to reduce table size.
6) Stability and practical limits
The solver clamps gates to 0–1 to prevent drift during long runs. To keep runtime reasonable, the calculator limits the total number of internal steps. If you need longer simulations, increase dt carefully or shorten total time while keeping the stimulus window within the simulated interval.
7) Interpreting outputs
The voltage chart shows spike timing and peak voltage, while the gate chart explains which channels drive each phase. During the upstroke, m rises sharply; repolarization follows as h decreases and n increases. The table also reports INa, IK, and IL to quantify current balance.
8) Export for reporting
CSV export provides the full sampled time series for external plotting, curve fitting, or teaching labs. The PDF export produces a compact summary with key settings and an initial slice of data, suitable for quick documentation. Together, these outputs support reproducible parameter sweeps and model comparisons.
FAQs
1) What does the spike counter measure?
It counts upward crossings of 0 mV in the sampled voltage trace. If you change sampling or use very coarse steps, closely spaced spikes may be missed or merged.
2) Why do I get no spikes with a step stimulus?
The amplitude may be too small, the stimulus window too short, or the resting voltage too low. Increase amplitude, extend duration, or start near −65 mV to reach threshold.
3) When should I use RK4 instead of Euler?
Use RK4 when you want better accuracy at moderate dt or when Euler shows oscillations or blow‑ups. RK4 is generally safer for parameter sweeps.
4) How should I pick dt and sampling step?
Choose dt small enough to resolve fast sodium activation, then sample more coarsely to keep files manageable. A common pairing is dt=0.01 ms and sample 0.05–0.2 ms.
5) Are the parameters dimensionally consistent?
Yes. Voltage is mV, time is ms, conductance is mS/cm², capacitance is uF/cm², and current is uA/cm². These units match classical Hodgkin–Huxley conventions.
6) Why are gate variables limited to 0–1?
Gates represent probabilities of channel subunits being open. Numerical errors can push them outside physical bounds, so clamping prevents unrealistic conductances and improves stability.
7) Can I model repetitive firing with this tool?
Yes. Use longer total time and a pulse train or sustained step current. Adjust amplitude and timing to explore refractory recovery and steady firing patterns.