14

I'm trying to solve a problem in path planning:

Given points $p_0$ and $p_1$ and vectors $v_0$ and $v_1$,

find a function $p(t)$ st. $p(0) = p_0$, $p(T) = p_1$, $p'(0) = v_0$ and $p'(T) = v_1$

which minimizes $T$ (or $p^{-1}(x_1)$) given the constraint $|p''(t)| \le 1$.

From what I've read, I think this might be solvable using the calculus of variations. I don't really know much about how it works, so I'm hoping somebody can help me with some introductory material and perhaps a hint on whether the problem is solvable at all.

Thomas Ahle
  • 5,629
  • This may help you. Also maybe you'll find somehting usefule here – Stefan4024 Oct 23 '13 at 11:11
  • I've looked at the Brachistochrone curve, however my problem is made more difficult by the fact, that I don't have constant acceleration. Instead my acceleration can be any function of $t$, with the only limit that its absolute value can't be greater than $1$ (or some constant). – Thomas Ahle Oct 23 '13 at 11:19
  • I must admit I'm not that good at physics, so I don't know how can I help you. First I saw this problem and I've seen the brachistochrone curve earlier so I thought it may help you, because they are somehow related. – Stefan4024 Oct 23 '13 at 11:22
  • 1
    Can you specify what kind of function $p$ shall be? It seems, for example, that it must be differentiable twice. – Simon Markett Oct 23 '13 at 12:27
  • 1
    @Simon: I don't think it makes sense to require that $p$ be twice differentiable. For instance, if $v_0 = v_1 = 0$, then obviously the fastest way from $p_0$ to $p_1$ is to accelerate at full power until you are half way, and then decelerate at full power. At the mid-point, the acceleration is discontinuous, so $p$ is not twice differentiable. – TonyK Nov 03 '13 at 17:11
  • 1
    In fact, I suspect that the fastest path will always use full power all the way, with just the direction of acceleration changing. – TonyK Nov 03 '13 at 18:58
  • 3
    I found an interesting paper on the topic here: http://arxiv.org/pdf/1310.5905v1.pdf – Thomas Ahle Nov 03 '13 at 19:33
  • @TonyK, yes, that is pretty much along the lines of what I was thinking. OP is also asking for the existence of a solution. If $p$ has to be twice differentiable, then the answer will probably be 'no'. So is $p$ piecewise differentiable, or something else? – Simon Markett Nov 04 '13 at 11:19
  • So, from the paper, it appears that the acceleration is always on the form Magnitude:1, Angle: $\text{ArcTan}(at+b)+c$. I can integrate this twice, and insert my boundary conditions for speed and position, which leaves me with 4 equations in $a$, $b$, $c$ and $T$. I've however tried solving this set numerically in Mathematica, and for any non trivial boundaries, it seems near impossible to get convergence. Any ideas? – Thomas Ahle Nov 05 '13 at 08:01

1 Answers1

4

Disclaimer: this is only a partial answer to the question as formulated, mainly because it doesn't correctly take into account the condition that the end-point $\vec{p_1}$ is prescribed as well. Please read the bottom lines. Furthermore it is assumed that the problem is two-dimensional.

It is well known that a straight line is the shortest path between two points, but it can only be realized with constant velcities, e.g. as given by: \begin{eqnarray*} x(t) = v_x.t + s_x \\ y(t) = v_y.t + s_y \end{eqnarray*} $\vec{s} = (s_x,s_y)$ is an initial position, $\vec{v} = (v_x,v_y)$ is a (constant) velocity, $t$ is time.
Replace the linear relationship by a quadratic one. It's somewhat reasonable to suppose that it will give us the most efficient solution with non-constant velocities, as required by the OP. \begin{eqnarray*} x(t) = \frac{1}{2} a_x.t^2 + v_x.t + s_x \\ y(t) = \frac{1}{2} a_y.t^2 + v_y.t + s_y \end{eqnarray*} Here $\vec{a} = (a_x,a_y)$ is the constant acceleration. The resulting curve is a quadratic spline.
The begin- and end-points are given. It's easy to see, with $T$ as the end-time: $$ \vec{p_0} = \left[ \begin{array}{c} s_x \\ s_y \end{array} \right] $$ $$ \vec{p_1} = \left[ \begin{array}{c} \frac{1}{2} a_x.T^2 + v_x.T + s_x \\ \frac{1}{2} a_y.T^2 + v_y.T + s_y \end{array} \right] $$ The begin- and end-velocities are given. It's easy to see, with $T$ as the end-time: $$ \vec{v_0} = \vec{v}(0) = \left[ \begin{array}{c} v_x \\ v_y \end{array} \right] $$ $$ \vec{v_1} = \vec{v}(T) = \left[ \begin{array}{c} a_x.T + v_x \\ a_y.T + v_y \end{array} \right] $$ From the last two equations we find: $$ \frac{v_x(T) - v_x(0)}{a_x} = T \quad ; \quad \frac{v_y(T) - v_y(0)}{a_y} = T $$ And we know that $\sqrt{a_x^2 + a_y^2} = 1$. So let's define a constant and normed acceleration: $$ \left[ \begin{array}{c} a_x \\ a_y \end{array} \right] = \left[ \begin{array}{c} v_x(T) - v_x(0) \\ v_y(T) - v_y(0) \end{array} \right] / \sqrt{(v_x(T) - v_x(0))^2 + (v_y(T) - v_y(0))^2} $$ Or $$\vec{a} = \frac{\vec{v_1} - \vec{v_0}}{\left|\vec{v_1} - \vec{v_0}\right|} $$ Everything is defined now. For example the time $T$ is easy to calculate from: $$ T = \frac{v_x(T) - v_x(0)}{a_x} = \sqrt{(v_x(T) - v_x(0))^2 + (v_y(T) - v_y(0))^2} = \left|\vec{v_1} - \vec{v_0}\right| $$ But I'm a bit worried about the "normed acceleration". Let's assume instead that: $$ \vec{a} = \frac{\vec{v_1} - \vec{v_0}}{\left|\vec{v_1} - \vec{v_0}\right|} \times A $$ Where $A$ (a scalar) has the dimension of an acceleration. Then: $$ T = \frac{\left|\vec{v_1} - \vec{v_0}\right|}{A} $$ has the dimension of time. Which sounds better to me, as a physicist :-)

As has been said above, this is a partial answer to the question. The reason is that we can calculate the end-position now, instead of imposing it: $$ \vec{p_1} = \vec{p_0} + \frac{\left|\vec{v_1} - \vec{v_0}\right|}{A} \frac{\vec{v_1}+\vec{v_0}}{2} $$ One reason that I've undeleted this post again is that there seems to be no other possibility than the quadratic spline if one wants to maintain a constant optimal acceleration from the beginning to the end. More information about quadratic splines is found in: Splines (PDF).

Han de Bruijn
  • 17,475
  • This keeps the acceleration fixed at all times, right? So it can never break, say? – Thomas Ahle Dec 14 '16 at 21:08
  • @ThomasAhle: I'm a bit surprised by your late comment. But anyway, you're quite right: the acceleration is fixed. And the above is not a completely correct answer to the question, due to the non-present boundary condition at the end-position. – Han de Bruijn Dec 15 '16 at 14:46