I use the code on page 277 of the Neuron Book. (ExpSyn1). The mod file compiles without any error. However when I try to use the ExpSyn1 in a hoc code I get an error stating that ExpSyn1 is not a template. Any idea what this error means and how I can correct it. Bellow is the ExpSyn1.mod code followed by the hoc code.
The mod cod
Code: Select all
:ExpSyn1
NEURON {
POINT_PROCESS ExpSyn1
RANGE e,i,weight
NONSPECIFIC_CURRENT i
}
PARAMETER{
tau=0.1
e=0 (millivolt)
weight=0.1
}
ASSIGNED {
v (millivolt)
i (nanoamp)
}
STATE { g (microsiemens)
}
INITIAL {g=0}
BREAKPOINT {
SOLVE state METHOD cnexp
i=g*(v-e)
}
DERIVATIVE state {g'=-g/tau}
NET_RECEIVE (weight (microsiemens)){
g=g+weight
}
The hoc code
Code: Select all
// test of ExpSyn1 page 277 The NEURON book
begintemplate testcell
public soma,dend,netconlist
create soma, dend[2]
objref netconlist
proc init() {
create soma
netconlist= new List()
soma{
nseg=1
L=15
diam=15
Ra=150
insert hh
gnabar_hh=0.25
gl_hh = .0001666
gel_hh = -60.0
}
dend[0]{
nseg=21
L=300
diam=1
insert pas
}
dend[1]{
nseg=21
L=300
diam=1
insert pas
}
connect dend[0](0), soma(0)
connect dend[1](0), soma(1)
}
endtemplate testcell
objref source
source= new testcell()
objref dest
dest= new testcell()
tstop = 200
objref stim
source.soma {
stim= new IClamp(0.5)
stim.del=20
stim.dur =100
stim.amp = 0.2
}
//create two different types of synapses
nsyn=2
objectvar syn[nsyn]
/*
AMAP like synapse on dend 0
dest.dend[0] syn[0] = new ExpSyn(0)
syn[0].tau=3
syn[0].e=0
*/
dest.dend[0] syn[0] = new ExpSyn1(0)
// NMDA type synapse
dest.dend[1] syn[1] = new Exp2Syn(0)
syn[1].tau1=3
syn[1].tau2=10
syn[1].e=0
//make connection by appending
source.soma dest.netconlist.append(new NetCon(&v(1),syn[0], -20,1,1.5))
source.soma dest.netconlist.append(new NetCon(&v(1),syn[1], -20,1,0.5))
access dest.soma
Note that if you uncomment codes related to ExpSyn the code works OK.
Mike