19.5 Relaxation Methods for Boundary Value Problems 863 FACR Method The best way to solve equations of the form(19.4.28),including the constant coefficient problem(19.0.3),is a combination of Fourier analysis and cyclic reduction, the FACR method [3-6].If at the rth stage of CR we Fourier analyze the equations of the form (19.4.32)along y,that is,with respect to the suppressed vector index,we will have a tridiagonal system in the z-direction for each y-Fourier mode: 砖-2r+鸿+鸿+2=△2gk (19.4.35) 81 Here is the eigenvalue ofT()corresponding to the kth Fourier mode.For the equation (19.0.3),equation (19.4.5)shows that will involve terms like cos(2k/L)-2 raised to a power.Solve the tridiagonal systems for at the levels j=2,2 x 2r,4 x 2,...,J-2r.Fourier synthesize to get the y-values on these z-lines.Then fill in the intermediate z-lines as in the original CR algorithm. The trick is to choose the number of levels of CR so as to minimize the total number of arithmetic operations.One can show that for a typical case of a 128x128 mesh,the optimal level is r =2;asymptotically,r-log2(log2J). A rough estimate of running times for these algorithms for equation(19.0.3) is as follows:The FFT method(in both x and y)and the CR method are roughly comparable.FACR with r=0(that is,FFT in one dimension and solve the tridiagonal equations by the usual algorithm in the other dimension)gives about a factor of two gain in speed.The optimal FACR with r=2 gives another factor ss是0 of two gain in speed. CITED REFERENCES AND FURTHER READING: 6 Swartzrauber,P.N.1977,S/AM Review,vol.19,pp.490-501.[1] Buzbee,B.L,Golub,G.H.,and Nielson,C.W.1970,SIAM Journal on Numerical Analysis,vol.7, pp.627-656:see als0op.ct.vol.11,pp.753-763.2] Hockney,R.W.1965,Journal of the Association for Computing Machinery,vol.12,pp.95-113.[3] Hockney,R.W.1970,in Methods of Computational Physics,vol.9(New York:Academic Press). pp.135-211.[4] Hockney,R.W.,and Eastwood,J.W.1981.Computer Simulation Using Particles (New York: Recipes McGraw-Hill),Chapter 6.[5] Numerical Recipes 10621 43106 Temperton,C.1980,Journal of Computationa/Physics,vol.34,pp.314-329.[6] (outside North 19.5 Relaxation Methods for Boundary Value Problems As we mentioned in $19.0,relaxation methods involve splitting the sparse matrix that arises from finite differencing and then iterating until a solution is found There is another way of thinking about relaxation methods that is somewhat more physical.Suppose we wish to solve the elliptic equation Cu=p (19.5.1)
19.5 Relaxation Methods for Boundary Value Problems 863 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). FACR Method The best way to solve equations of the form (19.4.28), including the constant coefficient problem (19.0.3),is a combination of Fourier analysis and cyclic reduction, the FACR method [3-6]. If at the rth stage of CR we Fourier analyze the equations of the form (19.4.32) along y, that is, with respect to the suppressed vector index, we will have a tridiagonal system in the x-direction for each y-Fourier mode: uk j−2r + λ(r) k uk j + uk j+2r = ∆2g(r)k j (19.4.35) Here λ(r) k is the eigenvalue of T(r) corresponding to the kth Fourier mode. For the equation (19.0.3), equation (19.4.5) shows that λ(r) k will involve terms like cos(2πk/L) − 2 raised to a power. Solve the tridiagonal systems for uk j at the levels j = 2r, 2 × 2r, 4 × 2r, ..., J − 2r. Fourier synthesize to get the y-values on these x-lines. Then fill in the intermediate x-lines as in the original CR algorithm. The trick is to choose the number of levels of CR so as to minimize the total number of arithmetic operations. One can show that for a typical case of a 128×128 mesh, the optimal level is r = 2; asymptotically, r → log2(log2 J). A rough estimate of running times for these algorithms for equation (19.0.3) is as follows: The FFT method (in both x and y) and the CR method are roughly comparable. FACR with r = 0 (that is, FFT in one dimension and solve the tridiagonal equations by the usual algorithm in the other dimension) gives about a factor of two gain in speed. The optimal FACR with r = 2 gives another factor of two gain in speed. CITED REFERENCES AND FURTHER READING: Swartzrauber, P.N. 1977, SIAM Review, vol. 19, pp. 490–501. [1] Buzbee, B.L, Golub, G.H., and Nielson, C.W. 1970, SIAM Journal on Numerical Analysis, vol. 7, pp. 627–656; see also op. cit. vol. 11, pp. 753–763. [2] Hockney, R.W. 1965, Journal of the Association for Computing Machinery, vol. 12, pp. 95–113. [3] Hockney, R.W. 1970, in Methods of Computational Physics, vol. 9 (New York: Academic Press), pp. 135–211. [4] Hockney, R.W., and Eastwood, J.W. 1981, Computer Simulation Using Particles (New York: McGraw-Hill), Chapter 6. [5] Temperton, C. 1980, Journal of Computational Physics, vol. 34, pp. 314–329. [6] 19.5 Relaxation Methods for Boundary Value Problems As we mentioned in §19.0, relaxation methods involve splitting the sparse matrix that arises from finite differencing and then iterating until a solution is found. There is another way of thinking about relaxation methods that is somewhat more physical. Suppose we wish to solve the elliptic equation Lu = ρ (19.5.1)
864 Chapter 19.Partial Differential Equations where C represents some elliptic operator and p is the source term.Rewrite the equation as a diffusion equation, du (19.5.2) Ot =Cu-p An initial distribution u relaxes to an equilibrium solution as t-oo. This equilibrium has all time derivatives vanishing.Therefore it is the solution of the original elliptic problem(19.5.1).We see that all the machinery of19.2,on diffusive initial value equations,can be brought to bear on the solution of boundary value problems by relaxation methods. Let us apply this idea to our model problem(19.0.3).The diffusion equation is 菲 0u02u.0u t=m2+ 6g2-p (19.5.3) 7 If we use FTCS differencing (cf.equation 19.2.4),we get △t =+(+1u+-1u+u+1+-1-4u别)-pAt(19.54) Recall from(19.2.6)that FTCS differencing is stable in one spatial dimension only if △t/△2≤.In two dimensions this becomes△t/△2≤子.Suppose we try to take —于王久 9 the largest possible timestep,and set At =A2/4.Then equation(19.5.4)becomes 42 石包∽ 9 4=(u写+u+u-11+u+1+-1)- 4 4P.1 (19.5.5) Thus the algorithm consists of using the average of u at its four nearest-neighbor points on the grid (plus the contribution from the source).This procedure is then 6 iterated until convergence. This method is in fact a classical method with origins dating back to the last century,called Jacobi's method (not to be confused with the Jacobi method for eigenvalues).The method is not practical because it converges too slowly. 第 However,it is the basis for understanding the modern methods,which are always 10621 compared with it. Numerica Another classical method is the Gauss-Seide/method.which turns out to be 431 important in multigrid methods (819.6).Here we make use of updated values of u on Recipes the right-hand side of (19.5.5)as soon as they become available.In other words,the averaging is done"in place"instead of being"copied"from an earlier timestep to a later one.If we are proceeding along the rows,incrementing j for fixed l,we have 时-(g+++4+)- △2 4p.1 (19.5.6) This method is also slowly converging and only of theoretical interest when used by itself,but some analysis of it will be instructive. Let us look at the Jacobi and Gauss-Seidel methods in terms of the matrix splitting concept.We change notation and call ux,"to conform to standard matrix notation.To solve A·x=b (19.5.7)
864 Chapter 19. Partial Differential Equations Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). where L represents some elliptic operator and ρ is the source term. Rewrite the equation as a diffusion equation, ∂u ∂t = Lu − ρ (19.5.2) An initial distribution u relaxes to an equilibrium solution as t → ∞. This equilibrium has all time derivatives vanishing. Therefore it is the solution of the original elliptic problem (19.5.1). We see that all the machinery of §19.2, on diffusive initial value equations, can be brought to bear on the solution of boundary value problems by relaxation methods. Let us apply this idea to our model problem (19.0.3). The diffusion equation is ∂u ∂t = ∂2u ∂x2 + ∂2u ∂y2 − ρ (19.5.3) If we use FTCS differencing (cf. equation 19.2.4), we get un+1 j,l = un j,l + ∆t ∆2 un j+1,l + un j−1,l + un j,l+1 + un j,l−1 − 4un j,l − ρj,l∆t (19.5.4) Recall from (19.2.6) that FTCS differencing is stable in one spatial dimension only if ∆t/∆2 ≤ 1 2 . In two dimensions this becomes ∆t/∆2 ≤ 1 4 . Suppose we try to take the largest possible timestep, and set ∆t = ∆2/4. Then equation (19.5.4) becomes un+1 j,l = 1 4 un j+1,l + un j−1,l + un j,l+1 + un j,l−1 − ∆2 4 ρj,l (19.5.5) Thus the algorithm consists of using the average of u at its four nearest-neighbor points on the grid (plus the contribution from the source). This procedure is then iterated until convergence. This method is in fact a classical method with origins dating back to the last century, called Jacobi’s method (not to be confused with the Jacobi method for eigenvalues). The method is not practical because it converges too slowly. However, it is the basis for understanding the modern methods, which are always compared with it. Another classical method is the Gauss-Seidel method, which turns out to be important in multigrid methods (§19.6). Here we make use of updated values of u on the right-hand side of (19.5.5) as soon as they become available. In other words, the averaging is done “in place” instead of being “copied” from an earlier timestep to a later one. If we are proceeding along the rows, incrementing j for fixed l, we have un+1 j,l = 1 4 un j+1,l + un+1 j−1,l + un j,l+1 + un+1 j,l−1 − ∆2 4 ρj,l (19.5.6) This method is also slowly converging and only of theoretical interest when used by itself, but some analysis of it will be instructive. Let us look at the Jacobi and Gauss-Seidel methods in terms of the matrix splitting concept. We change notation and call u “x,” to conform to standard matrix notation. To solve A · x = b (19.5.7)
19.5 Relaxation Methods for Boundary Value Problems 865 we can consider splitting A as A=L+D+U (19.5.8) where D is the diagonal part of A,L is the lower triangle of A with zeros on the diagonal,and U is the upper triangle of A with zeros on the diagonal. In the Jacobi method we write for the rth step of iteration D.xo)=-(L+U·xr-1)+b (19.5.9) 81 For our model problem(19.5.5),D is simply the identity matrix.The Jacobi method converges for matrices A that are"diagonally dominant"in a sense that can be made mathematically precise.For matrices arising from finite differencing,this condition is usually met. What is the rate of convergence of the Jacobi method?A detailed analysis is beyond our scope,but here is some of the flavor:The matrix-D-1.(L+U)is the iteration matrix which,apart from an additive term,maps one set of x's into the next.The iteration matrix has eigenvalues,each one of which reflects the factor by which the amplitude of a particular eigenmode of undesired residual is suppressed during one iteration.Evidently those factors had better all have modulus<1 for 号, 9 the relaxation to work at all!The rate of convergence of the method is set by the rate for the slowest-decaying eigenmode,i.e.,the factor with largest modulus.The modulus of this largest factor,therefore lying between 0 and 1,is called the spectral 9 radius of the relaxation operator,denoted ps The number of iterations r required to reduce the overall error by a factor 10-P is thus estimated by pln10 T≈ (19.5.10) (-Inps) In general,the spectral radius p goes asymptotically to the value 1 as the grid size J is increased,so that more iterations are required.For any given equation, Pa份Nw Numerica 10621 grid geometry,and boundary condition,the spectral radius can,in principle,be computed analytically.For example,for equation (19.5.5)on a Jx J grid with 431 Dirichlet boundary conditions on all four sides,the asymptotic formula for large Recipes Jturns out to be Ps≈1- 3 2.2 (19.5.11) The number of iterations r required to reduce the error by a factor of 10-P is thus 2p.J21n10 1 T2 J2 (19.5.12) In other words,the number of iterations is proportional to the number of mesh points, J2.Since 100 x 100 and larger problems are common,it is clear that the Jacobi method is only of theoretical interest
19.5 Relaxation Methods for Boundary Value Problems 865 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). we can consider splitting A as A = L + D + U (19.5.8) where D is the diagonal part of A, L is the lower triangle of A with zeros on the diagonal, and U is the upper triangle of A with zeros on the diagonal. In the Jacobi method we write for the rth step of iteration D · x(r) = −(L + U) · x(r−1) + b (19.5.9) For our model problem (19.5.5), D is simply the identity matrix. The Jacobi method converges for matrices A that are “diagonally dominant” in a sense that can be made mathematically precise. For matrices arising from finite differencing, this condition is usually met. What is the rate of convergence of the Jacobi method? A detailed analysis is beyond our scope, but here is some of the flavor: The matrix −D −1 · (L + U) is the iteration matrix which, apart from an additive term, maps one set of x’s into the next. The iteration matrix has eigenvalues, each one of which reflects the factor by which the amplitude of a particular eigenmode of undesired residual is suppressed during one iteration. Evidently those factors had better all have modulus < 1 for the relaxation to work at all! The rate of convergence of the method is set by the rate for the slowest-decaying eigenmode, i.e., the factor with largest modulus. The modulus of this largest factor, therefore lying between 0 and 1, is called the spectral radius of the relaxation operator, denoted ρ s. The number of iterations r required to reduce the overall error by a factor 10−p is thus estimated by r ≈ p ln 10 (− ln ρs) (19.5.10) In general, the spectral radius ρs goes asymptotically to the value 1 as the grid size J is increased, so that more iterations are required. For any given equation, grid geometry, and boundary condition, the spectral radius can, in principle, be computed analytically. For example, for equation (19.5.5) on a J × J grid with Dirichlet boundary conditions on all four sides, the asymptotic formula for large J turns out to be ρs 1 − π2 2J2 (19.5.11) The number of iterations r required to reduce the error by a factor of 10 −p is thus r 2pJ2 ln 10 π2 1 2 pJ2 (19.5.12) In other words, the number of iterations is proportional to the number of mesh points, J2. Since 100 × 100 and larger problems are common, it is clear that the Jacobi method is only of theoretical interest
866 Chapter 19.Partial Differential Equations The Gauss-Seidel method,equation (19.5.6),corresponds to the matrix de- composition (+D):x)=-Uxr-1)+b (19.5.13) The fact that L is on the left-hand side of the equation follows from the updating in place,as you can easily check if you write out(19.5.13)in components.One can show [1-3]that the spectral radius is just the square of the spectral radius of the Jacobi method.For our model problem,therefore, π2 p≈1- (19.5.14) rpJIn10 1 T2 (19.5.15) The factor of two improvement in the number of iterations over the Jacobi method still leaves the method impractical. RECIPESI 2 Successive Overrelaxation(SOR) We get a better algorithm-one that was the standard algorithm until the 1970s -if we make an overcorrection to the value of x(r)at the rth stage of Gauss-Seidel iteration,thus anticipating future corrections.Solve(19.5.13)for x(),add and 9 subtract x(r-1)on the right-hand side,and hence write the Gauss-Seidel method as xo)=xr-1)-(L+D)-1.[(L+D+U)·xr-)-b (19.5.16) 32 The term in square brackets is just the residual vector g(-1),so xr)=xr-1)-(L+D)-1.r-1) (19.5.17) Now overcorrect,defining xr)=xr-)-w(L+D)-1.r-1) (19.5.18) Numerical Here w is called the overrelaxation parameter,and the method is called successive -431 overrelaxation (SOR). (outside Recipes The following theorems can be proved [1-3]: .The method is convergent only for 0<w<2.If0<w<1,we speak of underrelaxation. North Under certain mathematical restrictions generally satisfied by matrices arising from finite differencing,only overrelaxation(1<w<2 )can give faster convergence than the Gauss-Seidel method. .If pJacobi is the spectral radius of the Jacobi iteration (so that the square of it is the spectral radius of the Gauss-Seidel iteration),then the optimal choice for w is given by 2 W= (19.5.19) 1+V1-Pjacobi
866 Chapter 19. Partial Differential Equations Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). The Gauss-Seidel method, equation (19.5.6), corresponds to the matrix decomposition (L + D) · x(r) = −U · x(r−1) + b (19.5.13) The fact that L is on the left-hand side of the equation follows from the updating in place, as you can easily check if you write out (19.5.13) in components. One can show [1-3] that the spectral radius is just the square of the spectral radius of the Jacobi method. For our model problem, therefore, ρs 1 − π2 J2 (19.5.14) r pJ2 ln 10 π2 1 4 pJ2 (19.5.15) The factor of two improvement in the number of iterations over the Jacobi method still leaves the method impractical. Successive Overrelaxation (SOR) We get a better algorithm — one that was the standard algorithm until the 1970s — if we make an overcorrection to the value of x(r) at the rth stage of Gauss-Seidel iteration, thus anticipating future corrections. Solve (19.5.13) for x (r), add and subtract x(r−1) on the right-hand side, and hence write the Gauss-Seidel method as x(r) = x(r−1) − (L + D) −1 · [(L + D + U) · x(r−1) − b] (19.5.16) The term in square brackets is just the residual vector ξ (r−1), so x(r) = x(r−1) − (L + D) −1 · ξ(r−1) (19.5.17) Now overcorrect, defining x(r) = x(r−1) − ω(L + D) −1 · ξ(r−1) (19.5.18) Here ω is called the overrelaxation parameter, and the method is called successive overrelaxation (SOR). The following theorems can be proved [1-3]: • The method is convergent only for 0 <ω< 2. If 0 <ω< 1, we speak of underrelaxation. • Under certain mathematical restrictions generally satisfied by matrices arising from finite differencing, only overrelaxation (1 <ω< 2 ) can give faster convergence than the Gauss-Seidel method. • If ρJacobi is the spectral radius of the Jacobi iteration (so that the square of it is the spectral radius of the Gauss-Seidel iteration), then the optimal choice for ω is given by ω = 2 1 + 1 − ρ2 Jacobi (19.5.19)
19.5 Relaxation Methods for Boundary Value Problems 867 For this optimal choice,the spectral radius for SOR is PJacobi PSOR (19.5.20) As an application of the above results,consider our model problem for which PJacobi is given by equation (19.5.11).Then equations(19.5.19)and(19.5.20)give 2 w心1+刀 (19.5.21) pSOR≈1- 2π for large J (19.5.22) 菲 Equation(19.5.10)gives for the number of iterations to reduce the initial error by a factor of 10-P, ICAL 3 r≈pJln10.1 2π 3P (19.5.23) RECIPES Comparing with equation (19.5.12)or(19.5.15),we see that optimal SOR requires of orderJ iterations,as opposed to of orderJ2.Since J is typically 100 or larger, this makes a tremendous difference!Equation (19.5.23)leads to the mnemonic that 3-figure accuracy (p=3)requires a number of iterations equal to the number of mesh points along a side of the grid.For 6-figure accuracy,we require about twice as many iterations. as9色% How do we choose w for a problem for which the answer is not known analytically?That is just the weak point of SOR!The advantages of SOR obtain only in a fairly narrow window around the correct value of w.It is better to take w slightly too large,rather than slightly too small,but best to get it right. One way to choose w is to map your problem approximately onto a known problem,replacing the coefficients in the equation by average values.Note,however, that the known problem must have the same grid size and boundary conditions as the actual problem.We give for reference purposes the value of pJacobi for our model problem on a rectangularJ×L grid,allowing for the possibility that△x≠△y: Recipes Numerica 10.621 431 cos Recipes △ PJacobi (19.5.24) △x 1 △u North Equation(19.5.24)holds for homogeneous Dirichlet or Neumann boundary condi- tions.For periodic boundary conditions,make the replacement -2. A second way,which is especially useful if you plan to solve many similar elliptic equations each time with slightly different coefficients,is to determine the optimum value w empirically on the first equation and then use that value for the remaining equations.Various automated schemes for doing this and for "seeking out"the best values of w are described in the literature. While the matrix notation introduced earlier is useful for theoretical analyses, for practical implementation of the SOR algorithm we need explicit formulas
19.5 Relaxation Methods for Boundary Value Problems 867 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machinereadable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). • For this optimal choice, the spectral radius for SOR is ρSOR = ρJacobi 1 + 1 − ρ2 Jacobi 2 (19.5.20) As an application of the above results, consider our model problem for which ρJacobi is given by equation (19.5.11). Then equations (19.5.19) and (19.5.20) give ω 2 1 + π/J (19.5.21) ρSOR 1 − 2π J for large J (19.5.22) Equation (19.5.10) gives for the number of iterations to reduce the initial error by a factor of 10−p, r pJ ln 10 2π 1 3 pJ (19.5.23) Comparing with equation (19.5.12) or (19.5.15), we see that optimal SOR requires of order J iterations, as opposed to of order J 2. Since J is typically 100 or larger, this makes a tremendous difference! Equation (19.5.23) leads to the mnemonic that 3-figure accuracy (p = 3) requires a number of iterations equal to the number of mesh points along a side of the grid. For 6-figure accuracy, we require about twice as many iterations. How do we choose ω for a problem for which the answer is not known analytically? That is just the weak point of SOR! The advantages of SOR obtain only in a fairly narrow window around the correct value of ω. It is better to take ω slightly too large, rather than slightly too small, but best to get it right. One way to choose ω is to map your problem approximately onto a known problem, replacing the coefficients in the equation by average values. Note, however, that the known problem must have the same grid size and boundary conditions as the actual problem. We give for reference purposes the value of ρ Jacobi for our model problem on a rectangular J × L grid, allowing for the possibility that ∆x = ∆y: ρJacobi = cos π J + ∆x ∆y 2 cos π L 1 + ∆x ∆y 2 (19.5.24) Equation (19.5.24) holds for homogeneous Dirichlet or Neumann boundary conditions. For periodic boundary conditions, make the replacement π → 2π. A second way, which is especially useful if you plan to solve many similar elliptic equations each time with slightly different coefficients, is to determine the optimum value ω empirically on the first equation and then use that value for the remaining equations. Various automated schemes for doing this and for “seeking out” the best values of ω are described in the literature. While the matrix notation introduced earlier is useful for theoretical analyses, for practical implementation of the SOR algorithm we need explicit formulas