Solving Linear Equations with Poorly Conditioned Matrices

Click For Summary

Discussion Overview

The discussion revolves around solving a system of linear equations represented as XA=Y, where X and Y are row vectors, and A is a given matrix. Participants explore issues related to poorly conditioned matrices, specifically focusing on the implications of condition numbers and potential methods for obtaining reliable solutions despite these challenges.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes using MATLAB to solve for X and receiving a warning about the matrix being close to singular or badly scaled, raising concerns about the reliability of the results.
  • Another participant explains that rcond is the reciprocal of the condition number of A, indicating that the matrix is poorly conditioned and the results may not be reliable.
  • A participant suggests using a nonlinear solver, specifically MATLAB's fsolve function, to find a solution, while cautioning that the solution may still not be good due to the poor conditioning of A.
  • There is a discussion about the Newton-Raphson method as a nonlinear numerical method, with concerns raised about the requirement for an initial guess and the underlying need to solve linear equations, which brings back the issue of the condition number.
  • Participants share links to relevant resources and previous threads for further exploration of the topic.

Areas of Agreement / Disagreement

Participants express varying opinions on the best approach to take when dealing with poorly conditioned matrices. There is no consensus on a definitive method for obtaining reliable solutions, and the discussion remains unresolved regarding the effectiveness of suggested techniques.

Contextual Notes

Participants note that the matrix A is given and its entries are constrained within a specific range, which may limit the applicability of certain methods. The discussion highlights the challenges posed by the condition number and the implications for numerical methods.

matematikawan
Messages
336
Reaction score
0
I have a system of linear equations which can be expressed as XA=Y where X and Y are row vectors. The vector Y and the matrix A are given. I need to solve for X.
I can rephrase the same equation as AtXt=Yt but the answer will still be the same.

I try using MATLAB to solve for X using the commands X=Y/A or X=Y*inv(A). Matlab do give an answer but it comes with the message

"Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 2.336280e-028. "

I have check that the determinant of A is not zero although it is near zero. Hence A is not singular. The problem may be due to condition number of the matrix A, I think. What does the RCOND in the message meant?

If I still want to solve the equation although the matrix is badly condition, what a better method should I use?
 
Physics news on Phys.org
Here's a link to a page for matlab's rcond function: http://www.nacs.uci.edu/dcslib/matlab/matlab-v53/help/techdoc/ref/rcond.html
 
Last edited by a moderator:
rcond is the reciprocal of the condition of A. Thanks Mark. So my matrix A is badly condition. The answer obtained is not reliable. However not much I can do about it because the matrix A is a given matrix with entry number in the range [0,1]. In my work (i discretize pde) I only change Y.

Is there any hope for me, say using other method, to solve the equation with reliable answer?

I see there is also a thread on Condition number.
https://www.physicsforums.com/showthread.php?t=350038

I will be following that also, in case there are helpful response.
 
I'm from that thread you linked. My method of solving a poorly conditioned system is to use a nonlinear solver.

If you have a system Ax = b then you can program a function in MATLAB to take an input of x and the output would be Ax - b.

I.E. F(x) = Ax - b (which ideally equals 0 for the desired value of x).

In this case, you'd want to find the zeros of F to find the solution to x. Matlab's built in fsolve function works well here. Be warned though, as was the case in my problem, since the matrix A is poorly conditioned, yes it will give you a solution but it may not be a good solution.
 
I hope you don't mind that I put the link to your thread here. Now I can understand better what you had written in your previous post (the one at your started thread).

The only nonlinear numerical method that I know is the Newton-Raphson method (NR). I do not know what algorithm is behind the MATLAB nonlinear solver fsolve().

The NR that I know required an initial estimation for the zero because nonlinear equation in general can have more than one root. This is an extra information that we have to supply which we shouldn't be doing because our equations have only one zero.

Also the algorithm behind the NR still required it to solve system of linear equations. So it back to square one, the problem with the condition number.




ps. Actually to which forum should I post questions on numerical method?
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K