On the Chebyshev-Collocation Method for Bi ... - Semantic Scholar

1 downloads 0 Views 284KB Size Report
Jun 24, 2003 - aSchool of Computing, Univ. of Utah, Salt Lake City, Utah, USA. bDiv. of Applied Math., Brown Univ., Providence, RI, USA. Abstract. A method ...
On the Chebyshev-Collocation Method for Bi-Harmonic Problems with Homogeneous Dirichlet Boundary Conditions R. M. Kirby a , Z. Yosibash b,1 a School

of Computing, Univ. of Utah, Salt Lake City, Utah, USA.

b Div.

of Applied Math., Brown Univ., Providence, RI, USA

Abstract A method for “strongly” implementing homogeneous Dirichlet boundary conditions for one-dimensional fourth-order and two-dimensional bi-harmonic problems solved by means of the Chebyshev-collocation method is presented. This method properly adjusts the discrete operator to account for the Dirichlet homogeneous boundary conditions (the function and its normal derivative being zero on the boundary). We show that without special care, the straight forward implementation of this method fails to properly incorporate these boundary conditions, and hence the new approach is required. Numerical experiments in both one and two dimensions are provided to demonstrate the ideas presented.

Keywords: Pseudo-spectral methods, Chebyshev-collocation, fourth-order problems, biharmonic operator, homogeneous Dirichlet boundary conditions.

1

Introduction

Pseudo-spectral methods have been shown to provide numerical solutions having a high rate of convergence, and have been used extensively as a numerical tool for solving first-order and second-order partial differential equations (and substantially less for fourth-order operators). The boundary conditions may be imposed by either the penalty method (see [1]), i.e. the conditions are imposed in a weak sense so as the number the collocation points is increased a better representation of the boundary conditions is obtained, or enforced 1

Email addresses: [email protected] (R. M. Kirby), [email protected] (Z. Yosibash). On Sabbatical leave from the Dept. of Mech. Engrg., Ben-Gurion Univ. Beer-Sheva, Israel.

Preprint submitted to Applied Numerical Mathematics

June 24, 2003

“strongly” by restricting the numerical operator to exactly enforce the boundary conditions. Although penalty methods are more general and widely used, enforcing “strongly” the boundary conditions ensures that for any given order the boundary conditions are exact to machine precision. When the fourth-order operator is considered, enforcing “strongly” the homogeneous Dirichlet boundary conditions in the discrete operator requires a careful mathematical examination. One must: a) restrict the polynomial space in which the solution is sought, so that it automatically satisfies the homogeneous boundary condition, and b) project the right hand side function using an interpolation operator into the proper space. Failure to do so may yield inconsistencies in the numerical operator and possibly results in low accuracy approximations. We demonstrate the approach on a fourth-order ordinary differential equations (ODE) in one-dimension and the bi-harmonic partial differential equation (PDE) in two dimensions. Consider the 1-D ODE: u,xxxx = f (x) u(±1) = u,x (±1) = 0

in (−1, 1)

(1) (2)

and the bi-harmonic 2-D PDE: def

∇4 u = u,xxxx + 2u,xxyy + u,yyyy = f (x, y) u(±1, y) = u,x (±1, y) = u(x, ±1) = u,y (x, ±1) = 0

in (−1, 1) × (−1, 1)

(3) (4)

def ∂u . ∂x

where u,x =

Other spectral methods, mainly based on the spectral Galerkin approach, for fourth-order and bi-harmonic problems having Dirichlet boundary conditions have been proposed, analyzed and successfully implemented (see e.g. [2–5]), and it is not our intension to review these. Considerably less attention has been devoted to strongly incorporate the Dirichlet boundary conditions for pseudo-spectral methods. Herein we present the numerical formulation on the basis of the one-dimensional problem in Section 2, followed by a numerical example demonstrating the accuracy of the results. In Section 3 the ideas are extended to the two-dimensional bi-harmonic operator, again followed by a numerical example. In section 4 we demonstrate the necessity of the proposed methodology when strongly implementing homogeneous Dirichlet boundary condition. A specific bi-harmonic problem is numerically solved by a “straight forward” means and the results are compared to the method presented herein. We conclude by a summary and some remarks.

2

2

The One-Dimensional Fourth-Order Problem

