You are on page 1of 26

FIXED-END TIME AND FIXED-END

PROBLEM: WITH CONSTRAINTS


Optimal Control: Calculus of Variations 37
Extrema of functions with conditions
Consider the extrema of a function (x
1
, x
2
) with two
interdependent variables x
1
and x
2
, subject to the condition
g x
1
, x
2
= u
Optimal Control: Calculus of Variations 38
Approach 1: Direct method
As a necessary condition for extrema, we have
J =
o
ox
1
Jx
1
+
o
ox
2
Jx
2
= u
Without constraint case: optimum is where
]
x
1
=
]
x
2
= u.
For with constraint case, Jx
1
and Jx
2
are not arbitrary, but
related as:
Jg =
og
ox
1
Jx
1
+
og
ox
2
Jx
2
= u
Arbitrarily choose one of two variables, say x
1
, as an
independent variable. Then x
2
becomes dependent variable.
Then Jx
2
= -
gx
1
gx
2
Jx
1
provided
g
x
2
= u.

Optimal Control: Calculus of Variations 39
Approach 1: Direct method
Therefore,
J =
o
ox
1
Jx
1
+
o
ox
2
Jx
2
=
o
ox
1
Jx
1
-
o
ox
2
og ox
1
/
og ox
2
/
Jx
1

=
o
ox
1
-
o
ox
2
og ox
1
/
og ox
2
/
Jx
1
= u
As Jx
1
is arbitrary and can not be zero,
]
x
1
-
]
x
2
g x
1
/
g x
2
/
= u.
Or,
o
ox
1
og
ox
2
-
o
ox
2
og
ox
1
= u
Alternatively,
]
x
1
]
x
2
g
x
1
g
x
2
= u
Optimal Control: Calculus of Variations 40
Approach 1: Direct method
The following two equations solved simultaneously to find a
solution of the problem:
1.
]
x
1
g
x
2
-
]
x
2
g
x
1
= u
2. g(x
1
, x
2
) = u

Some Facts:
First equation is also know as Jacobian of and g.
Tedious to solve for higher order problems.
Optimal Control: Calculus of Variations 41
Approach 2: Lagrange Multiplier method
An augmented Lagrangian function is formed:
L x
1
, x
2
, z = x
1
, x
2
+ zg(x
1
, x
2
)
Where, z is Lagrange multiplier, a parameter to be determined.

With g x
1
, x
2
= u, L x
1
, x
2
, z = x
1
, x
2
.
Therefore, necessary condition for extrema is that
J = JL = u
JL = J + zJg = u
Since and g are functions of both x
1
and x
2
:
JL = J + zJg =
o
ox
1
Jx
1
+
o
ox
2
Jx
2
+ z
og
ox
1
Jx
1
+
og
ox
2
Jx
2
=
o
ox
1
+ z
og
ox
1
Jx
1
+
o
ox
2
+z
og
ox
2
Jx
2
= u

Optimal Control: Calculus of Variations 42
Approach 2: Lagrange Multiplier method
JL = J +zJg =
o
ox
1
+z
og
ox
1
Jx
1
+
o
ox
2
+z
og
ox
2
Jx
2
= u
Since both Jx
1
and Jx
2
are not independent, let Jx
1
is
independent. Then Jx
2
is dependent differential.
Further, let z is so chosen that one of the coefficient becomes
zero. Let the coefficient of Jx
2
is made zero by choosing a value
of z as z
-
, that is
o
ox
2
+z
-
og
ox
2
= u
Therefore,
]
x
1
+ z
g
x
1
Jx
1
= u.
Since Jx
1
is independent variable:
o
ox
1
+z
-
og
ox
1
= u
Optimal Control: Calculus of Variations 43
Approach 2: Lagrange Multiplier method
L x
1
, x
2
, z = x
1
, x
2
+zg x
1
, x
2

Further,
L
x
= g x
1
-
, x
2
-
= u

Combining the three equations:
L
x
1
=
]
x
2
+z
-
g
x
2
= u
L
x
2
=
]
x
1
+z
-
g
x
1
= u
L
x
= g x
1
-
, x
2
-
= u
To be solved simultaneously
By eliminating z
-
from first two equations:
o
ox
1
og
ox
2
-
o
ox
2
og
ox
1
= u
The same can be extended for multiple constraints, i.e. g
1
x
1
, x
2
= u,
g
2
x
1
, x
2
= u,
Optimal Control: Calculus of Variations 44
Extrema of Functionals with Constraints
Pioblem Befinition: Extiemize the functional
[ = _ I x
1
t , x
2
t , x
1
t , x
2
t , t Jt
t
]
t
0

subject to the constraint (plant or system equations)

g(x
1
t , x
2
t , x
1
t , x
2
t ) = u

with fixed end-point conditions:
x
1
t
0
= x
10
; x
2
t
0
x
20
x
1
t
]
= x
1]
; x
2
t
]
= x
2]

Optimal Control: Calculus of Variations 45
Six Steps for Solution
Step 1: Lagrangian
Step 2: Variations and Increment
Step 3: First Variation
Step 4: Fundamental Theorem
Step 5: Fundamental Lemma
Step 6: Euler-Lagrange Equation
Optimal Control: Calculus of Variations 46
Step 1 : Lagrangian
Pioblem Befinition: Extiemize the functional
[
u
= _ L x
1
t , x
2
t , x
1
t , x
2
t , z t , t Jt
t
]
t
0


where z t is the Lagrange multiplier and

L = I x
1
t , x
2
t , x
1
t , x
2
t , t +z(t)g(x
1
t , x
2
t , x
1
t , x
2
t )


Optimal Control: Calculus of Variations 47
Step 2 : Variations and Increment
Consiuei the vaiiations:
x

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 : Euler-Lagrange 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 Euler-Lagrange 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 Euler-Lagrange 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
1-c
-2 2
and C
2
=
1
1-c
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 higher-order 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

You might also like