Preface: Euler-Lagrange Equation
Preface: Euler-Lagrange Equation
Preface: Euler-Lagrange Equation
Preface
Inthelastlecture,weintroducedthesubjectofthecalculusofvariations,whichisthesecondmethod
used to solve optimal control problems. We developed the mathematical concepts which support the
fundamental theorem of the calculus of variations, which lead to the EulerLagrange equation. The
solutionofthisequationisoneofourprimaryobjectivesgoingforward.Inthislecture,webeginthat
taskbysettingupandsolvingtheEulerLagrangeequationforasetofsimpleexamples.
Euler-Lagrange Equation
WebeginourdiscussionoftheEulerLagrangeequationwithasimpleprobleminvolvingafunctionalof
asinglefunction,i.e.
tf
J ( x) g ( x ( t ) , x ( t ) , t ) d t
t0
(9.1)
Where,wehavethat x isascalarfunctionintheclassoffunctionswithcontinuousfirstderivatives.We
wanttofind x thatcauses J tohavearelativeextremum.Weshallassumethat t 0 and t f arefixed,and
thattheendpoints,i.e. x 0 and x f ,arespecified.Westartwiththeincrementof J asfollows,
J ( x) J ( x x) J ( x)
tf
g x ( t ) x ( t ) , x ( t ) x ( t ) , t d t
t0
tf
(9.2)
g x ( t ) , x ( t ) , t d t
t0
tf
g x ( t ) x ( t ) , x ( t ) x ( t ) , t g x ( t ) , x ( t ) , t d t
t0
x ( t )
d
x ( t ) ,andalso x ( t ) d x ( t )
dt dt
Wecanexpandtheintegrandofequation(9.2)inaTaylorseriesaboutthepoint x ( t ) , x ( t ) asfollows:
tf
g
J ( x) { g x ( t ) , x ( t ) , t x x ( t ) , x ( t ) , t x ( t )
t0
g
x ( t ) , x ( t ) , t x ( t )
x
1 2g
x ( t ) , x ( t ) , t ( x ( t ) ) 2
2 x 2
g2
x ( t ) , x ( t ) , t ( x ( t ) x ( t ) ) (9.3)
x x
1 2g
2 x ( t ) , x ( t ) , t ( x ( t ) )
2
2 x
higher order terms
g x ( t ) , x ( t ) , t } d t
tf
g
J (x , x ) { x x ( t ) , x ( t ) , t x ( t )
t0
(9.4)
g
x ( t ) , x ( t ) , t x ( t ) } d t
x
tf
x ( t ) x ( t 0 ) x ( t ) d t
t0
g tf
J (x , x ) x ( t ) , x ( t ) , t x ( t )
x t0
t
f
g
{ x ( t ) , x ( t ) , t (9.5)
t0 x
d g
x ( t ) , x ( t ) , t } x ( t ) d t
dt x
Note that since x ( t 0 ) and x ( t f ) are specified, all admissible curves must pass through these points.
Thus, x ( t 0 ) x ( t f ) 0 andthetermsoutsideoftheintegralinequation(9.5)mustvanish.Now,
ifweapplythefundamentaltheoremtoequation(9.5)andconsideranextremalcurve,weget
tf
g
J (x , x ) { x x
( t ) , x ( t ) , t
t0
(9.6)
d g
d t x
x ( t ) , x ( t ) , t } x ( t ) d t
Now,thefundamentallemmaofthecalculusofvariationsstatesthefollowing:
tf
continuousintheinterval t 0 , t f ,then h iseverywherezeroin t 0 , t f .
Applyingthefundamentallemmatoequation(9.6),weobtaintheEulerLagrangeequation,i.e.
g d g
( x ( t ) , x ( t ) , t )
( x ( t ) , x ( t ) , t ) 0 (9.7)
x dt x
Equation(9.7)holdstrueforall t t 0 , t f .Wealsonotethatequation(9.7)isanordinarydifferential
equation(ODE),whichisgenerallysecondorder,nonlinear,andtimevarying.Allofthesefactorsplus
thepresenceofsplitboundaryconditionsmakesolutiondifficult.
Letstakeasimpleexampleasfollows:
/2
Find the extremal x of J ( x ) x
( t ) x 2 ( t ) d t which satisfies the boundary
2
conditions x ( 0 ) 0 x ( / 2 ) 1 .
First,wemustformtheEulerLagrangeequation.Wenotethat
g ( x ( t ) , x ( t ) ) x 2 (t ) x 2 ( t )
Andso,
g d g
0 ( x ( t ) , x ( t ) , t ) ( x ( t ) , x ( t ) , t )
x d t x
2 x ( t )
d
dt
2 x ( t ) (9.8)
x ( t ) x ( t )
Note that equation (9.8) is a linear ODE with constant coefficients, and so it is readily solved using
classicaltechniques.Doingso,wecanwritethefamiliarformofthesolutionasfollows:
Wenowapplytheboundaryconditionstoequation(9.9)inordertosolveforthearbitraryconstants c1
and c2 ,i.e.
x ( 0 ) 0 c1 cos ( 0 ) c 2 sin ( 0 ) c1 0
x ( / 2 ) 1 c1 cos ( / 2 ) c 2 sin ( / 2 ) c 2 1
Thus,thesolutiontoequation(9.8)accountingfortheboundaryconditionsisgivenby:
x ( t ) sin t (9.10)
Thissimpleexampleillustratestheprocessbutnotthedifficultiesencounteredinsolvingequation(9.7).
Wewilldealwiththeseconcernslater.Fornow,wewishtoconsiderproblemswheretheconditionsat
thefinalboundarymaybefreetovary.Notethatproblemswhereconditionsattheinitialtimearefree
canalwaysbehandledinasimilarfashion.
Returningtoequation(9.5),wenotethat x ( t f ) isarbitrary,andsowemusthavethat
g
( x ( t f ) , x ( t f ) , t f ) 0 (9.12)
x
Note that equation (9.12) provides the second boundary condition with x ( t 0 ) x0 being the other.
Consequently,wehavesplitboundaryconditionsonceagain.
Again,letstakeasimpleexample,i.e.
x
2
Determine the extremal of the functional J ( x ) ( t ) 2 x ( t ) x ( t ) 4 x 2 ( t ) d t ,
2
WestartwiththeEulerLagrangeequation,i.e.
g d g
0 ( x ( t ) , x ( t ) , t ) ( x ( t ) , x ( t ) , t )
x d t x
8 x ( t ) 2 x ( t )
d
dt
2 x ( t ) 2 x ( t ) (9.13)
x ( t ) 4 x ( t )
Notethatequation(9.13)isalinearODEwithconstantcoefficients,andsoitisreadilysolved.Doingso,
thesolutionisasfollows,i.e.
x * ( t ) c1e 2 t c 2 e 2 t (9.14)
Onceagain,weusetheboundaryconditionsinordertodeterminethearbitraryconstantsinequation
(9.14).Inthiscase,wegetasetofsimultaneousequations,i.e.
x ( 0 ) 1 c1 c 2
g
x ( 2 ) , x ( 2 ) 0 c1e 4 3 c2 e 4
x
Nowsolvingthesesimultaneousequationsfortheunknowncoefficients,wegetthefollowing,i.e.
3e4 e4
c1 c1 (9.15)
e 4 3 e 4 e 4 3e 4
g
J ( x) x * ( t f ) , x * ( t f ) , t f x ( t f )
x
g x * ( t f ) , x * ( t f ) , t f t f
tf
g (9.16)
{ x * ( t ) , x * ( t ) , t
t0 x
d g
x * ( t ) , x * ( t ) , t } x ( t ) d t
dt x
Notethatwehavethefollowingrelationships,
x f x ( t f ) x * ( t f ) t f
Or,
x ( t f ) x f x * ( t f ) t f (9.17)
Substitutingequation(9.17)intoequation(9.16),andcollectingthelinearterms,weobtain
g
J ( x*, x ) x * ( t f ) , x * ( t f ) , t f x f
x
g
g x * ( t f ) , x * ( t f ) , t f x * ( t f ) , x * ( t f ) , t f x ( t f ) t f
x
g
tf
x * ( t ) , x * ( t ) , t d g x * ( t ) , x * ( t ) , t x ( t ) d t
t0
x d t x
(9.18)
The EulerLagrange equation must be satisfied regardless of boundary conditions. But, a few other
comments are in order regarding the terms outside of the integral in equation (9.18) above. If t f and
x ( t f ) areunrelated,then x f and t f areindependentofoneanotherandarbitrary,soeachoftheir
respectivecoefficientsinequation(9.18)mustbezero,i.e.
g
x * ( t f ) , x * ( t f ) , t f 0
x
(9.19)
g
g x * ( t f ) , x * ( t f ) , t f x * ( t f ) , x * ( t f ) , t f x ( t f ) 0
x
Alsonotethatequation9.19impliesthat
g x * ( t f ) , x * ( t f ) , t f 0 (9.20)
x(t f ) (t f ) (9.21)
Andso,
d
x (t f ) (t f ) t f (9.22)
dt
Consequently,ifwesubstituteequation(9.22)intoequation(9.18),thenweobtainthefollowing
g x * ( t f ) , x * ( t f ) , t f
g d
x * ( t f ) , x * ( t f ) , t f
(9.23)
( t f ) x * ( t f ) 0
x dt
Equation(9.23)iscalledthetransversalitycondition.
Now, lets consider some examples of free end conditions. First, consider the case where x ( t f ) is
specifiedbut t f isfreeasfollows:
tf
1
Find an extremal of the functional J ( x ) x ( t ) 2 x ( t ) d t with boundary
2
1
2
conditions x ( 1 ) 4 , x ( t f ) 4 and t f 1 isfree.
Asalways,westartwiththeEulerLagrangeequations,i.e.
g d g
0 ( x ( t ) , x ( t ) , t ) ( x ( t ) , x ( t ) , t )
x d t x
2
d
dt
x ( t ) (9.24)
2 x ( t )
Or,
x * ( t ) 2 (9.25)
Thesolutionofequation(9.25)isfoundbyintegratingtwicetoobtain
x * ( t ) t 2 c1t c 2 (9.26)
Now,wemustfindthevaluesoftheunknownandarbitraryconstantsinequation(9.26),i.e. c1 and c2 ,
usingtheboundaryconditions.Since t f isfree,wehavethat
x * (1 ) 4 1 c1 c 2 c1 c 2 3
1 2 1
2 x *(t f ) x * ( t f ) 0 2 c 2 c12 (9.27)
2 2
x * ( t f ) 4 t f c1t f c 2
2
Wecansolvethesesimultaneousequations(9.27)toobtainthefollowingresult,i.e.
x * ( t ) t 2 6 t 9 ,and t f 5 (9.28)
Notethatalloftheboundaryconditionsareindeedmetbytheextremalcurve(9.28).
( t ) 5 t 15 (9.29)
Besidesthisboundaryconstraint,theproblemisstatedasfollows:
tf
1 x 1/ 2
Findanextremalofthefunctional J ( x ) 2
(t ) d t withboundarycondition
0
x ( 0 ) 0 .
First,weformtheEulerLagrangeequation,i.e.
d g
0 ( x ( t ) , x ( t ) , t )
d t x
d
dt
2 x ( t ) (9.30)
x ( t )
Thesolutionisfoundbyintegratingequation(9.30)twicewhichyieldsthefollowingexpression:
x * ( t ) c1t c2 (9.31)
x * ( t f )
5 x * ( t f ) 1 x *2 ( t f ) 1/ 2
0
1 x * 2
(t f ) 1/ 2
And,aftersimplifying,wehavethat
5 x * ( t f ) 1 0 (9.32)
x(t f ) (t f )
1
t f 5 t f 15
5
Andso,
75
tf 2.88 (9.33)
26
Thefigurebelowpresentstheexpectedresult:theshortestpath(seetheredlinebelow)liesalongthe
perpendicularlinethatpassesthroughtheoriginandintersectsthelineformedbythemovingpoint.
x(t)
15
x*(t)
t
5
10