推 LiamIssac : maybe you should try stopping the algorithm as x 12/10 15:19
→ LiamIssac : and xnext have very small deviation (not using 12/10 15:19
→ LiamIssac : 100 iterations) 12/10 15:19
when it iterate 100 times , I get my answer
x =
1.0e+38 *
-4.7250
-5.4609
-3.5379
-1.8584
-0.8646
when I try to calculate the answer with Gauss-Seidel iteration
x =
14.9999
-31.9998
41.9997
-25.9998
6.0000
itr = 4295
※ 編輯: simon860730 (140.115.204.20), 12/10/2017 15:26:01
推 LPH66 : 我看維基百科是說 Jacobi method 要求 A 是對角優勢 12/10 16:01
→ LPH66 : 也就是主對角線上的絕對值要在橫列中最大 12/10 16:03
→ LPH66 : 但這個方程組看起來似乎很難轉成這種矩陣... 12/10 16:03
推 sin55688 : 先檢查跌代矩陣的eig是否滿足收斂條件 12/10 16:11
推 sin55688 : 就是 inv(D)R 譜半徑要小於1 才會收斂 12/10 16:14
inv(D)*R =
0 -1.0000 -1.0000 -1.0000 -1.0000
-0.5000 0 -1.5000 -2.0000 -2.5000
-0.1667 -0.5000 0 -1.6667 -2.5000
-0.0500 -0.2000 -0.5000 0 -1.7500
-0.0143 -0.0714 -0.2143 -0.5000 0
eig(inv(D)*R) =
-2.4808
-0.1831
0.6999
0.9654
0.9986
爆炸了 不會收斂呢
※ 編輯: simon860730 (140.115.204.20), 12/10/2017 16:27:02
※ 編輯: simon860730 (140.115.204.20), 12/10/2017 16:48:44
※ 編輯: simon860730 (140.115.204.20), 12/10/2017 16:50:15