# How do I find minimum constant deceleration so that object does not pass distance d in time t?

I'm working on a problem for an online judge site. I've boiled down the problem to this calculation: given a vehicle with an initial velocity $v$, how can one calculate the minimum constant deceleration $a$ required to make sure the vehicle does not travel more than distance $d$ by time $t$? The constant deceleration is always applied until the vehicle either stops or reaches distance $d$. Stopping the vehicle at distance $d$ is allowed, if no other deceleration $a$ exists that slows the vehicle just enough so that it does not reach distance $d$ until time $t$. I tried starting with

$$d = vt - \frac{at^2}{2}$$

and solving for $a$, giving $a = 2\frac{vt - d}{t^2}$ but that doesn't work by itself since it allows for the vehicle to extend past $d$ and return to it by going backwards (negative velocity), which violates the requirement that the vehicle not pass distance $d$ until time $t$.

So I applied $v = v_0 - at$ to calculate the maximum constant deceleration $a$ that produces non-negative final velocity at time $t$: $a \le \frac{v_0}{t}$. And if the calculation above exceeds this maximm deceleration then I apply the stopping distance deceleration formula: $a = \frac{v^2}{2d}$ (it's ok that this doesn't take exactly time $t$).

But my intuition tells me there should be some cases where the vehicle can be slowed without stopping it using constant deceleration over distance $d$, but I'm not seeing how to apply the suvat equations to do this. Maybe there is no way unless $\frac{v}{t} = 2\frac{vt - d}{t^2}$?

-
So why isn't $a = 2\frac{vt - d}{t^2}$ work again? Once $v-a t$ becomes zero then $a=0$ and the thing stands still. –  ja72 Nov 2 '12 at 16:52
@ja72 well $v$ would be zero in that case, but not $a$. –  David Z Nov 2 '12 at 17:33
@DavidZaslavsky, that's how braking (friction) works. With zero speed you get zero deceleration. –  ja72 Nov 2 '12 at 21:21
@ja72 yes, but this problem doesn't say that the deceleration is caused by friction. Though I see now that it does say the deceleration is applied until the vehicle stops; I missed that earlier. –  David Z Nov 2 '12 at 21:27
Yes the deceleration is due to friction. Actually I think $a=2\frac{vt-d}{t^2}$ combined with the check for non-negative final velocity (and if it is negative then just apply the deceleration that stops right at $d$). But I'm still having issues getting the problem judged as correct so I wanted to see if this is a correct approach or if I was missing something. –  Bogatyr Nov 2 '12 at 21:38

Lets call your maximum time and distance to stop $T$ and $D$. If your vehicle is moving with speed $v_0$ and you apply a constant deceleration $a$, it will stop after a time $t = v_0 / a$, having traveled a distance $d=\frac{1}{2}v_0^2/a$.

Divide those two equations, and you can relate stopping time, distance and starting velocity as $d/t = v_0 / 2$, or $d = v_0 t / 2$.

You can have three different situations with your $T$, $D$ and $v_0$:

• if $D = v_0 T / 2$ then all works out nicely, and you can use any of the two formulas from the previous paragraph to calculate the acceleration that will have you stop at the right time and distance.
• if $D > v_0 T / 2$ then the acceleration that would have you stop at a distance $D$ is larger than the one that would have you atop after a time $T$, so you need to use the distance equation.
• if $D < v_0 T / 2$ then the opposite is true, and you need to use the time equation.

I think the above conditions can be summarized quite nicely in a $t-d$ graph, if you can't make sense of the above, let me know and I'll edit the answer to include it.

-
Note that stopping is not a requirement -- just that after time $T$, the vehicle has not travelled past $D$, using minimal constant deceleration $a$. Stopping is an option if just slowing doesn't work out. –  Bogatyr Nov 3 '12 at 3:08
please update your answer to include the notion that stopping is not a requirement. thanks! –  Bogatyr Nov 6 '12 at 18:58

It turns out my approach was correct, but I had different errors preventing acceptance of my solution. To summarize:

• Calculate the maximum constant deceleration $a$ that can be applied for time $t$ that results in non-negative final velocity: $a_{max}=\frac{v_0}{t}$. This is needed because the next equation does not take into account decleration that stops at velocity 0 (deceleration due to friction)

• Calculate the slowing (might be stopping) decleration that places the vehicle at distance $d$ at time $t$: $a_{slow} = 2\frac{v_0t-d}{t^2}$

• if $a_{slow} > a_{max}$, then applying $a_{slow}$ causes the vehicle to exceed distance $d$ before time $t$ (and to go "in reverse" back to $d$) -- use $a_{stop} = \frac{v_0^2}{2d}$, else use $a_{slow}$