19.7 KB · commit a9602da
We wish to solve Laplace's equation uxx+uyy=0(9.30) in a bounded region R with boundary C. As in Dirichlet's problem, let the value of u be specified everywhere on C. For simplicity, let R be a square region so that it can be divided into a network of small squares of side h. Let the values of u(x,y) on the boundary C be given by ci and let the interior mesh points and the boundary points be as in Fig. 9.3.
Figure 9.3 — Interior mesh points and boundary points.
Then, as shown in the previous section, Eq. (9.30) can be replaced by either the standard five-point formula, viz. Eq. (9.25); or the diagonal five-point formula given in Eq. (9.27). The approximate function values at the interior mesh points can now be computed according to the scheme: we first use the diagonal five-point formula Eq. (9.27) and compute u5,u7,u9,u1 and u3 in this order. Thus, we obtain
u5u9u3=41(c1+c5+c9+c13);=41(u5+c7+c9+c11);=41(c3+c5+c7+u5).u7u1=41(c15+u5+c11+c13);=41(c1+c3+u5+c15);We then compute, in the order, the remaining quantities, viz., u8,u4,u6 and u2 by the standard five-point formula (9.25). Thus, we have
u8u6=41(u5+u9+c11+u7);=41(u3+c7+u9+u5);u4u2=41(u1+u5+u7+c15);=41(c3+u3+u5+u1).When once all the ui,(i=1,2,3,…,9) are computed, their accuracy can be improved by any of the iterative methods described below.
Let ui,j(n) denotes the nth iterative value of ui,j. An iterative procedure to solve Eq. (9.25) is ui,j(n+1)=41[ui−1,j(n)+ui+1,j(n)+ui,j−1(n)+ui,j+1(n)](9.31) for the interior mesh points. This is called the point Jacobi method.
The method uses the latest iterative values available and scans the mesh points systematically from left to right along successive rows. The iterative formula is: ui,j(n+1)=41[ui−1,j(n+1)+ui+1,j(n)+ui,j−1(n+1)+ui,j+1(n)](9.32) It can be shown that the Gauss–Seidel scheme converges twice as fast as the Jacobi scheme. This method is also referred to as Liebmann's method.
Equation (9.32) can be written as
ui,j(n+1)=ui,j(n)+41[ui−1,j(n+1)+ui+1,j(n)+ui,j−1(n+1)+ui,j+1(n)−4ui,j(n)]=ui,j(n)+41Ri,jwhich shows that (1/4)Ri,j is the change in the value of ui,j for one Gauss–Seidel iteration. In the SOR method, a larger change than this is given to ui,j(n), and the iteration formula is written as
ui,j(n+1)=ui,j(n)+41ωRi,j=41ω[ui−1,j(n+1)+ui+1,j(n)+ui,j−1(n+1)+ui,j+1(n)]+(1−ω)ui,j(n)=ωui,j(n+1)+(1−ω)ui,j(n)(9.33)The rate of convergence of Eq. (9.33) depends on the choice of ω, which is called the accelerating factor and lies between 1 and 2.
The percentage error in the value uij is given by ∣εij∣=uij(n+1)ui,j(n+1)−ui,j(n)×100%(9.34) It was shown by B.A. Carré that for ω=1.875, the rate of convergence of Eq. (9.33) is twice as fast as that when ω=1, and for ω=1.9, the rate of convergence is 40 times greater than that when ω=1. In general, however, it is difficult to estimate the best value of ω. The following examples illustrate the methods of solution.
It is seen from the figure that the boundary values are symmetric about the diagonal AC. Hence, u1=u4 and we need find only u1, u2 and u3. The standard five-point formula applied at the point P gives u2+u3+2+4−4u1=0. Hence we have u1=41(u2+u3+6). The iteration formula is therefore u1(n+1)=41[u2(n)+u3(n)+6]. Similarly, the iteration formulae at the points Q and R are given by u2(n+1)=21u1(n+1)+25, and u3(n+1)=21u1(n+1)+21. For the first iteration, let u2=5 (since it is nearer to the value u=5), and u3(0)=1. Hence
u1(1)u2(1)u3(1)=41(5+1+6)=3,=21(3)+25=4,=21(3)+21=2.For the second iteration, we have
u1(2)u2(2)=41(4+2+6)=3,=21(3)+25=4,and u3(2)=21(3)+21=2. Since the values are unchanged, we conclude that u1=3, u2=4, u3=2 and u4=3. ◀
Figure 9.5
Solution: (a) To start Jacobi's iteration process, we obtain the approximate values of u1, u2, u3 and u4 as follows:
u1(1)u2(1)u3(1)u4(1)=41(0+0+0+1)=0.25;=41(0+0+0+1)=0.25;=41(1+1+0+0)=0.5;=41(1+1+0+0)=0.5.The iterations have been continued using Eq. (9.31), and seven successive iterates are given below:
u1 u2 u3 u4 0.1875 0.1875 0.4375 0.4375 0.15625 0.15625 0.40625 0.40625 0.14062 0.14062 0.39062 0.39062 0.13281 0.13281 0.38281 0.38281 0.12891 0.12891 0.37891 0.37891 0.12695 0.12695 0.37695 0.37695 0.12598 0.12598 0.37598 0.37598 (b) Gauss–Seidel method: Five successive iterates are given below:
u1 u2 u3 u4 0.25 0.3125 0.5625 0.46875 0.21875 0.17187 0.42187 0.39844 0.14844 0.13672 0.38672 0.38086 0.13086 0.12793 0.37793 0.37646 0.12646 0.12573 0.37573 0.37537
(c) SOR method: With ω=1.1, three successive iterates obtained by using Eq. (9.33) are given below.
u1 u2 u3 u4 0.275 0.35062 0.35062 0.35062 0.16534 0.10683 0.38183 0.37432 0.11785 0.12181 0.37216 0.37341 ◀
From (ii) and (iii), it is seen that u2=u3 and so we need to find only u1, u2 and u4 from (i), (ii) and (iv). The iteration formulae are therefore given by
u1(n+1)u2(n+1)u4(n+1)=21u2(n)+30=41[u1(n+1)+u4(n)+150]=21u2(n+1)+45.For the first iteration, we assume that u2(0)=u4(0)=0. Hence we obtain
u1(1)u2(1)u4(1)=30,=41(30+0+150)=45=21(45)+45=67.5.For the second iteration, we have
u1(2)u2(2)u4(2)=21u2(1)+30=21(45)+30=52.5=41[u1(2)+u4(1)+150]=41[52.5+67.5+150]=67.5=21[u2(2)]+45=78.75.For the third iteration, we obtain
u1(3)u2(3)u4(3)=21u2(2)+30=21(67.5)+30=63.75=41[u1(3)+u4(2)+150]=41[63.75+78.75+150]=73.125=21u2(3)+45=21(73.125)+45=81.5625.The fourth iteration gives
u1(4)u2(4)u4(4)=21u2(3)+30=21(73.125)+30=66.5625=41[u1(4)+u4(3)+150]=41[66.5625+81.5625+150]=74.53125=21u2(4)+45=21(74.53125)+45=82.2656.
For the fifth iteration, we obtain
u1(5)u2(5)u4(5)=21u2(4)+30=21(74.53125)+30=67.2656=41[u1(5)+u4(4)+150]=41[67.2656+82.2656+150]=74.8828=21u2(5)+45=21(74.8828)+45=82.4414.The sixth iteration gives
u1(6)u2(6)u4(6)=21u2(5)+30=21(74.8828)+30=67.4414=41[u1(6)+u4(5)+150]=41[67.4414+82.4414+150]=74.9707=21u2(6)+45=21(74.9707)+45=82.4854.From the last two iterates, we conclude that u1=67,u2=u3=75,andu4=83. ◀
This is an efficient method for the numerical solution of elliptic partial differential equations and was proposed by Peaceman and Rachford. It is quite general but, for easy understanding, we demonstrate its applicability with reference to the Laplace equation in two dimensions. For more details, the reader is referred to Isaacson and Keller [1966].
We consider Laplace's equation in two dimensions, viz., ∂x2∂2u+∂y2∂2u=0(9.35) and the standard five-point formula ui−1,j+ui+1,j+ui,j−1+ui,j+1−4ui,j=0(9.25) The use of formula given in Eq. (9.25) involves the solution of a system of algebraic equations, whose coefficient matrix, for n=6, is of the form
A=−4101001−4101001−4001100−4100101−4100101−4(9.36)The general form of such a system is given by
B=TI⋮IT⋮0I⋮0⋮I⋮TI⋮IT,(9.37)where T is a tridiagonal matrix of the form
T=−41⋮1−4⋮01⋮10⋮−41⋮1−4(9.38)System A is called a block tridiagonal system and such systems are solved by Gaussian elimination or, in the case of large systems, by Gauss–Seidel iterations. But tridiagonal systems of the type of Eq. (9.38) are much easier to solve than block tridiagonal systems. Hence the question arises as to whether we can obtain directly tridiagonal systems in the numerical solution of Laplace's equation. Peaceman and Rachford showed that this is possible and their method of procedure, called the alternating direction implicit method (or the ADI method) is described below.
We rearrange Eq. (9.25) in either of two ways: ui−1,j−4ui,j+ui+1,j=−ui,j−1−ui,j+1(9.39) or ui,j−1−4ui,j+ui,j+1=−ui−1,j−ui+1,j(9.40) The ADI is an iteration method and Eqs. (9.39) and (9.40) are used as iteration formulae ui−1,j(r+1)−4ui,j(r+1)+ui+1,j(r+1)=−ui,j−1(r)−ui,j+1(r)(9.41) and ui,j−1(r+2)−4ui,j(r+2)+ui,j+1(r+2)=−ui−1,j(r+1)−ui+1,j(r+1)(9.42) Equation (9.41) is used to compute function values at all internal mesh points along rows and Eq. (9.42) those along columns. For j=1,2,3,…,n−1, Eq. (9.41) yields a tridiagonal system of equations and can easily be solved. Similarly, for i=1,2,3,…,n−1, Eq. (9.42) also yields a tridiagonal system of equations.
In the ADI method, formulae (9.41) and (9.42) are used alternately. For example, for the first row j=1, and Eq. (9.41) gives
ui−1,1(r+1)−4ui,1(r+1)+ui+1,1(r+1)=−ui,0(r)−ui,2(r),(i=1,2,3,…,n−1)(9.43) Together with the boundary conditions, Eq. (9.43) represents a tridiagonal system of equations and are easily solved for ui,1(r+1). We next put j=2 and obtain the values of ui,2(r+1) on the second row. The process is repeated for all the rows, viz. up to j=n−1. We next alternate the direction, i.e. we use Eq. (9.42) to compute ui,j(r+2). It is easy to see that at every stage we will be solving a tridiagonal system of equations. Example 9.5 demonstrates the method of solution.
For computing the function values on the second row, we set j=2 in (9.41) to obtain ui−1,2(1)−4ui,2(1)+ui+1,2(1)=−ui,1(0)−ui,3(0)(ii) With i=1 and i=2, Eq. (ii) gives u0,2(1)−4u1,2(1)+u2,2(1)=−u1,1(0)−u1,3(0) and u1,2(1)−4u2,2(1)+u3,2(1)=−u2,1(0)−u2,3(0) Substituting the boundary values and solving the above, we obtain u1,2(1)=u2,2(1)=31=0.3333. Having completed the computations on the two rows, we now alternate the direction and compute the function values on the columns, starting with the first one. For this, we use Eq. (9.42) with r=0. Setting i=1, Eq. (9.42) becomes u1,j−1(2)−4u1,j(2)+u1,j+1(2)=−u0,j(1)−u2,j(1)(iii) Putting j=1 and j=2 in the above, we obtain the equations u1,0(2)−4u1,1(2)+u1,2(2)=−u0,1(1)−u2,1(1) and u1,1(2)−4u1,2(2)+u1,3(2)=−u0,2(1)−u2,2(1). Substituting the boundary values and solving the above equations, we obtain u1,1(2)=458=0.1778andu1,2(2)=4517=0.3778 To compute the values on the second column, we now set i=2 in Eq. (9.42) u2,j−1(2)−4u2,j(2)+u2,j+1(2)=−u1,j(1)−u3,j(1)(iv) Putting j=1 and j=2 in the above, we obtain the equations u2,0(2)−4u2,1(2)+u2,2(2)=−u1,1(1)−u3,1(1) and u2,1(2)−4u2,2(2)+u2,3(2)=−u1,2(1)−u3,2(1) Substituting the boundary values in the above two equations and solving them, we obtain u2,1(2)=0.1778andu2,2(2)=0.3778
The iterations are continued to improve the function values obtained first on the rows, then on the columns, and so on. The reader is advised to continue these computations for the next iteration. ◀