gk[channel].stepMode = 3 gk[channel].connect('inputRequest', chan, 'Gk') print chan.name, chan.Gbar if channel.startswith('K'): chan.Ek = EK elif channel.startswith('Na'): chan.Ek = ENa elif channel.startswith('Ca'): chan.Ek = ECa elif channel.startswith('AR'): chan.Ek = EAR # chan.X = 0.25 else: print 'Error: unknown channel', channel soma.insertCaPool(5.2e-6 / 2e-10, 50e-3) vm_table = soma.insertRecorder('Vm', 'Vm', sim.data) soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=20.0e-3, firstWidth=1e3) print 'Rm:', soma.Rm print 'Cm:', soma.Cm, print 'Em:', soma.Em gk_naf2_table = moose.Table('Gk_NaF2', sim.data) gk_naf2_table.stepMode = 3 chan = moose.HHChannel(soma.path + '/NaF2') print chan.Gbar, chan.Ek chan.connect('Gk', gk_naf2_table, 'inputRequest') sim.schedule()
from capool import CaPool from compartment import MyCompartment from simulation import Simulation sim = Simulation() cell = moose.Cell('cell', sim.model) soma = MyCompartment('soma', cell) soma.diameter = 16e-6 soma.length = 15e-6 soma.Em = -70e-3 soma.initVm = -65e-3 soma.setSpecificRm(5.0) soma.setSpecificRa(2.5) soma.setSpecificCm(9e-3) soma.insertChannel('NaF', specificGbar=1875.0, Ek=50e-3, shift=-3.5e-3) soma.insertChannel('CaL', specificGbar=10.0, Ek=125e-3) soma.insertCaPool(2600000.0, 100e-3) vmTable = soma.insertRecorder('Vm', 'Vm', sim.data) caTable = moose.Table('ca', sim.data) caTable.stepMode = 3 soma.ca_pool.connect('Ca', caTable, 'inputRequest') sim.schedule() sim.run(200e-3) sim.dump_data('data') from pylab import * mus_Ca = array(caTable) mus_data = loadtxt('data/Vm.plot') nrn_data = loadtxt('../nrn/mydata/Vm.plot') nrn_Vm = nrn_data[:,1] nrn_t = nrn_data[:,0] nrn_data = loadtxt('../nrn/mydata/Ca.plot')
gk[channel].stepMode = 3 gk[channel].connect('inputRequest', chan, 'Gk') print chan.name, chan.Gbar if channel.startswith('K'): chan.Ek = EK elif channel.startswith('Na'): chan.Ek = ENa elif channel.startswith('Ca'): chan.Ek = ECa elif channel.startswith('AR'): chan.Ek = EAR # chan.X = 0.25 else: print 'Error: unknown channel', channel soma.insertCaPool(5.2e-6 / 2e-10, 50e-3) vm_table = soma.insertRecorder('Vm', 'Vm', sim.data) soma.insertPulseGen('pulsegen', sim.model, firstLevel=3e-10, firstDelay=20.0e-3, firstWidth=1e3) print 'Rm:', soma.Rm print 'Cm:', soma.Cm, print 'Em:', soma.Em gk_naf2_table = moose.Table('Gk_NaF2', sim.data) gk_naf2_table.stepMode = 3 chan = moose.HHChannel(soma.path + '/NaF2') print chan.Gbar, chan.Ek chan.connect('Gk', gk_naf2_table, 'inputRequest') sim.schedule() config.context.useClock(0, sim.model.path + '/##') soma.useClock(1, 'init') for channel in soma.channels: channel.useClock(0)