Pontryagin's Maximum Principle expaination I am having problems understanding the Pontryagin's Maximum principle.
I really dont understand the necessary conditions for minimization problem. On every website that I checked I have the impression that they are formulated in a very complicate way.
Can you write to me what this conditions are (in a simple and understandable way) and how can I use them in an optimization problem?
What can they say in a fixed endpoint adn free end time problem?
 A: The maximum/minimum principle states that the optimal path is one that maximizes/minimizes a special quantity called Hamiltonian for all $t \in [t_0,t_f]$; and given the optimal trajectory, this special quantity is constant for all $t$ as well.
In order to make sense of this, let's consider the problem of minimizing
$$ J = \int_{t_0}^{t_f} \mathcal{L}(x,u) dt$$
subject to
$$ \dot{x} = f(x,u) $$
Now suppose that you have a feasible trajectory. In that case you may define an alternative performance index $J^*$ as
$$ J^* = \int_{t_0}^{t_f} \mathcal{L}(x,u) + p[ f(x,u) - \dot{x} ] dt$$
such that $J = J^*$ is allways true (we just added zero and multiplied it with $p$ which is some function of $t$).
However, now the integrand of $J^*$ changes differently w.r.t. $x$ and $u$ than $J$ does, even though $J^*$ and $J$ have the same value for the same $x$ and $u$ (as long as the trajectory is feasible).
Now, apply Euler-Lagrange's equation to the integrand of $J^*$ with respect to $u$, $x$, and $p$ and you get the following conditions:
\begin{align}
\tfrac{\partial \mathcal{L} (x,u)}{\partial u} + p \tfrac{\partial f (x,u)}{\partial u} &= 0 \quad \text{Trajectory is extremal w.r.t. $u$} \\
\tfrac{\partial \mathcal{L} (x,u)}{\partial x} + p \tfrac{\partial f (x,u)}{\partial x} + \dot{p} &= 0 \quad \text{Trajectory is extremal w.r.t. $x$} \\
f(x,u)-\dot{x} &= 0 \quad \text{Trajectory is extremal w.r.t. $p$}
\end{align}
Notice that extremizing with respect to $p$ is the same as ensuring a feasible trajectory.
Now, if we let $ \mathcal{H}(x,u,p) = \mathcal{L}(x,u) + p f(x,u) $ we can write these conditions in a way that is much more compact:
\begin{align}
\tfrac{\partial \mathcal{H} (x,u,p)}{\partial u} &= 0 \\
\tfrac{\partial \mathcal{H} (x,u,p)}{\partial x} &= - \dot{p} \\
\tfrac{\partial \mathcal{H} (x,u,p)}{\partial p} &= \dot{x}
\end{align}
Not only that, but we can now notice that these equations are exactly the same as Hamilton's equations from classical mechanics.
Hence, we call $\mathcal{H}$ the Hamiltonian and we know from classical mechanics that it will be a constant quantity for the optimal trajectory.
