headmyshoulder / odeint-v2

odeint - solving ordinary differential equations in c++ v2
http://headmyshoulder.github.com/odeint-v2/
Other
340 stars 101 forks source link

Bug in velocity-verlet #150

Closed mariomulansky closed 9 years ago

mariomulansky commented 9 years ago

There is possibly a bug in the velocity-verlet algorithm. In velocity-verlet.hpp, line 115:

algebra_stepper_base_type::m_algebra.for_each4(
            qout , qin , pin , ain ,
            typename operations_type::template scale_sum3< value_type , time_type , time_square_type >( one , one_half * dt , one * dt * dt ) );

it should be one * dt and one_half * dt * dt

headmyshoulder commented 9 years ago

Yeah, this is a bug. I will fix it.

On 29.01.2015 18:07, Mario Mulansky wrote:

There is possibly a bug in the velocity-verlet algorithm. In velocity-verlet.hpp, line 115:

algebra_stepper_base_type::m_algebra.for_each4( qout , qin , pin , ain , typename operations_type::template scale_sum3< value_type , time_type , time_square_type >( one , one_half * dt , one * dt * dt ) );

it should be |one * dt| and |one_half * dt * dt|

— Reply to this email directly or view it on GitHub https://github.com/headmyshoulder/odeint-v2/issues/150.

ddemidov commented 9 years ago

How serious is it? Should I rerun any experiments depending on velocity-verlet?

mariomulansky commented 9 years ago

probably :(

ddemidov commented 9 years ago

Thanks, good to know :)

headmyshoulder commented 9 years ago

Yes, you should :(

On 29.01.2015 18:22, Denis Demidov wrote:

How serious is it? Should I rerun any experiments depending on velocity-verlet?

— Reply to this email directly or view it on GitHub https://github.com/headmyshoulder/odeint-v2/issues/150#issuecomment-72065735.