52
IT Licentiate theses 2001-014 Fourth Order Symmetric Finite Difference Schemes For The Wave Equation ABRAHAM Z EMUI UPPSALA UNIVERSITY Department of Information Technology

Fourth Order Symmetric Finite Difference Schemes For The

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fourth Order Symmetric Finite Difference Schemes For The

IT Licentiate theses2001-014

Fourth Order Symmetric FiniteDifference Schemes For TheWave Equation

ABRAHAM ZEMUI

UPPSALA UNIVERSITYDepartment of Information Technology

Page 2: Fourth Order Symmetric Finite Difference Schemes For The
Page 3: Fourth Order Symmetric Finite Difference Schemes For The

Fourth Order Symmetric Finite Difference Schemesfor the Wave Equation

BY

ABRAHAM ZEMUI

December 2001

DEPARTMENT OFSCIENTIFIC COMPUTING

INFORMATION TECHNOLOGY

UPPSALA UNIVERSITY

UPPSALA

SWEDEN

Dissertation for the degree of Licentiate of Philosophy in Numerical Analysisat Uppsala University 2001

Page 4: Fourth Order Symmetric Finite Difference Schemes For The

Fourth Order Symmetric Finite Difference Schemes for the Wave Equation

Abraham [email protected]

Department of Scientific ComputingInformation Technology

Uppsala UniversityBox 337

SE-751 05 UppsalaSweden

http://www.it.uu.se/

c© Abraham Zemui 2001ISSN 1404-5117

Printed by the Department of Information Technology, Uppsala University, Sweden

Page 5: Fourth Order Symmetric Finite Difference Schemes For The

FOURTH ORDER SYMMETRIC

FINITE DIFFERENCE SCHEMES FOR

THE WAVE EQUATION

ABRAHAM ZEMUI

Dec. 11, 2001

Page 6: Fourth Order Symmetric Finite Difference Schemes For The

Abstract. The solution of the acoustic wave equation in one spacedimension is studied. The PDE is discretized using finite element approxi-mation. A cubic piecewise Lagrange polynomial is used as basis. Consistentfinite element and lumped mass schemes are obtained. These schemes areinterpreted as finite difference schemes. Error analysis is given for thesefinite differences (only for constant coefficients).

Key words. finite element approximation, error analysis, lumped massapproximations, finite difference approximation, Galerkin method, Helmholtzequation

Page 7: Fourth Order Symmetric Finite Difference Schemes For The

1 Introduction

There are several computational methods available for solving partial dif-ferential equations which are obtained as models from different disciplinesof sciences. Among these are finite differences and finite element methods.These have their own advantages and disadvantages. The success of thefinite element method in elliptic problems has put pressure on numericalanalysts and engineers to give up classical difference methods and adoptfinite element for linear time-dependent problems. The efficiency of high-order methods has been studied by Swartz and Wendroff in [1] and by Kreissand Oliger in [8]. On the other hand, high order finite difference operatorsthat are used for solving partial differential equations are already obtained[2,11]. However these schemes are not symmetric whereas those obtainedby finite elements are symmetric. The main goal here is to produce highorder symmetric finite difference schemes. These are constructed by usingfinite element methods. Symmetry reduces the number of independent vari-ables from mathematical point of view. It helps in establishing stability [12].Thus symmetry simplifies the task of getting a numerical solution. Availablesoftware, can be applied easily for symmetric schemes. To exploit these, wefirst obtain finite element schemes and interpret them as finite differenceschemes [3,6], thereby obtaining symmetric high order finite differences. Itwas observed in [7] that Galerkin’s method, using a local basis, providesunconditionally stable, implicit generalized finite-difference schemes for alarge class of linear and nonlinear problems. In addition Strang and Fix em-phasize that finite element methods can be interpreted as finite differencemethods.

Another interesting aspect is the use of lumped mass matrices. When wework with a finite element scheme, we express discrete finite element equa-tions in terms of finite difference operators which lead to a banded matrixsystem. The coefficient matrix of this banded matrix system is the massmatrix. That is, the time derivative is preceded by a mass matrix whichmakes the time stepping implicit. To obtain an explicit scheme, one has tolump the mass matrix such that it becomes diagonal. Our construction ofa finite difference scheme is based on lumping a finite element scheme withnodal basis functions which are piecewise cubic Lagrange polynomial func-tions and are generalizations of piecewise linear hat functions. The lumpingwe are using does not always produce a diagonal matrix. Some problemscontain time derivatives in their boundary conditions. For such problemswe have obtained a symmetric positive definite matrix as the lumped mass

1

Page 8: Fourth Order Symmetric Finite Difference Schemes For The

matrix that retains the desired order of accuracy . It should be positivedefinite in order for the scheme to be stable. Lumping the mass matrix canimprove stability for some problems ( as in our case) compared to the consis-tent mass matrix and make the scheme explicit. However lumping can alsoreduce the numerical accuracy significantly. It depends upon the equationsunder consideration.

In this report acoustic wave propagation in layered media is studied.The acoustic wave equation occurs in different phenomena. Acoustic wavesconstitute one kind of pressure fluctuation that can exist in a compress-ible fluid. In addition to the audible pressure fields of moderate intensity,the most familiar, there are also ultra-sonic and infra-sonic waves whosefrequencies lie beyond the limits of hearing, there are also shock waves gen-erated by explosions and supersonic aircraft and many others. When anacoustic wave traveling in one medium encounters the boundary of a secondmedium, reflected and transmitted waves are generated. Hence we will con-sider the solution of the one dimensional acoustic wave equation not onlyin one medium, but also in two media. There are two boundary conditionsto be satisfied for all times at all points on the boundary: (1) the acousticpressures on both sides of the boundary must be equal and (2) the normalcomponents of the particle velocities on both sides of the boundary must beequal.

We use the finite element method (FEM) and the finite difference method(FDM) on the reduced equation, the Helmholtz equation associated withsuitable boundary conditions. The purpose being to obtain efficient schemesmotivated by Helmholtz equation to use for the time dependent wave prop-agation problems which will be applied in the sequel. The other importantthing why we study the Helmholtz equation is that it makes easier to analyzeaccuracy. These analysis will also be applicable for the time dependent prob-lems. Note that the stability will not be covered by studying the Helmholtzequation. For time domain stability, it is of critical importance that themass matrix is positive definite while this is not so relevant for frequencydomain problems.

In section 2, the numerical solutions of FEM in one and two mediausing one-sided and centered boundary approximations are described. Al-though boundaries are treated easily in FEM, we will have alternatives atthe boundary. One-sided and centered scheme at the boundary where thelatter is obtained by putting fictitious points outside the domain. This is

2

Page 9: Fourth Order Symmetric Finite Difference Schemes For The

common in FDM. The local truncation errors for the total problem includ-ing the boundaries are presented in section 3. In section 4, FDM(schemesobtained by lumping) are discussed. In section 5, error analysis based onreflection analysis [4] is given while in section 6 numerical examples are pro-vided, where we study the rate of convergence of the numerical methods.Finally the time dependent problem is considered in one and two mediacases which is followed by concluding remarks.The one dimensional wave equation is given by

1c2

∂2P

∂t2= ρ

∂x

∂P

∂x(1.1)

where c = speed of sound, ρ = density and P is the acoustic pressure. Pri-marily, we consider the reduced wave equation, known as Helmholtz equa-tion. The Helmholtz equation arises in many physical applications, eg. scat-tering problems, in electro-magnetics and acoustics. We assume the densityto be constant. To get the Helmholtz equation, we assume a time harmonicdependence, then one can write the solution as

P (x, t) = Re(u(x)e−iωt), u− complex (1.2)

where ω = frequency. Substituting in (1.1), yields the Helmholtz equationin one dimension

d2u

dx2+ k2u = 0; (1.3)

where k = ωc . It is to be solved in the interval 0 ≤ x ≤ 1 with different

boundary conditions at the end points x = 0 and x = 1. Furthermore, theequation is solved in two different media where certain boundary conditionsare to be satisfied at the interface of the two media.

2 The Finite Element Method(FEM)

