LQR Lagrange
LQR Lagrange
LQR Lagrange
Lecture 2
LQR via Lagrange multipliers
2–1
Some useful matrix identities
(provided I + Z is invertible)
to verify:
−1
Y (I + XY ) = I + XY − X(I + Y X)−1Y (I + XY )
I − X(I + Y X)
= I + XY − X(I + Y X)−1(I + Y X)Y
= I + XY − XY = I
let’s check:
−1
−1 −1
−1 −1
I + X(Z Y) = I −X I +Z YX Z Y
= I − X(Z(I + Z −1Y X))−1Y
= I − X(Z + Y X)−1Y
1
(A + bcT )−1 = A−1 − (A−1b)(cT A−1)
1 + cT A−1b
−1 −1 −1 −1
−1
(A + BC) =A −A B I + CA B CA−1
−1 −1
−1
(A + BC) = A(I + A BC)
= (I + (A−1B)C)−1A−1
−1 −1 −1
C A−1
= I − (A B)(I + C(A B))
= A−1 − A−1B(I + CA−1B)−1CA−1
minimize f (x)
subject to F x = g
• F ∈ Rm×n is fat
∇xL = ∇f (x) − F T λ = 0, ∇λ L = g − F x = 0
∇f
{x | F x = g}
f (x) = constant
∇f
1
PN −1
xTt Qxt uTt Rut + 12 xTN Qf xN
minimize J= 2 t=0 +
subject to xt+1 = Axt + But, t = 0, . . . , N − 1
N
X −1
L=J+ λTt+1 (Axt + But − xt+1)
t=0
∇xN L = Qf xN − λN = 0, so λN = Qf xN
this recursion for state x runs forward in time, with initial condition
λt = AT λt+1 + Qxt, λN = Qf xN
• λ is called co-state
• recursion for λ sometimes called adjoint system
thus, Riccati recursion gives clever way to solve this set of linear equations
so
λt+1 = (I + Pt+1BR−1B T )−1Pt+1Axt
Pt = Q + AT (I + Pt+1BR−1B T )−1Pt+1A
ut = −R−1B T λt+1
= −R−1B T (I + Pt+1BR−1B T )−1Pt+1Axt
= −R−1(I + B T Pt+1BR−1)−1B T Pt+1Axt
= −((I + B T Pt+1BR−1)R)−1B T Pt+1Axt
= −(R + B T Pt+1B)−1B T Pt+1Axt