the row-sum norm. Do not normalize the system.
A = [ 1 4 9 16 25;4 9 16 25 36; 9 16 25 36 49; 16 25 36 49 64;25 36 49 64 81]
How many digits of precision will be lost due to ill-conditioning?
(b)Repeat (a), but scale the matrix by making the maximum element in each
row equal to one.
Matlab Code:
A = [ 1 4 9 16 25;4 9 16 25 36; 9 16 25 36 49; 16 25 36 49 64;25 36 49 64 81]
%(a)
conditionA = cond(A)
significant = 10^(log10(cond(A)) - 7.2)
%(b)
b = [ 1/25 0 0 0 0;0 1/36 0 0 0;0 0 1/49 0 0;0 0 0 1/64 0;0 0 0 0 1/81];
A_scaled = b * A
conditionA_scaled = cond(A_scaled)
significant_scaled = 10^(log10(cond(A_scaled)) - 7.2)
RESULTS
A =
1 4 9 16 25
4 9 16 25 36
9 16 25 36 49
16 25 36 49 64
25 36 49 64 81
conditionA =
3.145210075463109e+17
significant =
1.984493397046558e+10
A_scaled =
0.040000000000000 0.160000000000000 0.360000000000000 0.640000000000000 1.000000000000000
0.111111111111111 0.250000000000000 0.444444444444444 0.694444444444444 1.000000000000000
0.183673469387755 0.326530612244898 0.510204081632653 0.734693877551020 1.000000000000000
0.250000000000000 0.390625000000000 0.562500000000000 0.765625000000000 1.000000000000000
0.308641975308642 0.444444444444444 0.604938271604938 0.790123456790123 1.000000000000000
conditionA_scaled =
9.237149093911445e+16
significant_scaled =
5.828247062861999e+09
These results show that both matrices are substantially ill-formed and there is a large loss of significance
No comments:
Post a Comment