<p>Hamiltonian
\begin{align}
H(y(t),u(t),\lambda(t)) = y(t)+u(t)^2 + \lambda(t) u(t)
\end{align}</p>

<p>First order conditions read
\begin{align}
&amp;H_u = 0 \quad \Longleftrightarrow \quad u(t) = -\frac{\lambda(t)}{2}\\[2mm]
&amp;\frac{d\lambda(t)}{dt} = -H_y = -1\\[2mm]
&amp;\lambda(1) = 0
\end{align}
Integrate costate
\begin{align}
&amp;\int \frac{d\lambda(t)}{dt} = \int -1\\[2mm]
&amp;\int d\lambda(t) = \int -dt\\[2mm]
&amp;\lambda(t) = -t + C 
\end{align}
with 
\begin{align}
&amp;\lambda(1) = -1 + C = 0 \quad \Longleftrightarrow \quad C = 1\\[2mm]
\Longrightarrow \quad &amp; \lambda(t) = 1-t\\[2mm]
\Longrightarrow \quad &amp; u(t) = \frac{t-1}{2}  
\end{align}
Now integrate state equation
\begin{align}
&amp;\int \frac{dy(t)}{dt} = \int \frac{t-1}{2}\\[2mm]
&amp;\int dy(t) = \int \frac{t-1}{2}dt\\[2mm]
&amp;y(t) = \frac{t}{2}\left(\frac{t}{2}-1\right) + C
\end{align}
with 
\begin{align}
&amp;y(0) =  C = 5\\
\Longrightarrow \quad &amp; y(t) = \frac{t}{2}\left(\frac{t}{2}-1\right) + 5
\end{align}</p>

<p>If I'm not mistaken necessary conditions are sufficient if maximized Hamiltonian is concave in state (Arrow sufficiency if I recall correctly (see e.g. Caputo, 2005, Ch. 3))
\begin{align}
H^*(y,\lambda) = \max_u H(y,u,\lambda) = y - \frac{\lambda^2}{2}.
\end{align}
Now we have
\begin{align}
H_y &gt; 0 = H_{yy}
\end{align}
such that concavity is given.</p>

CC BY-SA 3.0
2017-10-24T21:15:05.040Z
2017-10-24T21:15:05.040Z
clueless
<p>The problem is to maximize $\int_0^1 y(t) + u(t)^2 dt$ where $y$ is state and $u$ is control.</p>

<p>Further we have $y' = u, y(0) = 5$.</p>

<p>I set up the Maximum Principle equations, but, in particular, I need to maximize the Hamiltonian in the $u$-variable. </p>

<p>My nstructor's solutions does this by differentiating and letting it equal zero, i.e. he gets $$2u(t) + \lambda = 0.$$</p>

<p>Then he goes on with the other equations, and sovles for $\lambda$, and then $u$.</p>

<p>However, if we differentiate the Hamiltonian again with respect to $u$, then we get $$2 &gt; 0$$
which is not negative, hence surely the 1st equation is not warranted, as we have found a minimum, not maximum? </p>

CC BY-SA 3.0
2017-10-24T17:01:58.333Z
Is your control unconstrained?
Boaten
<optimal-control>
Optimal control theory: How to maximize Hamiltonian in this case?
Darka
# Optimal control theory: How to maximize Hamiltonian in this case?

(Asked by: username_0 on 2017-10-24)

The problem is to maximize $\int\_0^1 y(t) + u(t)^2 dt$ where $y$ is state and $u$ is control.

Further we have $y' = u, y(0) = 5$.

I set up the Maximum Principle equations, but, in particular, I need to maximize the Hamiltonian in the $u$-variable.

My nstructor's solutions does this by differentiating and letting it equal zero, i.e. he gets $$2u(t) + \lambda = 0.$$

Then he goes on with the other equations, and sovles for $\lambda$, and then $u$.

However, if we differentiate the Hamiltonian again with respect to $u$, then we get $$2 > 0$$
which is not negative, hence surely the 1st equation is not warranted, as we have found a minimum, not maximum?

**Tags:** optimal-control
> **Comments:**
> **username_1**: Is your control unconstrained?  

---

## 1 answers

### Answer by username_2 on 2017-10-24. Score: 2

Hamiltonian
\begin{align}
H(y(t),u(t),\lambda(t)) = y(t)+u(t)^2 + \lambda(t) u(t)
\end{align}

First order conditions read
\begin{align}
&H\_u = 0 \quad \Longleftrightarrow \quad u(t) = -\frac{\lambda(t)}{2}\\[2mm]
&\frac{d\lambda(t)}{dt} = -H\_y = -1\\[2mm]
&\lambda(1) = 0
\end{align}
Integrate costate
\begin{align}
&\int \frac{d\lambda(t)}{dt} = \int -1\\[2mm]
&\int d\lambda(t) = \int -dt\\[2mm]
&\lambda(t) = -t + C
\end{align}
with
\begin{align}
&\lambda(1) = -1 + C = 0 \quad \Longleftrightarrow \quad C = 1\\[2mm]
\Longrightarrow \quad & \lambda(t) = 1-t\\[2mm]
\Longrightarrow \quad & u(t) = \frac{t-1}{2}
\end{align}
Now integrate state equation
\begin{align}
&\int \frac{dy(t)}{dt} = \int \frac{t-1}{2}\\[2mm]
&\int dy(t) = \int \frac{t-1}{2}dt\\[2mm]
&y(t) = \frac{t}{2}\left(\frac{t}{2}-1\right) + C
\end{align}
with
\begin{align}
&y(0) = C = 5\\
\Longrightarrow \quad & y(t) = \frac{t}{2}\left(\frac{t}{2}-1\right) + 5
\end{align}

If I'm not mistaken necessary conditions are sufficient if maximized Hamiltonian is concave in state (Arrow sufficiency if I recall correctly (see e.g. Caputo, 2005, Ch. 3))
\begin{align}
H^\*(y,\lambda) = \max\_u H(y,u,\lambda) = y - \frac{\lambda^2}{2}.
\end{align}
Now we have
\begin{align}
H\_y > 0 = H\_{yy}
\end{align}
such that concavity is given.


---

