headmyshoulder/odeint-v2 — Issue #7: behavior of integrate_const
Author: mariomulansky
Created: 2012-02-08 17:01:21+00:00
State: open

the current implementation of integrate_const shows some weaknesses mainly due to the finite precision calculation of the time iteration.
as we now have integrate_n_steps function for all stepper types i propose to implement integrate_const by calling the integrate_n_steps with the following calculation of the the number of steps:

num_of_steps = static_cast< size_t >( floor( (t_end-t_start) / dt ) );

with such an implementation integrate_const will have the following properties:

* the observer is called at times 0 , dt , 2dt , 3dt , ... , n*dt with t_end-dt < n*dt <= t_end
* the final state is calculated at time n*dt ( which might be < t_end)

i think this is a reasonable behavior and can be implemented quickly from what is there already. some quick tests showed that floor( (t_end-t_start) / dt ) behaves definitely better than the current time+=dt implementation.