# Large condition number with good accuracy

In computation of the solution I achieve a solution with nice precision and small number of nodes but the condition number of the matrix is very large. I am confused. Is it possible to have a large condition number with a good precision? The condition number is $10^4$ and it increases as the number of nodes increses and also the precision increases. How do you explain this condition?

• I think that you need to specify some things. What does good precision means? What is the problem you are solving? Big and small are terms that should be defined in context. – nicoguaro Feb 3 '17 at 15:38
• @nicoguaro The work is numerical and precision is that the numerical solution is close to the analytic solution. – salehhj Feb 3 '17 at 15:42
• The condition number of the matrix indicates that there might be large errors when solving a system of equations. Consider an extreme example of a diagonal matrix with a single very large entry. There will be essentially no round-off error in solving this system. – Bill Greene Feb 3 '17 at 15:46
• I thought that the work was numerical, since you're using the finite element method. But what is close in your case? $10^{-3}, 10^{-6}, 10^{-9}$? – nicoguaro Feb 3 '17 at 15:51
• The simplest estimate says that the relative solution error in the worst case is bounded by $cond(A)$ times the relative righthand side error. So there is no contradiction. If you are solving system without random perturbations of the righthand side, your error in the righthand side is basically the roundoff errors. E.g., if you are using double precision, it is usually 1.0e-15, so $cond(A)=10^4$ results in relative solution error about only 1.0e-11. Which is nothing if you are considering $10^-3$ as a small difference. – VorKir Feb 3 '17 at 21:41

## 1 Answer

Of course you can. The condition number gives you an upper bound for the error. Suppose you want to solve $Ax=b$ where $A$ is a matrix with large condition number. The error depends on the structure of $A$ and on $b$.

As an example, if $A$ is a $2 \times 2$ diagonal matrix, with elements $1$ and $10^{-20}$, solving $Ax=b$ will still be accurate, despite having a huge condition number of $10^{20}$.

• The answer is correct but should have emphasized upper bound in the first sentence. It's a worst case scenario, but that need not happen for any given right hand side $b$. – Wolfgang Bangerth Feb 3 '17 at 22:40