Solving 2x2 diagonally dominant matrix systems (non-symmetric)

529 Views Asked by At

I have a linear system of the form $Ax=b$ where $A\in \mathbb{R}^{2\times2}, b\in \mathbb{R}^{2\times1}$. A is diagonally dominant and non-symmetric. This is a "kernel" that I am using to solve a bigger problem, and I want to do it with the fastest numerically stable way. So far I am using Gaussian Elimination as a straight forward choice, needs 4 mutiplications/divisions and 3 additions/substractions. Before I start trying out different methods on my own, I wonder if this has been studied in depth.

1

There are 1 best solutions below

5
On

$2 \times 2$ systems are pretty easy; if $A$ is diagonally dominant by a sufficient margin, you should have no problems with numerical stability. If we have $$ A = \pmatrix{1&a_1\\a_2&1}, \quad b = \pmatrix{b_1\\b_2} $$ Then the solution will be $$ x = A^{-1}b = \frac{1}{1 - a_1 a_2} \pmatrix{1&-a_1\\-a_2&1} \pmatrix{b_1\\b_2} = \frac 1{1-a_1 a_2}\pmatrix{b_1 - a_1 b_2\\-a_1b_1 + b_2} $$ I don't think you can do much better than that. The only step that could potentially go wrong is dividing by $1 - a_1 a_2$, but if $A$ is "diagonally dominant enough", that isn't a problem.

Gaussian elimination should work just as well in getting you the answer (and apparently does a multiplication better, since this takes 5 multiplications and 3 additions).