diff --git a/docs/Chapters/12-KALLMAN-DECOMPOSITION.md b/docs/Chapters/12-KALLMAN-DECOMPOSITION.md index e69de29..f2d54a7 100644 --- a/docs/Chapters/12-KALLMAN-DECOMPOSITION.md +++ b/docs/Chapters/12-KALLMAN-DECOMPOSITION.md @@ -0,0 +1,48 @@ +# Kallman Decomposition + +## Some background +- $X_r = R(K_c)$ : Reachable space is the range of the +`controllable matrix` +- $X_{no} = Ker(K_o)$ : Not observable Space is the kernel +of the `observability matrix` +- $X = X_r \bigoplus X_{nr}$ : Each possible state is sum of +bases of `reachable` and `not-reachable states` + +## Full Decomposition +> [!TIP] +> Follow [Example 12](./Examples/EXAMPLE-12.md/#kallman-full-decomposition) To understand this part +- $X_1 = X_r \cap X_{nr}$ : `Reachable` but `Not-Observable` + space +- $X_2 =$ Complement of $X_1$ to cover $X_r$ : Both `Reachable` + and `Observable` +- $X_3 =$ Complement of $X_1$ to cover $X_{no}$ : Both + `Not-Reachable` and `Not-Observable` +- $X_4 =$ Complement of all the others to cover $X$ : Bot + `Not-Reachable` and `Observable` + +From here we have these blocks: +$$ +\begin{align*} + \hat{A} &= \begin{bmatrix} + \hat{A}_{11} & \hat{A}_{12} & \hat{A}_{13} & \hat{A}_{14} \\ + 0 & \hat{A}_{22} & 0 & \hat{A}_{24} \\ + 0 & 0 & \hat{A}_{33} & \hat{A}_{34} \\ + 0 & 0 & 0 & \hat{A}_{44} + \end{bmatrix}\\ + + \hat{B} &= \begin{bmatrix} + \hat{B}_{1} \\ \hat{B}_{2} \\ 0 \\ 0 + \end{bmatrix}\\ + + \hat{C} &= \begin{bmatrix} + 0 & \hat{C}_{2} & 0 & \hat{C}_{4} + \end{bmatrix} +\end{align*} +$$ + +Now, the eigenvalues of $\hat{A} = \cup_i^4 \hat{A}_{ii}$ and: +- $eig(\hat{A}_{11})$: `Reachable` and `Not-Observable` +- $eig(\hat{A}_{22})$: `Reachable` and `Not-Observable` +- $eig(\hat{A}_{33})$: `Not-Reachable` and `Not-Observable` +- $eig(\hat{A}_{44})$: `Not-Reachable` and `Observable` + diff --git a/docs/Chapters/Examples/EXAMPLE-12.md b/docs/Chapters/Examples/EXAMPLE-12.md new file mode 100644 index 0000000..de738c7 --- /dev/null +++ b/docs/Chapters/Examples/EXAMPLE-12.md @@ -0,0 +1,230 @@ +# Example 12 +## Kallman Full Decomposition + +$$ +\begin{align*} + A &= \begin{bmatrix} + -4 & -3 & 0 & -2 \\ + 6 & 5 & 0 & 2 \\ + 4 & 1 & 1 & -6 \\ + -1 & -1 & 0 & -3 \\ + \end{bmatrix}\\ + + B &= \begin{bmatrix} + -1 \\ + 1 \\ + 2 \\ + 0 \\ + \end{bmatrix}\\ + + C &= \begin{bmatrix} + -3 & -2 & 0 & 1 \\ + \end{bmatrix}\\ + + D &= \begin{bmatrix} + 0 + \end{bmatrix}\\ + + K_r &= \begin{bmatrix} + -1 & 1 & -1 & 1 \\ + 1 & -1 & 1 & -1 \\ + 2 & -1 & 2 & -1\\ + 0 & 0 & 0 & 0 + \end{bmatrix}\\ + + K_{no} &= \begin{bmatrix} + +-3 &-2 &0 &1\\ +-1 &-2 &0 &-1\\ +-7 &-6 &0 &1\\ +-9 &-10& 0 &-1\\ + \end{bmatrix}\\ + +\end{align*}\\ +\text{To find all the bases, for $P_{K_r}$ you should find the}\\ +\text{independent columns and find the system}\\ + +\text{For $P_{K_{no}}$ you should find the system by looking at}\\ +\text{rows, solve it and then find some bases}\\ +\begin{align*} + + P_{K_r} &= \begin{bmatrix} + 0&1\\ + 0&-1\\ + 1&0\\ + 0&0 + \end{bmatrix}\\ + + X_r &= \begin{cases} + x_1 =-x_2 \\ + x_4 = 0 + \end{cases}\\ + + X_{no} &= \begin{cases} + -3x_1 - 2x_2 + x_4 = 0 \\ + -x_1 -2x_2 -x_4 = 0 + \end{cases} \rightarrow \\ + + &\rightarrow \begin{cases} + x_1 = x_4 \\ + x_1 = -x_2 + \end{cases} \\ + + P_{K_{no}} &= \begin{bmatrix} + 1 & 0\\ + -1 & 0\\ + 0 & 1 \\ + 1 & 0 + \end{bmatrix} + + +\end{align*} \\ +\text{Now, let's get all $X_r$ and $X_{no}$ elements}\\ + +\begin{align*} + X_r &= \left\{ + \alpha \begin{bmatrix} + 0\\ + 0\\ + 1\\ + 0 + \end{bmatrix} + + + \beta \begin{bmatrix} + 1\\ + -1\\ + 0\\ + 0 + \end{bmatrix} + \right\}\\ + + X_{no} &= \left\{ + \alpha \begin{bmatrix} + 1 \\ + -1\\ + 0 \\ + 1 + \end{bmatrix} + + + \beta \begin{bmatrix} + 0\\ + 0\\ + 1 \\ + 0 + \end{bmatrix} + \right\} +\end{align*}\\ +$$ +Now, let's get $X_1$, $X_2$, $X_3$, $X_4$ + +$$ +\begin{align*} +X_1 &= X_r \cap X_{no} = \begin{cases} + x_1 =-x_2 \\ + x_4 = 0 \\ + x_1 = x_4 + \end{cases}\\ + +X_1 &= \begin{bmatrix} + 0 \\ 0 \\ x_3 \\ 0 +\end{bmatrix}\\ + +0 &= X_1^T X_1^\perp \rightarrow \\ + +&\rightarrow \begin{bmatrix} + 0 & 0 & x_3 & 0 +\end{bmatrix} +\begin{bmatrix} + x_a \\ x_b \\ x_c \\ x_d +\end{bmatrix} = 0 \rightarrow \\ +&\rightarrow\begin{cases} + x_c = 0 +\end{cases} \\ + +X_1^\perp &= \begin{bmatrix} + x_a \\ x_b \\ 0 \\ x_d +\end{bmatrix}\\ + +X_2 &= X_r \cap X_1^\perp = \begin{cases} + x_1 = -x_2 \\ + x_3 = 0 \\ + x_4 = 0 \\ +\end{cases}\\ + +X_2 &= \begin{bmatrix} + x_1 \\ -x_1 \\ 0 \\ 0 +\end{bmatrix}\\ + +X_3 &= X_{no} \cap X_1^\perp = \begin{cases} + x_1 = -x_2 \\ + x_1 = x_4 \\ + x_3 = 0 \\ +\end{cases}\\ + +X_3 &= \begin{bmatrix} + x_1 \\ -x_1 \\ 0 \\ x_1 +\end{bmatrix}\\ + +0 &= X_2^T X_2^\perp = +\begin{bmatrix} + 1 & -1 & 0 & 0 +\end{bmatrix} +\begin{bmatrix} + x_a \\ x_b \\ x_c \\ x_d +\end{bmatrix}\rightarrow \\ +&\rightarrow\begin{cases} + x_a - x_b = 0 +\end{cases} \\ +\\ + +0 &= X_3^T X_3^\perp = +\begin{bmatrix} + 1 & -1 & 0 & 1 +\end{bmatrix} +\begin{bmatrix} + x_a \\ x_b \\ x_c \\ x_d +\end{bmatrix}\rightarrow \\ +&\rightarrow\begin{cases} + x_a - x_b + x_d = 0 +\end{cases} \\ +\\ + +X_4 &= X_1^\perp \cap X_2^\perp \cap X_3^\perp = \\ + &= \begin{cases} + x_3 = 0 \\ + x_1 = x_2 \\ + x_4 = 0\\ + \end{cases} = \\ + &= \begin{bmatrix} + x_1 \\ x_2 \\ 0 \\ 0 + \end{bmatrix} + + +\end{align*} + + +$$ + +Now we find the change state matrix: +$$ +\begin{align*} + Q^{-1} &= \begin{bmatrix} + X_1 & X_2 & X_3 & X_4 + \end{bmatrix} = \\ + &= \begin{bmatrix} + 0 & 1 & 1 & 1\\ + 0 & -1 & -1 & 1\\ + 1 & 0&0&0\\ + 0&0&1&0 + \end{bmatrix} +\end{align*} +$$ + +Compute: +$$ +\begin{align*} + \hat{A} &= QAQ^{-1}\\ + \hat{B} &= QB \\ + \hat{C} &= CQ^{-1} +\end{align*} +$$