def makeChemProto(name): chem = moose.Neutral('/library/' + name) comptVol = diffLen * dendDia * dendDia * PI / 4.0 for i in (['dend', comptVol], ['spine', 1e-19], ['psd', 1e-20]): print(('making ', i)) compt = moose.CubeMesh(chem.path + '/' + i[0]) compt.volume = i[1] z = moose.Pool(compt.path + '/z') z.concInit = 0.0 z.diffConst = diffConst nInit = comptVol * 6e23 * concInit nstr = str(1 / nInit) x = moose.Pool(chem.path + '/dend/x') x.diffConst = diffConst func = moose.Function(x.path + '/func') func.expr = "-x0 * (0.3 - " + nstr + " * x0) * ( 1 - " + nstr + " * x0)" print((func.expr)) func.x.num = 1 moose.connect(x, 'nOut', func.x[0], 'input') moose.connect(func, 'valueOut', x, 'increment') z = moose.element('/library/' + name + '/dend/z') reac = moose.Reac('/library/' + name + '/dend/reac') reac.Kf = 1 reac.Kb = 10 moose.connect(reac, 'sub', x, 'reac') moose.connect(reac, 'prd', z, 'reac')
def makeCellProto(name): elec = moose.Neuron('/library/' + name) ecompt = [] soma = rd.buildCompt(elec, 'soma', dx=somaDia, dia=somaDia, x=-somaDia, RM=RM, RA=RA, CM=CM) dend = rd.buildCompt(elec, 'dend', dx=dendLen, dia=dendDia, x=0, RM=RM, RA=RA, CM=CM) moose.connect(soma, 'axial', dend, 'raxial') elec.buildSegmentTree()
def makePlot(name, srcVec, field): tab = moose.Table2('/graphs/' + name + 'Tab', len(srcVec)).vec for i in zip(srcVec, tab): moose.connect(i[1], 'requestOut', i[0], field) return tab