lecture 13: optimisation -...
TRANSCRIPT
Lecture 13: RLSC - Prof. Sethu Vijayakumar 1
Lecture 13: Optimisation (planning under constraints)
Contents:
• Planning under constraints • Optimisation of a function (with constraints)
• Optimisation of a functional (with constraints)
• Pontryagin’s Minimisation Principle
• Example: LQR
Lecturer: Dr. David Braun
Planning & Optimisation
Lecture 13: RLSC - Prof. Sethu Vijayakumar 2
Planning & Optimisation
Lecture 13: RLSC - Prof. Sethu Vijayakumar 3
Minimisation of a function
Constrained Unconstrained
Fun
ctio
nal
Fun
ctio
n
Minimisation of a functional
Minimisation of a function
under (algebraic) constraints
Minimisation of a functional
under (differential) constraints
1. Minimisation of a function
Lecture 13: RLSC - Prof. Sethu Vijayakumar 4
• Consider a minimisation problem:
where
• The objective is to find such that
• The following equation provides a necessary condition for to be a minimum
• However, this equation defines all stationary points, and as such its solution may also be a maximum or an inflection points of the considered function.
• A sufficient condition for a minimum is provided by:
is a positive definite matrix
)(min xfnRx
0)( *
x
x
f
nRx * )(min)( * xfxfnRx
*x
)( *
2
2
xx
f
RRf n :
Minimisation of a function
Lecture 13: RLSC - Prof. Sethu Vijayakumar 5
• At the minimum (or any stationary point), the differential of a function has to be zero (consider a one variable case):
• At the minimum, the function cannot decrease regardless of how its argument changes:
)(min)( * xfxfifRx
00)(0)(,1 ** dfxdx
dfxx
dx
dfdfx
00)()(,1 *
2
22*
2
2
fxdx
fdxx
dx
fdfx
)()( 32*
2
2
xOxxdx
fddff
Imposition of constraints
Lecture 13: RLSC - Prof. Sethu Vijayakumar 6
),(min 21, 21
yxfxx
0),( 21 xxg
))(,(min
)(0),(
1
1
1
1
1
221
1
xgxf
xgxxxg
x
• Consider the minimisation of a function subject to algebraic constraints:
• To solve this problem, we can attempt to reduce this constrained minimisation to the previously discussed unconstrained one by elimination of the constraints:
Lagrange multiplier method
Lecture 13: RLSC - Prof. Sethu Vijayakumar 7
0
~
,
~
,0
~
222111
f
x
g
x
f
x
f
x
g
x
f
x
f
• Alternatively, we may also employ the Lagrange multiplier method by following the procedure described below:
1. Define the Lagrangian:
2. Define an unconstrained minimisation:
3. Find the solution of the above problem by applying the condition(s) previously presented for unconstrained minimisation:
),,(~
min 21,, 21
xxfxx
),(),(),,(~
212121 xxgxxfxxf
Example
Lecture 13: RLSC - Prof. Sethu Vijayakumar 8
02
~
,02
~
,02
~
212
2
1
1
xx
fx
x
fx
x
f
• Find the minimiser of the following constrained problem:
• Lagrange multiplier method:
• The solution of these equations provides a (unique and global) minimum
of the original problem:
))2((min),,(~
min 21
2
2
2
1),,(
21,, 3
2121
xxxxxxfRxxxx
)(min),(min 2
2
2
1),(
21, 2
2121
xxxxfRxxxx
02),( 1221 xxxxg
2,1,1 21 xx
2. Minimisation of a functional
Lecture 13: RLSC - Prof. Sethu Vijayakumar 9
dtxxtLI
T
TCx
0
],0[),,(min
1
0)0()0()()(,0
x
x
LTxT
x
L
x
L
dt
d
x
L
• Consider the minimisation problem:
where
• The following differential (Euler-Lagrange) equation and the associated boundary condition provide the necessary conditions for the above functional minimisation (see the next page for the derivation):
RTCI ],0[: 1
Calculus of variations
10
0,0)0()0()()(0,
x
L
dt
d
x
Lx
x
LTxT
x
LIx
• An increment of a functional along a function is defined by:
where defines the variation of and
is the variation of the functional.
• According to the Fundamental Theorem of the Calculus of Variations,
for a function that minimises (or maximises) the functional .
T
T
xdtx
L
dt
d
x
Lx
x
LTxT
x
L
dtxx
Lx
x
LI
0
0
)0()0()()(
tohIdtxxtLxxxxtLI
T
..)),,(),,((0
)()( * txtxx
Lecture 8: RLSC - Prof. Sethu Vijayakumar
x
I
I x
10 Lecture 13: RLSC - Prof. Sethu Vijayakumar
Imposition of constraints
Lecture 13: RLSC - Prof. Sethu Vijayakumar 11
0
0,
)0(),,,(,),,())((min xxuxtfxdtuxtLTxI
T
xu
),,(),,(),,( uxtfuxtLuxtH
• Consider now a problem where minimization of a functional is subject to differential constraints:
• Following the Lagrange multiplier method, we may first define the Hamiltonian function: and then replace the above problem with the following unconstrained minimisation:
dtxHdtxfLI
TT
xu)())((
~min
00,,
Imposition of constraints
Lecture 13: RLSC - Prof. Sethu Vijayakumar 12
0
)0()0()()()()(~
),,,(
0
dtxH
uu
Hx
x
H
xTxTTxTx
Ixu
T
• Following the Fundamental Theorem of the Calculus of Variations:
• The necessary conditions follows:
))!,,,(min(0
)()(,
)0(, 0
uxtHu
H
Tx
Tx
H
xxH
x
u
Pontryagin’s Minimum Principle
Lecture 13: RLSC - Prof. Sethu Vijayakumar 13
),,,(min
)()(,
)0(, 0
uxtH
Tx
Tx
H
xxH
x
u
0
0
)0(),,,(,),,())((min xxuxtfxdtuxtLTxI
T
u
• Consider the following problem subject to differential and control constraints:
(where is a time-invariant, closed and convex) .
• According to the PMP the following equations provide the necessary conditions for optimality of the solution:
Example: LQR
Lecture 13: RLSC - Prof. Sethu Vijayakumar 14
0
0
)0(,,)(2
1)()(
2
1xxBuAxxdtRuuQxxTxPTxI
T
TT
T
T
TT
T
T
BRuBRuu
H
TxPTAQxx
H
xxBuAxH
x
1
0
0
)()(,
)0(,
• Quadratic objective functional and linear dynamics:
• Define the Hamiltonian function:
• Application of PMP leads to the following conditions:
)(2
1BuAxRuuQxxH TTT
Example: LQR -
Lecture 13: RLSC - Prof. Sethu Vijayakumar 15
)(),( ttxx
)(tuu
)()(,
)0(, 0
1
TxPTAQxx
H
xxBBRAxx
T
T
T
• By substituting the optimal control inputs into the dynamics one obtains the following two-point boundary value problem (TPBVP):
• Using the shooting method we can find:
• Finally, substituting into the optimal control solution, we obtain:
)()( 1 tBRtuu T
)(t
Example: LQR -
Lecture 13: RLSC - Prof. Sethu Vijayakumar 16
Px
T
TT PTPPBPBRQPAPAP )(,1
xtPBRxtuu T )(),( 1
),( xtuu
xPBRxuu T
1)(
• In order to obtain a linear feedback control law, let us introduce the following substitution:
• Plugging this relation into the TPBVP, the following matrix Riccati equation is defined:
• The solution of the above equation and the relation provide a time-varying linear feedback control-law:
• In a special case, when the differential equation is time-invariant and the time horizon is infinite, the linear feedback controller becomes time-invariant:
PBBRPQPAAP TT 10
Px
Lecture 13: RLSC - Prof. Sethu Vijayakumar 17
For more details refer to …
• D. E. Kirk, Optimal Control Theory: An Introduction. Englewood Cliffs, NJ: Prentice-Hall, 1970.
• A. E. Bryson and Y. C. Ho, Applied Optimal Control. Hemisphere, Wiley, 1975.
• J. T. Betts, “Survey of numerical methods for trajectory optimization,” AIAA
Journal of Guidance, Control and Dynamics, vol. 21, no. 2, pp. 193–207, 1998.