compute speed and acceleration ​