Ejemplo n.º 1
0
def test_twocomp(sim):
    """Pass a simulation object as parameter"""
    spine_area_mult = 2.0
    cell = moose.Cell('mycell', sim.model)
    soma = MyCompartment('soma', cell)
    soma.length = 20e-6
    soma.diameter = 2 * 7.5e-6
    soma.Em = -65e-3
    soma.initVm = -65e-3
    soma.setSpecificCm(9e-3)
    soma.setSpecificRm(5.0)
    soma.setSpecificRa(2.5)
    
    dend = MyCompartment('dend', cell)
    dend.length = 40e-6
    dend.diameter = 2 * 1.06e-6
    dend.Em = -65e-3
    dend.initVm = -65e-3
    dend.setSpecificCm(9e-3 * spine_area_mult)
    dend.setSpecificRm(5.0 / spine_area_mult)
    dend.setSpecificRa(2.5)
    soma.traubConnect(dend)
    vm_table = dend.insertRecorder("Vm1", "Vm", sim.data)
    dend.insertPulseGen("pulsegen1", sim.model, firstLevel=3e-10, firstDelay=20e-3, firstWidth=100e-3)
#     sim.schedule()
#     sim.run(100e-3)
#     sim.dump_data("data")
    return cell
Ejemplo n.º 2
0
import moose
import config
from cell import *
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')