So we have a portion of the code attached below (couldn't fit the rest), that works both on a Mac and a Windows computer.
However with, stim.amp = 0.2 it creates a spike surpassing threshold on the Windows computer but on the Mac we have to raise the amplitude to 0.4 in order to record a spike (completely different pattern though).
Any advice on how to keep the program working consistently between computers?
Kind Regards,
Laura Dovek
Code: Select all
endtemplate SemilunarGranuleCell
for i=0, nsgccell-1 {SGCcell[i] = new SemilunarGranuleCell(i)}
objref stim
SGCcell[0].soma stim = new Izap(0.5)
stim.del = 100
stim.dur = 3000
stim.f0 = 2
stim.f1 = 100
stim.amp = 0.2
objref VmT
objref VmMat[2]
VmT = new Vector()
for i=0,0 {
VmMat[i] = new Vector()
}
proc VecMx() { local i
VmT.append(t)
for i=0,0 {
VmMat[i].append( SGCcell[i].soma.v(0.5))
}
}
objref Spike[2]
for i=0,0 {
Spike[i] = new Vector()
}
strdef Spkstr
objref dfile
dfile = new File()
proc SpkMx() { local i, j
k = 0
for i=0,0 {
Spike[i].spikebin(VmMat[i], 0)
}
dfile.wopen("sgcspike.txt")
while(k < VmT.size) {
for j = 0,0 {
if(Spike[j].x[k] != 0) {
dfile.printf("%f\t%d\n", VmT.x[k], j)}
}
k +=1 }
dfile.close("sgcspike.txt")
}
strdef strmat
objref efile
efile = new File()
efile.wopen("SGCMempot.txt")
efile.printf("t\t")
for i = 0, 0 {
efile.printf("%s\t", SGCcell[i])}
efile.printf("\n")
efile.close("SGCMempot.txt")
proc sMatrix(){ local i
efile.aopen("SGCMempot.txt")
efile.printf("%f\t", t)
for i = 0, 0 {
efile.printf("%f\t", SGCcell[i].soma.v(0.5))}
efile.printf("\n")
efile.close("SGCMempot.txt")
}
objref VmT
objref VmMat[nsgccell]
VmT = new Vector()
for i=0, 0{
VmMat[i] = new Vector()
}
proc VecMx() { local i
VmT.append(t)
for i=0, 0{
VmMat[i].append( SGCcell[i].soma.v(0.5))
}
}
proc init() { local dtsav, temp, secsav
finitialize(v_init)
t = -1000
dtsav = dt
secondorder =0
dt= 10
// if cvode is on, turn it off to do large fixed step
temp= cvode.active()
if (temp!=0) {cvode.active(0)}
while(t<-100) { fadvance() print t}
//restore cvode if reqd
if (temp!=0) {cvode.active(1)}
dt = dtsav
secondorder =2
t = 0
if (cvode.active()){
cvode.re_init()
}else{
fcurrent()
}
//frecord_init()
}
proc continuerun() {local rt
eventcount =0
eventslow =1
stoprun =0
if (using_cvode_) {
cvode.event($1)
}
while(t < $1 && stoprun == 0) {
step()
sMatrix()
//gMatrix()
VecMx()
rt = stopsw()
if (rt > realtime) {
realtime = rt
if (!stdrun_quiet) fastflushPlot()
doNotify()
if (realtime == 2 && eventcount > 50) {
eventslow = int(eventcount/50)+1
}
eventcount = 0
}else{
eventcount = eventcount +1
if ((eventcount%eventslow) == 0) {
doEvents()
}
}
}
flushPlot()
}
objectvar save_window_, rvp_
objectvar scene_vector_[4]
objectvar ocbox_, ocbox_list_, scene_, scene_list_
{ocbox_list_ = new List() scene_list_ = new List()}
{
xpanel("RunControl", 0)
v_init = -60
xvalue("Init","v_init", 1,"stdinit()", 1, 1 )
xbutton("Init & Run","run()")
xbutton("Stop","stoprun=1")
runStopAt = 5
xvalue("Continue til","runStopAt", 1,"{continuerun(runStopAt) stoprun=1}", 1, 1 )
runStopIn = 1
xvalue("Continue for","runStopIn", 1,"{continuerun(t + runStopIn) stoprun=1}", 1, 1 )
xbutton("Single Step","steprun()")
t = 0
xvalue("t","t", 2 )
tstop = 3200 //1500
xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 )
dt = 0.1
xvalue("dt","dt", 1,"setdt()", 0, 1 )
steps_per_ms = 10 //40
xvalue("Points plotted/ms","steps_per_ms", 1,"setdt()", 0, 1 )
xpanel(544,121)
}
{
save_window_ = new Graph(0)
save_window_.size(0,tstop,-80,40)
scene_vector_[2] = save_window_
{save_window_.view(0, -80, tstop, 120, 290, 470, 579.84, 208)}
graphList[0].append(save_window_)
save_window_.save_name("graphList[0].")
//save_window_.addexpr("SGCcell[1].soma.v(0.5)",1,1)
save_window_.addexpr("SGCcell[0].soma.v(0.5)",2,1)
save_window_.addexpr("Izap[0].i",3,1)
}
save_window_ = new Graph(0)
save_window_.size(0,1000,-2,2)
scene_vector_[3] = save_window_
{save_window_.view(0, -80, tstop, 120, 290, 470, 579.84, 208)}
graphList[1].append(save_window_)
save_window_.save_name("graphList[1].")
save_window_.addexpr("Izap[0].i",3,1)
proc rrun(){
//initSGCcell()
run()
SpkMx()
}
rrun()
objectvar scene_vector_[1]
{doNotify()}