The idea of FEM starts by a subdivision of the structure or the region ofphysical interest, into smaller pieces. These pieces have to be easy to beidentified by a computer and may be segments as in one space dimension ormay be triangles or rectangles in two space dimensions. Then within eachpiece the trial functions have a simple form, usually they are polynomials.A piecewise polynomial function defined in terms of the values at nodes,defined by the element geometry, leads to a sparse coefficient matrix andthe possibility of solving bigger problems. It was recognized that increasingthe degree of the polynomials would greatly improve the accuracy.

3

Page 10: Fourth Order Symmetric Finite Difference Schemes For The

In our case we have constructed the global basis as a piecewise cubic La-grange polynomial(described below). Some other bases such as piecewisequadratic and Hermite cubic elements which are constructed by imposingcontinuity not only on the function but also on the first derivative have beenanalyzed [3]. The advantage of this approach being a reduction in the de-grees of freedom. There is a double node at each point x = jh. Instead ofbeing determined by the values at four distinct points, the cubic is deter-mined by its values and its first derivatives at the two end points. This failsin the approximation of solutions which do not have a continuous derivative.There is another cubic space, formed from functions for which the secondderivative is also continuous at the nodes. Such a piecewise cubic which hasa continuous second derivative is called a cubic spline. It is no longer obvi-ous which nodal parameters determine the shape of the cubic over a givensubinterval, say (j − 1)h ≤ x ≤ jh. The nodes xj−1 and xj which belong tothe interval, account for only two conditions and the other two must comefrom outside. Discussions on these are given in [3].Therefore, for the FEM applied to the problem (1.3), a grid is defined by

xj =jh, j = 0, 1 . . . N.

h =1/N

Let P h3 be the space of all piecewise cubic Lagrange polynomials which are

continuous at the nodes x = jh. We seek an approximation

uh(x) =N∑

j=0

ujφhj (x) (2.1)

where uh(x) is a piecewise cubic polynomial which in each interval xi ≤ x ≤xi+1 is the Lagrange interpolating polynomial based on the nodes xi−1, xi,xi+1 and xi+2. It implies that uh(x) is continuous at the nodes xi but withjumps in the derivatives. Observe that the above representation involvesprescribed functions φh

j (x) and unknown coefficients uj . We want φj tofulfill the following:1. φh

j is a cubic polynomial over each element, uniquely determined by itsvalues at the nodes in the element.2. φh

i (xj) = δij where δij denotes the Kronecker delta.3. The support of φi(xj) is restricted to four sub-intervals xi−2 ≤ x ≤ xi+2

It should be noted that the uj are just the values of the function, ie

uh(xj) = uj

4

Page 11: Fourth Order Symmetric Finite Difference Schemes For The

Moreover, any cubic polynomial defined on the whole interval can be ex-pressed in terms of the basis namely

P3(x) =∑

P3(xj)φhj (x)

which implies P h3 ≡ P3(x)

The following φ(x) constitutes a basis for integer nodes to be rescaledand translated as required. The basis functions φh

i (x) are then formed fromφ(x) stated below in (2.3) by rescaling the independent variable from x toxh , and translating the origin to lie at the node ih.

φhi (x) = φ(

x

h− i), i = 0, 1, 2 . . . N (2.2)

φ(x) =

16(x + 1)(x + 2)(x + 3), −2 ≤ x ≤ −1

−12 (x− 1)(x + 1)(x + 2), −1 ≤ x ≤ 0

12(x− 1)(x− 2)(x + 1), 0 ≤ x ≤ 1

−16 (x− 1)(x− 2)(x− 3), 1 ≤ x ≤ 2

(2.3)

2.1 One-sided boundary approximation

Primarily we consider one-sided schemes at the boundary. The basis func-tion need to be modified at the boundary. Accordingly, the following mod-ifications are needed on the interval 0 ≤ x ≤ 1 for the elements φ0, φ1, φ2

and φ3

φ0(x) =−16

(x− 1)(x− 2)(x− 3), 0 ≤ x ≤ 1

φ1(x) =12x(x− 2)(x− 3), 0 ≤ x ≤ 1

φ2(x) =−12

x(x− 1)(x− 3), 0 ≤ x ≤ 1

φ3(x) =16x(x− 1)(x− 2), 0 ≤ x ≤ 1

Observe that the support of φ3(x) is extended from the interval [1, 5] to theinterval [0, 5]. These modifications are equivalent to the use of one-sided

5

Page 12: Fourth Order Symmetric Finite Difference Schemes For The

interpolation at the boundary.We define the scalar product and the corresponding norm by

(u, v) =∫ 1

0

1ρu(x)v(x)dx, ||u||2 = (u, u), (2.4)

Now, the Galerkin method(FEM) for the Helmholtz equation is formulatedas follows. Find uh(x)εP h

3 such that

(d2uh

dx2+ k2uh, vh) = (f, vh), vhεP h

3 (2.5)

f is approximated by its piecewise cubic interpolate

fh =∑

j

f(xj)φhj (x)

where f(xj) is the value of the function at the node x = jh. The treatmentof the boundary conditions is straightforward. When a Dirichlet boundarycondition is applied, we should require φ(x) = 0 on the boundary such thatthe approximate solution uh(x), fulfills the boundary condition, and thoseboundary conditions involving derivatives can be treated by integration byparts. For instance, with a Dirichlet boundary condition at x = 1 and

du(x)dx

=αu(x) + g, x = 0 (2.6)

we obtain after integration by parts

−N−1∑

j=0

(∫ 1

0(φh

i )′(φhj )′dx)uj − δi,0(αu0 − g) + k2

N∑

j=1

(∫ 1

0φh

i φhj dx)uj

=∫ 1

0fhφh

i dx,

i = 0, . . . N − 1. (2.7)

In this case as well as the one with Dirichlet boundary conditions at bothends we obtain a linear system for u1, . . . , uN−1 which can be expressed inmatrix form Au=b, with the matrix A having entries

1h

Si,j + hk2Mi,j

whereSi,j = − ∫ 1

0 φ′iφ′jdx, Mi,j =

∫ 10 φiφjdx and bi =

∫ 10 fhφidx.

6

Page 13: Fourth Order Symmetric Finite Difference Schemes For The

The matrices S and M are called the stiffness and mass matrices respec-tively. It was found, for the Dirichlet boundary conditions, by computingthe integrals in Maple that the stiffness matrix

SD =

−13945

211120

−760

−7360

211120

−11845

2320

130

−7360

−760

2320

−3215

2524

130

−7360

−7360

130

2524

−199

2524

130

−7360

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

and the mass matrix

MD =

1046945

1240

−111260

3115120

1240

223270

3592520

−370

3115120

−111260

3592520

79

2571680

−370

3115120

3115120

−370

2571680

733945

2571680

−370

3115120

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

With the impedance boundary condition (2.6) at x = 0 we obtain

SI =

α + −10990

2215

−310

245

2215

−13945

211120

−760

−7360

−310

211120

−11845

2320

130

−7360

245

−760

2320

−3215

2524

130

−7360

0 −7360

130

2524

−199

2524

130

−7360

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

7

Page 14: Fourth Order Symmetric Finite Difference Schemes For The

M I =

214945

59315

−31315

17945

59315

1046945

1240

−111260

3115120

−31315

1240

223270

3592520

−370

3115120

17945

−111260

3592520

79

2571680

−370

3115120

0 3115120

−370

2571680

733945

2571680

−370

3115120

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

Note that when α = 0 in (2.6), it represents Neumann boundary conditions.Our next step was to solve the Helmholtz equation in two different media.

When an acoustic wave traveling in one medium encounters the boundaryof a second medium, reflected and transmitted waves are generated as infig.1.

incoming wave

transmitted wave

reflected wave

I II

Figure 1: Reflection and transmission of a wave incident on the boundarybetween fluids with different characteristic impedances.

The two media could be both fluids or one of the media is a solid. Theratio of the pressure amplitudes and intensities of the reflected and trans-mitted waves to those of the incident wave depend on the characteristicacoustic impedances and speeds of sound in the two media and on the anglethe incident wave makes with the interface. Let u1 and u2 be the solutionsof the equation in medium 1 and 2 respectively, and let the densities and