Consider the 1-D problem (1)-(2). In order to “strongly” impose the boundary conditions, we seek polynomial solutions u(x) ∈ P N1 of the form: u(x) = (1 − x2 )q(x).

(5)

According to (5), the approximating polynomial space of q(x) is two orders lower (i.e. P N2 where N2 = N1 −2) than that of u(x). Assuming a polynomial solution of the form above, we can write a fourth derivatives approximation of u(x) in terms of derivatives of the polynomial function q(x) as follows: d4 (1 − x2 )q(x) 4 dx = (1 − x2 )q,xxxx − 8xq,xxx − 12q,xx ! 4 d3 d2 2 d = (1 − x ) 4 − 8x 3 − 12 2 q(x) dx dx dx

u,xxxx (x) =

(6)

By (5), u(x) identically satisfies the homogeneous Dirichlet boundary condition u(±1) = 0, and in order that u,x (±1) = 0 one has to restrict q(±1) = 0. Inserting (6) into (1) the ODE to be solved reduces to: d3 d2 d4 (1 − x ) 4 − 8x 3 − 12 2 q(x) = f (x) dx dx dx !

2

(7)

Solving (7) for the function q(x) by the Chebyshev-collocation method can be accomplished by the specification of the collocation points chosen to be the Chebyshev Gauss-Lobatto points defined as: xGL = − cos(πj/N2 ) j = 0, . . . , N2 . (8) j where N2 + 1 is the number of collocation points chosen. Notice that the boundary points are included in the set of collocation points, and thus we must restrict the numerical operator so that q(x) is zero at xGL and xGL 0 N2 . Furthermore, one needs to project f (x) into the space of polynomials of degree N2 defined by the Chebyshev-Gauss-Lobatto points. This projection is done using the interpolation function IN2 f (see e.g. [6]). This interpolation of f (x) combined with the removal of the end-points in the computation of q(x) places the right hand side into the space P N1 −4 as dictated by Funaro et al. [7]. GL 2 Let B = Bij = xGL j δij , A = Aij = (1 − (xj ) )δij and I = δij where i, j = 0, . . . , N2 . Let D be the collocation derivative matrix based upon the Chebyshev-Gauss-Lobatto points x GL j given by the following expression:

3

dhj (xGL i ) dx where hj (x) are the Lagrange interpolating polynomials such that hj (xGL i ) = δij . D = Dij =

Given the definitions above, we can define an approximation to equation (6) by the following matrix: D4 = AD4 − 8BD3 − 12D2 . ˜ to be the differentiation operator after being constrained to account for essential We define D ˜ 4 corresponds to the operator D4 after two rows boundary conditions. i.e., the operator D and columns have been adjusted so that q(±1) = 0, therefore equation (7) in its discrete form becomes: ˜ 4 ~q = f~ D (9) GL T GL GL T ~ where ~q = (q(xGL 1 ), . . . , q(xN2 −1 )) and f = (f (x1 ), . . . , f (xN2 −1 )) .

Solving (9) combined with enforcement of the zero boundary conditions at the end-points provides q(x) at the N2 + 1 Chebyshev-Gauss-Lobatto points. To regain the polynomial solution u(x) on a sufficient number of collocation points to support a polynomial of order N1 , we do the following: first, define a new grid of N1 + 1 Chebyshev-Gauss-Lobatto points x˜GL j , j = 0, . . . , N1 . Elevate the polynomial q(x) to the new grid by evaluating q(x) at the new grid points. Finally multiply q(x) by the function (1 − x2 ) at the new grid points. Because the new grid is chosen to support polynomials of order N2 + 2 = N1 , the polynomial u(x) = (1 − x2 )q(x) is thus uniquely defined on the new grid. 2.1 Numerical Results

The proposed method of strongly enforcing the homogeneous Dirichlet boundary conditions is applied to (1-2) with the RHS: f (x) = e10x (10) for which the exact solution is: uex (x) = 10−4 e10x − (−4.40529x3 + −3.85463x2 + 5.50662x + 4.95595) The numerical solution obtained using N1 = 24 (i.e. N2 = 22) is shown in Figure 1. The same problem is solved also by the implementation given in [8, p. 147]. The implementation in this paper differs from that in [8] in the care taken to maintain the correct polynomial spaces as mandated by [7]. This type of modification was accomplished in [9] for the one-dimensional fourth-order problem through an appropriate modification of the Lagrange interpolating polynomials to meet the boundary conditions. The approximated 4

