Finding optimal way to steer a system to origin with input constraints

control theorylinear algebralinear-controloptimal controloptimization

For the system $$\ddot{x}+x=u$$ with $\|u\| \le 1$, find the optimal way to steer the system from

(a) $(x(0),\dot{x}(0))$ to $(0,0)$

(b) $(x(0),\dot{x}(0))$ to $x=0$

and minimize $$\int_0^{t_f} \|u(t)\| \,\mathrm{d} t$$


Attemp (for part a)
the system can be written as $$\dot{x}_1=x_2~ ,~ \dot{x}_2=-x_1+u$$ and the hamiltonian can be written as
$$H(x,t,u,\lambda)=|u(t)|+x_2\lambda_1-x_1\lambda_2+u(t)\lambda_2$$then i'll have
$$\begin{bmatrix}\dot{\lambda}_1 \\ \dot{\lambda}_2 \end{bmatrix}= \begin{bmatrix}0 &1 \\ -1 &0 \end{bmatrix}\begin{bmatrix}\lambda_1 \\ \lambda_2 \end{bmatrix},$$ With initial conditions $\lambda_1(0)=A\cos \theta, \lambda_2(0)=A\sin \theta$ i have
$$\lambda_1(t)=A\cos(t-\theta), \lambda_2(t)=A\sin(t-\theta)$$
and $u(t)=-sign(\lambda_2(t))=+1 ~\text{or} -1$.

Is my approach correct ? i'm confused about the range of optimal $u(t)$ for various $\lambda$. And i'm also confused about approaching part b, when $x=0$ then i've the set $S =\{(x_1,x_2)|x_1=0, -\infty<x_2<+\infty\}$ , then i think i need to find a vector $q=[K ~0]^{\top}$ such that $<\lambda(t_f),q>=0$ ?

Best Answer

You also have to take the absolute value of $u(t)$ into account. Namely say $\lambda_2=0.5$ then your solution gives $u(t)=-1$ with $|u(t)|+u(t)\,\lambda_2=0.5$. However, $u(t)=0$ yields $|u(t)|+u(t)\,\lambda_2=0$ which is lower. Namely $|u(t)|$ is the dominant term when $|\lambda_2|<1$, which has the minimum $u(t)=0$. So the expression which would minimize the Hamiltonian would be

$$ u(t) = \left\{ \begin{array}{ll} 1, & \text{if}\ \lambda_2 < -1 \\ -1, & \text{if}\ \lambda_2 > 1 \\ 0, & \text{otherwise} \end{array} \right. . $$

You still need to find values for $\lambda_1(0)$ and $\lambda_2(0)$, however I am not sure there would be a closed form solution for it. There isn't even always a solution, for example if $t_f$ is too small such that the constrained input can't drive the system from its initial conditions to zero. In general this is solved with the shooting method. In the case that $(x(t_f),\dot{x}(t_f))=(0,0)$ then $(\lambda_1(t_f),\lambda_2(t_f))$ is allowed to be anything. In the case that only $x(t_f)=0$ ($\dot{x}(t_f)$ can be anything) then $\lambda_1(t_f)$ can still be anything, however the other co-state has to satisfy

$$ \lambda_2(t_f) = \left[\frac{\partial g_{t_f}}{\partial \dot{x}}\right]_{x=x(t_t)}, $$

with $g_{t_f}$ the terminal cost, which in this case is zero.

Related Question