8

Page 15: Fourth Order Symmetric Finite Difference Schemes For The

speed of sound be ρ1, c1 and ρ2, c2 in medium 1 and medium 2. The equa-tions are to be solved in the interval −1 ≤ x ≤ 1. The following boundaryconditions are to be satisfied at the interface of the two media, the firstrequiring continuity of pressure, means that there can be no net force on theplane separating the fluids. The second condition, continuity of the normalcomponent of particle velocity, requires that the fluids remain in contact.Thus

u1(0) = u2(0) (2.8)1ρ1

∂u1(0)∂x

=1ρ2

∂u2(0)∂x

(2.9)

The equations are

ρ1d

dx(

1ρ1

du1

dx) + k2

1u1 = 0, −1 ≤ x ≤ 0 (2.10)

ρ2d

dx(

1ρ2

du2

dx) + k2

2u2 = 0, 0 ≤ x ≤ 1 (2.11)

where the wave numbers are k1 = ωc1

in medium I and k2 = ωc2

in mediumII. Although the waves must have the same frequency, since the speeds c1

and c2 are different, the wave numbers are different. The analytic solutionsin the two media with an incoming wave from the left are

u1(x) = eik1x + Re−ik1x (2.12)u2(x) = Teik2x (2.13)

where R and T are the reflection and transmission coefficients and are givenby

R =c2ρ2 − c1ρ1

c2ρ2 + c1ρ1

T =2c2ρ2

c2ρ2 + c1ρ1

c1ρ1 and c2ρ2 are called impedances of medium I and II respectively. Tosolve it numerically we apply the above concepts discussed in one mediumto this problem in the interval −1 ≤ x ≤ 1 where u1 is assumed to be thesolution in the interval −1 ≤ x ≤ 0 and u2 is the solution in the secondmedium 0 ≤ x ≤ 1 and imposing equations (2.8) and (2.9) on the basiswhere the two media are tied. At the interface a common basis exists. The

9

Page 16: Fourth Order Symmetric Finite Difference Schemes For The

scalar product is defined by

(u, v) =∫ 1

−1

1ρu(x)v(x)dx

=∫ 0

−1

1ρ1

u(x)v(x)dx +∫ 1

0

1ρ2

u(x)v(x)dx.

(2.14)

The Galerkin formulation now leads to

−∫ 0

−1(φh1

i )′1ρ1

0∑

−N1

ui(φh1j )′dx + k2

1

∫ 0

−1φh1

i

1ρ1

0∑

−N1

uiφh1j dx+

−∫ 1

0(φh2

i )′1ρ2

N2∑

0

ui(φh2j )′dx + k2

2

∫ 1

0φh2

i

1ρ2

N2∑

0

uiφh2j dx = 0

(2.15)

The matrices obtained are the same as in the above for the impedanceboundary condition in one medium case except at the interface we have thesum of the two entries. The following is an example how the stiffness matrixlooks like.

I

II

Figure 2: Stiffness matrix in two media

10

Page 17: Fourth Order Symmetric Finite Difference Schemes For The

whereI =

1h1

1ρ1

S

II =1h2

1ρ2

S

and

S =

−10990

2215

−310

245

2215

−13945

211120

−760

−7360

−310

211120

−11845

2320

130

−7360

245

−760

2320

−3215

2524

130

−7360

−7360

130

2524

−199

2524

130

−7360

. . . . . . . . . . . . . . . . . . . . .−7360

130

2524

−199

2524

130

−7360

−7360

130

2524

−3215

2320

−760

245

−7360

130

2320

−11845

211120

−310

−7360

−760

211120

−13945

2215

245

−310

2215

−10990

Moreover, at the interface where the two block matrices overlap, the entryfor the stiffness matrix is

1h1

1ρ1

−10990

+1h2

1ρ2

−10990

where h1 and h2 are the step sizes in the respective media. The same appliesfor the mass matrix.

2.2 Centered boundary approximations

We have also implemented a centered scheme at the boundary for compar-ison with one sided schemes. Here the support is extended to the left, ie.,we consider the grid points x−1, x0, x1, x2, etc as shown below such thatx = 0 which is not necessarily a grid point lies between x0 and x1 andx0 = −αh where h is the step size and 0 ≤ α ≤ 0.5. We refrain from taking0.5 < α < 1 as it produces a singularity for α = 1, and for some valuesit is almost one sided. If the latter case arises we will use only the pointsx0 x1 and x2 . It should be noted that the main reason why we put α 6= 0

11

Page 18: Fourth Order Symmetric Finite Difference Schemes For The

into consideration is that in two-dimensional irregular domains we cannotexpect α = 0.

x x x x x-1 x=0 1 2 30

Figure 3: Arrangements of grid points for the centered scheme at the bound-ary.

Now considering the Dirichlet boundary condition, we have added φ−1(x)for the basis defined in (2.3) and modified φ−1(x) , φ1(x) and φ2(x) to satisfythe essential boundary condition.

φ−1(new) = φ−1(x)− φ−1(α)φ0(α)

φ0(x)

φ1(new) = φ1(x)− φ1(α)φ0(α)

φ0(x)

φ2(new) = φ2(x)− φ2(α)φ0(α)

φ0(x)

For the Neumann boundary condition no changes have been made. Howeverfor the two media case we keep the right and left sides and modify φ0 inorder the continuity conditions to be fulfilled at the interface as

φ0 =

φl0(x)

φl0(α)

, x ≤ 0

φr0(x)

φr0(α)

, x ≥ 0

Consequently for α = 0, the following stiffness and mass matrices areobtained, respectively for the Dirichlet boundary condition.

SD =

−145

160

−7360

160

−9445

2524

130

−7360

−7360

2524

−199

2524

130

−7360

0 130

2524

−199

2524

130

−7360

0 −7360

130

2524

−199

2524

130

−7360

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

12

Page 19: Fourth Order Symmetric Finite Difference Schemes For The

MD =

2945

−3140

3115120

−3140

731945

2571680

−370

3115120

3115120

2571680

733945

2571680

−370

3115120

0 −370

2571680

733945

2571680

−370

3115120

0 3115120

−370

2571680

733945

2571680

−370

3115120

. . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . .

One can imagine easily how the corresponding matrices for impedance andfor the two media cases looks like. Hence we avoid listing them.

13

Page 20: Fourth Order Symmetric Finite Difference Schemes For The

3 Local truncation errors

Error estimates for FEM based on Galerkin methods are determined by theapproximation property of the finite element space. In other words if Vh isa space of piecewise polynomials of degree r−1, from approximation theorywe know that there is a vh in Vh such that

||v − vh|| ≤ const ¦ hr

for v smooth enough, vεVh. Then there is an error estimate for the solutionuh such that

||u− uh|| ≤ const ¦ hr

In the subsequent discussions we use the conventional error analysis of FDM.We first consider the standard rows for the interior points far from theboundaries of the stiffness and mass matrices which are respectively

1h

(−7360

130

2524

−199

2524

130−7360

)

andh(

3115120

−370

2571680

733945

2571680

−370

3115120

)

The Galerkin method can be viewed as a difference method for uj . Exploita-tion of this point of view led to the super-convergence results of [6] and [10]which we apply for our scheme

hk2(31

15120uj−3 − 3

70uj−2 +

2571680

uj−1 +733945

uj +2571680

uj+1 − 370

uj+2 +31

15120uj+3)

+1h

(−7360

uj−3 +130

uj−2 +2524

uj−1 − 199

uj +2524

uj+1 +130

uj+2 − 7360

uj+3) = 0

(3.1)

Correspondingly, it was found that the local truncation error by Taylorseries is

hu′′(xi)− 11360

h5u(6) − 5910080

h7u(8)

andhu(xi)− 11

360h5u(4) − 23

7560h7u(6)

Observe here that super-convergence is attained, ie., the stiffness matrixis a 4th order approximation of d2

dx2 whereas (3.1) is a 6th order accurateapproximation of

u′′ + k2u = 0

14

Page 21: Fourth Order Symmetric Finite Difference Schemes For The