6

5

uN(x)

4

3

2

1

0 −1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x

Fig. 1. Plot of the solution of (1-2) with RHS given by (10). Solution was obtained using polynomials up to 24th order.

solution obtained by the method in [8] is denoted by uo , as opposed to uR which is the numerical solution obtained by the method presented in this paper. In Figure 2 the discrete L∞ errors defined as: maxi=0,N1 |uex (˜ xGL xGL i ) − uo (˜ i )|,

maxi=0,N1 |uex (˜ xGL xGL i ) − uR (˜ i )|,

(11)

are shown as N1 is increased. We also show in Figure 2 (right) that the methods in [8, p. 147] does not produce zero slopes at the boundary as required (the method presented in this paper provides boundary conditions on the order of machine zero O(10−14 ), so it has not been added to the graph). 2

10

0

10 0

10

−2

10 −2

10

−4

10

−4

−6

10

N

|d/dx u (1)|

Discrete L∞ Error

10

−6

10

−8

−8

10

−10

10

−12

10

10

−10

10

−12

10

−14

10

−14

6

8

10

12

14

16

18

20

22

24

10

26

Polynomial Order

6

8

10

12

14

16

18

20

22

24

26

28

Polynomial Order

Fig. 2. Left: Discrete L∞ error versus polynomial order for the method proposed in [8, p. 147] and for the method described above (squares). Right: Value of the slope at x = 1 for the method proposed in [8, p. 147] (circles). For the method proposed above, the slope remains on the order of machine precision (M ≈ 10−14 ) across all polynomial orders.

It may be observed that although the other method does not precisely incorporate the homogeneous Dirichlet boundary conditions, as N1 increases the boundary conditions converge spectrally to the correct values. It is also interesting to note that the sacrifice for implementing the boundary conditions exactly is a slight shift upward in the convergence plot for the new method. This can be explained by observing that the new methodology truly restricts the search space of solutions to polynomials of the form given in (5). 5

3

The Two-Dimensional Bi-harmonic Problem

Consider the 2-D bi-harmonic problem (3)-(4), for which we now represent the solution as: u(x, y) = (1 − x2 )(1 − y 2 )q(x, y)

(12)

This particular choice automatically satisfies the boundary conditions u(±1, y) = u(x, ±1) = 0. As in the 1-D case, we substitute (12) in (3) to obtain the following equation in terms of q(x, y): d4 d3 d2 (1 − y ) (1 − x ) 4 − 8x 3 − 12 2 q(x, y)+ dx dx dx ! 3 4 d d2 2 2 d (1 − x ) (1 − y ) 4 − 8y 3 − 12 2 q(x, y)+ dy dy dy 2 2 d d d2 d d d3 2 4 + 8y + 8x − 2(1 − x2 ) 2 − 2(1 − y 2 ) 2 + 16xy − 4x(1 − y 2 ) dy dx dx dy dxdy dxdy 2 ! d4 d3 (13) −4y(1 − x2 ) 2 + (1 − x2 )(1 − y 2 ) 2 2 q(x, y) = f (x, y) dx dy dx dy 2

!

2

In the case of a 2-D problem, the use of the tensor product operator ⊗ is very helpful and is defined as follows. Let P and of size n × n and m × m respectively. Their  R be two matrices   P11 R . . . P1n R   . .. ..   tensor-product P ⊗ R =  , is a matrix of size mn × mn.  .. . .      def

Pn1 R . . . Pnn R

GL We define the set {xGL i , yj }, i, j = 0, . . . , N2 which are the Chebyshev-Gauss-Lobatto point distribution on [−1, 1] × [−1, 1], and D is the one-dimensional Chebyshev-collocation derivative operator as defined previously. Thus, the bi-harmonic discrete operator, equivalent to the 1-D case using the (N2 + 1)2 Chebyshev-Gauss-Lobatto collocation points ((N2 + 1) points in each direction), becomes:

Lbi−harmonic = (I ⊗ A)(D4 ⊗ I) + (A ⊗ I)(I ⊗ D4 ) + h

