How can I improve the voltage resolution of my simulations.
Using a step size of 25 usec I often get same voltage values for a period of 250usec at a stretch. I want resolution on the scale of 25usec.
plz help
Rishabh
Improving voltage resolution
Re: Improving voltage resolution
Could you provide a minimal, stand-alone hoc sample that will reproduce the behaviour that you describe? There are many reasons why you might get "the same voltage values", it's hard to tell without looking at the concrete code.rishabh wrote:How can I improve the voltage resolution of my simulations.
Using a step size of 25 usec I often get same voltage values for a period of 250usec at a stretch. I want resolution on the scale of 25usec.
Christoph
code used in my simulations
Its a single compartment WB cell model containing Na and Kdr channels.
The stimulating current clamp values = 1000 = 1uA/cm2
Not sending details of WB cell template
*************************************************************
load_file("nrngui.hoc")
load_file("WBCell.tem")
objref c, apc, apcvec
objref filvol,filfI,matvol,matfI
proc insertAPC(){
c.soma apc = new APCount(0.5)
apcvec = new Vector()
apc.thresh = -30
apc.record(apcvec)
}
objref rec[2]
for(i=0;i<2;i=i+1){
rec= new Vector()
}
matvol = new Matrix()
filvol = new File()
dt = 0.025
tstop = 2500
stamp = 1000
stdur = 10
stdelay = 1000
filvol.aopen("WB1micro.dat")
c = new WBCell(stamp,stdur,stdelay,1,1)
insertAPC()
rec[0].record(&t)
rec[1].record(&c.soma.v(0.5))
run()
matvol.resize(rec[0].size(),2)
matvol.setcol(0,rec[0])
matvol.setcol(1,rec[1])
matvol.fprint(filvol)
filvol.close()
*************************************************************
Thanx
Rishabh
The stimulating current clamp values = 1000 = 1uA/cm2
Not sending details of WB cell template
*************************************************************
load_file("nrngui.hoc")
load_file("WBCell.tem")
objref c, apc, apcvec
objref filvol,filfI,matvol,matfI
proc insertAPC(){
c.soma apc = new APCount(0.5)
apcvec = new Vector()
apc.thresh = -30
apc.record(apcvec)
}
objref rec[2]
for(i=0;i<2;i=i+1){
rec= new Vector()
}
matvol = new Matrix()
filvol = new File()
dt = 0.025
tstop = 2500
stamp = 1000
stdur = 10
stdelay = 1000
filvol.aopen("WB1micro.dat")
c = new WBCell(stamp,stdur,stdelay,1,1)
insertAPC()
rec[0].record(&t)
rec[1].record(&c.soma.v(0.5))
run()
matvol.resize(rec[0].size(),2)
matvol.setcol(0,rec[0])
matvol.setcol(1,rec[1])
matvol.fprint(filvol)
filvol.close()
*************************************************************
Thanx
Rishabh
Re: code used in my simulations
I have to admit that I had great problems making the File class produce formatted output using format specifiers such as "%.4f" or similar on my system. It always resulted in some truncation errors. The same may have happened to you, which might explain why there were sudden "jumps" in time. Look at the first column of your file ("WB1micro.dat"): Does it show you the same time value in subsequent rows in later parts of your file? If so, a temporary, but inefficient workaround would be to fall back to the old-fashioned way of writing files. Try to write your file the following way:rishabh wrote:Code: Select all
matvol.fprint(filvol)
Code: Select all
load_file("nrngui.hoc")
load_file("WBCell.tem")
proc vec_fprint() {local i
fprint("%d\t%d\n",$o1.size(),2)
for i=0,$o1.size()-1 {
fprint("%.3f\t%.4f\n",i*dt,$o1.x[i])
}
}
objref c, apc, apcvec
objref filvol,filfI,matvol,matfI
proc insertAPC(){
c.soma apc = new APCount(0.5)
apcvec = new Vector()
apc.thresh = -30
apc.record(apcvec)
}
objref rec
rec = new Vector()
dt = 0.025
tstop = 2500
stamp = 1000
stdur = 10
stdelay = 1000
c = new WBCell(stamp,stdur,stdelay,1,1)
insertAPC()
rec.record(&c.soma.v(0.5))
run()
wopen("WB1micro.dat")
vec_fprint(rec)
wopen()
An additional remark: If stdelay specifies the delay in ms until the IClamp starts and your system is at rest at the beginning, you won't see any voltage change during the first 1000 ms.
Christoph
It worked ! It smooths out the graphs but the AP profile seems a bit incorrect to me. I will devise a better test for it. I am simulating a burst waveform, lets see how it looks.
And yes my data file has same time values in many rows ! Can one set the accuracy of the data in NEURON like one can do in C++ ?
And yes my data file has same time values in many rows ! Can one set the accuracy of the data in NEURON like one can do in C++ ?
I'm a bit puzzled: Did you use the code that I've posted above, but you still have the same time values in subsequent rows? That would be strange.rishabh wrote:And yes my data file has same time values in many rows !
If you refer to the purely C++ standard I/O manipulators which are defined in <iomanip>, such as setprecision() and setwidth(): No, not to my knowledge. If you refer to the stdio printf() function: I've just used the syntax in the code I've posted, it's in line 7:rishabh wrote:Can one set the accuracy of the data in NEURON like one can do in C++ ?
Code: Select all
// ...
fprint("%.3f\t%.4f\n",i*dt,$o1.x[i])
// ...
http://www.neuron.yale.edu/neuron/stati ... tml#printf
As I mentioned in my earlier post, these format specifiers appear to be broken when used from within the class File on my system - and apparently on yours as well.
Christoph