In addition to the interior points we have also tried to determine the accuracyof the interior including the boundaries. We have listed tables of Taylorseries expansions for the different boundary conditions encountered.

row stiffness

1 3124hu′′0 + 79

72h2u′′′0 + 6371440h3u

(4)0 + 59

1440h4u(5)0 + . . .

2 56hu′′0 + 173

90 h2u′′′0 + 3718h3u

(4)0 + 64

75h4u(5)0 . . .

3 2524hu′′0 + 1087

360 h2u′′′0 + 64671440h3u

(4)0 + 1291

288 h4u(5)0 . . .

Table 1: Taylor series expansion for the first three non-regular rows of thestiffness matrix with a Dirichlet boundary condition.

row mass1 79

72h2u′0 + 97180h3u′′0 + 29

168h4u′′′0 . . .

2 17390 h2u′0 + 89

45h3u′′0 + 9370h4u′′′0 . . .

3 1087360 h2u′0 + 811

180h3u′′0 + 3781840 h4u′′′0 . . .

Table 2: Taylor series expansion for the first three non-regular rows of themass matrix with a Dirichlet boundary condition.

Although the truncation error is large at the boundary, still the scheme isof order 5 for FEM (to be proved in section(5)) and of order 4 for FDM. Thelocal truncation error is of order three. To justify our claim for the localtruncation error we have divided the FEM scheme by h to have analogywith finite difference techniques. From the tables (1) and (2) and from thedifferential equation(1.3), since u(0) = 0 from the boundary condition theeven order derivatives vanish, and u′′′(0) = k2u′(0) is used in each row.Then we are left with h3 in both tables as truncation error. Therefore weinfer that FEM is of order three at the boundary. It is proved in [9] that forcertain classes of difference schemes it is possible to lower the accuracy oneorder at the boundary without losing the convergence rate defined by theinterior scheme. However here it turns out that the global error is of order5 while the local truncation error at the boundary is of order 3.For the sake of completeness we list below the Taylor series expansions ofthe stiffness and mass matrices for the Neumann boundary conditions. Thelocal truncation error at the boundary is of order 2 and the global error isof order four for both FEM and FDM.

15

Page 22: Fourth Order Symmetric Finite Difference Schemes For The

row stiffness

1 −13 hu′′0 + 2

45h2u′′′0 + 190h3u

(4)0 + 1

45h4u(5)0 . . .

2 3124hu′′0 + 79

72h2u′′′0 + 6371440h3u

(4)0 + 59

1440h4u(5)0 . . .

3 56hu′′0 + 173

90 h2u′′′0 + 3718h3u

(4)0 + 64

45h4u(5)0 . . .

4 2524hu′′0 + 1087

360 h2u′′′0 + 64671440h3u

(4)0 + 1291

288 h4u(5)0 . . .

Table 3: Taylor series expansion for the first four non-regular rows of thestiffness matrix where Neumann boundary conditions is employed.

row mass1 1

3h2u0 + −145 h3u′′0 + −2

105h4u′′′0 . . .

2 3124h2u0 + 91

180h3u′′0 + 139840h4u′′′0 . . .

3 56h2u0 + 89

45h3u′′0 + 9370h4u′′′0 . . .

4 2524h2u0 + 811

180h3u′′0 + 3781840 h4u′′′0 . . .

Table 4: Taylor series expansion for the first non-regular rows of the massmatrix where Neumann boundary condition is employed.

In a similar fashion we reach the same conclusion for the centered schemeat the boundary.

row stiffness

1 −124 hu′′0 + −7

360h2u′′′0 + −191440h3u

(4)0 + −7

1440h4u(5)0 . . .

2 2524hu′′0 + 353

360h2u′′′0 + 7391440h3u

(4)0 + 233

1440h4u(5)0 . . .

3 hu′′0 + 2h2u′′′0 + 2h3u(4)0 + 4

3h4u(5)0 . . .

4 hu′′0 + 3h2u′′′0 + 92h3u

(4)0 + 9

2h4u(5)0 . . .

Table 5: Taylor series expansion for the first four non-regular rows of thestiffness matrix of the centered scheme at the boundary with Dirichletboundary condition.

It is of order four, but the centered scheme is better as we compare theconstant terms in the respective truncation errors.

16

Page 23: Fourth Order Symmetric Finite Difference Schemes For The

row mass1 −7

360h2u′0 + −1180h3u′′0 + −1

840h4u′′′0 . . .

2 353360h2u′0 + 91

180h3u′′0 + 139840h4u′′′0 . . .

3 2h2u′0 + 2h3u′′0 + 43h4u′′′0 . . .

4 3h2u′0 + 56391260h3u′′0 + 9

2h4u′′′0 . . .

Table 6: Taylor series expansion for the first non-regular rows of the massmatrix of the centered scheme at the boundary with Dirichlet boundarycondition.

4 Lumped Mass Matrix

To obtain an explicit scheme in the time dependent problem, it is common tolump the mass matrix such that it becomes diagonal. It should be noted thatthe stiffness matrix is retained as in FEM. We have lumped the mass matrixas follows. For a regular row, ie., one corresponding to an interior point awayfrom the boundary, we simply lump the mass matrix to a single diagonalentry equal to 1. It is evident from the local truncation error obtained onpage (14) that this approximation will keep fourth order accuracy althoughthe super-convergence of the FEM scheme is lost. For the non-regular rowswhich are affected by the boundary conditions we consider the Taylor seriesexpansion of each and we seek fourth order accuracy by making the massmatrix diagonal, if it is possible, otherwise by making the mass matrixsymmetric and positive definite. The latter happens when we consider twodifferent media. In the subsequent we give examples of the steps performedin obtaining the entries for the non -regular rows of the lumped matrix fordifferent boundary conditions. To begin with, consider Dirichlet boundaryconditions and let us look the Taylor series expansions given in tables 7 and8.

row stiffness

1 3124hu′′0 + 79

72h2u′′′0 + 6371440h3u

(4)0 + 59

1440h4u(5)0 + . . .

2 56hu′′0 + 173

90 h2u′′′0 + 3718h3u

(4)0 + 64

75h4u(5)0 . . .

3 2524hu′′0 + 1087

360 h2u′′′0 + 64671440h3u

(4)0 + 1291

288 h4u(5)0 . . .

Table 7: Taylor series expansion for the first three non-regular rows of thestiffness matrix.

17

Page 24: Fourth Order Symmetric Finite Difference Schemes For The

row mass lumped(FD)1 79

72h2u′0 + 97180h3u′′0 + 29

168h4u′′′0 . . . 7972

2 17390 h2u′0 + 89

45h3u′′0 + 9370h4u′′′0 . . . 173

90

3 1087360 h2u′0 + 811

180h3u′′0 + 3781840 h4u′′′0 . . . 1087

360

Table 8: Taylor series expansion for the first three non-regular rows of themass matrix including the entries in the lumped mass matrix.

It should be noted that using the differential equation (1.3) and theboundary conditions, the derivatives of the second order in the Taylor seriesexpansions in both tables vanish. Moreover the derivatives of order three inthe Taylor series expansion of the stiffness matrix cancels its correspondingderivatives of first order in the Taylor series expansion of the mass matrix.Now we want the diagonal elements in the lumped scheme to be the coeffi-cients that occur in the cancellations, and use

γui = ξ(u0 + ihu′0 +(ih)2

2u′′0 + . . .)

letting γ to be the principal coefficients that occurred in the cancellationsand ξ to be the diagonal elements in the lumped mass matrix.From this equation we determine the value of ξ which is the value of one ofthe diagonals as they are given in the above table and the following matrix.

M l =

7972

173180

10871080

1. . .

. . .

Applying the same technique for the Neumann boundary condition, the

18

Page 25: Fourth Order Symmetric Finite Difference Schemes For The

lumped mass matrix is found to be

M lN =

13

3124

56

2524

1. . .

. . .

However in lumping the mass matrix, for the third boundary condition(impedance)we considered, the change is significant as it is no longer restricted to thefirst row as in FEM. Suppose one uses the following boundary condition

du(0)dx

− αu(0) = 0, (4.1)

As in the above the Taylor series expansion of each row is found.

