EIT Agent
登录
← 校园网页目录

校园网页 · 学校官网

Efficient spectral-Galerkin method II. Direct solvers for second- and fourth-order equations using Chebyshev polynomials.pdf

SIAM J. SCI. COMPUT. c° 1995 Society for Industrial and Applied Mathematics Vol. 16, No. 1, pp. 74{87, Junuary 1995 006 E±cient Spectral-Galerkin Method II. Direct Solvers of Second and Fourth Order Equations by Using Chebyshev Polynomials¤ Jie Sheny Abstract. E±cient direct solvers based on the Chebyshev-Galerkin methods for second and fourth order equations are presented. They are based on appropriate base functions for the Galerkin formulation which lead to discrete systems with special structured matrices which can be e±ciently inverted. Numerical results indicate that the direct solvers presented in this paper are signi¯cantly more accurate and e±cient than that based on the Chebyshev-tau method. Key words. spectral-Galerkin method, Chebyshev polynomial, Helmholtz equation, bihar- monic equation, direct solver AMS subject classi¯cations. 65N35, 65N22, 65F05, 35J05 1. Introduction. This paper is the second in a series for developing e±cient spectral-Galerkin methods for elliptic equations. In part I of this work [12], we de- scribed the direct solution techniques for the Helmholtz equation and the biharmonic equation by using Legendre-Galerkin approximations. These direct solvers are very e±cient compared to the existing ones, especially for solving the biharmonic equation. Although using Legendre polynomials o®ers many advantage over using Chebyshev polynomials, such as symmetricity and sparseness of the matrices for the discrete sys- tems, its obvious drawback is the lack of fast transform between the physical and spectral spaces, such as Fast Fourier Transforms (FFT) for Chebyshev polynomials. Since such transforms must be performed frequently when dealing with nonlinear equations, it is preferable to use Chebyshev polynomials when the resulting discrete systems can be solved with an accuracy and a number of operations comparable to the case when Legendre polynomials are used. It is our purpose in this paper to develop e±cient Galerkin methods using Chebyshev polynomials. As we mentioned in [12], although the theoretical analysis of Chebyshev-Galerkin method is the easiest to perform and the results are usually optimal among the three commonly used spectral methods, namely Galerkin, collocation and tau, its practical implementation is virtually unavailable in the literature due to the lack of appropriate bases. On the other hand, the tau method and the collocation method have been extensively used. The latter of course is more °exible and more suitable for problems with variable coe±cients. However for problems with constant coe±cients, and also for some problems with variable coe±cients (e.g. the example of a nonseparable equation considered in [12]), the Chebyshev-tau method and Chebyshev-Galerkin method could be more e±cient. It is clear that for the Chebyshev-Galerkin approximations we can construct similar special bases as in [12] for the Legendre-Galerkin approximations. But due to the nonuniform weight associated with the Chebyshev polynomials, the matrices of the resulting linear systems are usually not sparse as in the Legendre case. However, these matrices usually possess special structures which can be explored to derive e±cient algorithms. ¤ Received by the editors February 22, 1993; accepted for publication (in revised form) November 4, 1993. This work was supported in part by NSF grant DMS-9205300. y Department of Mathematics, Penn State University, University Park, Pennsylvania 16802 (shen j@math.psu.edu). 74 efficient spectral-galerkin method ii 75 For the general second order equations with constant coe±cients, we are able to apply the matrix decomposition method to solve the discrete system arising from the Chebyshev-Galerkin approximation in about (d¡1)N d+1 arithmetic operations (where d = 2 or 3 is the dimension of the domain, N is the cuto® number of the Chebyshev series in each direction) with an accuracy comparable to that of the Legendre-Galerkin approximation and signi¯cantly better than that of the Chebyshev-tau approximation. This algorithm is clearly superior to the popular Chebyshev-tau algorithm [8] in terms of accuracy and e±ciency as is demonstrated by the numerical examples in Section 5. It is also more e±cient than the Legendre-Galerkin algorithm in [12] for solving equations with multiple right hand sides, thanks to the FFT. For the fourth order equations, we are only able to derive an e±cient and stable algorithm in the one dimensional case. Again thanks to the FFT, it is more e±cient than the the Legendre-Galerkin method presented in [12]. It can be used in particu- lar to solve the 2-D Stokes equations with periodic-nonperiodic boundary conditions. However, due to probably the non symmetricity associated to the nonuniform Cheby- shev weight function, we are unable to extend the method of capacitance matrix used in [2] and [12] to solve the 2-D biharmonic equations. The remainder of the paper is organized as follows: In the next section, we describe in detail our algorithms for solving the Helmholtz equations. In section 3, we consider the fourth order equations. In section 4, we extend our technique to more general problems. Finally in section 5, we present and compare some numerical results. 2. Helmholtz equations. In this section, we are interested in using the Chebyshev- Galerkin method to solve the Helmholtz equation (2.1) ®u ¡ ¢u = f in ­ = I d; uj@­ = 0; where I = (¡1; 1) and d = 1, 2 or 3. More general second order problems will be treated in Section 4. Let us ¯rst introduce some basic notations which will be used in the sequel. We denote by Tn(x) the nth degree Chebyshev polynomial, and we set SN = spanfT0(x); T1(x); : : : ; TN (x)g; VN = fv 2 SN : v(§1) = 0g: Then the standard Chebyshev-Galerkin approximation to (2.1) is: Find uN 2 V d N such that (2.2) ®(uN ; v)! ¡ (¢uN ; v)! = (f; v)!; 8 v 2 V d N ; where !(x) = ¦d i=1(1 ¡ x2 i )¡ 1 2 and (u; v)! = R ­ uv!dx is the scalar product in the weighted space L2 !(­). The norm in L2 !(­) will be denoted by k ¢ k!. Let us denote H s !(­) to be the weighted Sobolev spaces with the norm kvks;!. It is well known (cf. [4]) that for ® ¸ 0, s ¸ 1 and u 2 H s !(­), the following optimal error estimates holds: (2.3) ku ¡ uN k! + N ku ¡ uN k1;! · C(s)N ¡skuks;!: Although the approximation (2.2) achieves the optimal convergence rate, its prac- tical value depends on the choice of a basis for V d N . It is essential for the sake of e±ciency to choose an appropriate basis for V d N such that the resulting linear system is as simple as possible. However, to the best of the author's knowledge, the only basis available in the literatures (see for instance [7]) is: VN = spanfÁ2(x); Á3(x); ¢ ¢ ¢ ; ÁN (x)g 76 jie shen with Ák(x) = ½ Tk(x) ¡ T0(x); k even Tk(x) ¡ T1(x); k odd : Unfortunately this basis leads to a linear system with full matrix and hence its usage is virtually prohibited in practice. In the following, we shall construct appropriate bases so that the matrices of the resulting linear systems can be e±ciently inverted. 2.1. One dimensional case. The following simple lemma is the key to the e±ciency of our algorithms. Lemma 2.1. Let Ák(x) = Tk(x) ¡ Tk+2(x), akj = ¡(Á00 j (x); Ák(x))! and bkj = (Áj(x); Ák(x))!. Then (2.4) VN = spanfÁ0(x); Á1(x); ¢ ¢ ¢ ; ÁN ¡2(x)g; and (2.5) bkj = bjk = 8 >< >: (ck+1) 2 ¼; j = k ¡ ¼ 2 ; j = k ¡ 2 and j = k + 2 0; Otherwise ; and (2.6) akj = 8 >< >: 2¼(k + 1)(k + 2); j = k 4¼(k + 1); j = k + 2; k + 4; k + 6; ¢ ¢ ¢ 0; j > k or j + k odd : Proof. It is clear that Ák(x) 2 VN and that fÁk(x)g are linear independent. (2.4) then follows from the fact that dimVN = N ¡ 1. The proof of (2.5)-(2.6) is based on the following well known properties of Cheby- shev polynomials. We recall that the fTn(x)gn=1 n=0 form an orthogonal basis for L2 !(I) and (2.7) (Ti(x); Tj(x))! = ci ¼ 2 ±ij; 8 i; j ¸ 0; where c0 = 2 and ci = 1 for i ¸ 1. We recall also that the following recurrence relation holds (2.8) 2Tn(x) = T 0 n+1(x) n + 1 ¡ T 0 n¡1(x) n ¡ 1 : Note that Tn(x) is a polynomial of degree n and therefore T 00 n (x) 2 SN ¡2. More precisely (2.9) T 00 n (x) = n¡2X k=0 k+n even 1 ck n(n2 ¡ k2)Tk(x): Now (2.5) can be easily derived by using (2.7). Thanks to (2.9), we have (2.10) T 00 k+2(x) = 1 ck (k + 2)((k + 2)2 ¡ k2)Tk(x) + 1 ck¡2 (k + 2)((k + 2)2 ¡ (k ¡ 2)2)Tk¡2(x) + ¢ ¢ ¢ It follows immediately from (2.10) and (2.7) that ¡(Á00 k(x); Áj(x))! = 0; for j > k or j + k odd; efficient spectral-galerkin method ii 77 and ¡(Á00 k(x); Ák(x))! = (T 00 k+2(x); Tk(x))! = (k + 2)((k + 2)2 ¡ k2)(Tk(x); Tk(x))! = 2¼(k + 1)(k + 2): Setting Á00 j (x) = Pj n=0 dnTn(x), by a simple computation using (2.9), we derive dn = ( 1 cj 4(j + 1)(j + 2); n = j 1 cn f(j + 2)3 ¡ j3 ¡ 2n2g; n < j : Hence for j = k + 2; k + 4; ¢ ¢ ¢ , we ¯nd ¡(Á00 j (x); Ák(x))! = dk(Tk(x); Tk(x))! ¡ dk+2(Tk+2(x); Tk+2(x))! = 4¼(k + 1): In the remainder of the paper, we shall use capital letters to denote matrices or two dimensional arrays, bold face letters to denote column vectors. It is now clear that (2.2) (with d = 1) is equivalent to (2.11) ®(uN ; Ák(x))! ¡ (u00 N ; Ák(x))! = (f; Ák(x))!; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2: Let us denote fk = (f; Ák(x))!; f = (f0; f1; ¢ ¢ ¢ ; fN ¡2)T ; uN = N ¡2X n=0 vnÁn(x); v = (v0; v1; ¢ ¢ ¢ ; vN ¡2)T ; and (2.12) B = (bkj)0·k;j·N ¡2 ; A = (akj)0·k;j·N ¡2 : Then (2.11) is equivalent to the following matrix equation: (2.13) (®B + A)v = f : First of all, we observe that akj = bkj = 0 for k + j odd. Hence the above system of order N ¡ 1 can be decoupled into two subsystems of order N=2 and N=2 ¡ 1. The same argument can also be applied to multidimensional systems. In fact, the 2-D system (2.14) and 3-D system (2.19) can be respectively decoupled into four and eight subsystems. However it is as e±cient and less tedious in coding, especially in multidimensional cases, to treat the original systems directly. (i) ® = 0: (2.13) reduces to Av = f . From Lemma 2.1, we see that A is an special upper triangular matrix whose nonzero o®-diagonal elements in each row are equal to a constant. Hence this linear system can be solved by special backward substitution in about 4N arithmetic operations. (ii) ® 6= 0: We form explicitly the LU factorization ®B +A = LU . Since the matrix B has only 3 nonzero diagonals, the elements in each row of U , except the diagonal and the nearest o® diagonal elements, are equal to a constant. Consequently the linear system (2.13) can be solved with essentially the same number of operations as needed for solving a pentadiagonal system. 2.2. Two dimensional case. It is clear that V 2 N = spanfÁk(x)Áj(y) : k; j = 0; 1; ¢ ¢ ¢ ; N ¡ 2g: 78 jie shen Let us denote uN = N ¡2X k;j=0 ukjÁk(x)Áj(y); fkj = (f; Ák(x)Áj(y))!; U = (ukj)k;j=0;1;¢¢¢ ;N ¡2; F = (fkj)k;j=0;1;¢¢¢ ;N ¡2: Taking v = Ál(x)Ám(y) in (2.2) with d = 2 for l; m = 0; 1 ¢ ¢ ¢ ; N ¡ 2, we ¯nd that it is equivalent to the following matrix equation: (2.14) ®BU B + AU B + BU AT = F; where A and B are the matrices de¯ned in (2.12). This equation can be solved in particular by the matrix decomposition method as in [3], [8] and [12]. To this end, we need to study the following eigenvalue problems: (2.15) ¡(Ãxx; v)! = ¸(Ã; v)!; 8 v 2 VN ; Ã(§1) = 0: Denoting Ã(x) = PN ¡2 n=0 xnÁn(x); and taking v = Áj(x) for j = 0; 1; ¢ ¢ ¢ ; N ¡ 2, we ¯nd that (2.15) is equivalent to the following generalized eigenvalue problem: (2.16) Ax = ¸Bx: It is shown by Gottlieb and Lustman [6] that the eigenvalues of the problem (2.15) are all real positive. Now let ¤ be the diagonal matrix whose diagonal elements are the eigenvalues of A¡1B, and let E be the matrix formed by the eigenvectors of A¡1B, i.e. A¡1BE = E¤. From Lemma 2.2, the diagonal elements of ¤ are all real positive and E is a real matrix. Applying A¡1 to (2.14), we obtain ®A¡1BU B + U B + A¡1BU AT = A¡1F: Setting U = EV , the above equation becomes ®E¤V B + EV B + E¤V AT = A¡1F: Now applying E¡1 to the above equation, set G = E ¡1A¡1F , we ¯nd (2.17) ®¤V B + V B + ¤V AT = G: Let vp = (vp0; vp1; ¢ ¢ ¢ ; vpN ¡2)T and gp = (gp0; gp1; ¢ ¢ ¢ ; gpN ¡2)T for p = 0; 1; ¢ ¢ ¢ ; N ¡ 2. Then the pth row of the equation (2.17) becomes: (2.18) (®¸p + 1)Bvp + ¸pAvp = gp; p = 0; 1; ¢ ¢ ¢ ; N ¡ 2: which is equivalent to N ¡ 1 one dimensional equation of the form (2.13). In summary, the solution of (2.14) consists of four steps: (0) Compute the eigenpairs ¤; E for A¡1B and compute E¡1; (1) Compute G = E¡1A¡1F ; (2) obtain V by solving (2.18); (3) Set U = EV . We remark that A¡1B can be decoupled into two submatrices of upper Hessen- burg form onto which the QR method can be directly applied. Hence the CPU time and more importantly the roundo® errors of the preprocessing stage are signi¯cantly reduced compared to that of Chebyshev-tau method (see Section 5 below). The step efficient spectral-galerkin method ii 79 2 and A¡1F takes O(N 2) operations. Note that the matrices E and E ¡1 have al- ternating zero elements and hence the steps 1 and 3 can be performed in about N 3 arithmetic operations. 2.3. Three dimensional case. Let us denote uN = N ¡2X n;m;l=0 unmlÁn(x)Ám(y)Ál(z); fijk = (f; Ái(x)Áj(y)Ák(z)): since V 3 N = spanfÁi(x)Áj(y)Ák(z) : i; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2g; taking v = Ái(x)Áj(y)Ák(z) in (2.2) with d = 3 for i; j; k = 0; 1 ¢ ¢ ¢ ; N ¡ 2, we ¯nd that it is equivalent to the following equation: (2.19) ®binunmlbjmbkl + ainunmlbjmbkl + binunmlajmbkl + binunmlbjmakl = fijk; i; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2; where we have used the conventional notation as a pair of repeated index implies a summation of the index from 0 to N ¡ 2. As in [12], we shall decompose (2.19) into N ¡ 1 2-D systems of the form (2.14). Let us denote a¡1 ij and e¡1 ij (not to be confused with 1=aij and 1=eij) to be respectively the ijth entry of the matrices A¡1 and E¡1, then by the de¯nition of E and ¤ in Section 2.2, we have (2.20) a¡1 ik bknenq = ¸qeiq; e¡1 qi eip = ±qp; a¡1 qi aip = ±qp: Multiply a¡1 ri to the equation (2.19), and set unml = enqvqml, using the above relations, we derive ®¸qerqvqmlbjmbkl + erqvqmlbjmbkl + ¸qerqvqmlajmbkl + ¸qerqvnmlbjmakl = a¡1 ri fijk: Multiply e¡1 pr to the above equation, we obtain (®¸p + 1)vpmlbjmbkl + ¸p(vpmlajmbkl + vpmlbjmakl) = e¡1 pr a¡1 ri fijk ´ gpjk: Now set V p = (vpml)0·m;l·N ¡2 and Gp = (gpml)0·m;l·N ¡2, we can rewrite the above equation as (2.21) (®¸p + 1)BV pB + ¸p(AV pB + BV pAT ) = Gp; p = 0; 1; ¢ ¢ ¢ ; N ¡ 2: For each p, the above equation corresponding to a two dimensional equation of the form (2.14). In summary, the solution of (2.19) consists of the following steps: (0) Pre-processing: compute the eigenpairs ¤ and E of A¡1B and compute E¡1; (1) Compute gpjk = e¡1 pr a¡1 ri fijk for p; j; k = 0; 1; ¢ ¢ ¢ ; N ¡ 2; (2) Obtain V p by solving (2.21) for p = 0; 1; ¢ ¢ ¢ ; N ¡ 2; (3) Set unml = enqvqml for n; m; l = 0; 1; ¢ ¢ ¢ ; N ¡ 2. Step 2 consists of solving N ¡ 1 two-dimensional equations of the form (2.14). Hence it takes about N 4 operations. Steps 1 and 3 take about N 4 operations. Hence each particular solution of (2.19) can be obtained in about 2N 4 operations. 3. Fourth order equations. In this section, we consider the fourth order equation with the ¯rst boundary condition (3.1) ¢2u ¡ ®¢u + ¯u = f in ­ = I d; u = @u @n = 0; 80 jie shen where n is the normal vector to @­ and d = 1 or 2. Let us denote WN = fv 2 SN : v(§1) = vx(§1) = 0g: Then the Chebyshev-Galerkin approximation of (3.1) consists of ¯nding uN 2 W d N such that (3.2) (¢uN ; ¢(v!)) + ®(ruN ; r(v!)) + ¯(uN ; v)! = (f; v)!; 8 v 2 W d N : It can be shown that for ®; ¯ > 0 and u 2 H s !(­) \ H 2 0;!(­) for s ¸ 2, then the following optimal error estimate holds (see [11]): (3.3) ku ¡ uN k! + N ku ¡ uN k1;! + N 2ku ¡ uN k2;! · C(s)N ¡skuks;!: 3.1. One dimensional case. It is obvious that dim(WN ) = N ¡ 3 and it is an easy matter to verify that a basis of WN is given by (3.4) Ãk(x) = Tk(x) ¡ 2(k + 2) k + 3 Tk+2(x) + k + 1 k + 3 Tk+4(x); k = 0; 1; ¢ ¢ ¢ ; N ¡ 4: Setting fk = (f; Ãk(x))!; f = (f0; f1; ¢ ¢ ¢ ; fN ¡4)T ; uN = N ¡4X n=0 vnÃn(x); v = (v0; v1; ¢ ¢ ¢ ; vN ¡4)T ; and akj = (Ã00 j (x); (Ãk(x)!)00); A = (akj)0·k;j·N ¡4 ; ckj = (Ã0 j(x); (Ãk(x)!)0); C = (ckj)0·k;j·N ¡4 ; bkj = (Ãj(x); Ãk(x))!; B = (bkj)0·k;j·N ¡4 : By setting v = Ãk(x) for k = 0; 1; ¢ ¢ ¢ ; N ¡ 4 in (3.2) with d = 1, we ¯nd that it is equivalent to the following matrix form: (3.5) (A + ®C + ¯B)v = f : Lemma 3.1. The nonzero elements of A, B and C are: bkk = µ ck + 4(k + 2)2 (k + 3)2 + (k + 1)2 (k + 3)2 ¶ ¼ 2 ; where c0 = 2; ck = 1 for k ¸ 1; bkk+2 = bk+2k = ¡ µ k + 2 k + 3 + k + 4 k + 5 k + 1 k + 3 ¶ ¼; bkk+4 = bk+4k = k + 1 k + 3 ¼ 2 ; ckk = ¡4 k + 1 k + 3 (k + 2)2¼; ckk¡2 = 2(k ¡ 1)(k + 2)¼; ckk+2 = 2(k + 1)(k + 2)¼; akk = 8(k + 1)2(k + 2)(k + 4)¼; akj = 8 j + 3 (k + 1)(k + 2) ¡ k(k + 4) + 3(j + 2)2¢ ¼; j = k + 2; k + 4; ¢ ¢ ¢ : Proof. All the formulaes except the last one can be obtained by direct computations using the properties of Chebyshev polynomials. The computation of the last formula is extremely tedious by hand and we have resorted to the symbolic computation software Mathematica. efficient spectral-galerkin method ii 81 Although the matrix A in the system (3.5) is not sparse but its special structure allows us to obtain the solution in O(N ) operations. Let us explain the procedure in the case ® = ¯ = 0 in detail. The solution of Av = f can be obtained by the backward substitution: (3.6) vk = (fk ¡ N ¡4X j=k+1 k+j even akjvj)=akk; k = 0; 1; ¢ ¢ ¢ ; N ¡ 4: Notice that akj can be factorized as akj = p(k)q(j) + r(k)s(j); j = k + 2; k + 4; ¢ ¢ ¢ ; with p(k) = 8k(k + 1)(k + 2)(k + 4)¼; q(j) = 1 j + 3 ; r(k) = 24(k + 1)(k + 2)¼; s(j) = (j + 2)2 j + 3 : Therefore N ¡4X j=k+1 k+j even akjvj = N ¡4X j=k+1 k+j even (p(k)q(j) + r(k)s(j))vj = p(k) N ¡4X j=k+1 k+j even q(j)vj + r(k) N ¡4X j=k+1 k+j even s(j)vj: It is then clear that the above relation for k = 0; 1; ¢ ¢ ¢ ; N ¡ 4 can be evaluated in O(N ) operations. Hence fvkgN ¡4 k=0 can be obtained in just O(N ) operations. In the case ®; ¯ 6= 0, we can form explicitly the LU factorization, i.e. A + ®C + ¯B = LU . Notice that the entries of U , excluding the diagonal and two nearest o®diagonals, are also factorizable as A. Consequently the system can still be solved in O(N ) operations. Whenever spectral methods are used for solving the fourth order equations, one should be concerned with roundo® errors caused by potentially large condition num- bers. As is pointed out in [7], the direct application of tau method to the fourth order equations leads to very ill conditioned system and is numerically unstable. Large condition numbers of order N 8 were also reported [5] for the spectral-collocation ap- proximation to the 1-D fourth order equations. However the Chebyshev-Galerkin approximation presented above leads to systems with smaller condition numbers and is numerically stable. In table I, we list the condition numbers of A and the diagonally scaled matrix DA, where D is the inverse of diagonal matrix diag(A). It is clear that cond(A) = (N 4) and cond(DA) = O(N 2). Hence the propagation of roundo® errors should not be very signi¯cant. The numerical example presented in Section 5 con¯rms that the above algorithm is numerically stable. Table I. Condition numbers for the 1-D fourth order equation N 16 32 64 128 256 cond(A) 4.896E+3 1.046E+5 1.907E+6 3.241E+7 5.535E+8 cond(DA) 6.636E+1 2.674E+2 1.057E+3 4.174E+3 1.653E+4 82 jie shen Remark 3.1. The second boundary condition, i.e. u(§1) = uxx(§1) = 0, can also be considered. In this case a basis for the space ~WN = fv 2 SN : v(§1) = vxx(§1) = 0g is given by: Ãk(x) = Tk(x) ¡ (1 + ek)Tk+2(x) + ekTk+4(x); k = 0; 1; ¢ ¢ ¢ ; N ¡ 4; with ek = (k + 1)(2k2 + 4k + 3) (k + 3)(2k2 + 12k + 19) . Unfortunately the exact formula for akj = (Ã0000 j (x); Ãk(x))! derived by using Mathematica is extremely complicated and not factorizable as in the case of the ¯rst boundary condition. Hence the solution of the corresponding discrete system requires O(N 2) operations. Furthermore the linear system is extremely ill conditioned such that the numerical solution makes little sense even at a relatively small N = 32. Therefore it is more e±cient and reliable to treat the 1-D fourth order equation(when ¯ = 0) with the second boundary condition as a decoupled system of two 1-D second order equations. 3.2. Two dimensional case. Using the same notations as in Section 2.2 (with Ák(x) replaced by Ãk(x), and N ¡ 2 replaced by N ¡ 4), taking v = Ãl(x)Ãm(y) in (3.2) with d = 2 for l; m = 0; 1; ¢ ¢ ¢ ; N ¡ 4, we ¯nd that it is equivalent to the following matrix equation: (3.7) ®BU B + ¯(CU B + BU C T ) + AU B + 2CU C T + BU AT = F: As we noted in [12], this system can be e±ciently solved by the matrix decomposition method if A¡1B and A¡1C are commutative. Unfortunately, we are not able to make A¡1B and A¡1C commutative by modifying a few rows of A, B and C, as we successfully did for Legendre-Galerkin approximation [12]. Hence we are not able to apply the method of capacitance matrix to solve the system (3.7). However the system can still be solved by using a special band elimination procedure in O(N 4) operations (see a similar procedure in [10]). But this is certainly not competitive to the direct solver with complexity 2N 3 by Legendre-Galerkin method presented in [12]. 4. Some extensions. We have described in [12] how problems with nonhomo- geneous boundary conditions can be e±ciently transformed into problems with corre- sponding homogeneous boundary conditions. We have also explained in [12] how to treat certain non separable equations. Those techniques apply directly to the Cheby- shev case as well. In this section, we shall present some other relevant extensions. 4.1. Other boundary conditions. For Neumann or Rabin type boundary conditions, we should construct special base functions satisfying the corresponding homogeneous boundary conditions. Let us consider for instance the 1-D equation with the homogeneous Neumann boundary condition: (4.1) ¡uxx = f in I; ux(§1) = 0: Let WN = © u 2 SN : R I udx = 0; ux(§1) = 0 ª ; and Ák(x) = Tk(x) ¡ k2 (k+2)2 Tk+2(x). It can be easily shown that (4.2) WN = spanfÁ1(x); ¢ ¢ ¢ ; ÁN ¡2(x)g: Then the standard Chebyshev-Galerkin method for (4.1) is: Find uN = PN ¡2 n=1 vnÁn(x) 2 WN such that (4.3) ¡(u00 N ; v)! = (f; v)!; 8 v 2 WN : efficient spectral-galerkin method ii 83 If we denote akj = ¡(Á00 j (x); Ák(x))!, by a direct computation as in Lemma 2.1, we can derive (4.4) akj = 8 >< >: 2¼(k + 1)k2=(k + 2); j = k 4¼j2(k + 1)=(k + 2)2; j = k + 2; k + 4; k + 6; ¢ ¢ ¢ 0; j > k or j + k odd : Now let ~akj = akj=j2, ~A = (~akj)1·k;j·N ¡2 and gj = (f; Áj(x))!=j2. Then the equa- tion (4.3) is equivalent to ~Av = g: We note that ~A now has the same structure as the matrix A de¯ned in (2.6). Therefore the system can be solved in O(N ) operations. 4.2. Equations with additional ¯rst order terms. Let us ¯rst consider the 1-D equation (4.5) ®u + ¯ux ¡ uxx = f in I u(§1) = 0: Let ckj = (Á0 j(x); Ák(x))! and C = (ckj)0·k;j·N ¡2. A simple computation leads to (4.6) ckj = 8 >< >: ¼(k + 1) j = k + 1 ¡¼(k + 1) j = k ¡ 1 0; Otherwise : Hence the discrete system corresponding to (4.5) is: (®B + ¯C + A)v = f ; where A and B are the matrices de¯ned in Lemma 2.1. Hence the system can be solved in O(N ) operations. Multidimensional problems can be e±ciently handled as well. We consider for instance the 2-D equation (4.7) ®u + ¯uy ¡ ¢u = f in ­ = I £ I ; uj@­ = 0: Using the same notations as in Section 2.2, we ¯nd that the discrete equation corre- sponding to (4.7) is: ®BU B + ¯BU C T + AU B + BU AT = F; which can still be solved by the matrix decomposition method exactly as in the case ¯ = 0 in Section 2.2. 4.3. 2-D Stokes equations with periodic-nonperiodic boundary condi- tions. We consider the 2-D Stokes equations (4.8) ¡ ¢u + px = f; ¡¢v + py = g; in ­; ux + vy = 0; in ­; where ­ = [¡1; 1] £ [¡¼; ¼]. We assume that the solutions (u; v; p) of the 2-D Stokes equations are periodic in the y-direction and satisfy the homogeneous Dirichlet bound- ary condition on the two vertical boundaries of ­. We can then write µ u v ¶ = +1X k=¡1 µ uk(x) vk(x) ¶ eiky; µ f g ¶ = +1X k=¡1 µ f k(x) gk(x) ¶ eiky; p = +1X k=¡1 pk(x)eiky: 84 jie shen Hence the 2-D Stokes equations can be split into a series of one dimensional systems: ¡ uk xx + k2uk + pk x = f k; ¡vk xx + k2vk + ikpk = gk; x 2 I; uk x + ikvk = 0; x 2 I; uk(§1) = vk(§1) = 0; ¡1 < k < +1: For each k, we can easily eliminate vk and pk from the above system and the result is the fourth order equation: (4.9) uk xxxx ¡ 2k2uk xx + k4uk = ikgk x + k2f k; x 2 I; uk(§1) = uk x(§1) = 0: Once uk is known, vk and pk can be determined by vk = i k uk x; pk = i k (gk ¡ k2vk + vk xx); k 6= 0: For k = 0, we simply get u0 = 0; p0 = xf 0 and v0 = ¡ f 0 2 (x2 ¡ 1). The equation (4.9) is exactly a fourth order equation of the form (3.1) with d = 1. Hence its Chebyshev-Galerkin approximation can be e±ciently implemented. For a di®erent treatment of the equations (4.8) with periodic-nonperiodic boundary conditions, we refer to [1]. 5. Numerical results. As noted by many authors (see [8] and [9]), when solving the discrete Helmholtz system by the matrix decomposition method, roundo® errors could be signi¯cant for large N since the accuracy of the algorithm relies on the accuracy of the matrix decomposition. Hence we shall ¯rst examine the roundo® errors of solving the discrete system associated with the 1-D Poisson equation by the matrix decomposition method. Numerical experiments indicate that the roundo® errors in the multidimensional computations by matrix decomposition method behave similarly as in the 1-D case. Let u = (u0; u1; ¢ ¢ ¢ ; uN ¡2)T be a uniformly distributed random vector and we compute f = Au where A is the matrix given in (2.6). Let v be the approximate solution to the system Au = f obtained by using the matrix decomposition method, max0·i·N ¡2 jui ¡ vij max0·i·N ¡2 juij can then be regarded as the roundo® error of the procedure. In table II, we list the roundo® errors as described above by using the Chebyshev- Galerkin (CG), Legendre-Galerkin (LG) and Chebyshev-tau (CT) methods. All computations are performed in double precision on SunSparc 2 workstation. LAPACK subroutines dgeev, dstev are used to compute the eigenvalue problems. VFFTPACK subroutines are used for FFT. The integer N represents the cuto® num- ber in the Chebyshev or Legendre series. Table II. Roundo® errors of the matrix decomposition methods N 8 16 32 64 128 256 CG 3.36E-15 3.10E-15 4.88E-13 4.27E-11 1.54E-9 2.92E-9 CT 4.38E-13 2.44E-12 2.61E-11 1.28E-9 2.36E-8 7.86E-8 LG 1.73E-15 8.44E-15 1.02E-13 4.81E-11 4.49E-11 8.99E-11 Two remarks are in order. Firstly the roundo® errors of CT method are much more pronounced than that of CG and LG methods. Consequently the CG and LG methods are signi¯cantly more accurate than the CT method (see also table III). Secondly there were doubts [8] that the matrix decomposition method would not be suitable for computations with large N because the rapid increase of roundo® errors efficient spectral-galerkin method ii 85 documented in [9] when N goes from 8 to 64. However our computations reveal that roundo® errors only increase slightly when N is further increased from 64 to 256. Hence all three methods, especially CG and LG methods, can be safely used for computations with large cuto® N as long as the computations are performed in double precision. We now report on several numerical examples by CG, CT and LG methods. Let us remark that the pure spectral-Galerkin method is rarely used in practice. In fact the so called pseudospectral method is used to treat the right hand sides, i.e. we replace f by its polynomial interpolation over the set of Gauss-Lobatto points. For the sake of comparison, we shall use again the two examples used in [8]. Example 1. The 2-D Poisson equation ¡¢u = 2k2 sin(k¼x) sin(k¼y); in ­ = I £ I; uj@­ = 0; with a smooth exact solution u(x; y) = sin(k¼x) sin(k¼y). Example 2. The 2-D Poisson equation ¡¢u = 1; in ­ = I £ I; uj@­ = 0; with an exact solution u(x; y) = ¡ 64 ¼4 1X n;m=1 n;m odd (¡1) n+m 2 cos( n¼x 2 ) cos( m¼y 2 ) nm(n2 + m2) ; which has singularities at the four corners. In table III, we list the maximum pointwise error of u ¡ uN by LG, CT, CG methods. Table III. Maximum pointwise error of u ¡ uN for examples 1 and 2. Example N CG CT LG 1 16 (k=4) 5.22E-3 3.33E-2 2.93E-3 1 32 (k=4) 2.17E-12 4.77E-11 3.44E-13 1 64 (k=4) 6.11E-15 8.67E-13 5.55E-15 1 128 (k=32) 2.85E-9 9.15E-8 1.82E-9 1 256 (k=32) 2.79E-14 1.59E-12 3.39E-14 2 16 3.36E-6 3.52E-5 1.42E-6 2 32 1.27E-7 2.23E-6 7.48E-8 Table IV. Execution time and pre-processing time. N 32 64 128 CG 0.05 (0.08) 0.26 (0.48) 1.96 (4.05) CT 0.09 (0.13) 0.44 (0.54) 3.36 (5.20) LG 0.10 (0.03) 0.64 (0.12) 6.96 (1.01) In Table IV, we list the execution time for the three methods. The approximate preprocessing time is given in parentheses. We note that in terms of accuracy and e±ciency, the CG method is far more superior than the popular CT method. On the other hand, The accuracy of the CG method and the LG method is comparable. The LG method is probably the method 86 jie shen of the choice if only one particular solution is needed. The CG method is more e±cient for equations with multiple right hand side, as is the case for solving time dependent problems. However the LG method could be potentially accelerated by implementing the fast transforms mentioned in [12]. Example 3. The 1-D fourth order equation uxxxx ¡ ®uxx + ¯u = ¡8¼2(16¼2 + ®) cos(4¼x) + ¯ sin(2¼x); x 2 I; u(§1) = ux(§1) = 0; with a smooth exact solution u(x) = sin(2¼x). In table V, we list the maximum pointwise error of u ¡ uN by the CG method with two typical choices of ®, ¯. The results indicate that the spectral accuracy is achieved and that the e®ect of roundo® errors is very limited. Table V. Maximum pointwise error of u ¡ uN for Example 3 by CG method. N 16 32 64 128 CG (® = ¯ = 0) 1.97E-2 9.42E-12 9.42E-14 4.68E-13 CG (® = 2 ¤ N 2; ¯ = N 4) 5.99E-3 3.00E-12 5.38E-15 2.35E-14 Concluding remarks. We have presented in this paper some e±cient direct solvers for the general second order equations and for the 1-D fourth order equations by using the Chebyshev-Galerkin approximation. Our algorithm for the second order equations is more accurate and more e±cient than the Chebyshev-tau method. Furthermore the implementation of the algorithm is also relatively easier. Our algorithm for the 1-D fourth order equations is very e±cient and numerically stable. It can be used in par- ticular to solve the 2-D Navier-Stokes equations with periodic-nonperiodic boundary conditions. Unfortunately, we were not able to derive an competitive algorithm for the 2-D fourth order equations. REFERENCES [1] C. BERNARDI, Y. MADAY, and B. M'ETIVET, Calcul de la pression dans la r¶esolution spec- trale du problµeme de Stokes, La Recherche A¶erospatiale, 1987. [2] B. L. BUZBEE AND F. W. DORR, The direct solution of the biharmonic equation on rect- angular regions and the Poisson equation on irregular regions, SIAM J. Numer. Anal., 11 (1974), pp. 753{763. [3] B. L. BUZBEE, G. H. GOLUB, and C. W. NIELSON, On direct methods for solving Poisson's equations, SIAM J. Numer. Anal., 7 (1970), pp. 627{656. [4] C. CANUTO, M. Y. HUSSAINI, A. QUARTERONI, and T. A. ZANG, Spectral Methods in Fluid Dynamics, Springer-Verlag, 1987. [5] D. FUNARO AND W. HEINRICHS, Some results about the pseudospectral approximation of one dimensional fourth order problems, Numer. Math., 58 (1990), pp. 399{418. [6] D. GOTTLIEB AND L. LUSTMAN, The spectrum of the Chebyshev collocation operator for the heat equation, SIAM J. Numer. Anal., 20 (1983), pp. 909{921. [7] D. GOTTLIEB AND S. A. ORSZAG, Numerical Analysis of Spectral Methods: Theory and Applications, SIAM-CBMS, Philadelphia, 1977. [8] D. B. HAIDVOGEL AND T. A. ZANG, The accurate solution of Poisson's equation by expansion in Chebyshev polynomials , J. Comput. Phys., 30 (1979), pp. 167{180. [9] P. HALDENWANG, G. LABROSSE, S. ABBOUDI, and M. DEVILLE, Chebyshev 3-D spectral and 2-D pseudospectral solvers for the Helmholtz equation, J. Comput. Phys., 55 (1984), pp. 115{128. efficient spectral-galerkin method ii 87 [10] W. HEINRICHS, A stabilized treatment of the biharmonic operator with spectral methods, SIAM J. Sci. Stat. Comput., 12 (1991), pp. 1162{1172. [11] Y. MADAY AND B. M'ETIVET, Chebyshev spectral approximation of Navier-Stokes equations in a two dimensional domain, Model. Math. Anal. Numer., 21 (1986), pp. 93{123. [12] J. SHEN, E±cient spectral-Galerkin method I. Direct solvers for second- and fourth-order equations by using Legendre polynomials, SIAM J. Sci. Comput., 15 (1994), pp. 1489{1505.

采集于

查看校方原文 ↗