0
$\begingroup$

I have an acceleration function in python with position and time parameters and returns the acceleration value.

I need the end velocity at a position ,start velocity is zero.

how to calculate this problem?

$\endgroup$
1

1 Answer 1

1
$\begingroup$

Velocity $\vec v(\vec r,t)$ is the integral of acceleration $\vec a(\vec r, t)$ with respect to time, and position $\vec r(t)$ is the integral of velocity with respect to time. So if the object starts at the origin with velocity zero then at time $t$

$\vec v(\vec r(t) ,t) = \int_0^t \vec a(\vec r(t), t) dt \\ \vec r(t) = \int_0^t \vec v(\vec r(t), t) dt$

Unless your acceleration function is something simple, the best you can do here is numerical integration. The simplest method of numerical integration is Euler's method. With this method, you take a small time step $\delta t$ and assume that velocity and acceleration are constant over that time step. Then you update position and velocity for the beginning of the next time step as follows:

$\vec r(t + \delta t) = \vec r(t) + \vec v(\vec r(t), t) \delta t \\\vec v(t + \delta t) = \vec v(t) + \vec a(\vec r(t), t) \delta t$

There are other methods of numerical integration which are more complicated, but give more accurate results.

$\endgroup$
1
  • $\begingroup$ Reversing the order of calculation (update velocity first, then update position using the updated velocity) does much better than basic Euler's method. The reason is that this reverse calculation is the simplest of symplectic integrators. $\endgroup$ Sep 14, 2020 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.