Let $x(t) \in \mathbb{R}$, such that $x(0) = x_0$, $\dot{x}(0) = v_0$ Find the optimal trajectory for $x(t)$, such that $$L = \int_{t=0}^T|x(t) - x_f|^2dt$$ is minimized, subject to the constraint $|\ddot{x}(t)| \leq a_0, \forall t$. $x_0, x_f, v_0$ and $a_0$ are known constants.

Any insights on general methods to attacking such problems are welcome. I would appreciate any advice.

Edit: I would like to emphasize that essential part of this question is proving that the trajectory is optimal. The problem above is a much simplified version of the actual problem I am solving. Therefore, I ask for the principle of constructing necessary and sufficient equations for finding the optimal trajectory.

  • 1
    $\begingroup$ You need an initial velocity as well as an initial position to solve this. $\endgroup$
    – Paul
    Apr 25, 2019 at 23:10
  • $\begingroup$ I agree, sorry, edited $\endgroup$ Apr 26, 2019 at 9:08
  • $\begingroup$ This is a simple problem in optimal control. $\endgroup$ Apr 27, 2019 at 14:28
  • $\begingroup$ @MohammadKhosravi So I have heard. Can you provide a solution or a link to literature addressing it $\endgroup$ Apr 27, 2019 at 17:20
  • $\begingroup$ @AleksejsFomins you can check en.m.wikipedia.org/wiki/… $\endgroup$ Apr 27, 2019 at 17:26

1 Answer 1


I don't know of any general method here so I'll stick with a guess based on simple physical intuition. My guess is that the optimal solution will be to switch between accelerating maximum in one direction, then the other direction (to kill the velocity and prevent too big overshoot) and then stay put (when we have reached the point $x_f$ with zero velocity). For these cases we can easily compute the value of $L$ which could serve as a check against other possible solutions.

By shifting the coordinate system and rescaling time and space coordinates we can for simplicity assume that $x_0 = 0$, $x_f = 1$ and $T = 1$. I will also assume that the initial velocity $x'(0) = 0$. For the case where we are free to choose $x'(0)$, see the end of this answer. Let's split into three cases depending on how large the maximum acceleration is.

If $a_0<2$ then the solution is to accelerate at max all the way so $x(t) = \frac{a_0t^2}{2}$. For this case it's clear that this is the optimal solution and we have $L = 1 - \frac{a_0}{3} + \frac{a_0^2}{20}$.

If $2<a_0<4$ then we accelerate at max till $t = 1 - \sqrt{\frac{(a_0-2)}{2a_0}}$ and then flip the sign of the acceleration and decelerate at max till we reach $x_f = 1$ at $t=1$. For this case $L = \frac{22 a_0^3-120 a_0^2+280 a_0 - 15\sqrt{2(a_0-2) a_0}(a_0-2)^2}{240a_0}$.

If $a_0 > 4$ then we accelerate at max till $t = \frac{1}{\sqrt{a_0}}$ then declerate at max till $t = \frac{2}{\sqrt{a_0}}$ (for which we are at $x_f=1$ with zero velocity) and then we stop accelerating and stay put. For this final case we find $L = \frac{23}{30\sqrt{a_0}}$.

A plot of the solution for $a_0 = 16$ is given below:

enter image description here

In the proposal above I have assumed that the initial condition is $x'(0)=0$, i.e. that we start off with zero velocity. If we are free to choose the initial velocity then let's solve by going backwards from $t=1$ starting at $x = x_f$. We stay here as long as we possibly can and then start accelerating maximally so that we just reach $x=0$ at $t=0$ (with non-zero velocity $x'(0) = \sqrt{\frac{a_0}{2}}$). Thus the solution (for $a_0>2$) will be $x(t) = 1 - (t/t_0-1)^2$ for $t < t_0$ and $x(t) = 1$ for $t>t_0$ where $t_0 = \sqrt{\frac{2}{a_0}}$. For this case we have $L = \frac{\sqrt{2}}{5\sqrt{a_0}}$.

  • 1
    $\begingroup$ There is no requirement that the final velocity is zero. $\endgroup$
    – Paul
    Apr 25, 2019 at 23:11
  • $\begingroup$ @Paul True, but you don't want to have any velocity when you are at $x = x_f$. $\endgroup$
    – Winther
    Apr 25, 2019 at 23:12
  • $\begingroup$ @Paul I think you probably meant to say initial velocity above. I added this case also for completeness. $\endgroup$
    – Winther
    Apr 25, 2019 at 23:47
  • $\begingroup$ I mentioned the final velocity since you mention braking, but as I indicated above the lack of an initial velocity is also an issue. $\endgroup$
    – Paul
    Apr 25, 2019 at 23:58
  • $\begingroup$ @Paul Then I don't understand your point. Why should the optimal solution (in the last case, in the first two I don't have zero final velocity) have non-zero final velocity? Being at $x=x_f$ is the best place to be when you want to minimize $L$. $\endgroup$
    – Winther
    Apr 26, 2019 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.