# Optimal trajectory under acceleration constraint

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.

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

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 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:

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}}$$.

• There is no requirement that the final velocity is zero. – Paul Apr 25 at 23:11
• @Paul True, but you don't want to have any velocity when you are at $x = x_f$. – Winther Apr 25 at 23:12
• @Paul I think you probably meant to say initial velocity above. I added this case also for completeness. – Winther Apr 25 at 23:47
• I mentioned the final velocity since you mention braking, but as I indicated above the lack of an initial velocity is also an issue. – Paul Apr 25 at 23:58
• @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$. – Winther Apr 26 at 0:00