5/05/2010

[動態規劃] 淺談 離散時間動態規劃 (2) -Minimax Dynamic programming

考慮系統狀態方程:
\[
x(k+1) = f(x(k), u(k))
\]現在引入一個 監測函數 (monitor function): $g(x(k))$ 此函數用來擷取我們所關心的系統狀態。

現在我們定義 cost function
\[
J(u) := \displaystyle \min_{k=1,2,...,N} g(x(k))
\]
我們的目標:
藉由選取最佳的 $u(k) \in \Omega_k$ 使得 $\max J(u)$,亦即
\[
\max \displaystyle \min_{k=1,2,...,N} g(x(k))
\]

此時我們的 Bellman equation 需要進行修正:
\[
I(x(l), N-l) = \max_{u(l) \in \Omega_l} \left \{ \min \left \{ g\left( x(l+1), I(x(l+1), N-(l+1)) \right ) \right \} \right\}
\]

Example
考慮如下狀態方程:
\[x\left( {k + 1} \right) = \left[ {\begin{array}{*{20}{c}}
{\frac{1}{2}}&{\frac{1}{4}}\\
{ - \frac{1}{2}}&{\frac{1}{4}}
\end{array}} \right]x\left( k \right) + \left[ {\begin{array}{*{20}{c}}
1\\
1
\end{array}} \right]u\left( k \right)
\] 其中 $x(k) := [x_1(k) \ x_2(k)]^T$;
現在,僅考慮 $N=2$ (只有兩步)的情況,另外控制力 $u(0), u(1) \geq 0$ 且需滿足如下拘束: $u(0) + u(1) \leq 1$,定義監測函數
\[
g(x(k)) = x_1(k)
\]
試求一組 $u^*(0), u^*(1)$ maximize the Floor of $g((k))$。

Solution
首先考慮 Optimal cost of one-step-to-go:  ($l=N-1 =1$)
\[
\begin{array}{l}
I\left( {x\left( 1 \right),1} \right) = \mathop {\max }\limits_{u\left( 1 \right) \in {\Omega _1}} \left\{ {g\left( {x\left( 2 \right)} \right)} \right\} = \mathop {\max }\limits_{u(1) \in \left[ {0,1 - u(0)} \right]} \left\{ {{x_1}\left( 2 \right)} \right\}\\
\begin{array}{*{20}{c}}
{}&{}&{}&{}&{}&{}
\end{array} = \mathop {\max }\limits_{u(1) \in \left[ {0,1 - u(0)} \right]} \left\{ {\frac{1}{2}{x_1}\left( 1 \right) + \frac{1}{4}{x_2}\left( 1 \right) + u\left( 1 \right)} \right\}
\end{array}
\]觀察上式可知欲得到 Maximum,我們需選
\[{u^*}(1) = 1 - u(0)
\]故將上述 $u^*(1)$ 代回,我們可得對應的 Optimal cost to go :
\[I\left( {x\left( 1 \right),1} \right) = \frac{1}{2}{x_1}\left( 1 \right) + \frac{1}{4}{x_2}\left( 1 \right) + 1 - u(0)
\]現在我們計算 Two-steps-to-go: ($l=N-2 =0$)
\[\begin{array}{l}
I\left( {x\left( l \right),N - l} \right) = \mathop {\max }\limits_{u\left( l \right) \in {\Omega _l}} \left\{ {\min \left\{ {g\left( {x\left( {l + 1} \right)} \right),I\left( {x\left( {l + 1} \right),N - l - 1} \right)} \right\}} \right\}\\
 \Rightarrow I\left( {x\left( 0 \right),2} \right) = \mathop {\max }\limits_{u\left( 0 \right) \in {\Omega _0}} \left\{ {\min \left\{ {{x_1}\left( 0 \right),I\left( {x\left( 1 \right),1} \right)} \right\}} \right\}\\
 \Rightarrow I\left( {x\left( 0 \right),2} \right) = \mathop {\max }\limits_{u\left( 0 \right) \in \left[ {0,1} \right]} \left\{ {\min \left\{ {{x_1}\left( 0 \right),\frac{1}{2}{x_1}\left( 1 \right) + \frac{1}{4}{x_2}\left( 1 \right) + 1 - u(0)} \right\}} \right\} \ \ (*)
\end{array}
\] 由系統狀態方程可知
\[\left\{ \begin{array}{l}
{x_1}\left( 1 \right) = \frac{1}{2}{x_1}\left( 0 \right) + \frac{1}{4}{x_2}\left( 0 \right) + u\left( 0 \right)\\
{x_2}\left( 1 \right) =  - \frac{1}{2}{x_1}\left( 0 \right) + \frac{1}{4}{x_2}\left( 0 \right) + u\left( 0 \right)
\end{array} \right.
\]故將上述結果代回 $(*)$ 可得
\[ \Rightarrow I\left( {x\left( 0 \right),2} \right) = \mathop {\max }\limits_{u\left( 0 \right) \in \left[ {0,1} \right]} \left\{ {\min \left\{ {A + u\left( 0 \right),B - \frac{1}{4}u\left( 0 \right)} \right\}} \right\}
\] 其中
\[\left\{ \begin{array}{l}
A = \frac{1}{2}{x_1}\left( 0 \right) + \frac{1}{4}{x_2}\left( 0 \right)\\
B = 1 + \frac{1}{8}{x_1}\left( 0 \right) + \frac{3}{{16}}{x_2}\left( 0 \right)
\end{array} \right.
\] 為了找出 Maximum,我們定義 $F(u(0)) :={\min \left\{ {A + u\left( 0 \right),B - \frac{1}{4}u\left( 0 \right)} \right\}}$ 那麼考慮以下兩種情況:
CASE 1: $A \geq B$:則 $u^*(0)=0, u^*(1) = 1$
CASE 2: $A <B$ :則
\[{u^*}\left( 0 \right) = \left\{ \begin{array}{l}
\frac{4}{5}\left( {B - A} \right),\begin{array}{*{20}{c}}
{}
\end{array}if\begin{array}{*{20}{c}}
{}
\end{array}\frac{4}{5}\left( {B - A} \right) \in \left[ {0,1} \right]\\
1,\begin{array}{*{20}{c}}
{}
\end{array}otherwise
\end{array} \right.\] 且 $u^*(1) = 1 - u^*(0)$

沒有留言:

張貼留言

[隨筆] A+焦慮的世代

接住A+世代學生 當了老師之後發現要"接住"學生確實不容易,撇開老師自身可能也有需要被接住的問題不談。我這幾年常常感受到這世代的學生們有著很大的徬徨,不太清楚未來的方向,但是卻有著非得要拿到A/A+不可的糾結,於是課優先選甜涼課,實習競賽投好投滿。好像看著同學...