I am trying to add some Exp2Syn synapses driven by a NetStim to my model, but I am having difficulty getting them going. My synapses at this point don't do anything (that is, syn.i is always 0)
Here is my code:
Code: Select all
load_file("nrngui.hoc")
pi = 3.1415926535
create axon
axon {
pt3dclear()
pt3dadd(0, 0, 0, 5)
pt3dadd(100, 0, 0, 5)
insert pas
insert extracellular
}
objref syn[10], nc[10], ns
objref synapse_location_file
synapse_location_file = new File()
synapse_location_file.wopen("synapse_locs.dat")
axon ns = new NetStim(0.5)
ns.interval = 10
ns.start = 10
ns.noise = 0
ns.number = 10000000
for i=0,9 {
axon syn[i] = new Exp2Syn(0.5)
syn[i].tau1 = 0.2
syn[i].tau2 = 2
syn[i].e = 0
axon nc[i] = new NetCon(ns, syn[i])
nc[i].weight = 0.004
nc[i].delay = 0
}
synapse_location_file.close()
objref syncurr_output, imembrane_output
syncurr_output = new File()
imembrane_output = new File()
syncurr_output.wopen("syncurr.dat")
imembrane_output.wopen("imembrane.dat")
proc doOutput() {
syncurr_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, syn[0].i, syn[2].i, syn[4].i, syn[6].i, syn[8].i)
axon {
imembrane_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, (i_membrane(0.1) * area(0.1)), (i_membrane(0.3) * area(0.3)), (i_membrane(0.5) * area(0.5)), (i_membrane(0.7) * area(0.7)), (i_membrane(0.9) * area(0.9)))
}
}
dt = 0.01
Tstop = 1000
proc run() {
fcurrent()
printf("Starting!\n")
while (t <= Tstop) {
fadvance()
doOutput()
}
printf("Complete!\n")
}
run()
syncurr_output.close()
imembrane_output.close()
I would appreciate anyone's help on this matter.