Calculation of acceleration and displacement