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.
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.