# Optimal control problem

I'm having trouble with the following problem:

The system

$$\dot{x} = -x+4u$$

where $u=u(t)$ is not subject to any constraint, is to be controlled from $x(0)=2$ to $x(1)=1$ in such a way as to minimize

$$\begin{equation*} J = \int_0^1(x+2xu+u^2)\, \mathrm{d}t \end{equation*}$$

Find the optimal control $u^*$ and the optimal path $x^*$.

I've tried using Pontryagin's maximum principle by writing the Hamiltonian and maximizing it with respect to the control $u$, but it doesn't seem to get me anywhere.

Any help would be appreciated. Thanks.

From the system $u = (\dot{x} + x)/4$, you can then replace it $J$ to get

$$J(x,\dot{x}) = \int_0^1 dt\; \left[ x + \frac{5}{8}x\dot{x} + \frac{1}{16}\dot{x}^2 + \frac{9}{16}x^2\right] = \int_0^1dt\;\mathcal{L}(x,\dot{x})$$

which can be minimized by solving

\begin{eqnarray*} \frac{d}{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{x}} \right) - \frac{\partial \mathcal{L}}{\partial x} &=& 0 \\ \Rightarrow\quad \ddot{x} - 9x &=& 8 \end{eqnarray*}

which is a second order-linear ODE in $x$.

Alternatively you can define

$$v = \frac{\partial \mathcal{L}}{\partial \dot{x}}$$

and solve the system

\begin{eqnarray*} \dot{x} &=& \frac{\partial \mathcal{H}}{\partial v}\\ -\dot{v} &=& \frac{\partial \mathcal{H}}{\partial x}\\ \end{eqnarray*}

which are two first-order linear ODE, with

$$\mathcal{H}(x, v) = \dot{x} v - \mathcal{L}(x, \dot{x})$$

• I got the ODE $\ddot x - 9 x = 8$ from the Euler-Lagrange equation. One of us made an error. – Rodrigo de Azevedo Nov 4 '16 at 11:00
• I also got $\ddot{x}-9x=8$ – Sam42 Nov 4 '16 at 12:09
• @RodrigodeAzevedo you are right, I just updated my comment. Thanks for spotting the mistake – caverac Nov 4 '16 at 12:20
• @Sam42 Thanks Sam, already corrected the mistake – caverac Nov 4 '16 at 12:22