-1
$\begingroup$

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.

$\endgroup$
7
  • $\begingroup$ If you're using Newtonian mechanics, it should be a simple math equation? $\endgroup$ Commented Jul 11, 2022 at 2:08
  • $\begingroup$ You mean from the displacement equation? I edited my post to include my attempt at this. $\endgroup$
    – halbe
    Commented Jul 11, 2022 at 2:40
  • $\begingroup$ Now consider that some object (a planet or moon) near your starting or ending point, or along your path, may exert forces on your spaceship as you travel. And that the mass of your ship reduces as you burn fuel. And you may not want to arrive with zero velocity, but with your velocity matched to some moving object at your destination. And you might want to minimize either the time or takes to get there, or the fuel you use doing it. You end up with a very complicated optimization problem, probably not something you can write a closed form solution for... unless you can simplify the problem... $\endgroup$
    – The Photon
    Commented Jul 11, 2022 at 4:36
  • $\begingroup$ Suppose there is no gravity worth that needs to be considered, I am minimizing time it takes to get there, the only force is my own acceleration, and the velocity is always relative to the target that I am moving towards (which should be 0 when I arrive). The goal here is to get an estimation. This will be continuously calculated along the trajectory, so I only have to know "should I accelerate towards or away" at any given instant, I don't have to map out the entire trajectory. $\endgroup$
    – halbe
    Commented Jul 11, 2022 at 5:36
  • $\begingroup$ Remember you have two formulas for s(t) (displacement). You start out with t*v0 + t/2*a^2 until you hit the turning point. After the turning point (call it t0), your velocity is your velocity at the turning point t0*v0 + t0/2*a^2 minus a*t. I think you have enough simultaneous equations to find a unique solution. $\endgroup$ Commented Jul 11, 2022 at 12:44

2 Answers 2

0
$\begingroup$

Assume you have constant acceleration of magnitude $g$ which is applied for a distance $x_C \geq \frac{\ell}{2} $ and then for the remaining distance $\ell- x_C$ the acceleration is reversed.

$$ a(x) = g \;\mathrm{sign}( \frac{x_C - x}{\ell} ) $$

where $\rm sign()$ is a function that returns $+1$ for positive argument and $-1$ for negative argument.

The velocity profile of the above acceleration is found from $ \tfrac{1}{2} v^2 = \int a(x)\,{\rm d}x $ and is is

$$ v(x) = \sqrt{ 2 g \left( x_C - | x-x_C| \right) } $$

where $|\,|$ is the absolute value. To hit the target of final velocity $v(\ell) = v_F$ the point of thrust reversal must be at

$$ x_C = \frac{\ell}{2} + \frac{v_F^2}{4 g} $$

Finally the time needed to reach distance $x$ is found with $t = \int \frac{1}{v}\,{\rm d}{x}$ or in this case

$$ t(x) = \frac{x_C}{g} - \frac{ | x - x_C |}{g} $$

Giving the final travel time of $t_F = \frac{x_C}{g} - \frac{L-x_C}{g} $


In general, you go from a velocity profile $v(x)$ to acceleration with $a(x) = v(x) \tfrac{\rm d}{{\rm d}x} v(x)$.

Here is a list of some of the direct integrals you can do with varying accelerations

  • Acceleration as a function of speed $$ t = \int \frac{1}{a}\,{\rm d}v + C $$ $$ x = \int \frac{v}{a}\,{\rm d}v + C$$
  • Acceleration as a function of distance $$ \tfrac{1}{2}v^2 = \int a\,{\rm d}x + C$$ $$ t = \int \frac{1}{v}\,{\rm d}x + C$$
$\endgroup$
2
  • $\begingroup$ I see, that does answer my question since it was in one dimension, but it occurs to me that if one has any relative velocity that isn't parallel with the target then I will simply start orbiting it by following this. I could neutralize my velocity before starting to accelerate towards it, but I am not sure how to do both of these at the same time. How would I get the direction that I need to accelerate in? $\endgroup$
    – halbe
    Commented Jul 14, 2022 at 0:45
  • $\begingroup$ @AdlerHalbe - that is an entirely different question, which is much harder to answer. You are entering the world of path planning now since the path isn't fixed anymore. I am answering how to work with the velocity profile (speed vs. distance) within a fixed path. Feel free to ask a new question in Physics and don't forget to award the answer that helped you the most here. $\endgroup$
    – jalex
    Commented Jul 14, 2022 at 12:26
0
$\begingroup$

For simplicity and without loss of generality you can set your target position and velocity both to 0, so your initial velocity is the initial relative velocity and your initial position is the initial distance.

This is going to be a case where you will do what is called "bang bang" control. You will accelerate at your maximum rate in one direction until you reach a certain point at which time you will switch to the opposite acceleration. So you have a pair of constant acceleration problems, each of which are easy and well known. This is the same as what you described for zero relative initial velocity, but the time to switch is unknown.

First segment: $$ \ddot x_1(t) = a$$ $$\dot x_1(0) = v_0$$ $$ x_1(0) = x_0$$ $$x_1(t) = \frac{1}{2} a \ t^2 + v_0 \ t + x_0$$

Second segment: $$ \ddot x_2(t) = -a$$ $$\dot x_2(t_f) = 0$$ $$ x_2(t_f) = 0$$ $$x_2(t) = -\frac{1}{2} a \ t^2 + a t_f \ t - \frac{1}{2} a t_f^2$$

So you have two expressions for, one for the constant acceleration phase that starts at your initial condition and one for the constant acceleration phase that ends at the final condition. We don't know the switching time $t_s$, but we do know that the position and velocity of the two phases must match at $t_s$. So we can write $$x_1(t_s)=x_2(t_s)$$ $$\dot x_1(t_s) = \dot x_2(t_s)$$

Now we have two equations and we can solve for $t_s$ and $t_f$ to know both when to switch acceleration direction and when we will arrive.

$\endgroup$

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.