Computational Physics

(Rick Simeone) #1

584 Appendix A


We can change the convergence rate by another discretisation of the con-
tinuum initial value problem (A.90), in which instead ofψijn+^1 in (A.89), a linear
combination of this function and the ‘old one’,ψijnis taken:


ψijn+^1 =( 1 −ω)ψijn+ω

[


1


4


(ψin+1,j+ψin−1,j+ψin,j+ 1 +ψin,j− 1 )

]


+


x^2
4

ρij.

(A.92)

Another way of looking at this method is to consider it as a discretisation of (A.86)
withωx^2 = 4 t. The solutions to this equation are again modes of the form
(A.91), but now with


e−α= 1 −ω[ 1 −(coskn+cosky)/ 2 ]. (A.93)

We see that the relaxation time of the slowest modes is still of orderL^2. This method
is called thedamped Jacobi method.
Yet another type of iteration is the one in which we scan the rows of the grid in
lexicographic order and overwrite the old values of the solution,ψijn, with the new


ones,ψijn+^1 , during the scan so that these new values are then used instead of the
old ones in the evaluation of the right hand side of the iteration Eq. (A.89). This
method is called theGauss–Seidel method. In formula this leads to the rule:


ψin,+j^1 =

1


4


(ψin+1,j+ψin−+1,^1 j+ψin,j+ 1 +ψin,+j−^11 )+
x^2
4

ρij. (A.94)

In this method, the slowest modes still relax with e−α≈ 1 −O( 1 /L^2 )although
the prefactor turns out to be half that of the Jacobi method. An improvement can
be achieved by considering an extension similar to the damped Jacobi method, by
combining the old and new solutions according to


ψijn+^1 (ω)=( 1 −ω)ψijn+
ω
4

[(ψin+1,j+ψin−+1,^1 j+ψin,j+ 1 +ψin,+j−^11 )]. (A.95)

The method can be shown to converge for 0≤ω<2 and there exists some optimal
value forωfor which the relaxation rate is given by e−α≈ 1 −O( 1 /L), substantially
better than all the methods described up to now. This optimal value turns out to
be close to 2. This can be understood by a heuristic argument. In a Gauss–Seidel
update of a particular site, half of its neighbours have their old, and the other half the
new values. We would obviously like the new value at the present site to be equal to
the average of the new values of all its neighbours. We therefore compensate for the
fact that half of the neighbours still have the old value by multiplying the change
in the potentialψat each site by a factor of two. The precise optimal value forω
is related to the parameterαfor the slowest mode in the simple Jacobi method,
which is in general unknown (we have found this parameter above from the exact

Free download pdf