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!