2 4(I ⊗ I) + 8(I ⊗ B)(I ⊗ D) + 8(B ⊗ I)(D ⊗ I) − 2(A ⊗ I)(D2 ⊗ I) −2(I ⊗ A)(I ⊗ D2 ) + 16(B ⊗ B)(D ⊗ D) − 4(B ⊗ A)(D ⊗ D2 ) −4(A ⊗ B)(D2 ⊗ D) + (A ⊗ A)(D2 ⊗ D2 )

i

(14)

As in the one-dimensional problem, we must project the right hand side into the space of 2-D polynomials spanned by the Chebyshev-Gauss-Lobatto collocation points (IN2 ⊗IN2 )f~(x, y).

6

To enforce the homogeneous boundary conditions on the normal derivatives of u(x, y) on the boundaries, we constrain q(±1, y) = q(x, ±1) = 0 by altering the differentiation matrices, so that equation (3) in its discrete form becomes: ˜ bi−harmonic ~q(xGL , y GL ) = f~(xGL , y GL ) L i j i j

(15)

˜ bi−harmonic is as in (14) with all derivative matrices replaced by where i, j = 1, . . . , N2 − 1, L ˜ 4 instead of D4 , D˜2 instead of D2 and D ˜ instead of a corresponding restricted version, i.e. D D. As in the one-dimensional case, once q(x, y) has been determined, the last step is to represent u(x, y) in terms of q(x, y). As in the one-dimensional case, we do this in three steps. First, ˜jGL ), i, j = 0, . . . , N1 we define a new tensor product Chebyshev-Gauss-Lobatto grid (˜ xGL i ,y of size (N1 + 1) × (N1 + 1). We then evaluate q(x, y) on to the new grid. Lastly, we form u(x, y) by multiplying the values of q(x, y) by the function (1 − x2 )(1 − y 2 ) evaluated on the new grid. As in the one-dimensional case, the grid has been chosen to properly support polynomials of the order of u(x, y). 3.1 Numerical Results

We applied our method to (3-4) with the RHS: f (x, y) = −8π 4 (cos(2πx) sin(πy)2 + sin(πx)2 cos(2πy) − cos(2πx) cos(2πy))

(16)

for which the exact solution is: uex (x, y) = sin2 (πx) sin2 (πy) The solution using a Chebyshev-Gauss-Lobatto grid having 41 points in each direction is shown in Figure 3. We solve again the problem using also the algorithm proposed in [8, p. 148] (solution is denoted by uo ). For the two-dimensional case we define the discrete L∞ error as: maxi,j=0,N1 |uex (˜ xGL ˜jGL ) − u(˜ xGL ˜jGL )|, i ,y i ,y

(17)

and plot it in Figure 4 as N1 is increased. We also show in Figure 4 (right) that the methods in [8, p. 148] does not produce zero slopes at the boundary as required (our method provides a machine precision zero on the order O(10−14 ), so it has not been added to the graph).

7

1

0.5

0

1 1

0.5 0.5

0 0 −0.5

−0.5 −1

−1

Fig. 3. Solution of the 2-D bi-harmonic example problem. Solution obtained using polynomials of 40th order per direction. 2

2

10

10

0

0

10

10

−2

Abs. Normal Derivative on Boundary

10



Discrete L Error

−4

10

−6

10

−8

10

−10

10

−12

−4

10

−6

10

−8

10

−10

10

−12

10

10

−14

10

−2

10

−14

6

8

10

12

14

16

18

20

22

24

26

10

6

8

Polynomial Order

10

12

14

16

18

20

22

24

26

Polynomial Order

Fig. 4. Left: Discrete L∞ error versus polynomial order for the method proposed in [8] (circles) versus the solution method described above (squares) for the 2-D bi-harmonic example problem. Right: Maximum value of the normal derivative on the boundary for the method proposed in [8] (circles). For the method proposed above, the slope remains at machine precision ( M ≈ 1.0×10−14 ) across all polynomial orders.

4

Difference in the two approaches

To illustrate the difference between the results obtained by the method proposed in this paper compared to other more straight-forward methods which are not mathematically consistent, consider the following problem: ∇4 u(x, y) = exp 5x2 exp 5y 2 , on (−1, 1) × (−1, 1) u(±1, y) = u(x, ±1) = u,x (±1, y) = u,y (x, ±1) = 0

8

(18)

The problem was solved both by the algorithms herein (uR ), as well as by the method in [8] (uo ), as shown in Figure 5.

0.25

0.2

0.15

0.1

0.05

0 1 1

0.5 0.5

0 0 −0.5

−0.5 −1

−1

Fig. 5. The solution of the two-dimensional bi-harmonic problem (18) (both u R and uo ). Both solutions were obtained using 24 points per direction.

As in the previous numerical examples, the Dirichlet boundary conditions are not exactly met for the method in [8], however, as the number of collocation points is increased, the error in the normal derivative at the boundary decreases. 0

Abs. Normal Derivative on Boundary

10

−1

10

−2

10

−3

10

−4

10

10

12

14

16

18

20

22

24

Polynomial Order

Fig. 6. Maximum absolute value of the normal derivative of the solution uo over all four edges o max| ∂u ∂n | as a function of the polynomial order per direction (N 1 ).

To better visualize the difference between the two solutions we define the discrete L 2 norm as: v u !2 uNX 1 −1 uR (˜ xGL ˜jGL ) − uo (˜ xGL ˜jGL ) 1 u i ,y i ,y t (19) discrete L2 (N1 ) = ˜jGL ) (N1 − 1)2 i,j=1 uR (˜ xGL i ,y

and show it as a function of number of grid points in Figure 7. One may notice that as N 1 is

9

0

10

−1

10

−2

Discrete L2

10

−3

10

−4

10

−5

10

8

10

12

14

16

18

20

22

24

26

Polynomial Order

Fig. 7. Discrete L2 error as described in (19) for the two-dimensional bi-harmonic problem (18) as a function of the polynomial order per direction (N1 ).

increased the difference decreases, however, the scale shows that the L2 difference between the two different solution is not negligible.

5

Conclusions

This paper presents a method for strongly incorporating homogeneous Dirichlet boundary conditions into the discrete bi-harmonic operator when Chebyshev-collocation methods are used. It is based on a careful examination of the space in which the spectral method seeks for solutions, and the proper projection of the RHS of the equation into this space. The numerical experiments provided demonstrate that the method does indeed enforce the homogeneous Dirichlet boundary conditions at any N , and that other methods which do not carefully examine the problem may produce erroneous solutions. This is particularly important when dynamic systems of the form: u¨ + ∇4 u = f are considered. Acknowledgments: The authors thank Prof. George Em Karniadakis (Div. of Appl. Math., Brown Univ.) for helpful discussions, remarks and support, Profs. David Gottlieb and Jan Hesthaven (Div. of Appl. Math., Brown Univ.) for their useful discussions and Prof. L.N. Trefethen (Oxford Univ.) for helpful responses concerning questions about his text. The first author gratefully acknowledges the support of this work by the Scientific Computing

10

and Imaging Institute at the University of Utah. The second author gratefully acknowledges the support of this work by the AFOSR (Computational Mathematics Program) under grant number F49620-01-1-0035.

References [1] J.S. Hesthaven. Spectral penalty methods. Appl. Numer. Math., 33((1-4)):23–41, 2000. [2] C. Bernardi and Y. Maday. Spectral methods for the approximation of fourth-order problems: Application to the Stokes and Navier-Stokes equations. Comp. Structures, 30:205–216, 1988. [3] C. Bernardi, G. Coppoletta, and Y. Maday. Some spectral approximations of 2-dimensional 4th-order problems. Math. of Comp., 59:63–76, 1992. [4] J. Shen. Efficient spectral-Galerkin method. I Direct solvers of second- and fourth-order equations using Legendre polynomials. SIAM Jour. Sci. Comput., 15:1489–1505, 1994. [5] B. Bialecki and A. Karageorghis. A Legendre spectral Galerkin method for the bi-harmonic Dirichlet problem. SIAM Jour. Sci. Comput., 22:1549–1569, 2000. [6] C. Canuto, M.Y. Hussaini, A. Quarteroni, and T.A. Zang. Spectral Methods in Fluid Mechanics. Springer-Verlag, New York, 1987. [7] D. Funaro and W. Heinrichs. Some results about the pseudospectral approximation of onedimensional fourth-order problems. Numer. Math., 58:399–418, 1990. [8] Lloyd N. Trefethen. Spectral Methods in Matlab. SIAM, 2000. [9] J.A.C Weideman and S.C. Reddy. A MATLAB differentiation matrix suite. ACM Transactions on Mathematical Software, 26(4):465–519, 2000.

11

Suggest Documents