Académique Documents
Professionnel Documents
Culture Documents
Contents
1 Euler-Lagrange Equation
1.1 Functionals . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Euler-Lagrange Equation . . . . . . . . . . . . . . . . . . .
1.2.1 Transversality conditions . . . . . . . . . . . . . . .
1.2.2 Functionals involving several independent variables
1.3 Constrained minimization of functionals . . . . . . . . . .
1.3.1 Point constraints . . . . . . . . . . . . . . . . . . .
1.3.2 Differential equation constraints . . . . . . . . . . .
.
.
.
.
.
.
.
2
2
4
6
9
11
11
12
16
16
18
19
.
.
.
.
.
.
.
1
Euler-Lagrange Equation
1.1
Functionals
The calculus of variations deals with minimization or maximization of functions of functions, or functionals. A functional is a mapping or a transformation that depends on one or more functions and the values of functionals
are numbers.
Example 1.1.1 Suppose x(t) is a continuous function of t defined in the
interval [t0 , tf ] and:
J(x) =
tf
t0
x(t)dt
(1.1)
The real number assigned by the functional J is the area under the x(t) curve.
x(t)
x(t)
x1(t)
x2(t)
t
t
t0
t0
tf
tf
Example 1.1.2 The length l, of an arc connecting two given points A(x0 , y0),
B(x1 , y1 ) in the xy plane as depicted in Figure 1.2 is an example of a functional. We know that the length can be calculated as, (***, 2001):
y
B(x1,y1)
A(x0,y0)
dl dy(x)
dx
x
l = l(y(x)) =
x1
x0
dl(x) =
x1
x0
dx2
dy(x)2
x1
x0
v
u
u
t
dy(x)
1+
dx
y(x0 ) = y0 , y(x1 ) = y1
!2
dx
(1.2)
(0,y 1)
gravity
(x1, 0)
dt
(1.3)
If the length of the curve is l, and ds is an infinitely small part of the curve,
we obtain:
Z T
Z l
ds
T =
dt =
(1.4)
0
0 v
where v is the speed of the bead. Since ds = dx2 + dy 2, the equation (1.4)
is written as:
v
!2
Z x1 2
Z x1 u
Z x1 q
2
dx + dy
1u
1
dy
t
T =
=
1+
dx =
1 + y 2 dx (1.5)
v
v
dx
v
0
0
0
The speed at any point can be obtain from energy conservation, equating
kinetic energy to gravitational potential energy:
q
1 2
mv = 2gy, v = 2gy
2
The functional to be minimized then gives:
T =
x1
1 + y 2
dx =
2gy
x1
L(y, y )dx
(1.6)
(1.7)
where y = y(x).
1.2
Euler-Lagrange Equation
Problem: Suppose we are given two points (t0 , x0 ) and (tf , xf ) in the (t, x)
plane. We wish to find a curve, trajectory, joining the given points such that
the functional:
Z tf
J=
g(t, x, x)dt
t0
along this trajectory can achieve its extremal, that is maximal or minimal
value, (Kirk, 2004).
A fundamental equation of calculus of variations states that J has a
stationary value if the Euler-Lagrange equation:
g
d
x dt
g
x
=0
(1.8)
is satisfied.
The curves x = x(t) that are solutions to the Euler-Lagrange equation
are called extremals. We shall write the above equation also as:
gx
d
gx = 0
dt
4
x(t)
x=x(t)
xf
x0
x*=x*(t)
tf
t0
/2
(x(t)
x(t) )dt =
/2
(x 2 x2 )dt
2
(x x2 ) = 0
x
d
(2x)
= 2x 2
x=0
dt
or
x + x = 0
Obs. a
x + bx + cx = 0 has the characteristic equation as2 + bs + c = 0. If the
roots of the characteristic equation are real: s1,2 , the general solution is:
x(t) = c1 es1 t + c2 es2 t . If the roots of the characteristic equation are complex
s1,2 = j, the general solution is: x(t) = c1 et cos t + c2 et sin t
The characteristic equation s2 + 1 = 0 has two complex roots s1,2 = j
and the solution is:
x(t) = c1 cos t + c2 sin t
Taking into account the end-point conditions:
x(0) = c1 cos 0 + c2 sin 0 = c1 = 0
x(/2) = c1 cos /2 + c2 sin /2 = c2 = 1
Thus we have the extremal x(t) = sin t. The functional J can be minimized
or maximized only on the extremal x(t) = sin t. The extremal value of the
functional is: J (sin t) = 1 /4 = 0.214.
5
J=
(x(t)
2 + 12tx(t))dt
or
12t
2
(x + 12tx) = 0
x
d
(2x)
= 12t 2
x=0
dt
x(t) = 6t,
x(t)
=6
t2
+ c1
2
3t3
+ c1 t + c2 = t3 + c1 t + c2
3
x(0) = c2 = 0, x(1) = 1 + c1 + c2 = 1 c1 = 0
x(t) =
1.2.1
Transversality conditions
t)dt
t0
x(t)
x0
x*=x*(t)
tf
t0
g(x, x,
t)|t=tf = 0
x
(1.9)
J=
[x(t)
2 + 2x(t)x(t)
+ 4x(t)2 ]dt
2
(x + 2xx + 4x2 ) = 0
x
d
(2x + 2x) = 2x + 8x 2
x 2x = 0
dt
2x + 8x
or x 4x = 0.
The characteristic equation is s2 4 = 0 with the solutions: s1,2 = 2.
The general solution is:
x(t) = c1 e2t + c2 e2t
Evaluating the transversality condition (1.9) with t = 2:
g
|t=2 = (2x(t)
+ 2x(t))t=2 = x(2)
+ x(2) = 0
x
where
x(t) = c1 e2t + c2 e2t , x(t)
From x(0) = 1:
c1 e20 + c2 e20 = 1, c1 + c2 = 1
1
3e4 + e4 1
,
c
=
2
3e4 + e4
3e4 + e4
Exercise 1.1 . Determine the smooth curve of smallest length connecting
the point x(0) = 1 to the line t = 5, (Figure 1.6).
Hint. Find the extremal for the functional:
c1 =
J(x) =
tf
t0
v
u
u
t
dx
1+
dt
!2
dt =
1 + x(t)dt
x(t)
x=x(t)
1
t
0
5
t)dt
t0
g
g x
|t=tf = 0, or (g xg
x ) |t=tf = 0
x
Example 1.2.4 Find an extremal for the functional:
J=
tf
1
(2x(t) + x(t)
2 )dt
2
1
(2x x 2 ) = 2 x = 0
x
2
or
x = 2
with the solution x(t)
= 2t + c1 , x(t) = t2 + c1 t + c2 .
The final time tf is unspecified so, from (1.10):
1
(g xg
x ) |t=tf = (2x(t) + x(t)
2 x(t)
x(t))
t=tf = 0
2
1
1
2x(tf ) x(t
f )2 = 0 2(t2f + c1 tf + c2 ) (2tf + c1 ) = 0
2
2
8
(1.10)
From
4t2f + 4c1 tf + 4c2 2tf c1 = 0
together with the boundary conditions:
x(1) = 1 + c1 + c2 = 4, x(tf ) = t2f + c1 tf + c2 = 4
the constants and the final time can be calculated and the extremal result as:
x(t) = t2 6t + 9, and tf = 5
1.2.2
tf
t0
xi dt
g
x i
= 0, or gxi
d
gx = 0, i = 1, ..., n
dt i
tf
t0
g(x(t), x(t),
t)dt
(1.11)
(1.12)
g
d
x dt
g
x
=0
g
|t=tf = 0
x
where:
"
g
g
x
#T
(1.13)
=0
(1.14)
t=tf
x1 (t)
d
x (t)
dt 1
...
d
x
(t)
n
dt
/4
The functions x1 and x2 are independent and the boundary conditions are:
x1 (0) = 1; x1 (/4) = 2; x2 (0) = 3/2; x2 (/4) f ree
The Euler-Lagrange equations are:
d
d
gx 1 = 2x1 (x 2 ) = 2x1 x2 = 0
dt
dt
d
d
x1 2
x2 = 0
gx2 gx 2 = (x 1 + 2x 2 ) =
dt
dt
From (1.15): x2 (t) = 2x1 (t). By replacing in (1.16) we obtain:
g x1
(1.15)
(1.16)
x1 + 4x1 = 0
which has the solution:
x1 (t) = c1 cos 2t + c2 sin 2t
therefore
x2 (t) = 2c1 cos 2t + 2c2 sin 2t
Integrating twice yields:
c1
c2
cos 2t sin 2t + c3 t + c4
2
2
From the first transversality condition (tf is specified and x2 (tf ) is free:
x2 (t) =
g
x 2
=0
t=/4
gx 2 = x 1 + 2x 2 = 2c3 = 0, c3 = 0
x1 (0) = c1 1 + c2 0 = 1 c1 = 1
x2 (0) =
c1
c2
3
c1
1 0 + c3 0 + c4 = , c4 = 1.5 +
=2
2
2
2
2
x1 (/4) = c1 0 + c2 1 = 2, c2 = 2
1
x2 (t) = cos 2t sin 2t + 2
2
10
1.3
1.3.1
tf
t0
g(x(t), x(t),
t)dt
(1.17)
where x(t) is a n 1 vector of functions, that is required to satisfy m relationships of the form:
fi (x(t), t) = 0, i = 1, 2, ..., m < n
(1.18)
which are called point constraints. Constraints of this type would be present
if, for example, the admissible trajectories were required to lie on a specified
surface in the n + 1 dimensional (x(t), t) space. The presence of these m
constraining relations means that only n m of the n components of x are
independent.
One way to attack this problem might be to solve equations (1.18) for
m of the components of x(t) in terms of the remaining n m components which can the be regarded as n m independent functions - and use these
tf
t0
Z tf
t0
[g(x(t), x(t),
t) + 1 (t)f1 (x(t), t) + .... + m (t)fm (x(t), t)] dt
h
g(x(t), x(t),
t) + T (t)f(x(t), t) dt
(1.19)
Since the constraints must be satisfied for all t [t0 , tf ], the Lagrange
multipliers 1 , ..., m are assumed to be functions of time. This allows us the
flexibility of multiplying the constraining relations by a different real number
for each value of t.
If we define the augmented integrand function as:
ga (x(t), x(t),
(t), t) = g(x(t), x(t),
t) + T (t)f(x(t), t)
11
ga
, t) = 0
(x, x,
x
(1.20)
tf
t0
1 + x 21 (t) + x 22 (t)dt
x1 dt
ga
d
x2 dt
ga
= 2x1
x 1
!
ga
= 2x2
x 2
d
[x 1 (1 + x 21 + x 22 )1/2 ] = 0
dt
d
[x 2 (1 + x 21 + x 22 )1/2 ] = 0
dt
1.3.2
J(x) =
g(x(t), x(t),
t)dt
t0
fi (x(t), x(t),
t) = 0, i = 1, 2, ..., n
12
ga (x(t), x(t),
(t), t) = g(x(t), x(t),
t) + (t)T f(x(t), x(t),
t)
where (t) is a vector of n functions of time (Lagrange multipliers).
The Euler- Lagrange equation can be written:
"
ga
d ga
(x(t), x(t),
t)
(x(t), x(t),
t) = 0
x
dt x
(1.21)
f(x(t), x(t),
t) = 0
(1.22)
f (x(t), x(t),
t) = x2 (t) x 1 (t)
and one Lagrange multiplier is required.
The augmented function ga is:
1
ga (x(t), x(t),
t) = [x21 (t) + x22 (t)] + (x2 (t) x 1 (t))
2
From equation (1.21) we have:
"
ga
d ga
d
= x2 (t) + (t) = 0
x2 dt x 2
13
(1.23)
(1.24)
We need also:
x 1 (t) = x2 (t)
(1.25)
Equations (1.23),(1.24), (1.25) are necessary conditions for x (t) = [x1 (t) x2 (t)]T
to be an extremal for the functional J.
The solution of system (1.23, 1.24, 1.25) can be found as follows: from
(1.24) we have (t) = x2 (t) which, if differentiated with respect to t and
replaced in (1.23) gives: x 2 (t) = x1 (t), or (using (1.25)) x2 (t) = x2 (t).
The solution result as:
x1 (t) = C1 et C2 et , x2 (t) = C1 et + C2 et
(1.26)
For a set of initial conditions x1 (0) = x10 , x2 (0) = x20 , the constants C1
and C2 can be calculated and the solution result as:
x10 + x20 t x20 x10 t
x10 + x20 t x20 x10 t
x1 (t) =
e
e , x2 (t) =
e +
e
2
2
2
2
(1.27)
Example 1.3.3 Suppose that the system
x 1 (t) = x2 (t) x1 (t)
x 2 (t) = 2x1 (t) 3x2 (t) + u(t)
is to be controlled to minimize the performance measure
Z tf
1 2
J(x, u) =
[x1 (t) + x22 (t) + u2 (t)]dt
t0 2
Find a set of necessary conditions for optimal control.
The differential equation constraints are then:
f1 (x, u) = x2 (t) x1 (t) x 1 (t)
f2 (x, u) = 2x1 (t) 3x2 (t) + u(t) x 2 (t)
The augmented function ga :
1
ga (x, u, ) = [x21 (t) + x22 (t) + u2 (t)] + 1 (x2 (t) x1 (t) x 1 (t)) +
2
+2 (2x1 (t) 3x2 (t) + u(t) x 2 (t))
The Euler equations:
"
ga
d ga
= x1 1 22 + 1 = 0
x1 dt x 1
"
#
ga
d ga
= x2 + 1 32 + 2 = 0
x2 dt x 2
"
#
d ga
ga
= u + 2 = 0
u
dt u
14
15
2
Variational approach for optimal control
2.1
tf
t0
(2.1)
x(t0 ) = x0
(2.2)
subject to:
x = f(x(t), u(t), t),
The problem is to find an admissible control u (t) that causes the system
(2.2) to follow an admissible trajectory x (t) that minimizes the performance
measure (2.1).
We shall initially assume that the admissible state and control are not
bounded and that the initial conditions x(t0 ) = x0 and the initial time t0
are specified. x(t) is the n 1 state vector and u(t) is the m 1 vector of
control inputs.
In the terminology of the previous section (Euler-Lagrange equation with
differential equation constraints) we have a problem involving n+m functions
which must satisfy the n differential equation constraints. The m control
inputs are the independent functions. The only difference between (2.1) and
the functionals considered in the previous section is the term involving the
final states and final time. Assuming that h is a differentiable function we
can write:
Z tf
d
h(x(tf ), tf ) =
[h(x(t), t)]dt + h(x(t0 ), t0 )
t0 dt
16
tf
t0
"
d
g(x(t), u(t), t) + (h(x(t), t)) dt + h(x(t0 ), t0 )
dt
Since x0 and t0 are fixed, the minimization does not affect the h(x(t0 ), t0 )
term, so we need consider only the functional:
J(x, u) =
tf
t0
"
d
g(x(t), u(t), t) + (h(x(t), t)) dt
dt
tf
t0
g(x(t), u(t), t) +
"
h
(x(t), t)
x
#T
+
x(t)
h
(x(t), t) dt
h
ga (x, u, , t) = g(x, u, t) +
(x, t)
x
#T
x +
(x, t) + T (f(x, u, t) x)
t
x
dt
ga
d
u
dt
ga
d
x
dt
ga
x
=
=
=
=
ga
=0
x
!
ga
=0
u
"
h
h
d h
(
g+
x +
+ T (f x)
) =
x
x
t
dt x
!
!
h
h
d h
T
(g + f ) + +
x +
=
x
x x
t
dt x
2h
2h
2 h x
2h
(g + T f ) + + 2 x +
2
x
x
xt x t
xt
(g + T f ) + = 0
(2.3)
x
17
ga
d
u
dt
ga
u
ga
=
(g + T f )
u
u
(2.4)
(2.5)
(2.6)
together with the equations (2.2), which are constraints for the optimal control problem:
x = f(x(t), u(t), t)
The differential equation (2.5) is called the costate equation and (t) is
the costate vector.
2.1.1
If the final time tf is specified, the final state x(tf ) may be free or specified.
Case I Final state specified.
x(tf ) = xf
are n relations which are boundary conditions for differential equations
(2.5) and (2.2). Together with the initial conditions x(t0 ) = x0 will
ensure a unique solution of the system of differential equations
Case II Final state free. The final condition can be calculated from the first
transversality condition:
ga
(x(t), u(t), (t), t)
x
t=tf
Thus:
(tf ) =
h
(x(tf ), tf ) (tf ) = 0
x
h
(x(tf ), tf )
x
18
(2.7)
2.1.2
=0
t=tf
h
h
h
x
g+
x +
+ T (f x)
x
t
t
!#
t=tf
h
= g+ f +
t
T
=0
t=tf
h
(x(tf ), tf ) = 0
t
Case II Final state free. The two boundary conditions are derived from the
two transversality conditions:
(tf ) =
H(x(tf ), u(tf ), (tf ), tf ) +
h
(x(tf ), tf )
x
h
(x(tf ), tf ) = 0
t
(2.8)
and
H
= u(t) + 2 (t)
(2.9)
u
If (2.9) is solved for u (t) and substituted into the state equations, we have
0=
u (t) = 2 (t)
x 1 (t) = x2 (t)
x 2 (t) = x2 (t) 2 (t)
(2.10)
Equations (2.10) and (2.8) are a set of 4 first-order constant-coefficient differential equations. From (2.8):
1 (t) = c1 ;
x 1 = x2
x 2 = x2 2 = x2 c2 et c1 ; x2 = c3 et + c4 et ;
The constant c4 from the particular solution of x2 is calculated by replacing
the general solution into the equation
c2 c1
c3 et + c4 et + c3 et + c4 et = c2 et c1 c4 = et
2
2
The general solution of the state equation result:
c2
c1
x2 (t) = c3 et et
2
2
c1
c2
x1 (t) = c3 et et t + c4
2
2
Suppose the initial and final states are specified:
x(0) = [0 0]T ; x(2) = [5 2]T
We calculate the constants from:
c2
x1 (0) = c3 + c4 = 0
2
c2 c1
x2 (0) = c3
=0
2
2
c2
x1 (2) = c3 e2 e2 c1 + c4 = 5
2
c2 2 c1
2
x2 (2) = c3 e e
2
2
20
u2 (t)dt
The initial conditions are x(0) = 0, and x(2) are unspecified. The hamiltonian is:
1
H(x, u, ) = u2 (t) + 1 (t)x2 (t) + 2 (t)(x2 (t) + u(t))
2
H
= u + 2 = 0 u (t) = 2 (t)
u
The costate equations:
H
1 (t) =
=0
x1
H
1 (t) =
= 1 (t) + 2 (t)
x2
have the final conditions calculated from (2.7):
h
|t=t =2 = x1 (2) 5 = 1 (2)
x1 f
h
2 (tf ) =
|t=t =2 = x2 (2) 2 = 2 (2)
x2 f
1 (tf ) =
21
Bibliography
22