HH_cond_exp
HH_cond_exp(
    gbar_Na=20.0,
    gbar_K=6.0,
    gleak=0.01,
    cm=0.2,
    v_offset=-63.0,
    e_rev_Na=50.0,
    e_rev_K=-90.0,
    e_rev_leak=-65.0,
    e_rev_E=0.0,
    e_rev_I=-80.0,
    tau_syn_E=0.2,
    tau_syn_I=2.0,
    i_offset=0.0,
    v_thresh=0.0,
)Single-compartment Hodgkin-Huxley-type neuron with transient sodium and delayed-rectifier potassium currents using the ion channel models from Traub.
The ODEs for n, m, h and v are solved using the midpoint method, while the conductances g_exc and g_inh are solved using the exponential Euler method.
Equivalent code:
HH_cond_exp = Neuron(
    parameters = dict(
        gbar_Na = 20.0
        gbar_K = 6.0
        gleak = 0.01
        cm = 0.2 
        v_offset = -63.0 
        e_rev_Na = 50.0
        e_rev_K = -90.0 
        e_rev_leak = -65.0
        e_rev_E = 0.0
        e_rev_I = -80.0 
        tau_syn_E = 0.2
        tau_syn_I = 2.0
        i_offset = 0.0
        v_thresh = 0.0
    ), 
    equations = [
        # Previous membrane potential
        'prev_v = v',
        # Voltage-dependent rate constants
        'an = 0.032 * (15.0 - v + v_offset) / (exp((15.0 - v + v_offset)/5.0) - 1.0)',
        'am = 0.32  * (13.0 - v + v_offset) / (exp((13.0 - v + v_offset)/4.0) - 1.0)',
        'ah = 0.128 * exp((17.0 - v + v_offset)/18.0)',
        'bn = 0.5   * exp ((10.0 - v + v_offset)/40.0)',
        'bm = 0.28  * (v - v_offset - 40.0) / (exp((v - v_offset - 40.0)/5.0) - 1.0)',
        'bh = 4.0/(1.0 + exp (( 10.0 - v + v_offset )) )',
        # Activation variables
        ann.Variable('dn/dt = an * (1.0 - n) - bn * n', init = 0.0, method="exponential")
        ann.Variable('dm/dt = am * (1.0 - m) - bm * m', init = 0.0, method="exponential")
        ann.Variable('dh/dt = ah * (1.0 - h) - bh * h', init = 1.0, method="exponential")
        # Membrane equation
        ann.Variable('cm * dv/dt = gleak*(e_rev_leak -v) + gbar_K * n**4 * (e_rev_K - v) + gbar_Na * m**3 * h * (e_rev_Na - v)
                        + g_exc * (e_rev_E - v) + g_inh * (e_rev_I - v) + i_offset', method="exponential", init=-65.0),
        # Exponentially-decaying conductances
        ann.Variable('tau_syn_E * dg_exc/dt = - g_exc', method="exponential")
        ann.Variable('tau_syn_I * dg_inh/dt = - g_inh', method="exponential")
    ],
    spike = "(v > v_thresh) and (prev_v <= v_thresh)",
    reset = ""
)Parameters
| Name | Type | Description | Default | 
|---|---|---|---|
| gbar_Na | Maximal conductance of the Sodium current. | 20.0 | 
|
| gbar_K | Maximal conductance of the Potassium current. | 6.0 | 
|
| gleak | Conductance of the leak current (nF) | 0.01 | 
|
| cm | Capacity of the membrane (nF) | 0.2 | 
|
| v_offset | Threshold for the rate constants (mV) | -63.0 | 
|
| e_rev_Na | Reversal potential for the Sodium current (mV) | 50.0 | 
|
| e_rev_K | Reversal potential for the Potassium current (mV) | -90.0 | 
|
| e_rev_leak | Reversal potential for the leak current (mV) | -65.0 | 
|
| e_rev_E | Reversal potential for excitatory input (mV) | 0.0 | 
|
| e_rev_I | Reversal potential for inhibitory input (mV) | -80.0 | 
|
| tau_syn_E | Decay time of excitatory synaptic current (ms) | 0.2 | 
|
| tau_syn_I | Decay time of inhibitory synaptic current (ms) | 2.0 | 
|
| i_offset | Offset current (nA) | 0.0 | 
|
| v_thresh | Threshold for spike emission | 0.0 |