Inside a DG solver (so far 1D) I need to solve a linear system of equations multiple times. The order of the system is rather small ($N=10..20$). I need to solve the system $Ax=b$, where $A$ is the accumulation of stiffness matrix and mass matrix and further terms plus a component from the incoming flux. Therefore my matrix $A$ has (so far) the following properties.
- $A+A^T$ is diagonal
- $A_{11}\approx \sum_i \sum_j A_{ij}$
- $A_{11}\approx \frac12 \sum_i \sum_j |A_{ij}|$
Meaning, that $A$ has a diagonal entry that is significant larger than all other values. My right-hand side has no remarkable properties, all entries are roughly of the same order (or at least there are no properties similar to the properties of $A$)
So far, I simply solve the equation with
x=A\b
which has to be done quite often. Very often, I have a rough guess for $x$ and also $A$ and $b$ are very often similar from iteration to iteration.
So here is my question: Are there some methods I could consider the accelerate the computation? Do you think for such small systems, there is any chance to gain something, compared with the standard MATLAB solve? Can I make use of the fact, that I know that $A = M + E$, where $E$ contributes to only $A_{11}$ and $M$ stays the same over multiple iterations?
Thank you!
Normally, is is highly unlikely that you will be able to do significantly better than the backslash operator, unless you leave MATLAB behind.
Here you should try to capitalize on the fact that your matrix $A$ is constant except for a rank one perturbation. The result that you require is the Sherman-Morrison formula. The wikipedia entry for this formula is good. If you can compute an $LU$ factorization of $M$, then this formula will allow you to reuse it and solve linear systems of the form $Ax = b$, where $A = M + E$ and $E = uv^T$ is a rank one matrix.
I can not promise you that you will see an improvement. There are simply too many unknowns here. If speed is truly an issue, then I recommend that you consider leaving MATLAB behind.