The cable equation
Chapter 6.2
Read chapter 6.2
Python / NEURON demonstration
Imports:
from neuron import h, gui
import numpy as np
import matplotlib.pyplot as plt
Model definition (stick and ball):
soma = h.Section(name='soma')
soma.L = soma.diam = 12.6157 # [um]
soma.Ra = 100 # Axial resistance [Ohm * cm]
soma.cm = 1 # Membrane capacitance [uF / cm^2]
soma.insert('hh') # Insert active Hodgkin-Huxley current in the soma
soma.gnabar_hh = 0.12 # Sodium conductance [S/cm2]
soma.gkbar_hh = 0.036 # Potassium conductance [S/cm2]
soma.gl_hh = 0.0003 # Leak conductance [S/cm2]
soma.el_hh = -54.3 # Reversal potential [mV]
dend = h.Section(name='dend')
dend.L = 200 # [um]
dend.nseg = 101
dend.Ra = 100 # Axial resistance [Ohm * cm]
dend.cm = 1 # Membrane capacitance [uF / cm^2]
dend.diam = 1 # [um]
dend.insert('pas') # Insert passive current in the dendrite
dend.g_pas = 0.001 # Passive conductance [S/cm2]
dend.e_pas = -65 # Leak reversal potential [mV]
dend.connect(soma(1))
Stimulation:
stim = h.IClamp(dend(1))
stim.delay = 5
stim.dur = 1
stim_amp_array = [0.1, 0.3]
Recording vectors:
t_vec = h.Vector()
t_vec.record(h._ref_t)
soma_v_vec = h.Vector()
soma_v_vec.record(soma(0.5)._ref_v)
dend_v_vec_array = []
string_array = []
for i in np.flip(np.linspace(0, dend.L, 6)):
dend_v_vec = h.Vector()
string_array.append('{} %'.format(100*(i/dend.L)))
dend_v_vec.record(dend(i/dend.L)._ref_v)
dend_v_vec_array.append(dend_v_vec)
Simulation parameters:
simdur = 25.0
h.tstop = simdur
Simulating:
for s in stim_amp_array:
stim.amp = s
h.run()
Plotting:
plt.figure(figsize=(10,5))
cmap = plt.get_cmap('Blues')
colors = cmap(np.linspace(0,1,len(dend_v_vec_array) * 2))
plt.figure(figsize=(8,4))
plt.plot(t_vec, dend_v_vec_array[0], label='dendrite @ {}'.format(string_array[0]), linewidth = 3, color = colors[-1])
for i,v in enumerate(dend_v_vec_array[1:]):
plt.plot(t_vec, v, label='dendrite @ {}'.format(string_array[i+1]), color = colors[len(colors)-2-i])
plt.plot(t_vec, soma_v_vec, label='soma', color = 'red', linewidth=3)
plt.title("Cable Equation", fontSize=15)
plt.xlim([5,11])
plt.xlabel('Time (ms)', fontSize=15)
plt.ylabel("Membrane Potential (mV)", fontSize=15)
plt.legend()
plt.show()
h("forall {delete_section()}")
Resulted below threshold dynamic:
Resulted above threshold dynamic:
Modeling for various resulutions:
from neuron import h, gui
import numpy as np
import matplotlib.pyplot as plt
soma = h.Section(name='soma')
soma.L = soma.diam = 12.6157 # [um]
soma.Ra = 100 # Axial resistance [Ohm * cm]
soma.cm = 1 # Membrane capacitance [uF / cm^2]
soma.insert('hh') # Insert active Hodgkin-Huxley current in the soma
soma.gnabar_hh = 0.12 # Sodium conductance [S/cm2]
soma.gkbar_hh = 0.036 # Potassium conductance [S/cm2]
soma.gl_hh = 0.0003 # Leak conductance [S/cm2]
soma.el_hh = -54.3 # Reversal potential [mV]
dend = h.Section(name='dend')
dend.L = 200 # [um]
dend.Ra = 100 # Axial resistance [Ohm * cm]
dend.cm = 1 # Membrane capacitance [uF / cm^2]
dend.diam = 1 # [um]
dend.insert('pas') # Insert passive current in the dendrite
dend.g_pas = 0.001 # Passive conductance [S/cm2]
dend.e_pas = -65 # Leak reversal potential [mV]
dend.connect(soma(1))
stim = h.IClamp(dend(1))
stim.delay = 5
stim.dur = 1
stim.amp = 0.3
resolution_array = [2 , 4, 10]
t_vec = h.Vector()
t_vec.record(h._ref_t)
soma_v_vec = h.Vector()
soma_v_vec.record(soma(0.5)._ref_v)
dend_v_vec = h.Vector()
dend_v_vec.record(dend(1)._ref_v)
simdur = 25.0
h.tstop = simdur
plt.figure(figsize=(10,5))
line_types = [':', '--', '-']
for i, r in enumerate(resolution_array):
dend.nseg = r
h.run()
plt.plot(t_vec, dend_v_vec, label='dendrite with {} partitions'.format(r), color = 'black', linewidth = 3, linestyle=line_types[i])
plt.plot(t_vec, soma_v_vec, label='soma', color = 'red', linewidth=3, linestyle=line_types[i])
plt.title("Cable Equation", fontSize=15)
plt.xlim([5,11])
plt.xlabel('Time (ms)', fontSize=15)
plt.ylabel("Membrane Potential (mV)", fontSize=15)
plt.legend()
plt.show()
h("forall {delete_section()}")
Results:
Last updated