Calculate acceleration knowing initial speed, required speed, and distance to cover

613 Views Asked by At

How to get the acceleration in m/s by knowing the initial speed, required speed and the distance by which this required speed is to be achieved.

Basically I am developing a car simulation program, and I want the car to match the speed of another car by the time it gets to it.

So for example my car is driving at speed 20m/s and there is a vehicle driving at 10m/s which is 100m away. What acceleration should I have to gradually change my speed so that by the time my car reaches the other car the speed of my car will be that of the other.

2

There are 2 best solutions below

8
On

In uniform acceleration motion: $$v(t)=v(0)+at$$ where $v(0)$ is the initial velocity and $a$ the acceleration (a constant).
Differenciate both sides by $t$: $$dv(t)=adt$$ Multiply both sides by $v(t)$ $$v(t) \cdot dv(t)=a\cdot v(t)dt=a\cdot dx(t)$$ where $x(t)$ denotes the displacement from $t=0$.
Integrate both sides $$v^2(t)-C=2a\cdot x(t)$$ where $C$ is the integral constant depending on the initial condition, and it is easy to find that $C=v^2 (0)$ to satisfy the initial condition.

3
On

Here a proof with only elemental algebra.

Let $v_1,s_1$ be the initial velocity and initial position of the first car, and $v_2,s_2$ those of the second car. The first car accelerate (or decelerate, depending on the particular situation) with a uniform acceleration $a$. The equation of motion for the first car is: $$ s=\dfrac{1}{2}at^2+v_1t+s_1 $$ and his velocity is $v=at+v_1$.

For the second car we have $$ s=v_2t+s_2 \qquad v=v_2 \qquad (constant) $$ So, the time when the two cars are in the same position is given by: $$ \dfrac{1}{2}at^2+v_1t+s_1=v_2t+s_2 $$ solving this equation we find: $$ t=\dfrac{v_2-v_1 \pm \sqrt{(v_1-v_2)^2-2a(s_1-s_2)}}{a} $$ Note that the discriminant can always be $>0$, choosing a suitable $a$, so the equation has real solutions whatever be the initial velocities and positions. Only we have to choose the solution with $t>0$ and this depend on initial velocities. Anyway, we are searching the time when the velocity $v=at+v_1$ of the first car is the same $v_2$ of the second, so we pose: $$ at+v_1=v_2 \Rightarrow v_2-v_1\pm \sqrt{(v_1-v_2)^2-2a(s_1-s_2)}+v_1=v_2 $$ So, simplifing and squaring we find the formula: $$ (v_1-v_2)^2=2a(s_1-s_2) \Rightarrow a=\dfrac{(v_1-v_2)^2}{2(s_1-s_2)} $$ that solve the problem.