Professional Documents
Culture Documents
Lecture10 Handout
Lecture10 Handout
Lecture 10
1
Continuous Dynamic Optimization
Final time variation: dx (T ) = δx (T ) + x˙ (T ) dT
T
Leibniz’s rule: J(x) = ∫ h( x(t),t )dt
t0
T
( )
dJ = h ( x (T ),T ) dT − h x ( t 0 ),t 0 dt 0 + ∫ [h ( x(t),t)δx]dt
t0
T
x
with initial condition x0 given. The vector x has n components and the
vector u has m components.
The problem is to find the sequence u*(t) on the time interval [t0,T] that
drives the plant along a trajectory x*(t), minimizes the performance
index
2
Continuous Dynamic Optimization
We adjoin the constraints (system equations and terminal constraint) to
the performance index J with a multiplier function λ(t) ∈ Rn and a
multiplier constant ν ∈ Rp .
T
J ( t 0 ) = φ (T, x (T )) + ν Tψ (T, x (T )) + ∫ [L(t, x(t),u(t)) + λ (t )( f (t, x,u) − x˙ )]dt
T
t0
€
Thus,
T
J ( t 0 ) = φ (T, x (T )) + ν Tψ (T, x (T )) + ∫ [H (t, x(t),u(t), λ(t)) − λ (t) x˙ ]dt
T
t0
[
+ ∫ H xT δx + H uT δu − λT δx˙ + ( H λ − x˙ ) δλ dt
t0
T
]
We integrate by parts, , to obtain
T
dJ ( t 0 ) = (φ x + ψ xT ν − λT ) dx T + (φ t + ψ tT ν + H − λT x˙ + λT x˙ ) dt T
€
+ψ T T dν − ( H − λT x˙ + λT x˙ ) dt t 0 + λT dx t 0
T
⎡ T T ⎤
+ ∫ ⎢ H x + λ˙ δx + H uT δu + ( H λ − x˙ ) δλ ⎥dt
( ) dx ( t ) = δx ( t ) + x˙ ( t ) dt
t
⎣ ⎦
0
ME 433 - State Space Control 164
€
€
3
Continuous Dynamic Optimization
We assume that t0 and x(t0) are both fixed and given, then dt0 and dx(t0)
are both zero. According to the Lagrange theory the constrained
minimum of J is attained at the unconstrained minimum of . This is
achieved when for all independent increments in its arguments.
Then, the necessary conditions for a minimum are:
ψT =0
H λ − x˙ = 0 ⇒ x˙ = H λ = f
Two-point Boundary-value Problem
H x + λ˙ = 0 ⇒ −λ˙ = H x = Lx + λT f x
H u = Lu + λT f u = 0
T T
(φ x + ψ xT ν − λT ) dx T + (φ t + ψ tT ν + H ) dt T = 0
The initial condition for the Two-point Boundary-value Problem is the
known value for x0. For a fixed T, the final condition is either a desired
value of x(T) or the value of λ (T) given by the last equation. This
€ equation allows for possible variations in the final time T → minimum
time problems.
ME 433 - State Space Control 165
Performance Index
Costate Equation
Final-state Constraint
Stationary Condition
Hamiltonian
Boundary Condition
x ( t 0 ) given
T T
(φ x + ψ xT ν − λT ) dx T + (φ t + ψ tT ν + H ) dt T = 0
ME 433 - State Space Control 166
4
Continuous Dynamic Optimization
The time derivative of the Hamiltonian is
5
Continuous Dynamic Optimization
Plant:
Performance index:
Hamiltonian:
Costate Equation:
(State Equation)
(Costate Equation)
Hence, in the optimal control problem, the state and costate equations
are a generalized formulation of Hamilton’s equations of motion
ME 433 - State Space Control 170
6
Continuous Dynamic Optimization
Examples:
with initial condition x0 given. We assume that the final time T is fixed
and given, and that no function of the final state ψ is specified. We want
to find the sequence u*(t) that minimizes the performance index:
€ T
1 1
J ( t 0 ) = x T (T ) S (T ) x (T ) +
2 2
∫ ( x Q(t) x + u R(t)u)dt
T T
t0
7
Continuous Dynamic Optimization
We adjoin the system equations (constraints) to the performance index
J with a multiplier sequence λ(t) ∈ Rn.
T
1 1
J ( t 0 ) = x T (T )S (T ) x (T ) +
2 2
∫ [ x Q(t ) x + u R(t )u˙x + λ ( A(t ) x + B(t )u − x˙ )]dt
T T T
t0
H ( t ) = x T Q( t ) x + uT R( t ) u˙x + λT ( A( t ) x + B( t ) u)
€
Thus, the necessary conditions for a stationary point are:
∂H
x˙ = = A( t ) x + B( t ) u State Equation
€ ∂λ
∂H
−λ˙ = = Qx + AT ( t ) λ Costate Equation
∂x
€ ∂H
= Ru + BT λ = 0 ⇒ u( t ) = −R −1BT λ( t ) Stationary Condition
∂u
ME 433 - State Space Control 173
€
€
We will solve this system for two special cases:
8
Continuous Dynamic Optimization
x˙ = A( t ) x + B( t ) u,
€
If Q≠0, the problem is intractable analytically. The Two-point Boundary-
value Problem is now simplified:
(
λ(T ) = −GC−1 ( t 0 ,T ) rT − e A (T −t 0 ) x 0 )
Weighted Controllability Gramian of [A,B]
€ ME 433 - State Space Control 176
9
Continuous Dynamic Optimization
Summary:
T
T
GC ( t 0 ,T ) = ∫e A (T −τ )
BR −1BT e A (T −τ )
dτ
t0
The inverse of the gramian GC(t0,T) exits if and only if the system is
controllable.
€
(
λ(T ) = −GC−1 ( t 0 ,T ) rT − e A (T −t 0 ) x 0 )
t
T
x ( t ) = e A ( t −t 0 ) x 0 − ∫e A (T −τ )
BR −1BT e A (T −τ )
λ (T ) dτ
t0
€
u* ( t ) = R −1BT e A
T
(T −t )
(
GC−1 ( t 0 ,T ) rT − e A (T −t 0 ) x 0 )
€
ME 433 - State Space Control 177
t0
€
€
We need
Let us assume that this relationship holds for all t0≤t≤T (Sweep Method)
λ( t ) = S ( t ) x ( t )
ME 433 - State Space Control 178
10
Continuous Dynamic Optimization
We differentiate the costate and use the state equation,
€
€
If we select the optimal control, the value of the cost function for t0≤t ≤ T
is just
€
1 T
J (t0 ) = x ( t 0 ) S( t0 ) x (t 0 )
2
11
Continuous Dynamic Optimization
Examples:
Steady-State Feedback
6. Steady-State Feedback for discrete-time systems
where
−1
K k = ( R + BT Sk +1B) BT Sk +1 A
−1
Sk = AT Sk +1 A − AT Sk +1B( BT Sk +1B + R) BT Sk +1 A + Q
The
€ closed-loop system is time-varying!!!
x k +1 = ( A − BK k ) x k
€ What about a suboptimal constant
feedback gain?
€
ME 433 - State Space Control 182
12
Steady-State Feedback
6.1 The Algebraic Riccati Equation (ARE)
−1
Sk = AT Sk +1 A − AT Sk +1B( BT Sk +1B + R) BT Sk +1 A + Q RDE
Steady-State Feedback
1- When does there exist a bounded limiting solution S∞ to the Ricatti
equation for all choices of SN?
2- In general, the limiting solution S∞ depends on the boundary
condition SN. When is S∞ the same for all choices of SN?
3- When is the closed-loop system (uk=-K∞xk ) asymptotically stable?
€
€
13
Steady-State Feedback
7. Steady-State Feedback for continuous-time systems
u( t ) = −K ( t ) x ( t )
where
K ( t ) = R −1BT S ( t )
€
−S˙ = AT S + SA − SBR −1BT S + Q
Steady-State Feedback
7.1 The Algebraic Riccati Equation (ARE)
u = −K ∞ x
K ∞ = R −1BT S∞
ME 433 - State Space Control 186
14
Steady-State Feedback
1- When does there exist a bounded limiting solution S∞ to the Ricatti
equation for all choices of S(T)?
2- In general, the limiting solution S∞ depends on the boundary
condition S(T). When is S∞ the same for all choices of S(T)?
3- When is the closed-loop system (u=-K∞x) asymptotically stable?
Theorem: Let (A, B) be stabilizable. Then, for every choice of S(T) there
is a bounded solution S∞ to the RDE. Furthermore, S∞ is a positive
semidefinite solution to the ARE.
Theorem: Let C be a square root of the intermediate-state weighting
matrix Q, so that Q=CTC≥0, and suppose R>0. Suppose (A, C) is
observable. Then, (A, B) is stabilizable if and only if:
a- There is a unique positive definite limiting solution S∞ to the RDE.
Furthermore, S∞ is the unique positive definite solution to the ARE.
b- The closed-loop plant
x˙ = ( A − BK ∞ ) x
is asymptotically stable, where K∞ is given by
ME 433 - State Space Control 187
Steady-State Feedback
Examples:
15
Receding Horizon LQ Control
8. Receding Horizon LQ Control
So far we have seen two kinds of LQ control problems:
Finite Horizon: Finite duration, time-varying solution (even for time
invariant systems), solution via RDE, no stability properties necessary.
1 T 1 N −1
Discrete time: J= x N SN x N + ∑ ( x Tk Qk x k + uTk Rk uk )
2 2 k =0
−1
Sk = AkT Sk +1 Ak − AkT Sk +1Bk ( BkT Sk +1Bk + Rk ) BkT Sk +1 Ak + Qk
−1
uk = −( Rk + BkT Sk +1Bk ) BkT Sk +1 Ak x k
€
T
1 1
€Continuous time: J ( t 0 ) = x T (T ) S (T ) x (T ) +
2 2
∫ ( x Q(t) x + u R(t)u)dt
T T
t0
€ −S˙ = A S + SA − SBR B S + Q
T −1 T
−1 T
u( t ) = −R( t ) B( t ) S ( t ) x ( t )
€ Space Control
ME 433 - State 189
€
€
1 ∞ T
Discrete time: J = ∑ ( x k Qx k + uTk Ruk )
2 k =0
[ −1
S ∞ = A T S ∞ − S ∞ B( B T S ∞ B + R) B T S ∞ A + Q ]
−1
k = −( R + B S ∞ B) B S ∞ Ax k
T T
u€
∞
1
€
Continuous time: J=
2
∫ ( x Q(t ) x + u R(t )u)dt
T T
0
€
0 = AT S∞ + S∞ A − S∞ BR −1BT S∞ + Q
( t ) = −R −1BT S∞ x (t )
u€
ME 433 - State Space Control 190
€
16
Receding Horizon LQ Control
Receding Horizon: At each time i (discrete) or t (continuous) we solve
a finite horizon problem
Discrete time:
1 T 1 N −1 T
J = x i+N SN x i+N + ∑ ( x i+k Qk x i+k + uTi+k Rk ui+k )
2 2 k =0
−1
Sk = AkT Sk +1 Ak − AkT Sk +1Bk ( BkT Sk +1Bk + Rk ) BkT Sk +1 Ak + Qk 0 ≤ k ≤ N −1
−1
ui = −( Ri + BiT S0 Bi ) BiT S0 Ai x i
€
Continuous time: €
€ 1 T 1T
€
( T T
)
J ( t ) = x (t + T )S (T ) x (t + T ) + ∫ x (t + τ ) Q(τ ) x (t + τ ) + u( t + τ ) R(τ ) u( t + τ ) dτ
2 20
−S˙ = AT S + SA − SBR −1BT S + Q 0≤t ≤T
−1 T
€ u( t ) = −R( t ) B( t ) S (0) x ( t )
ME 433 - State Space Control 191
€ €
17
Receding Horizon LQ Control
Receding Horizon: At each time i (discrete) or t (continuous) we solve
a finite horizon problem
Discrete time:
−1
ui = −( Ri + BiT S0 Bi ) BiT S0 Ai x i
−1
Sk = AkT Sk +1 Ak − AkT Sk +1Bk ( BkT Sk +1Bk + Rk ) BkT Sk +1 Ak + Qk 0 ≤ k ≤ N −1
€
−1
Sk +1 = AkT Sk +1 Ak − AkT Sk +1Bk ( BkT Sk +1Bk + Rk ) BkT Sk +1
€Ak + Qk
€
Qk = Qk + Sk +1 − Sk
18