182
11 Optimal Control Theory
depend on q and the canonical momentum p = ∂ L/∂ ˙
q instead [4, 5]. Furthermore,
we require the partial derivatives of H (q, p) to return the time-derivatives of q and
p. As a prerequisite, we note that the Euler-Lagrange equations allow us to write
0 =
d
dt
∂ L
∂ ˙
q
−
∂ L
∂q
=
d
dt
p −
∂ L
∂q
or
˙
p =
∂ L
∂q
.
(11.30)
Using these relations we can express the total differential of the Lagrangian in the
following way
d L =
∂ L
∂q
dq +
∂ L
∂ ˙
q
d ˙
q = ˙
pdq + pd ˙
q = ˙
pdq + [d( p ˙
q) − ˙
qdp] , (11.31)
where we replace the partial derivatives of the Lagrangian by p and ˙
p with the help
of the definition of the canonical momentum p and (11.30). We remove the term
proportional to d ˙
q with the help of pd ˙
q = d( p ˙
q) − ˙
qdp. After collecting the terms
proportional to dq and dp on the left-hand side we arrive at
˙
qdp − ˙
pdq = d( p ˙
q − L) = d H =
∂ H
∂ p
dp +
∂ H
∂q
dq ,
(11.32)
where we define the terms that are left over on the right-hand side as the Hamiltonian
H = p ˙
q − L . Moreover, by writing d H(q, p) through its partial derivatives and
comparing coefficients with the left-hand side, we recover Hamilton’s equations,
summarized in the following equations
H = p ˙
q − L ,
˙
q =
∂ H
∂ p
,
˙
p = −
∂ H
∂q
.
(11.33)
Note that the requirement to use the canonical momentum p instead of ˙
q leads
to the introduction of the Hamiltonian H (q, p) and replaces the Euler-Lagrange
equations, which are of second order, by pairs of first-order equations—Hamilton’s
equations. This transformation from Lagrangian to Hamiltonian is usually referred
to as a Legendre transformation.
Let us now explore how this formalism helps us to solve the optimal-control
problem.
11.4 Hamiltonians for Optimal Control
In this section, we omit the end-point constraints in order to make the problem more
manageable, which can thus be summarized by minimizing
J [x, u] =
t f
t 0
g(x, u)dt subject to ˙
x = a(x, u) .
(11.34)
11 Optimal Control Theory
depend on q and the canonical momentum p = ∂ L/∂ ˙
q instead [4, 5]. Furthermore,
we require the partial derivatives of H (q, p) to return the time-derivatives of q and
p. As a prerequisite, we note that the Euler-Lagrange equations allow us to write
0 =
d
dt
∂ L
∂ ˙
q
−
∂ L
∂q
=
d
dt
p −
∂ L
∂q
or
˙
p =
∂ L
∂q
.
(11.30)
Using these relations we can express the total differential of the Lagrangian in the
following way
d L =
∂ L
∂q
dq +
∂ L
∂ ˙
q
d ˙
q = ˙
pdq + pd ˙
q = ˙
pdq + [d( p ˙
q) − ˙
qdp] , (11.31)
where we replace the partial derivatives of the Lagrangian by p and ˙
p with the help
of the definition of the canonical momentum p and (11.30). We remove the term
proportional to d ˙
q with the help of pd ˙
q = d( p ˙
q) − ˙
qdp. After collecting the terms
proportional to dq and dp on the left-hand side we arrive at
˙
qdp − ˙
pdq = d( p ˙
q − L) = d H =
∂ H
∂ p
dp +
∂ H
∂q
dq ,
(11.32)
where we define the terms that are left over on the right-hand side as the Hamiltonian
H = p ˙
q − L . Moreover, by writing d H(q, p) through its partial derivatives and
comparing coefficients with the left-hand side, we recover Hamilton’s equations,
summarized in the following equations
H = p ˙
q − L ,
˙
q =
∂ H
∂ p
,
˙
p = −
∂ H
∂q
.
(11.33)
Note that the requirement to use the canonical momentum p instead of ˙
q leads
to the introduction of the Hamiltonian H (q, p) and replaces the Euler-Lagrange
equations, which are of second order, by pairs of first-order equations—Hamilton’s
equations. This transformation from Lagrangian to Hamiltonian is usually referred
to as a Legendre transformation.
Let us now explore how this formalism helps us to solve the optimal-control
problem.
11.4 Hamiltonians for Optimal Control
In this section, we omit the end-point constraints in order to make the problem more
manageable, which can thus be summarized by minimizing
J [x, u] =
t f
t 0
g(x, u)dt subject to ˙
x = a(x, u) .
(11.34)