row stiffness

1 αu0 + u′0 + 13hu′′0 + 2

45h2u′′′0 + 190h3u

(4)0 + . . .

2 3124hu′′0 + 79

72h2u′′′0 + 6371440h3u

(4)0 + . . .

3 56hu′′0 + 173

90 h2u′′′0 + 3718h3u

(4)0 + . . .

4 2524hu′′0 + 1087

360 h2u′′′0 + 64671440h3u

(4)0 + . . .

Table 9: Taylor series expansion for the first four non regular rows of thestiffness matrix of the impedance boundary condition.

19

Page 26: Fourth Order Symmetric Finite Difference Schemes For The

row mass lumped(FD)1 1

3hu0 + 245h2u′0 − 1

45h3u′′0 + . . . 13 − 2

45αh

2 3124hu0 + 79

72h2u′0 + 97180h3u′′0 + . . . 31

24 + 1472αh

3 56hu0 + 173

90 h2u′0 + 8945h3u′′0 + . . . 5

6 − 2390αh

4 2524hu0 + 1087

360 h2u′0 + 811180h3u′′0 + . . . 25

24 + 3860αh

Table 10: Taylor series expansion for the first four non regular rows of themass matrix of the impedance boundary condition.

We observe that the principal coefficients in both expansions cancel eachother, namely the coefficients of the derivatives of the second order in theTaylor series expansion of the stiffness matrix with that of the undifferenti-ated function in the Taylor series expansion of the mass matrix . Besides thecoefficients of the derivatives of order three in the Taylor series expansion ofthe stiffness matrix cancel out those coefficients of the first order derivativesin the Taylor series expansion of the mass matrix. Consequently, to find theentries in the lumped mass matrix of this, where the impedance boundarycondition is applied, we use

γui + ρu′i = ξ(u0 + ihu′0 +(ih)2

2u′′0 + . . .) + βu′i

and the boundary condition u′0 = αu0, where γ,ρ represents the coefficientsof the principal and those of the first order derivative that occurred in thecancellation described above and ξ and β are to be determined for each row.Consequently, the lumped mass matrix turns out to be

M lI =

13 − 2

45αh3124 + 14

72αh56 − 23

90αh2524 + 38

60αh1

. . .. . .

The above matrix is positive definite for sufficiently small αh. Before weproceed, it is worth mentioning that the above procedure of lumping doesnot work when we have inflow boundary condition such as

∂u

∂x+

∂u

∂t= f (4.2)

20

Page 27: Fourth Order Symmetric Finite Difference Schemes For The

Hence we have formed non-diagonal lumping which is symmetric and pos-itive definite. Positive definiteness should be guaranteed in order for thetime dependent equations to be stable. To prove our claim, we consider thediscrete form of the wave equation.We introduce a grid in time, with points tn = n4t, n = 0, 1, 2, . . .A time discrete function un can then be defined. We approximate the timederivative by a centered second order accurate finite difference formula

∂2

∂t2=

un+1 − 2un + un−1

(4t)2(4.3)

The discrete form is

Mun+1 − 2un + un−1

(4t)2− Sun = 0 (4.4)

where M and S are mass and stiffness matrices respectively, and it is equiv-alent to

un+1 − (2 + (4t)2M−1S)un + un−1 = 0 (4.5)

We shall assume that the eigenvalues of S are non-positive, which is the casewith Dirichlet or Neumann boundary conditions. Then the eigenvalues λ ofM−1S are also non-positive by the identity

x∗Sx = λx∗Mx

provided that M is positive definite. By a change of coordinates v = M1/2u,the matrix M−1S goes over into the symmetric matrix M−1/2SM−1/2 andthe difference equation (4.5) becomes equivalent to a set of scalar equations

vn+1 − (2 +4tλ)vn + vn−1 = 0 (4.6)

with λ ≤ 0. This equation is stable if

4t ≤ 2 |λ|−1/2

Therefore the stability limit on 4t is determined by the largest eigenvaluesof −M−1S.We now going to construct a symmetric and positive definite lumped massmatrix. It suffices to consider the non-regular rows. Since there are fourrows of these, we form the following system of equations

4∑

j=1

mi,juj−1 = ξiu0 + βihu′0, i = 1, 2, 3, 4 (4.7)

21

Page 28: Fourth Order Symmetric Finite Difference Schemes For The

where ξi and βi are the coefficients of u0 and u′0 respectively in the ithrow for the Taylor series expansion of the mass matrix shown in table(8).Applying Taylor series expansion for the left hand side of the equation andrequiring symmetry, a system of 8 equations and 10 unknowns is solved, ie.,we have three free parameters. The following entries were obtained.

14245 + t2 − 4t3 + 4t1

−25645 − 2t2 + 8t3 − 7t1

4315 + t2 − 4t3 + 2t1 t1

−25645 − 2t2 + 8t3 − 7t1

2147180 + 4t2 − 15t3 + 12t1

−36190 − 2t2 + 6t3 − 3t1

−337360 + t3 − 2t1

4315 + t2 − 4t3 + 2t1

−36190 − 2t2 + 6t3 − 3t1 t2

8945 − 2t3 + t1

t1−337360 + t3 − 2t1

8945 − 2t3 + t1 t3

At this stage we require the above matrix (the lumped mass matrix) tobe positive definite. As an example for 4t small enough, it was found byinspection t1 = 1, t2 = 2 and t3 = 1 produce the required order of accuracyand stable scheme.

23245

−39145

4315 1

−39145

3047180

−45190

−697360

4315

−45190 2 44

45

1 −697360

4445 1

Finally for the two media case, the lumped matrix is not diagonal through-out. It is to be recalled that in constructing the lumped mass matrix, werequire the mass matrix to attain fourth order accuracy which is establishedby Taylor series expansion and also imposing the boundary conditions. How-ever, at the interface there are only continuity conditions. Hence at the in-terface, it is the positive definite matrix shown above. In general the matrixis as in fig.4.

22

Page 29: Fourth Order Symmetric Finite Difference Schemes For The

0 5 10 15 20 25 30 35 40

0

5

10

15

20

25

30

35

40

nz = 65

Figure 4: Lumped mass matrix which is symmetric positive definite at theinterface.

Furthermore the lumped mass matrix for the wave equation in the twomedia case with the impedance boundary condition given in (4.2), has thefollowing form.

23

Page 30: Fourth Order Symmetric Finite Difference Schemes For The

0 5 10 15 20 25 30 35 40

0

5

10

15

20

25

30

35

40

nz = 89

Figure 5: Lumped mass matrix for the impedance boundary condition intwo media.

5 Error analysis

This section presents a reflection analysis of the errors including the bound-aries associated with the approximations introduced in the last sections.Comparisons are made with the one-sided and centered approximations atthe boundaries. It should be noted that for the Dirichlet and impedanceboundary conditions, we consider an incoming wave from +∞ as being re-flected at x = 0 as shown in the diagram.

The Galerkin method, ie., FEM, can now be viewed as a differencemethod for uj

24

Page 31: Fourth Order Symmetric Finite Difference Schemes For The

reflected wave

incoming wave

x=0

Figure 6: Reflection of a wave traveling to the left.

`(uj) =1h2

(a3uj−3 +a2uj−2 +a1uj−1 +a0uj +a1uj+1 +a2uj+2 +a3uj+3)+

k2(b3uj−3 + b2uj−2 + b1uj−1 + b0uj + b1uj+1 + b2uj+2 + b3uj+3) = 0 (5.1)

Since the scheme is symmetric,

`(uj) = c3uj−3+c2uj−2+c1uj−1+c0uj +c1uj+1+c2uj+2+c3uj+3 = 0 (5.2)

whereci =

1h2

ai + k2bi

To do an error analysis for the scheme, we consider the finite differenceformulation of the problem in order to apply the technique used for finitedifferences rather than for FEM.The characteristic equation for (5.2) is

c3κ−3 + c2κ

−2 + c1κ−1 + c0 + c1κ + c2κ

2 + c3κ3 = 0 (5.3)

It can be shown easily that if κ is a solution of (5.1) then 1κ is also a solution.

