How to solve acceleration of an object?