Action potential after-depolarization (ADP) in a single compartment


In [1]:
from neuron import h
h.load_file('stdrun.hoc')


Out[1]:
1.0

Create a single-compartment


In [2]:
soma = h.Section(name = 'soma')

In [3]:
# morphology
soma.L = 25.55
soma.diam = 25.55
soma.Ra = 125
# passive properties
soma.insert('pas')
soma.g_pas = 6.66667e-05
soma.e_pas = -89 # will be adjusted later accordingly

In [4]:
def mysimulation(tstop, v_init):
    """
    Simulates the membrane potential 
    
    Arguments:
    tstop  -- simulation time (i.e h.tstop)
    v_init -- starting potential (i.e h.v_init)
    
    Returns:
    time and voltage as NumPy arrays
    """
    h.tstop = tstop
    h.v_init = h.v_init
    
    voltage, time = h.Vector(), h.Vector()

    voltage.record( soma(0.5)._ref_v, sec=soma)
    time.record(h._ref_t)
    h.run()
    
    plt.plot( np.array(time), np.array(voltage) )

Calculate e_pas for soma


In [5]:
from CA3.utils import optimize_e_pas
h.v_init = -89
optimize_e_pas(mysec = soma) # should be -89 mV


Out[5]:
  status: 0
    nfev: 34
 success: True
     fun: 0.0
       x: array([-89.])
 message: 'Optimization terminated successfully.'
     nit: 17

In [6]:
soma.insert('hh')


Out[6]:
<nrn.Section at 0x46134b0>

In [7]:
optimize_e_pas(mysec = soma)


Out[7]:
  status: 0
    nfev: 50
 success: True
     fun: 2.0158971739401933e-13
       x: array([-245.26937943])
 message: 'Optimization terminated successfully.'
     nit: 25

Stimulation electrode


In [8]:
stim = h.IClamp(0.5, sec=soma)
stim.dur = 2
stim.amp = 0
stim.delay = 10

In [9]:
soma.e_pas = -245.26937943
stim.amp = 2

In [11]:
mysimulation(tstop = 50, v_init = -89.)



In [ ]: