Methods for solving a system of matrix equations

48 Views Asked by At

While writing a MATLAB script I ran into the following problem. I need to calculate $f_1, f_2$ and $f_3$ given these three equations $$\begin{cases} (I-hAa_{11})f_1-hAa_{12}f_2-hAa_{13}f_3=Ay_{n-1}+bx(t_{n-1}+c_1h)\\ -hAa_{21}f_1+(I-hAa_{22})f_2-hAa_{23}f_3=Ay_{n-1}+bx(t_{n-1}+c_2h)\\ -hAa_{32}f_1-hAa_{32}f_2+(I-hAa_{33})f_3=Ay_{n-1}+bx(t_{n-1}+c_3h) \end{cases}\ $$ where $A$ and $I$ are $2 \times 2$ matrices, $b$ and $y_{n-1}$ are $2 \times 1$ vectors, $f_1, f_2$ and $f_3$ are unknown $2 \times 1$ vectors, $x: \mathbb{R} \rightarrow \mathbb{R}$ and all other quantities are real numbers. I tried searching for "system of linear matrix equations" but didn't find anything useful. At first I tried rewriting the system into a matrix form but this doesn't seem to be of any use either (what I get is a matrix of matrices (?) and I haven't heard of any method of calculating an inverse of such a thing). In desperation I solved the system "by hand" but the formulas I got are truly obnoxious and not really suitable for use in code. Are there any numerical methods which I could use?