How to suppress errors in matrix algebra involving very large matrices ?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have two very large matrices, A and B which constitute an equation
A* x + B* y =0
I am interested in solving for x (denoted x_star) so
x_star = pinv(A) * (- B*y);
Then, I back- substitute x_star to check the accuracy
A* x_star + B* y
But this value is not zero. Its usually a large number. How do I ensure this is zero? The matrices A and B are given as
y= [1,0]';
A(1,1) = 4.15325070802278e+22 - .07633591784246e+18i ;
A(1,2) = 9.04710238303399e+20- 8.73556649303388e+16i ;
A(2,1) = -9.04710238303399e+20+ .73556649303387e+16i;
A(2,2) = -1.9707469469826e+19 + 1.87151868951167e+15i ;
B(1,1) = 2.57576471264519e+18
B(1,2) = -1.18245242413448e+20 ;
B(2,1) = -5.610835634053e+16 ;
B(2,2 ) = 2.57575785721108e+18;
댓글 수: 0
답변 (2개)
Matt J
2016년 12월 13일
편집: Matt J
2016년 12월 13일
You can't make it zero. To hope for that is to be in denial of the realities of floating point arithmetic. But as for your specific data, the substitution result looks pretty reasonable,
>> A*x_star+B*y
ans =
1.0e+07 *
0.0001 + 4.5513i
-0.0000 - 0.0991i
Looks pretty small to me - certainly when compared to the magnitude of the elements of A and B which are O(1e20).
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!