Discrepancy between tvec and vector
Posted: Tue May 11, 2021 8:38 am
I hope this is something minor that I'm missing, but I've noticed a weird discrepancy between my tvec and a voltage vector when I need 1:1 correspondence, but only depending on the time step.
The program that I've written has a selectable time step as a parameter: 5us or 25us, and this is set pretty early in the program.
I declare my tvec like this:
tvec = new Vector()
tvec.indgen(0.000000, tstop, dt)
and I've verified after it's saved externally that it's correct for both the 5us and 25us case.
Then, I declare a list of voltage vectors...
obfunc recallv() { localobj tmplist, tmpvec
tmplist = new List()
forall for (x,0) {
tmpvec = new Vector()
tmpvec.record(&v(x), tvec)
tmplist.append(tmpvec)
}
return tmplist
}
For the 5us case, it works - my test case for a 10ms run has 2001 lines in the tvec and 2001 lines in the voltage trace.
For the 25us case, however, I have 401 lines in the tvec output and only 400 in the voltage trace. As minor as it is, I don't want to publish code with an off-by-one error.
Any thoughts on what could be happening here?
The program that I've written has a selectable time step as a parameter: 5us or 25us, and this is set pretty early in the program.
I declare my tvec like this:
tvec = new Vector()
tvec.indgen(0.000000, tstop, dt)
and I've verified after it's saved externally that it's correct for both the 5us and 25us case.
Then, I declare a list of voltage vectors...
obfunc recallv() { localobj tmplist, tmpvec
tmplist = new List()
forall for (x,0) {
tmpvec = new Vector()
tmpvec.record(&v(x), tvec)
tmplist.append(tmpvec)
}
return tmplist
}
For the 5us case, it works - my test case for a 10ms run has 2001 lines in the tvec and 2001 lines in the voltage trace.
For the 25us case, however, I have 401 lines in the tvec output and only 400 in the voltage trace. As minor as it is, I don't want to publish code with an off-by-one error.
Any thoughts on what could be happening here?