To solve this equation, letκ1 = eikh+ir

where κ1 is the principal root, then one can write the equation as follows

c0 + c1(2cos(kh + r)) + c2(2cos(2(kh + r))) + c3(2cos(3(kh + r))) = 0

Put s = kh, expand in Taylor series and neglecting high powers of r yields

−2sr − −176048

s8 +O(s9r) = 0

25

Page 32: Fourth Order Symmetric Finite Difference Schemes For The

which implies

r =−17

12096s7 +O(s8)

andκ1 u eikh(1− 17

12096(kh)7)

Observe thatir = O(s7).

Similarly for FDM, one can show that

ir = O(s5)

The spurious roots are simple roots. This implies that they can be foundby setting the coefficients that correspond to the mass matrix equal to zeroand from above it suffices to list only these

κ2 =−114

+314

√305− −1

14

√2550− 6

√305 u 0.1388

κ3 =−114

+−314

√305 +

114

√2550 + 6

√305 u −0.1334

Now consider the incoming wave κ−n1 where κ1 is the principal root

and suppose the boundary condition is of Dirichlet type, then the analyticsolution on x ≥ 0 is

u(x) = e−ikx − eikx (5.4)

and the numerical solution in terms of the principal root is

un = κ−n1 − κn

1 + en

which is equivalent to

un = (−1 + A1)κn1 + A2κ

n2 + A3κ

n3 + κ−n

1 ; |κ2| < 1, |κ3| < 1 (5.5)

The error is

u(xn)− un = en + e−ikxn − k−n1 − eikxn + kn

1

