t = x

t +ox
t ; x
t = x

t + ox
t ; i = 1,2
Then the vaiiation in [
u
is:
A[
u
= [
u
(x
1
t +ox
1
t , x
2
t +ox
2
t , x
1
t +ox
1
t , x
2
t
+ ox
2
t , t)  [
u
x
1
t , x
2
t , x
1
t , x
2
t , t
Optimal Control: Calculus of Variations 48
Step 3 : First Variations
Tayloi seiies expansion of [
u
:
[
u
= _ L x
1
t , x
2
t , x
1
t , x
2
t , z t , t Jt
t
]
t
0
[
u
x
1

t + ox
1
t , x
2

t + ox
2
t , x
1

t +ox
1
t , x
2

t + ox
2
t , t
= [
u
+o[
u
+
1
2!
o
2
[
u
+
o[
u
= _ _
oL
ox
1

ox
1
t +
oL
ox
2

ox
2
t +
oL
ox
1

ox
1
t
t
]
t
0
+
oL
ox
2

ox
2
t _ Jt
Optimal Control: Calculus of Variations 49
Step 3 : First Variations (contd)
As befoie integiating by paits of the expiessions involving
ox
t , i = 1,2:
_
oL
ox

ox
t Jt
t
]
t
0
= u _
J
Jt
oL
ox

ox
(t)Jt
t
]
t
0
Theiefoie,
o[
u
= _
oL
ox
1


J
Jt
oL
ox
1

ox
1
t Jt
t
]
t
0
+ _
oL
ox
2


J
Jt
oL
ox
2

ox
2
t Jt
t
]
t
0
Optimal Control: Calculus of Variations 50
Step 4 : Fundamental Theorem
Applying funuamental theoiem, we make o[
u
= u.
Recollect that both ox
1
anu ox
2
can not be inuepenuent. We make
ox
1
as uepenuent anu ox
2
as the inuepenuent one.
Next, we choose z

(t) in such a way that the factoi involving ox
1
in o[
u
vanishes, i.e. z

(t) is the solution of
oL
ox
1


J
Jt
oL
ox
1

= u
Then o[
u
becomes,
o[
u
= _
oL
ox
2


J
Jt
oL
ox
2

ox
2
t Jt
t
]
t
0
Optimal Control: Calculus of Variations 51
Step 5 : Fundamental Lemma
o[
u
= _
oL
ox
2


J
Jt
oL
ox
2

ox
2
t Jt
t
]
t
0
Now, since ox
2
t is inuepenuent vaiiable, invoke funuamental
lemma to wiite
oL
ox
2


J
Jt
oL
ox
2

= u
Then the first variation o[
u
becomes zero.
Optimal Control: Calculus of Variations 52
Step 6 : EulerLagrange Equation
Combining all the equations along with the conuition that
L
x

=
u, one wiite the necessaiy conuition foi an extiemum is:
oL
ox
1


J
Jt
oL
ox
1

= u
oL
ox
2


J
Jt
oL
ox
2

= u
oL
oz


J
Jt
oL
oz

= u
1.
L
x
= u since L is independent of z
2. The Lagrange multiplier enables to look at the problem as if
both the x
1
(t) and x
2
t are independent variable.
Optimal Control: Calculus of Variations 53
Example
Minimize the performance index
[ = _ x
2
t + u
2
(t) Jt
1
0
with boundary conditions x u = 1 and x 1 = u and subject to
the condition (plant equation)
x t = x t +u(t)
Optimal Control: Calculus of Variations 54
Solution by Direct method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
Replacing u(t) from the condition in [, one gets
[ = _ x
2
t + x t + x t
2
Jt
1
0
= _ 2x
2
t + x
2
t + 2x t x t Jt
1
0
= _ I Jt
1
0
Now, one can minimize [ in straight forward way.
Optimal Control: Calculus of Variations 55
Solution by Direct method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
Invoke EulerLagrange equation:
oI
ox


J
Jt
oI
ox

= u
I = 2x
2
t +x
2
t + 2x t x t
oI
ox

= 4x

t + 2x

t
oI
ox

= 2x

t +2x

(t)
oI
ox


J
Jt
oI
ox

= 4x

t + 2x

t 
u
ut
2x

t + 2x

t = u
Optimal Control: Calculus of Variations 56
Solution by Direct method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
Solution of EulerLagrange equation:
oI
ox


J
Jt
oI
ox

= 4x

t + 2x

t 
u
ut
2x

t + 2x

t = u
Simplifying,
x

t  2x

t = u
Solution of the above is:
x

t = C
1
c
 2t
+C
2
c
2t
The constants C
1
and C
2
can be determined using boundary
conditions as:
C
1
=
1
1c
2 2
and C
2
=
1
1c
2 2
Optimal Control: Calculus of Variations 57
Solution by Direct method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
Solution of x

t is:
x

t = C
1
c
 2t
+C
2
c
2t
Corresponding optimal control input is:
u

t = x

t + x

t
= C
1
1  2 c
 2t
+C
2
1 + 2 c
2t
Comment: Although the method appears to be simple, it is not
always possible to eliminate u t in the expression of [ especially
for higherorder systems.
Optimal Control: Calculus of Variations 58
Solution by Lagrange Multiplier Method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
The condition can be written as:
g = x t + x t  u t = u
Now, we form an augmented functional:
[ = _ x
2
t + u
2
t + z t x t +x t  u t Jt
1
0
= _ LJt
1
0
L = x
2
t +u
2
t + z t x t + x t  u t
Optimal Control: Calculus of Variations 59
Solution by Lagrange Multiplier Method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
L = x
2
t +u
2
t + z t x t + x t  u t
Invoke the optimality conditions:
oL
ox
1


J
Jt
oL
ox
1

= u
oL
ox
2


J
Jt
oL
ox
2

= u
oL
oz


J
Jt
oL
oz

= u
Optimal Control: Calculus of Variations 60
Solution by Lagrange Multiplier Method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
L = x
2
t +u
2
t + z t x t + x t  u t
Invoke the optimality conditions:
oL
ox
1


J
Jt
oL
ox
1

= u = 2x

t + z

t  z
t = u
oL
ox
2


J
Jt
oL
ox
2

= u = 2u

t  z

t = u
oL
oz


J
Jt
oL
oz

= u = x

t + x

t  u

t = u
Optimal Control: Calculus of Variations 61
Solution by Lagrange Multiplier Method
[ =
]
x
2
t +u
2
(t) Jt
1
0
; x u = 1; x 1 = u; x t = x t + u(t)
2x

t + z

t  z
t = u ; 2u

t  z

t = u ; x

t + x

t 
u

t = u
From last two equations:
z

t = 2u

t = 2(x

t + x

t )
Replacing above in the first equation:
2x

t + z

t z
t = u
= 2x

t +2 x

t +x

t  2 x t + x t = u
= x

t  2x

t = u
Then the same solution prevails as the direct method.
Optimal Control: Calculus of Variations 62