What is numerical solution to get the inverse of the special matrix with many repeated elements?

177 Views Asked by At

The question is about how to get the inverse of the matrix via numerical method. \begin{bmatrix} 0.3677 &0.1347 &-0.0871 &-0.0871 &-0.0706 &-0.0706 \\ 0.1347&0.3677 &-0.0871 &-0.0871 &-0.0706 &-0.0706 \\ -0.0871&-0.0871 &0.4154 &0.1824 &-0.1183 &-0.1183 \\ -0.0871&-0.0871 &0.1824 &0.4154 &-0.1183 &-0.1183 \\ -0.0706&-0.0706 &-0.1183 &-0.1183 &0.3989 &0.1659 \\ -0.0706& -0.0706 &-0.1183 &-0.1183 &0.1659 &0.3989 \end{bmatrix}

I have obtained the inverse using MATLAB, and the result shows a strong regularity. I must write codes to solve the problem in an embedded controller(MCU) so numerical solution is needed.

Could somebody give a hint? Thanks!

1

There are 1 best solutions below

2
On

You may express your matrix as a rank-3 update to a diagonal one $$ M = \left( \begin{array}{cccccc} g & 0 & 0 & 0 & 0 & 0 \\ 0 & g & 0 & 0 & 0 & 0 \\ 0 & 0 & h & 0 & 0 & 0 \\ 0 & 0 & 0 & h & 0 & 0 \\ 0 & 0 & 0 & 0 & i & 0 \\ 0 & 0 & 0 & 0 & 0 & i \\ \end{array} \right)+\left( \begin{array}{ccc} 1 & 0 & 0 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 1 \\ \end{array} \right).\left( \begin{array}{ccc} a & b & c \\ b & d & e \\ c & e & f \\ \end{array} \right).\left( \begin{array}{cccccc} 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ \end{array} \right)\\ M = D + U C U^\top $$ and apply Woodbury matrix identity $$ M^{-1} = D^{-1} - D^{-1} U \left( C^{-1} + U^\top D^{-1} U \right)^{-1} U^\top D^{-1}. $$

This operation cost is two inverses of $3 \times 3$ symmetric matrices ($C$ and $C^{-1} + U^\top D^{-1} U$). Inversions of diagonal matrices are trivial.

But if you need simple code for a controller I suggest implementing some simple factorization algorithms, like Cholesky or $LDL^\top$.