If you think about it for a minute, you realize that
at the ith step of
the Jacobi iteration, we know the new x-components
. Why not use them? That is, we have
Using the new information as soon as it becomes available speeds up the iteration process considerably. But as the following shows, neither Jacobi nor G-S is really ``good''.
The following is some output from Jacobi and G-S solvers
on the 1 -2 1 tridiagonal matrix, with r.h.s.=0.0025. I started
with a constant initial guess equal to the exact answer at the
middle component, i.e., x(i)=-.125 for all i.
The errors are the
-error.
at iteration 1 jacobierr 0.17864507 gausserr 0.16210562
index Jacobi G-S Exact
1 -0.063750 -0.063750 -0.023750
2 -0.126250 -0.095625 -0.045000
3 -0.126250 -0.111563 -0.063750
4 -0.126250 -0.119531 -0.080000
5 -0.126250 -0.123516 -0.093750
6 -0.126250 -0.125508 -0.105000
7 -0.126250 -0.126504 -0.113750
8 -0.126250 -0.127002 -0.120000
9 -0.126250 -0.127251 -0.123750
10 -0.126250 -0.127375 -0.125000
11 -0.126250 -0.127438 -0.123750
12 -0.126250 -0.127469 -0.120000
13 -0.126250 -0.127484 -0.113750
14 -0.126250 -0.127492 -0.105000
15 -0.126250 -0.127496 -0.093750
16 -0.126250 -0.127498 -0.080000
17 -0.126250 -0.127499 -0.063750
18 -0.126250 -0.127500 -0.045000
19 -0.063750 -0.065000 -0.023750
at iteration 10 jacobierr 0.09586771 gausserr 0.07724418
index Jacobi G-S Exact
1 -0.035972 -0.028775 -0.023750
2 -0.064932 -0.053889 -0.045000
3 -0.092520 -0.075191 -0.063750
4 -0.108262 -0.092786 -0.080000
5 -0.123438 -0.106964 -0.093750
6 -0.129185 -0.118134 -0.105000
7 -0.134768 -0.126751 -0.113750
8 -0.136025 -0.133272 -0.120000
9 -0.137253 -0.138121 -0.123750
10 -0.137256 -0.141544 -0.125000
11 -0.137253 -0.143423 -0.123750
12 -0.136025 -0.143189 -0.120000
13 -0.134768 -0.139967 -0.113750
14 -0.129185 -0.132850 -0.105000
15 -0.123438 -0.121189 -0.093750
16 -0.108262 -0.104762 -0.080000
17 -0.092520 -0.083795 -0.063750
18 -0.064932 -0.058854 -0.045000
19 -0.035972 -0.030677 -0.023750
at iteration 40 jacobierr 0.05750535 gausserr 0.03590245
index Jacobi G-S Exact
1 -0.026911 -0.025503 -0.023750
2 -0.050785 -0.048453 -0.045000
3 -0.072760 -0.068821 -0.063750
4 -0.090746 -0.086575 -0.080000
5 -0.107371 -0.101683 -0.093750
6 -0.119352 -0.114111 -0.105000
7 -0.130392 -0.123827 -0.113750
8 -0.136455 -0.130801 -0.120000
9 -0.141841 -0.135008 -0.123750
10 -0.142134 -0.136430 -0.125000
11 -0.141841 -0.135057 -0.123750
12 -0.136455 -0.130890 -0.120000
13 -0.130392 -0.123937 -0.113750
14 -0.119352 -0.114220 -0.105000
15 -0.107371 -0.101767 -0.093750
16 -0.090746 -0.086618 -0.080000
17 -0.072760 -0.068816 -0.063750
18 -0.050785 -0.048412 -0.045000
19 -0.026911 -0.025456 -0.023750