en ={

A1κn1 + A2κ

n2 + A3κ

n3 , n ≥ 1

0 ,n=0

where en represents the error due to the boundary approximation. Then en

satisfies the difference equation (5.1). Substituting into the difference equa-tions at the boundary yields a linear system of equations in the unknowns

26

Page 33: Fourth Order Symmetric Finite Difference Schemes For The

A1, A2 and A3 while κ1, κ2 and κ3 are the roots obtained above. Since|κ2| < 1, |κ3| < 1, we take κ2 = 0.1388 and κ3 = −0.1334. This linearsystem has the following form

1h2

Cx = b (5.6)

where C = C1 +O(h) +O(h2) and

C1 =

−1.467 0.444 −0.3950.299 −0.284 0.1970.044 0.041 0.0006

x =

A1

A2

A3

b =

c1h3

c2h3

c3h3

with c1, c2 and c3 are the constants obtained by Taylor series expansion forthe first three rows. These are c1 = 79/72, c2 = 173/90 and c3 = 1087/360.In this linear system of equations it suffices to show that the determinant ofthe matrix of the coefficient C is nonzero for all sufficiently small h. In ourcase we have shown that det(C) is different from zero. Hence we concludethat the order of accuracy is of O(h5).We have obtained the same order using a centered scheme at the boundary.However it is a known fact that different methods of the same order canhave different errors, they are distinguished by the error constants. As acomparison for the same problem, using a centered scheme where α is 0 and0.5, (see, fig3) we got C1 and b to be respectively

C1 =

−1/45 −0.0028 −0.0026 0.00191/60 −1.03 0.297 −0.270−7/360 −0.014 −0.179 0.107

0 1.06 0.0204 0.0245

b =

−7360h3

353360h3

2h3

3h3

27

Page 34: Fourth Order Symmetric Finite Difference Schemes For The

and

C1 =

−0.001 0.0009 −0.0014 0.00120.009 −2.10 0.439 −0.4180.006 −0.021 −0.175 0.104−0.002 0.019 0.017 0.022

b =

−0.00517h3

.5h3

1.4h3

2.5h3

Note that in these two cases

en =

A1κn1 + A2κ

n2 + A3κ

n3 , n ≥ 1

0 , n=0A−1 , n=-1

Hence,

x =

A−1

A1

A2

A3

Solving the three different systems of equations, the unknowns were foundto be, for the one-sided scheme at the boundary

x =

−13.9h5

56.1h5

112.2h5

for the centered scheme at the boundary, ie., for α = 0

x =

−1.19h5

7.68h5

−91.36h5

−133.7h5

while for α = 0.5

x =

61.4h5

−11.1h5

53.3h5

111h5

28

Page 35: Fourth Order Symmetric Finite Difference Schemes For The

We see from the values of the unknowns Ai’s, in particular the value ofA1, is smaller in the centered schemes at the boundary rather than in theone-sided schemes at the boundary. It should be noted that the reason wecompared the values of A1 is that it is the constant term of the non-decayingκ1. Hence we conclude that centered schemes at the boundary are better.In a similar fashion applying the techniques discussed above we show forthe other boundary conditions (Neumann and impedance) and also for theFDM schemes.

6 Numerical Examples

In this section some of the numerical experiments that have been performedare described. Consider

∂2u

∂x2+ k2u = (k2 − π2)sin(πx), 0 ≤ x ≤ 1 (6.1)

u(0) = 0 (6.2)u(1) = 0 (6.3)

The exact solution is

u(x) = sin(πx), 0 ≤ x ≤ 1 (6.4)

The FEM and FDM (lumped mass) solutions are obtained. Table 11 showsa grid refinement study for the problem.

h FEM (l∞) Lumped (l∞) rate(FEM) rate(Lumped)0.1 1.0254× 10−4 3.3300× 10−4 − −0.05 3.4014× 10−6 2.0667× 10−5 4.91 4.000.025 1.0784× 10−7 1.2927× 10−6 5.00 4.00

Table 11: Dirichlet boundary condition.

The second numerical example is the Neumann boundary condition.

∂2u

∂x2+ k2u = (k2 − π2)cos(πx), 0 ≤ x ≤ 1 (6.5)

du(0)dx

= 0 (6.6)

du(1)dx

= 0 (6.7)

29

Page 36: Fourth Order Symmetric Finite Difference Schemes For The

Here, the exact solution is

u(x) = cos(πx), 0 ≤ x ≤ 1 (6.8)

The numerical solutions of the FEM and FDM are obtained, and a gridrefinement study for both follows in the following table.Furthermore, the numerical solution for the impedance boundary condition

h FEM (l∞) Lumped (l∞) rate(FEM) rate(Lumped)0.1 1.8711× 10−4 .0020 − −0.05 1.4604× 10−5 1.3188× 10−4 3.68 3.940.025 1.0850× 10−6 8.1774× 10−6 3.76 4.00

Table 12: Neumann boundary condition

du

dx+ iku = 2ikeikx, x = 0 (6.9)

du

dx− iku = 0, x = 1 (6.10)

is obtained, and table 13 gives the convergence rates of both the FEM andFDM (lumped). Note that the analytic solution of this problem is

u(x) = eikx (6.11)

h FEM (l∞) Lumped (l∞) rate(FEM) rate(Lumped)0.01 1.4402× 10−5 2.7715× 10−4 − −0.005 9.0813× 10−7 1.8867× 10−5 3.99 3.880.0025 5.6883× 10−8 1.2058× 10−6 4.00 3.97

Table 13: Impedance boundary condition.

As an illustration, the following graphs were taken for the (6.9) and(6.10), with impedance boundary conditions for both FEM and FDM (Lumped)schemes.

30

Page 37: Fourth Order Symmetric Finite Difference Schemes For The

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1.5

−1

−0.5

0

0.5

1

1.5

The consistent mass matrix

h = 0.05

NumericalAnalytical

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1.5

−1

−0.5

0

0.5

1h = 0.05

The lumped mass matrix

NumericalAnalytical

Figure 7: Graphs for FEM(top) and for FDM with step size h = 0.05

31

Page 38: Fourth Order Symmetric Finite Difference Schemes For The

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1.5

−1

−0.5

0

0.5

1

1.5

The consistent mass matrix

h = 0.025

NumericalAnalytical

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1

−0.5

0

0.5

1h = 0.025

The lumped mass matrix

NumericalAnalytical

Figure 8: Graphs for FEM(top) and for FDM with step size h = 0.025

Finally, for the two media case given in (2.10) with

du

dx+ ik1u = 2ik1e

ik1x, x = −1 (6.12)

du

dx− ik2u = 0, x = 1 (6.13)

We have tested for different step sizes h1 and h2 and different densities. Forequal step sizes, table(14) shows the rate of convergence.

h = h1 = h2 FEM (l∞) Lumped (l∞) rate(FEM) rate(Lumped)0.01 1.4419× 10−5 2.5× 10−3 − −0.005 9.0825× 10−7 1.4296× 10−4 3.99 4.000.0025 5.6883× 10−8 8.6991× 10−6 4.00 4.00

Table 14: Impedance boundary condition in two media

In addition, the following graphs illustrate the two methods, FEM andFDM for the two media problem with different step sizes.

32

Page 39: Fourth Order Symmetric Finite Difference Schemes For The

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

The consistent mass matrix

h1 = 0.025 h2 = 0.025

Numerical Analytical

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1

−0.5

0

0.5

1

1.5

The lumped mass matrix

h1 = 0.025 h2 = 0.025

Figure 9: Graphs of FEM(top) and FDM with step size h = 0.025.

33

Page 40: Fourth Order Symmetric Finite Difference Schemes For The

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

The consistent mass matrix

h1 = 0.0125 h2 = 0.0125

NumericalAnalytical

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1.5

−1

−0.5

0

0.5

1

1.5

The lumped mass matrix

h1 = 0.0125 h2 = 0.0125

Figure 10: Graphs of FEM(top) and FDM with step size h = 0.0125.

Observe, the lumped scheme(FDM) needs finer step size to reach asymp-totic range of accuracy.

34

Page 41: Fourth Order Symmetric Finite Difference Schemes For The

7 Time Dependent Problems

Although, FEM is usually thought of as a method of discretization in space,it can be used in time as well. However, here we use the method of lines [4].It allows the space discretization to be handled separately. Consequently,for the wave equation (1.1), we have used finite difference approximationsfor the time derivative terms obtained by Taylor series combined with theFEM in space .At first we consider the wave equation

1c2

∂2u

∂t2=

∂2u

∂x2, 0 ≤ x ≤ 1 , t ≥ 0 (7.1)

u(x, 0) = f(x) (7.2)∂

∂tu(x, 0) = g(x) (7.3)

with Dirichlet boundary conditions

u(0, t) = u(1, t) = 0 (7.4)

Discretizing the spatial part of the equation by Galerkin method leads to asystem of ordinary differential equations in time.

M∂2u

∂t2= Su (7.5)

We now look at the time discretization of the system of ordinary differentialequations (7.5) by FDM.

We approximate the time derivative by a centered fourth order accuratefinite difference formula as follows.

∂2u

∂t2=

un+1 − 2un + un−1

(4t)2− (4t)2

12∂4u

∂t4+O((4t)4) (7.6)

From (7.5)∂2u

∂t2= M−1Su

which implies∂4u

∂t4= M−1S

∂2u

∂t2

ie.,∂4u

∂t4= M−1S(M−1Su)

35

Page 42: Fourth Order Symmetric Finite Difference Schemes For The

substituting (7.6) into (7.5), we obtain

un+1 = 2un − un−1 + (4t)2M−1S(un +(4t)2

12M−1Sun) (7.7)

where M and S are the mass and stiffness matrices respectively. In additionto the Dirichlet boundary condition, the other types of boundary conditions,such as, the Neumann boundary condition

∂u(0, t)∂x

=∂u(1, t)

∂x= 0 (7.8)

and the impedance boundary condition

∂u

∂x− 1

c

∂u

∂t= −2

c

∂f(t)∂t

(7.9)

were also applied.we have taken as first step the following boundary conditions

∂u

∂x(0, t) = αu(0, t) (7.10)

u(1, t) = 0 (7.11)

Exact solutions may be given by

u(x, t) = sin(β(x− 1))sinβt (7.12)

andα =

βcosβ

−sinβ(7.13)

For instance when β = 2 we have the following graph

36

Page 43: Fourth Order Symmetric Finite Difference Schemes For The

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9−1

−0.9

−0.8

−0.7

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1t =1, dt= 0.01 , || u−v || =0.00035657

Numerical Analytical

Figure 11: FEM graph for the boundary conditions given in (7.10) and(7.11).

Finally the equation is also solved in two media. The problem is posedas follows. Let u1 and u2 be the solutions of the equation in media I andII respectively, then the equations are

1c21

∂2u1

∂t2=

∂2u1

∂x2, −1 ≤ x ≤ 0 , t ≥ 0 (7.14)

∂u1

∂x− 1

c1

∂u1

∂t= − 2

c1

∂f(t)∂t

, x = −1 (7.15)

and

1c22

∂2u2

∂t2=

∂2u2

∂x2, 0 ≤ x ≤ 1 , t ≥ 0 (7.16)

∂u2

∂x+

1c2

∂u2

∂t= 0, x = 1 (7.17)

The complete solution u1 contains two arbitrary, but twice differentiable,functions

u1(x, t) = f(x− c1t) + g(x + c1t), (7.18)

37

Page 44: Fourth Order Symmetric Finite Difference Schemes For The

whileu2(x, t) = h(x− c2t) (7.19)

The second solution (7.19) is a wave traveling to the right, while a reflectedwave traveling to the left is not allowed, according to the boundary condition(7.17).We use

f(x− c1t) = e−α(x−c1t+γ)2 ,

g(x + c1t) =c2ρ2 − c1ρ1

c1ρ1 − c2ρ2e−α(−x−c1t+γ)2

andh(x− c2t) =

2c2ρ2

c1ρ1 + c2ρ2e−α((x−c2)t

c1c2

+γ)2

which are obtained by making use of the continuity equations (2.8) and (2.9)at the interface between the two media. Furthermore, numerically, it is alsonot easy to implement as the boundary condition contains a derivative intime. It is formulated as

1c2

M∂2u

∂t2+ A

∂u

∂t+ Su = F (t) (7.20)

where M and S are the mass and stiffness matrices respectively and

A =

1 0 . . . 00 0 . . . 0...

......

0 0 . . . 1

and

F (t) =

2c1

df(0,t)dt

00...00

Substituting the fourth order finite difference in time for ∂2u∂t2

and centraldifference in time for ∂u

∂t , the following is obtained.

Q1un+1 = Q2u

n + Q3un−1 + F (7.21)

38

Page 45: Fourth Order Symmetric Finite Difference Schemes For The

where

Q1 =M

(4t)2+

AM−1A

12− 4t

24AM−1S − S

12+

A

24t

Q2 =2M

(4t)2− AM−1A

6− S

6− M−1A

3

Q3 =M

(4t)2+

AM−1A

12+4t

24AM−1S − S

12+

A

24t

and

F =(4t)2

12AM−1 dF

dt− (4t)2

12d2F

dt2− (4t)2

6M−1 dF

dt

To see how the finite difference obtained by lumping performs with time de-pendent problems comparing to steady state problems such as the Helmholtzequation discussed earlier, we consider the following numerical examples

1c2

∂2u

∂t2=

∂2u

∂x2, 0 ≤ x ≤ 1 , t ≥ 0 (7.22)

u(x, 0) = sinπx (7.23)∂

∂tu(x, 0) = 0 (7.24)

with Dirichlet boundary conditions

u(0, t) = u(1, t) = 0 (7.25)

h 4t FEM (l∞) FDM (l∞) rate(FEM) rate(FDM)0.01 .001 8.7743× 10−10 1.7955× 10−9 − −0.005 .001 2.8935× 10−11 5.5023× 10−11 4.92 5.02

Table 15: Rate of convergence for Dirichlet boundary conditions

With impedance boundary condition

∂u

∂x(0, t) = αu(0, t) (7.26)

u(1, t) = 0 (7.27)

with α given in (7.13).

39

Page 46: Fourth Order Symmetric Finite Difference Schemes For The

h 4t FEM (l∞) FDM (l∞) rate(FEM) rate(FDM)0.01 .001 4.025× 10−5 3.565× 10−4 − −0.005 .001 2.7015× 10−6 2.2430× 10−5 3.89 3.99

Table 16: Rate of convergence for the impedance boundary conditions

As a third example

1c2

∂2u

∂t2=

∂2u

∂x2, 0 ≤ x ≤ 1 , t ≥ 0 (7.28)

∂u

∂x− 1

c

∂u

∂t= −2

c

∂f(t)∂t

, x = 0 (7.29)

∂u

∂x+

1c

∂u

∂t= 0, x = 1 (7.30)

Observe that we are using a symmetric positive definite matrix for FDM asremarked in section 2. The following table shows the rate of convergence.

h 4t FEM (l∞) FDM (l∞) rate(FEM) rate(FDM)0.01 .001 8.4705× 10−5 0.0188 − −0.005 .001 4.5987× 10−6 6.47× 10−4 3.75 4.85

Table 17: Rate of convergence for the impedance inflow boundary conditions.

At last, for the two media problem (7.13-7.16) taking α = 200 andρ = 1.3, the rate of convergence using a fourth order finite difference in timeis given below

h = h1 = h2 4t FEM (l∞) FDM (l∞) rate(FEM) rate(FDM)0.01 .001 8.4705× 10−5 0.0188 − −0.005 .001 4.5987× 10−6 6.47× 10−4 3.75 4.85

Table 18: Rate of convergence for the impedance boundary condition in twomedia.

40

Page 47: Fourth Order Symmetric Finite Difference Schemes For The

The following graph illustrates this last example

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−0.2

0

0.2

0.4

0.6

0.8

1

1.2The consistence mass matrix

Numerical Analytical

Figure 12: FEM and FDM in two media using fourth order finite differencein time.

8 CONCLUSION

In this paper FEM and FDM solutions of the Helmholtz equation in onedimension with different boundary conditions for the one medium and twomedia cases have been considered. The PDE is discretized by the Galerkinmethod. The main objective of the paper is to develop high order symmetricfinite difference approximations that will be employed for the wave equation.FEM constructed for the Helmholtz equation have been shown to performwell for the Dirichlet boundary condition compared to FDM. The analysisand the numerical experiments described in the paper show that the errorof FEM is O(h5) while the error of FDM(lumped) is O(h4). In addition it isobserved that the error of FEM in the interior is of O(h6) for the Helmholtzequation while the error of FDM is only O(h4). This means that for thisparticular equation FEM is superior with regard to the rate of convergence.Hence it is not significant to lump the mass matrix in order to obtain FDM

41

Page 48: Fourth Order Symmetric Finite Difference Schemes For The

for the Dirichlet boundary condition despite the latter is symmetric. Inother words if one is interested in the order of accuracy of a scheme for thewave equation, FEM should be used. Moreover, although FEM and FDMboth have the same order of accuracy in the Neumann boundary conditioncase the latter yields bigger error coefficient than the former. Hence, weinfer that FEM is better in frequency domain problems. Also as it is ex-plained in the paper for the impedance boundary condition where we havetime derivatives in the expression of the boundary, it is not possible to havediagonal lumped mass matrix(FDM) that retains the order of accuracy toimplement it in the time domain. It is done by a positive definite symmetricmatrix rather than a diagonal matrix which affects the cost when we imple-ment it in higher dimensions.

The other comparison we have made is among the one-sided scheme atthe boundary and centered scheme at the boundary, and it is shown thatthe latter works better which coincides with the known fact from the theoryof finite differences [5].

For time dependent problems, FEM with Dirichlet boundary conditionretains the super-convergence and FDM yields the desired accuracy. How-ever for the Neumann boundary condition both acquired the same order ofaccuracy showing FDM which is symmetric (being diagonal matrix) attainshigh order accuracy as desired. For the third type of boundary condition,the impedance, imposing time-dependent boundary condition, FDM is sym-metric and positive definite and the expected rate of convergence is obtainedbut the scheme needs finer space step size to reach asymptotic range of ac-curacy.

Moreover, the advantage of the FDM is its added stability condition.It was found by applying von-Neumann analysis, for the Cauchy problemthat the stability condition is c4t < 1.7h for FDM, whereas c4t < h forFEM. In both cases c was taken to be 1. Note that since we are consideringboundary value problem the CFL condition is slightly diferent from theCauchy problem. This implies that we have achieved a consistent differenceequation with a typical Courant condition for numerical stability. Hence fortime dependent problems and for the wave equation, it is of great importanceto lump the mass matrix thereby obtaining FDM scheme.

42

Page 49: Fourth Order Symmetric Finite Difference Schemes For The

REFERENCES

[1] B.Swartz and B.Wendroff. The relative efficiency of finite differenceand finite element methods I: Hyperbolic problems and splines, SIAM J.Numer. ANAL.,11 (1974), pp. 979-993.[2] P.Olsson, D. Gottlieb, B. Gustafsson, B. Strand, On the super-convergenceof Galerkin methods for Hyperbolic IBVP, SIAM J.Numer. ANAL., 33(1996),pp. 1778-1796.[3] STRANG,G and Fix,G. An analysis of the finite element method. 1973,Prentice-Hall,Inc.,Englewood Cliffs, N.J.[4] B.Gustafson, H.-O.Kreiss, and J.Oliger. Time Dependent problems andDifference Methods. Wiley and Sons,1995.[5] H.-O.KREISS, Difference approximations for boundary and eigenvalueproblems for ordinary differential equations, Math.Comp., 26(1972), pp.605-624.[6] V.THOMEE AND B.WENDROFF, Convergence estimates for Galerkinmethods for variable coefficient initial value problems, SIAM J.Numer.Anal.,11(1974), pp.1059-1068.[7] B.SWARTZ AND B.WENDROFF, Generalized finite-difference schemes,Math.Comp.,23(1969), pp.37-49.[8] H.O. Kreiss and J. Oliger. Comparison of accurate methods for the in-tegration of hyperbolic equations. Tellius,24(1972),pp.199-215.[9] B.GUSTAFSSON, The convergence rate for difference approximationsto general mixed initial boundary value problem, SIAM J.Numer Anal,18(1981), pp. 179-190[10] V.THOMEE, Spline approximation and difference scheme for the heatequation, The Mathematical Foundation of the Finite Element Methodwith Application to partial Differential Equations, A.K. Aziz,ed., AcademicPress, New York. 1972[11] M.H.Carpenter, D.Gottlieb, and S.Abarbanel. Time-stable boundaryconditions for finite-difference schemes solving hyperbolic systems: Method-ology and application to high-order compact schemes. J. Comput. Phys.,111(2):220-236, Apr. 1994[12] Douglas J. Riley. Transient Finite-Elements for Computational Electro-magnetics: Hybridization with Finite Differences, Modeling Thin Wires andThin slots, and Parallel processing. applied Computational Electromagnet-ics Society(ACES) Symposium, Monterey, California, March 2001

43

Page 50: Fourth Order Symmetric Finite Difference Schemes For The
Page 51: Fourth Order Symmetric Finite Difference Schemes For The
Page 52: Fourth Order Symmetric Finite Difference Schemes For The

Recent Licentiate theses from the Department of Information Technology

2001-004 Bengt Eliasson: Numerical Simulation of Kinetic Effects in IonosphericPlasma

2001-005 Per Carlsson:Market and Resource Allocation Algorithms with Application toEnergy Control

2001-006 Bengt Goransson:Usability Design: A Framework for Designing Usable In-teractive Systems in Practice

2001-007 Hans Norlander:Parameterization of State Feedback Gains for Pole Assign-ment

2001-008 Markus Bylund:Personal Service Environments — Openness and User Con-trol in User-Service Interaction

2001-009 Johan Bengtsson:Efficient Symbolic State Exploration of Timed Systems: The-ory and Implementation

2001-010 Johan Edlund:A Parallel, Iterative Method of Moments and Physical OpticsHybrid Solver for Arbitrary Surfaces

2001-011 Par Samuelsson:Modelling and control of activated sludge processes with ni-trogen removal

2001-012 PerAhgren:Teleconferencing, System Identification and Array Processing

2001-013 Alexandre David:Practical Verification of Real-time Systems

2001-014 Abraham Zemui:Fourth Order Symmetric Finite Difference Schemes for theWave Equation

Department of Information Technology, Uppsala University, Sweden