The compartmental model
Chapter 6.3
Python / NEURON demonstration
Imports:
from neuron import h, gui
import numpy as np
import matplotlib.pyplot as pltModel creation:
cells = {}
for i in range(3):
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))
cells[i] = {'soma': soma, 'dend': dend}
syns = [h.ExpSyn(cells[1]['dend'](0.5)), h.ExpSyn(cells[2]['dend'](0.5))]
netcons = [h.NetCon(cells[0]['soma'](0.5)._ref_v, syns[0], sec=cells[0]['soma']),
h.NetCon(cells[1]['soma'](0.5)._ref_v, syns[1], sec=cells[1]['soma'])]
for netcon in netcons:
netcon.weight[0] = 0.04
netcon.delay = 5
syn_ = h.ExpSyn(cells[0]['dend'](0.5))Stimulation:
Recording vectors:
Simulation parameters:
Simulating:
Plotting:
Results:

Last updated
Was this helpful?