I also came across this problem regarding the "Vector.record(&var, Dt)" as I need to record data and the corresponding time vector at a lower resolution than the actual simulation is running but I'm relying on a constant temporal resolution. I tried to understand where the roundoff error comes from in order to be using "safe" values for both dt and Dt but I at the moment this is not clear to me (given the description in the Programmer's Reference).
Ted, you mentioned in the previous post that dt must have a finite representation in base 2 (meaning dt=2^x right?) but is this also true for Dt? Moreover, I noticed that even when dt and Dt are the same, for instance dt=Dt=0.1 the recorded time vector will have multiple values of some time points.. The below code reproduces the problem ( t=0.5 and 8.4 ms occur twice ):
Code: Select all
dt = 0.1
Dt = 0.1
objref vec
vec = new Vector()
vec.record(&t, Dt)
proc run_simulation() {
tstop = $1
finitialize()
while (t<tstop) {
fadvance()
}
}
run_simulation(100)
for i=1,99 {
print vec.x[i]
}