Code: Select all
dt = 0.2
tstop = 500
while (t<tstop) {
fadvance()}
dt = 0.02
tstop = 700
while (t<tstop) {
fadvance()
count+=1
Code: Select all
dt = 0.2
tstop = 500
while (t<tstop) {
fadvance()}
dt = 0.02
tstop = 700
while (t<tstop) {
fadvance()
count+=1
just the roundoff error? the default value of float_epsilon is 1e-11. Do you mean I cannot control the last recorded data point to be at 700 ms? I understand the second last point may be like 699.999999... . It is still smaller than 700, so the next time point close to 700.02 will be calculated. I knew this before, just did not realise it may cause problems even setting the float_epsilon to be 1e-11.ted wrote:Sounds like finite precision arithmetic and roundoff error. At a minimum read this:
viewtopic.php?f=8&t=1686&p=12613
Code: Select all
oc>x = 0
oc>for i=1,2500 x+=0.2
oc>x
500
oc>x-500
-1.9838353e-11
oc>x = 0
oc>for i=1,35000 x+=0.02
oc>x-700
-3.4663117e-10
got it.ted wrote:Got it now?Code: Select all
oc>x = 0 oc>for i=1,2500 x+=0.2 oc>x 500 oc>x-500 -1.9838353e-11 oc>x = 0 oc>for i=1,35000 x+=0.02 oc>x-700 -3.4663117e-10