Chapter2 1
Chapter2 1
The optimal control problem is to find the control 𝑢𝑢∗ on the interval
[𝑖𝑖, 𝑁𝑁] that drives the system along a trajectory 𝑥𝑥𝑘𝑘∗ such that the value of
the performance index is minimized (optimized).
Example 2:1-1
A. Minimum-time Problems
Suppose we want to find the control 𝑢𝑢𝑘𝑘 to drive the system from the
given initial state 𝑥𝑥0 to a desired final state 𝑥𝑥 ∈ ℝn in minimum time,
then we could select the performance index
𝑁𝑁−1
𝐽𝐽 = 𝑁𝑁 = � 1
𝑘𝑘=0
and specify the boundary condition
MECE6388 Optimal Control Theory, 2024 Fall
Dr. Zheng Chen
𝑥𝑥𝑁𝑁 = 𝑥𝑥
𝐽𝐽 = � |𝑢𝑢𝑘𝑘 |
𝑘𝑘=0
Since the fuel burned is proportional to the magnitude of final state and
all intermediate state, we define a new cost
𝑁𝑁−1
1 1
𝐽𝐽 = 𝑠𝑠𝑥𝑥𝑁𝑁𝑇𝑇 𝑥𝑥𝑁𝑁 + �(𝑞𝑞𝑥𝑥𝑘𝑘𝑇𝑇 𝑥𝑥𝑘𝑘 + 𝑟𝑟𝑢𝑢𝑘𝑘𝑇𝑇 𝑢𝑢𝑘𝑘 )
2 2
𝑘𝑘=0
where 𝑞𝑞, 𝑟𝑟, and 𝑠𝑠 are scalar weighting factors.
For more generality, we could select weighting matrices 𝑄𝑄, 𝑅𝑅, and
𝑆𝑆 instead of scalars.
𝑁𝑁−1
1 1
𝐽𝐽 = 𝑥𝑥𝑁𝑁𝑇𝑇 𝑆𝑆𝑥𝑥𝑁𝑁 + � (𝑥𝑥𝑘𝑘𝑇𝑇 𝑄𝑄𝑥𝑥𝑘𝑘 + 𝑢𝑢𝑘𝑘𝑇𝑇 𝑅𝑅𝑢𝑢𝑘𝑘 )
2 2
𝑘𝑘=0
Problem Solution:
Let 𝜆𝜆 ∈ ℝ𝑛𝑛 and append the constraints to the performance index
𝑁𝑁−1
𝐽𝐽′ = 𝜙𝜙(𝑁𝑁, 𝑥𝑥𝑁𝑁 ) + �[𝐿𝐿𝑘𝑘 (𝑥𝑥𝑘𝑘 , 𝑢𝑢𝑘𝑘 ) + 𝜆𝜆𝑇𝑇𝑘𝑘+1 (𝑓𝑓 𝑘𝑘 (𝑥𝑥𝑘𝑘 , 𝑢𝑢𝑘𝑘 ) − 𝑥𝑥𝑘𝑘+1 )]
𝑘𝑘=𝑖𝑖
Note that we have associated with 𝑓𝑓 𝑘𝑘 the multiplier 𝜆𝜆𝑘𝑘+1 not 𝜆𝜆.
𝐽𝐽′ = 𝜙𝜙(𝑁𝑁, 𝑥𝑥𝑁𝑁 ) − 𝜆𝜆𝑇𝑇𝑁𝑁 𝑥𝑥𝑁𝑁 + 𝐻𝐻𝑖𝑖 (𝑥𝑥𝑖𝑖 , 𝑢𝑢𝑖𝑖 ) + � [𝐻𝐻𝑘𝑘 (𝑥𝑥𝑘𝑘 , 𝑢𝑢𝑘𝑘 , ) − 𝜆𝜆𝑇𝑇𝑘𝑘 𝑥𝑥𝑘𝑘 ]
𝑘𝑘=𝑖𝑖+1
where some minor manipulations with indies have been performed.
Now, we want to examine the increment 𝐽𝐽′ due to increment in all the
variables 𝑥𝑥𝑘𝑘 , 𝜆𝜆𝑘𝑘 and 𝑢𝑢𝑘𝑘 .
𝑇𝑇 𝑇𝑇 𝑇𝑇
𝑑𝑑𝐽𝐽′ = �𝜙𝜙𝑥𝑥𝑁𝑁 − 𝜆𝜆𝑁𝑁 � 𝑑𝑑𝑥𝑥𝑁𝑁 + �𝐻𝐻𝑥𝑥𝑖𝑖 𝑖𝑖 � 𝑑𝑑𝑥𝑥𝑖𝑖 + �𝐻𝐻𝑢𝑢𝑖𝑖 𝑖𝑖 � 𝑑𝑑𝑢𝑢𝑖𝑖
𝑁𝑁−1
𝑇𝑇 𝑇𝑇
+ � ��𝐻𝐻𝑥𝑥𝑘𝑘𝑘𝑘 − 𝜆𝜆𝑘𝑘 � 𝑑𝑑𝑥𝑥𝑘𝑘 + �𝐻𝐻𝑢𝑢𝑘𝑘𝑘𝑘 � 𝑑𝑑𝑢𝑢𝑘𝑘 �
𝑘𝑘=𝑖𝑖+1
𝑁𝑁
𝑇𝑇
+ � �𝐻𝐻𝜆𝜆𝑘𝑘−1
𝑘𝑘
− 𝑥𝑥𝑘𝑘 � 𝑑𝑑𝜆𝜆𝑘𝑘
𝑘𝑘=𝑖𝑖+1
where
𝜕𝜕𝐻𝐻𝑘𝑘
𝐻𝐻𝑥𝑥𝑘𝑘𝑘𝑘
≜
𝜕𝜕𝑥𝑥𝑘𝑘
Necessary conditions for a constrained minimum are thus given by
𝜕𝜕𝐻𝐻𝑘𝑘
𝑥𝑥𝑘𝑘+1 = , 𝑘𝑘 = 𝑖𝑖, … , 𝑁𝑁 − 1 , (1)
𝜕𝜕𝜆𝜆𝑘𝑘+1
𝜕𝜕𝐻𝐻𝑘𝑘
𝜆𝜆𝑘𝑘 = , 𝑘𝑘 = 𝑖𝑖 + 1, … , 𝑁𝑁 − 1 , (2)
𝜕𝜕𝑥𝑥𝑘𝑘
𝜕𝜕𝐻𝐻 𝑘𝑘
0= , 𝑘𝑘 = 𝑖𝑖, … , 𝑁𝑁 − 1 , (3)
𝜕𝜕𝑢𝑢𝑘𝑘
which arise from the terms inside the summations and the coefficient of
𝑑𝑑𝑢𝑢𝑖𝑖 and
𝑇𝑇
𝜕𝜕𝜕𝜕
� − 𝜆𝜆𝑁𝑁 � 𝑑𝑑𝑥𝑥𝑁𝑁 = 0, (4)
𝜕𝜕𝑥𝑥𝑁𝑁
𝑇𝑇
𝜕𝜕𝐻𝐻𝑖𝑖
� � 𝑑𝑑𝑥𝑥𝑖𝑖 = 0, (5)
𝜕𝜕𝑥𝑥𝑖𝑖
The stationary condition allows the optimal control 𝑢𝑢𝑘𝑘 to be expressed
in terms of the costate 𝜆𝜆𝑘𝑘 .
MECE6388 Optimal Control Theory, 2024 Fall
Dr. Zheng Chen
If the initial state 𝑥𝑥𝑖𝑖 is fixed, then 𝑑𝑑𝑥𝑥𝑖𝑖 = 0 . Then (5) holds
regardless of the value of 𝐻𝐻𝑥𝑥𝑖𝑖 𝑖𝑖 .
In the case of free initial state, 𝑑𝑑𝑥𝑥𝑖𝑖 is not zero, then from (5)
𝜕𝜕𝐻𝐻𝑖𝑖
=0
𝜕𝜕𝑥𝑥𝑖𝑖
System Model:
𝑥𝑥𝑘𝑘+1 = 𝑓𝑓 𝑘𝑘 (𝑥𝑥𝑘𝑘 , 𝑢𝑢𝑘𝑘 ), 𝑘𝑘 > 𝑖𝑖
Performance Index:
𝑁𝑁−1
Example
Consider a simple linear dynamical system:
𝑥𝑥𝑘𝑘+1 = 𝑎𝑎𝑥𝑥𝑘𝑘 + 𝑏𝑏𝑢𝑢𝑘𝑘
where 𝑎𝑎, 𝑏𝑏 are scalar constant values.
Given an initial condition 𝑥𝑥0 and the interval [0, 𝑁𝑁], we need to find a
control to minimize the control energy
𝑁𝑁−1
𝑟𝑟
𝐽𝐽0 = � 𝑢𝑢𝑘𝑘2
2
𝑘𝑘=0
for some scalar weighting factor r.
To find out 𝑥𝑥𝑘𝑘∗ and 𝐽𝐽0∗ with the optimal control 𝑢𝑢∗ , we put 𝑢𝑢∗ into the
dynamical equation
∗ ∗
1 − 𝑎𝑎2
𝑥𝑥𝑘𝑘+1 = 𝑎𝑎𝑥𝑥𝑘𝑘 + 2𝑁𝑁
(𝑟𝑟𝑁𝑁 − 𝑎𝑎𝑁𝑁 𝑥𝑥0 )𝑎𝑎𝑁𝑁−𝑘𝑘−1
1 − 𝑎𝑎
The solution of this dynamical system with forcing function given by the
second term is
𝑘𝑘−1
∗ 𝑘𝑘
1 − 𝑎𝑎2
𝑥𝑥𝑘𝑘 = 𝑎𝑎 𝑥𝑥0 + 2𝑁𝑁
(𝑟𝑟𝑁𝑁 − 𝑎𝑎𝑁𝑁 𝑥𝑥0 ) � 𝑎𝑎𝑘𝑘−𝑖𝑖−1 𝑎𝑎𝑁𝑁−𝑖𝑖−1
1 − 𝑎𝑎
𝑖𝑖=0
Rewrite it as
MECE6388 Optimal Control Theory, 2024 Fall
Dr. Zheng Chen
∗
(1 − 𝑎𝑎2(𝑁𝑁−𝑘𝑘) )𝑎𝑎𝑘𝑘 𝑥𝑥0 + (1 − 𝑎𝑎2𝑘𝑘 )𝑎𝑎𝑁𝑁−𝑘𝑘 𝑟𝑟𝑁𝑁
𝑥𝑥𝑘𝑘 =
1 − 𝑎𝑎2𝑁𝑁
where 𝑘𝑘 = 0, 𝑥𝑥0 = 𝑥𝑥0 and when 𝑘𝑘 = 𝑁𝑁, 𝑥𝑥𝑁𝑁∗ = 𝑥𝑥𝑁𝑁 .
∗
The optimal performance index is only related to the final state and the
initial state.
As 𝑟𝑟 → 0, we are concerned less and less about the control energy since
𝑢𝑢𝑘𝑘2 is weighted less and less heavily in 𝐽𝐽0 .
When we look at the final state
𝑎𝑎𝑁𝑁
𝑟𝑟𝑁𝑁 + 𝑥𝑥0
𝑥𝑥𝑁𝑁 = Λ
1
1+
Λ
𝑏𝑏2 (1−𝑎𝑎2𝑁𝑁 ) 𝑟𝑟𝑁𝑁 +0
As 𝑟𝑟 → 0, Λ = (1−𝑎𝑎2 )
→ ∞, 𝑥𝑥𝑁𝑁 → = 𝑟𝑟𝑁𝑁
𝑟𝑟 1+0
MECE6388 Optimal Control Theory, 2024 Fall
Dr. Zheng Chen
In summary, if we are not concerned about energy, the final state will
reach its desired value. There is a trade-off between the energy
consumed and final state desired. The value of 𝑟𝑟 effects the tradeoff.
To find the optimal value of the performance index, use optimal control
𝑢𝑢𝑘𝑘∗ in (2) and simplify to obtain
Λ
𝐽𝐽0∗ = (𝑟𝑟𝑁𝑁 − 𝑎𝑎𝑁𝑁 𝑥𝑥0 )2
2(1 + Λ)2
1
As 𝑟𝑟 → 0, Λ → ∞, 𝐽𝐽0∗ → (𝑟𝑟𝑁𝑁 − 𝑎𝑎𝑁𝑁 𝑥𝑥0 )2 , which is the fixed final state
2Λ
cost.