Imagine you are a spacecraft moving towards a position and you start out with zero relative velocity. You accelerate towards it, then halfway there you start accelerating in the opposite direction so that when you arrive your relative velocity is zero. How do you generalize this concept to account for when your relative velocity is not zero? Given a starting velocity, how do I determine what direction to accelerate towards in this instant in order to arrive at my target with zero velocity?
Edit: this is my failed attempt at doing this with the displacement equation
I tried using the determinant of the acceleration/velocity equation solved for t, as if the determinant is negative then there will be no real values for distance=0 since the spacecraft will never arrive. So if the determinant is positive even when we calculate it assuming a negative acceleration, that means we should accelerate in the negative direction because we will still arrive there (we may still overshoot, but accelerating in the negative direction is the best we can do).
Here's what I'm describing in pseudocode
displacement = velocity * time + 1/2 * acceleration * time^2
a = -1/2 * acceleration (the maximum amount we can accelerate in the opposite direction) b = velocity c = -displacement
determinant = b^2 - 4ac
if determinant is positive, accelerate in the negative direction else accelerate in the positive direction
But this doesn't appear to be correct at all, I don't think I understand the implication of the determinant correctly.
t*v0 + t/2*a^2
until you hit the turning point. After the turning point (call itt0
), your velocity is your velocity at the turning pointt0*v0 + t0/2*a^2
minusa*t
. I think you have enough simultaneous equations to find a unique solution. $\endgroup$