I want to change same parameters of the model to define their range values which does not affect the AP.I want to see what happens to the model changing each parameter, having the AP shape fixed.
I don't understand what the sentence means. Changing a parameter will change the shape of the action potential.
I would like change some parameters (in this case tau of the synapse between two compartments) and plot on the same plot window, for each run, the membrane potential of the post synaptic compratment. I would like to save in different files the results of each run.
This is my code now
Code: Select all
objref somevarveclist, tveclist, glist
somevarveclist = new List()
tveclist = new List()
glist = new List()
//record data
objref vvec, tvec
tvec = new Vector()
tvec.record(&t) // record time
vvec = new Vector()
vvec.record(&POST.v(0.5))
strdef fname, prefix
prefix = "tau"
objref f1
f1 = new File()
proc savedata() {
sprint(fname, "%s%d.dat",prefix,i)
f1.wopen("fname")
f1.printf("t POST.v(0.5)\n")
f1.printf("%d\n",tvec.size())
for i=0,tvec.size()-1 {
f1.printf("%g %g\n", tvec.x(i), vvec.x(i))
}
f1.close()
print "Save response to file - Done."
}
obfunc newgraph() { localobj xtmp, ytmp, gtmp
ytmp = $o1.c // make copies of the data to be plotted
xtmp = $o2.c
somevarveclist.append(ytmp) // save these copies
tveclist.append(xtmp)
gtmp = new Graph() // plot them
ytmp.plot(gtmp,xtmp)
gtmp.exec_menu("View = plot")
return gtmp
}
proc init(){
forall finitialize(v)
if (cvode.active()) {
cvode.re_init()
} else {
fcurrent()
}
}
proc batrun() { local i, gsaved
access POST
gsaved = synE.tau //but I would like to vary ncle.weight
for i = 1,$1 { //5 run
synE.tau = i*$2 //0.01 incremento
print synE.tau
run()
savedata()
glist.append(newgraph(vvec, tvec))
synE.tau = gsaved // restore original value
}
}
proc myrun() {
init()
batrun(5,0.01)
}
myrun()
Secpon point: Now I get 5 different windows and only in the first one I have values displayed. How could I save at each run the vvec and hold on the same plot?
Final point:
I tryed to change the NetCon weight ncle.weight so defined:
Code: Select all
objref ncle
ncle=new List()
objectvar synE
POST synE = new ExpSyn(0.5)
PRE ncle.append(new NetCon(&v(1), synE, -40, 0, 0.05))
Thanks for your help
Menica