Why using mldivide to solve high dimension linear equations would cause computational error
이전 댓글 표시
I tried to use A\b to solve the linear equation Ax=b, where A is a n*n matrix shown as followed:

when n is relatively small (like 10 or 20), it provided a good solution. But when n is greater than approximately 60, the solution provided is drifted from the real answer. The error between the provided solution and the actual solution becomes greater and greater when n increase.
I was wondering why this happened. A hint is said that the gaussian elimination for the matrix A is unstable, and coincidentally, the mldivide operation \ is using gaussian elimination. However, I still cannot find a obvious relation between the hint and the phenomenon.
채택된 답변
추가 답변 (2개)
To the OP:
Try taking different values of the RHS b. I'm pretty sure that for some particular vectors b, even the solution with perturbed A will not be accurate. There is no other explanation, since the condition numbers of A and A+perturbation are equally large.
댓글 수: 2
Jiasen
2014년 10월 24일
Thanks for taking the trouble to reply.
Yes, I think you are indeed right. In fact a condition number of 40 or 50 is actually quite small and should not lead to such large errors particularly when we are doing things upto 15 digits of precision. As further evidence that it is indeed instability in Gaussian elimination, take the following matrix:
B = A(end:-1:1, end:-1:1)
From the point of view of system of equations, this is exactly equivalent to the system obtained from A. Moreover condition number of A is the same as condition number of B. However taking b = rand(n,1) and solving:
y = B\b
the answer for y is very accurate, which shows that it has nothing to do with condition number and everything to do with the algorithm used for solution.
It would be good if you could post an answer and mark it answered yourself so that others could see the real reason and not be misled.
Regards.
[added later: Oh, I see that there is already an accepted answer so perhaps you could just add another answer]
Jan
2014년 9월 27일
0 개 추천
The hint say: The Gauss-elimination is instable. It is applied and you observe an instable behavior of the results. The relation is not only obvious but trivial. Therefore it's not clear to me, what you are asking for.
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!