summation-by-parts in time: the second derivative

25
Department of Mathematics Summation-by-parts in Time: the Second Derivative Jan Nordstr¨ om, Tomas Lundquist LiTH-MAT-R--2014/11--SE

Upload: liu-se

Post on 18-Nov-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

Department of Mathematics

Summation-by-parts in Time: the SecondDerivative

Jan Nordstrom, Tomas Lundquist

LiTH-MAT-R--2014/11--SE

Department of Mathematics

Linkoping University

S-581 83 Linkoping, Sweden.

Summation-by-parts in time: the second derivative

Jan Nordströma, Tomas Lundquista

aDepartment of Mathematics, Computational Mathematics, Linköping University,

SE-581 83 Linköping, Sweden

Abstract

A new technique for time integration of initial value problems involving sec-ond derivatives is presented. The technique is based on summation-by-partsoperators and weak initial conditions and lead to optimally sharp energyestimates. The schemes obtained in this way use wide operators, are uncon-ditionally stable and high order accurate. The additional complications whenusing compact operators in time are discussed in detail and it is concludedthat the existing compact formulations designed for space approximations arenot appropriate. As an application we focus on the wave equation and deriveoptimal fully discrete energy estimates which lead to unconditional stabil-ity. The scheme utilizes wide stencil operators in time, whereas the spatialoperators can have both wide and compact stencils. Numerical calculationsverify the stability and accuracy of the new methodology.

Keywords: time integration, second derivative approximations, initialvalue problems, high order accuracy, initial value boundary problems,boundary conditions, stability, convergence, summation-by-parts operators

1. Introduction

Hyperbolic partial differential equations on second order form appear inmany fields of applications including electromagnetics, acoustics and generalrelativity. The most common way of solving these equations has tradition-ally been to rewrite them on first order form and apply the well-establishedmethods for solving first order hyperbolic problems. For the time integrationpart, a popular choice due to its time reversibility is the leap-frog method,especially for long time simulations of wave propagation problems. This tra-ditional approach does however have some disadvantages. Most notably itincreases the number of unknowns and requires a higher resolution it both

Preprint submitted to Elsevier September 4, 2014

time and space [1]. Many attempts have been made to instead discretize thesecond order derivatives directly with finite difference approximations. Vari-ous types of compact difference schemes, e.g. including the classical methodsof Störmer and Numerov [2, 3, 4] have been proposed.

Of particular interest to us is the development of schemes based on highorder accurate operators in space obeying a summation-by-parts (SBP) ruletogether with the weak simultaneous-approximatiom-term (SAT) penaltytechnique for boundary conditions, [5, 1, 6]. The SBP-SAT technique inspace in combination with SBP-SAT in time leads in an almost automaticway to fully discrete schemes with unconditional stability. Even though wefocus on problems discretized by the SBP-SAT technique in space, we stressthat the methodology is completely general and suitable for other types ofstable semi-discrete formulations.

In this paper we extend the SBP-SAT technique by using summation-by-parts operators also for the second derivative in time, leading to an implicittime stepping scheme. A similar technique was developed for first derivativesin [7, 8]. The main advantage of this approach is that it leads to optimalfully discrete energy estimates, guaranteeing unconditional stability and lowdissipation. The schemes thus obtained can be on fully global or multi-stageform, or any combination of the two. The technique presented in this paperutilizes wide stencil operators in time obtained by applying a first derivativeSBP operator twice. The traditional compact operators usually used in spaceapproximations are also considered, but are found to be less suitable for timeintegration with in combination with SBP-SAT.

The organization of this paper is as follows. In section 2 we introduce thebasic technique by demonstrating the SBP-SAT method applied to a firstorder initial value problem. We extend this in section 3, proposing an energystable SBP-SAT implementation of second order problems. We obtain thediscrete formulation by applying a first derivative SBP operator twice, thusresulting in a wide stencil second order scheme. In section 4 we address thepossibility of using a compact stencil formulation for the second derivativein time. In section 5 we derive an energy stable fully discrete SBP-SATapproximation for the wave equation. Numerical calculations demonstratingthe stability and accuracy of the newly developed method are presented insection 6. Finally in section 7, conclusions are drawn.

2

2. The first derivative approximation

We introduce the SBP-SAT technique for solving initial value problemsby studying a simple first order equation (see [7, 8] for a more completedescription). Consider the scalar constant coefficient problem:

ut + λu = 0, 0 ≤ t ≤ T, (1)

where λ is a real constant. An energy estimate is obtained by multiplying(1) with u, followed by integration over the domain. Assuming an initialsolution given by u(0) = f , we get

u(T )2 + 2λ‖u‖2L2= f 2, (2)

where ‖u‖2L2=

∫ T

0u2dt.

The estimate (2) is the target for the numerical solution as well. Weintroduce a computational grid ~t = (0,∆t, . . . , T ) with uniform spacing∆t = T/N , and a corresponding discrete solution ~u = (u0, u1, . . . , uN). Thediscrete version of the time derivative is now defined by using a first derivativeoperator on summation-by-parts form

~ut = D1~u, (3)

whereD1 = P−1Q, Q+QT = B, P = P T > 0. (4)

In (4), B = ~eN~eTN − ~e0~e

T0, ~e0 = (1, 0, . . . , 0) and ~eN = (0, . . . , 0, 1). It now

remains is to impose the initial condition in a stable way by a penalty term.The fully discrete approximation of (1) becomes

~ut + λ~u = P−1τ(u0 − f)~e0. (5)

We choose τ = −1 and apply the energy method by multiplying (5) from theleft with ~uTP , and add the transpose, which yields

u2

N + 2Re(λ)‖~u‖2P = f 2 − (u0 − f)2, (6)

by adding and subtracting f 2. The discrete norm is here defined as ‖~u‖2P =~uTP~u. This estimate mimics the continuous target (2) perfectly, only intro-ducing a small additional damping term.

3

The SBP-SAT discretization presented above is global. In [8] we showthat the time interval can be divided into an arbitrary number of subdo-mains, allowing for a multi-stage formulation of the method, thus reducingthe number unknowns in each solve. Other operators on summation-by-partsform, such as spectral element operators [9], can also be used to reduce thenumber of unknowns even further. See also [10] for an overview of the pos-sible ways to construct SBP operators.

3. The wide second derivative approximation

As a first test problem for treating second order time derivatives withSBP-SAT we consider the scalar equation

utt + α2ut + β2u = 0, 0 ≤ t ≤ T (7)

where α2 and β2 are positive real constants. An energy estimate is obtainedby multiplying with ut followed by integration over the domain. Given thetwo initial conditions u(0) = f and ut(0) = h, the energy method then yields

ut(T )2 + β2u(T )2 + 2α2‖ut‖

2

L2= h2 + β2f 2. (8)

The estimate (8) is the target for our discrete energy estimate.Since we multiply (7) with the time derivative of the solution, we can im-

pose the second initial condition ut(0) = h in a stable way with the standardpenalty technique used for the first order equation in (5). However, whenit comes to implementing the first initial condition u(0) = f , it is not thateasy.

To impose the initial condition u(0) = f , we introduce the followingmodified discrete first derivative with the weak SAT condition added on

~ut = ~ut + P−1τ0(u0 − f)~e0. (9)

The modified operator (9) has the same order of accuracy as the one in (3).A discrete second derivative is now obtained by applying the first derivativeoperator again on ~ut

~utt = D1~ut. (10)

The discrete approximation of (7) with the weakly imposed SAT initial con-ditions becomes

~utt + α2~ut + β2~u = P−1τ0t((u0)t − h)~e0. (11)

4

By the choice τ0 = 1, τ0t = −1 and the discrete energy method (multiplyingfrom the left with uT

t P ) we obtain

((uN)t)2 + β2u2

N + 2α2‖~ut‖2

P = h2 + β2f 2 − ((u0)t − h)2 − β2(u0 − f)2, (12)

which mimics the continuous estimate (8) perfectly.We have proved

Proposition 1. The approximation (11) with τ0 = 1, τ0t = −1 and themodified first derivative (9) is an unconditionally stable approximation of theinitial value problem (7) with initial conditions u(0) = f and ut(0) = h.

Remark 1. The proof of Proposition 1 required that we augmented thefirst derivative with one of the initial conditions. This was straightforwardto do since we used the wide second order operator D2

1to approximate the

second derivative utt. The question arises whether an energy estimate can beobtained also for compact stencil operators. We will return to this questionin section 4.

3.1. Multi-block/stage formulation

So far we have considered the application of the SBP-SAT technique todiscretize second order problems in time as a global method, i.e. we solve (7)on the entire time interval of interest through a singe fully coupled equationsystem. However, it is often advantageous to divide the problem into smallertime intervals, thus reducing the number of unknown solution componentsin each step. In this section we consider the two block case, the extension toa fully multi-stage version is completely analogous.

Consider problem (7) divided into two time-slots

utt + α2ut + β2u = 0, 0 ≤ t ≤ ti

vtt + α2vt + β2v = 0, ti ≤ t ≤ T

We define the modified discrete first derivatives as

~ut = D1~u+ P−1τL(uN − v0)~eN + P−1τ0(u0 − f)~e0

~vt = D1~v + P−1τR(v0 − uN)~d0,(13)

where τL and τR are additional SAT penalty parameters forcing the solutionsuN and v0 toward each other. The unit vectors ~eN and ~d0 both correspond

5

to the time t = ti. An SBP-SAT discretization of the two-block problem is

D1~ut + α2~ut + β2~u = P−1τLt((uN)t − (v0)t)~eN + P−1τ0t((u0)t − h)~e0

D1~vt + α2~vt + β2~v = P−1τRt((v0)t − (uN)t)~d0,

where τLt and τRt forces (uN)t and (v0)t toward each other. We set τ0 = 1and τ0t = −1 as before. The energy method now yields

~uTt Q~ut + α2~uT

t P~ut + β2~uTt P~u+ β2u0(u0 − f) + β2τLuN(uN − v0)

= τLt(uN)t((uN)t − (v0)t)− (u0)t((u0)t − h)

~vTt Q~vt + α2~vTt P~vt + β2~vTt P~v + β2τRv0(v0 − uN)

= τRt(v0)t((v0)t − (uN)t),

which can be rewritten as

((vt)M)2 + β2v2M+2α2(‖ut‖2

PL+ vt‖

2

PR) = h2 + β2f 2 − ((u0)t − h)2 − β2(u0 − f)2

−β2

(

uN

v0

)T (

1 + 2τL −τL − τR−τL − τR −1 + 2τR

)(

uN

v0

)

+

(

(v0)t(uN)t

)T (

1 + 2τRt −τLt − τRt

−τLt − τRt −1 + 2τLt

)(

(v0)t(uN)t

)

.

A stable interface treatment require that the following conditions must befulfilled (for a proof, see [11])

τR = τL + 1, τL ≥ −1

2, τLt = τRt + 1, τRt ≤ −

1

2. (14)

In particular, the choice τL = 0 and τRt = −1 gives the sharp estimate

((vt)M)2 + β2v2M + 2α2(‖ut‖2

PL+ vt‖

2

PR) =h2 + β2f 2 − ((u0)t − h)2 − β2(u0 − f)2

− ((uN)t − (v0)t)2 − β2(uN − v0)

2.

Remark 2. The choices τL = 0 and τRt = −1 also make the left domaincompletely uncoupled to the right one, enabling a multi-block/stage procedure.

By generalizing the derivation above we can prove

Proposition 2. The multi-block/stage approximation of the initial valueproblem (7) with initial conditions u(0) = f and ut(0) = h obtained by usingi) the penalty coefficient τ0 = 1, τ0t = −1 for the initial conditions, ii) modi-fied first derivatives for the interface connection as in (13) and iii) interfacepenalty coefficient as in (14) is an unconditionally stable approximation.

Remark 3. The multi-block/stage formulation introduces an extra amountof damping at each block boundary when compared to the global formulation.

6

4. The compact second derivative approximation

We begin with a short review of how compact operators traditionallyare used for space approximations. The energy estimates in these problemsrequire compact operators that mimic the following integral property:

∫ b

a

uuxxdx = u(b)ux(b)− u(a)ux(a)−

∫ b

a

u2

xdx. (15)

For a wide second derivative operator D21, the discrete counterpart of (15) is

~uTPD2

1~u = ~uTQ~ux = ~uT (B −QT )~ux = uN(ux)N − u0(ux)0 − ~uT

xP~ux,

which correspond perfectly to (15). A traditional compact second orderderivative D2 on the other hand have the form

D2 = P−1(−M +BS), (16)

where M +MT ≥ 0, and S approximates the first derivative at the bound-aries. This gives

~uTPD2~u = ~uTB(S~u)−1

2~uT (M +MT )~u,

which mimics (15) in the sense that we get an approximation of the boundaryterms along with a damping term. A more strict similarity with (15) can beobtained using so called compatible operators defined by M = DT

1PD1 +R,

where D1 is an SBP first derivative operator, and R + RT ≥ 0 is a smalldamping term, giving

~uTPD2~u = ~uTB(D1~u)− (D1~u)TP (D1~u)−

1

2~uT (R +RT )~u.

Compatible operators are in particular needed for problems with combina-tions of mixed and pure second derivatives [12, 5].

In contrast to (15) we need, in order to derive continuous energy estimatesfor the second order initial problems, to approximate the identity

∫ T

0

ututtdt =1

2(ut(T )

2 − ut(0)2). (17)

7

The discrete version of this property by using the definition (16) and assum-ing S = D1 leads to

~uTt PD2~u =

1

2~uTt B~ut +

1

2~uT (−DT

1M −MTD1 +DT

1BD1)~u. (18)

The wide operator D21

corresponds to M = QTD1, and in this case we get

~uTt PD2

1~u = ~uT

t Q~u =1

2~uTt B~ut,

which mimics (17) perfectly. However for other choices, the expression (18) isin general indefinite for M+MT ≥ 0. The compatible form M = DT

1PD1+R

does not improve the situation.Clearly the form (16) traditionally used for compact operators does not

in a direct way lead to an estimate that mimics (17) even with additionaldamping. Without assuming any specific form of D2, the estimate becomes

~uTt PD2~u =

1

2~uTt B~ut + ~uT A~u,

whereA = DT

1(PD2 −QD1). (19)

Thus, for any given operator D2 we get an estimate that mimics (17) withadditional damping only if the symmetric part of the matrix A as given aboveis positive semi-definite. This is due to the fact that the second derivativeutt resides on the left hand side of the original equation.

A special case where A + AT is exactly zero is given by the followingoperator with a second order compact interior stencil:

D2 =1

∆t2

0 0 01 −2 1

. . . . . . . . .

1 −2 10 0 0

.

Except for this single example, we have not been able to construct any otheroperator for which A+ AT ≥ 0. Furthermore, even if this could be done, theimposition of the weak initial conditions would introduce additional compli-cations that we also believe are hard to overcome. We refer to Appendix Afor a more detailed analysis of compact operators in time which also includesimposition of the initial conditions.

8

5. Sharp fully discrete energy estimates

As an application of the new time discretization shown above we considerthe wave equation on the domain 0 ≤ t, x ≤ 1 with homogenous boundaryconditions.

utt = β2uxx

u(x, 0) = f(x)

ut(x, 0) = h(x) (20)

aut(0, t)− ux(0, t) = 0

aut(1, t) + ux(1, t) = 0.

The choice a = 0 corresponds to Neumann conditions, a = ∞ to Dirichletconditions and a = 1/β to non-reflecting artificial boundaries [13]. Moregeneral boundary conditions can also be considered [14].

To get an energy estimate for (20) we multiply with ut and integrate inspace. After implementation of the boundary conditions we get

d

dt(‖ut‖

2 + β2‖ux‖2) = −aβ2(ut(0, t)

2 + ut(1, t)2). (21)

Thus, we have an energy estimate if a > 0. Finally, by time integration weobtain an estimate of the solution at the final time

‖ut(·, 1)‖2+‖ux(·, 1)‖

2 = ‖h‖2+‖fx‖2−aβ2

1

0

(ut(0, t)2+ut(1, t)

2)dt. (22)

5.1. The semi-discrete formulation

As the first step to approximate (20) we introduce a semi-discrete solutionon the spatial grid ~x = (0,∆x, . . . , 1) with uniform spacing ∆x = 1/M . Wealso define the restriction of the data f and h to this grid. Thus, let

~u(t) = (u0(t), u1(t), . . . , uM(t))T ,

~f = (f(0), f(∆x), . . . , f(1))T

~h = (h(0), h(∆x), . . . , h(1))T .

For convenience, we also introduce notations for the numerical first deriva-tives of the solution and data vectors:

~ux = (P−1

x Qx)~u, ~fx = (P−1

x Qx)~f,

9

where P−1x Qx is an SBP operator. The SBP-SAT method in space now yields

~utt = β2(P−1

x Qx)~ux + P−1

x σ0(a(~ut)0 − (~ux)0)~e0x

+ P−1

x σM(a(~ut)M + (~ux)M)~e0x

~u(x, 0) = ~f (23)

~ut(x, 0) = ~h,

where ~e0x = (1, 0, . . . , 0)T , ~eMx = (0, . . . , 0, 1)T . For later reference we alsointroduce E0x = ~e0x~e

T0x, EMx = ~eMx~e

TMx and Bx = EMx−E0x. For simplicity

we use a wide stencil operator (P−1x Qx)

2 for the second spatial derivative.The extension to compact stencil operators in space poses no problem [14].

Multiplying from the left with ~uTt Px now gives:

~uTt Px~utt =β2~uT

t Qx~ux + σ0(~ut)0(a(~ut)0 − (~ux)0) + σM(~ut)M(a(~ut)M + (~ux)M)

=− β2(P−1

x Qx~ut)TPx~ux + a(σ0(~u

2

t )0 + σM(~u2

t )M)

+ (β2 + σM)(ut)M(ux)M − (β2 + σ0)(ut)0(ux)0.

The choice σ0 = σM = −β2 leads to

d

dt(~uT

t Px~ut + β2~uTxPx~ux) = −aβ2((u2

t )0 + (u2

t )M). (24)

Note that the relation (24) is completely analogous to the continuous (21).Finally, integrating in time yields

~ut(1)TPx~ut(1) + β2~ux(1)

TPx~ux(1) = ~hTPx~h+ β2 ~fT

x Px~fx

− aβ2

1

0

((u2

t )0 + (u2

t )M)dt,(25)

which mimics (22) perfectly.

Remark 4. The wide second derivative approximation in (23) can be replacedwith a compact approximation of the form (16). The estimate for the compactoperator corresponding to (25) becomes

~ut(1)TPx~ut(1) + β2~u(1)TMx~u(1) = ~hTPx

~h+ β2 ~fTMx~f

− aβ2

1

0

((u2

t )0 + (u2

t )M)dt.

In other words, no problems occur, which is contrary to the case with compactoperators in time, as was shown above.

10

5.2. The fully discrete formulation

Next we introduce the fully discrete solution, and begin by defining it atfixed temporal and spatial coordinates

~U |t=i∆t = (Ui,0, Ui,1, . . . , Ui,M)T , i = 0, . . . N

~U |x=j∆x = (U0,j, U1,j, . . . , UN,j)T , j = 0, . . .M.

The full solution vector and the numerical first derivatives with respect totime and space are

~U = (~U |Tt=0, ~U |Tt=∆t, . . . ,

~U |Tt=1)T , ~Ut = (P−1

t Qt⊗Ix)~U, ~Ux = (It⊗P−1

x Qx)~U

where P−1

t Qt and P−1x Qx are SBP operators, and It and Ix are unit matrices

of dimension N and M respectively.The fully discrete SBP-SAT approximation of (20) can now be written as

(P−1

t Qt ⊗ Ix) ~Ut = β2(It ⊗ P−1

x Qx)~Ux + (Pt ⊗ Px)−1(T0t + Σ), (26)

where the initial and boundary conditions are imposed by

~Ut = ~Ut + (Pt ⊗ Px)−1T0

T0 = τ0(It ⊗ Px)(~e0t ⊗ (~U |t=0 − ~f))

T0t = τ0t(It ⊗ Px)(~e0t ⊗ ( ~Ut|t=0 − ~h))

Σ = σ0(Pt ⊗ Ix)((a~Ut|x=0 − ~Ux|x=0)⊗ ~e0x)

+ σM(Pt ⊗ Ix)((a~Ut|x=1 + ~Ux|x=1)⊗ ~eMx).

(27)

A fully discrete energy estimate is now obtained by multiplying (26) from

the left with ~UTt (Pt ⊗ Px)

~UTt (Qt ⊗ Px) ~Ut = β2 ~UT

t (Pt ⊗Qx)~Ux + ~UT (T0t + Σ).

The summation-by-parts property (4) of Qt and Qx leads to

1

2~UTt (Bt ⊗ Px) ~Ut = β2 ~UT

t (Pt ⊗ (Bx −Qx))~Ux + ~UT (T0t + Σ)

= β2 ~UTt (Pt ⊗ Bx)~Ux − β2~UT

t (Pt ⊗QTx )~Ux (28)

+ β2τ0(~e0t ⊗ ~U |t=0 − ~f)T (It ⊗QTx )~Ux + ~UT

t (T0t + Σ).

11

We rewrite the second and third terms on the right hand side above bychanging the order of numerical differentiation as

−β2~UTt (Pt ⊗QT

x )~Ux = −β2~UT ((P−1

t Qt)T ⊗ Ix)(Pt ⊗QT

xP−1

x )(It ⊗ Px)~Ux

= −β2~UT (It ⊗ (P−1

x Qx)T )(QT

t ⊗ Ix)(It ⊗ Px)~Ux

= −β2~UTx (Q

Tt ⊗ Px)~Ux

= −β2

2~UTx (Bt ⊗ Px)~Ux, (29)

and

β2τ0(~e0t ⊗ ~U |t=0 − ~f)T (It ⊗QTx )~Ux = β2τ0(~Ux|t=0 − ~fx)

TPxUx|t=0. (30)

The remaining penalty terms in (28) simplifies by (27) to

~UTt T0t = τ0t ~Ut|

Tt=0

Px( ~Ut|t=0 − h), (31)

~UTt Σ = σ0

~Ut|Tx=0

Pt(a~Ut|x=0 − ~Ux|x=0) + σM~Ut|

Tx=1

Pt(a~Ut|x=1 + ~Ux|x=1) (32)

Inserting (29)-(32) into (28) now gives

~Ut|Tt=1

Px~Ut|t=1 + β2~Ux|

Tt=1

Px~Ux|t=1 = ~Ut|

Tt=0

Px~Ut|t=0 + β2~Ux|

Tt=1

Px~Ux|t=0

− 2(β2 + σ0) ~Ut|Tx=0

Pt~Ux|x=0

+ 2(β2 + σM) ~Ut|Tx=1

Pt~Ux|x=1

+ 2a(σ0~Ut|

Tx=0

Pt| ~Ut|x=0 + σM~Ut|

Tx=1

Pt| ~Ut|x=1)

+ 2β2τ0(~Ux|t=0 − ~fx)TPx

~Ux|t=0

+ 2τ0t ~Ut|Tt=0

Px( ~Ut|t=0 − h).

Finally, by choosing the penalty parameters as τ0 = 1, τ0t = −1 and σ0 =σM = −β2, we get

~Ut|Tt=1

Px~Ut|t=1 + β2~Ux|

Tt=1

Px~Ux|t=1 = ~hTPx

~h+ β2 ~fTx Px

~fx

− aβ2( ~Ut|Tx=0

Pt| ~Ut|x=0 + ~Ut|Tx=1

Pt| ~Ut|x=1)

− ( ~Ut|t=0 − h)TPx( ~Ut|t=0 − h) (33)

− β2(~Ux|t=0 − ~fx)TPx(~Ux|t=0 − ~fx),

12

which mimics both the continuous (22) and semi-discrete energy estimate(25) perfectly.

We have proved

Proposition 3. The fully discrete approximation (26) of (20) with initialand boundary conditions imposed by (27) and penalty coefficients τ0 = 1,τ0t = −1,σ0 = σM = −β2 is unconditionally stable.

Remark 5. By replacing the wide second derivative in space with a compactapproximation of the form (16) we get the following estimate

~Ut|Tt=1

Px~Ut|t=1 + β2~U |Tt=1

Mx~U |t=1 = ~hTPx

~h+ β2 ~fTMx~f

− aβ2( ~Ut|Tx=0

Pt| ~Ut|x=0 + ~Ut|Tx=1

Pt| ~Ut|x=1)

− ( ~Ut|t=0 − h)TPx( ~Ut|t=0 − h)

− β2(~U |t=0 − ~f)TMx(~U |t=0 − ~f),

which correspond to (33). Again, no complications occur, unlike the case withcompact operators in time shown above.

6. Numerical calculations

6.1. Accuracy

By using an SBP first derivative operator D1 of order τ at the boundaries,we get a a wide stencil operator D2

1with boundary order τ − 1. This gives

a theoretical convergence rate of τ + 1 for stable second order hyperbolicsystems, see [15].

In Figure 1 we show the accuracy results for equation (7) with α2 = 0,β2 = 2π and T = 5, employing the exact solution u = cos(2πt). We use 7 dif-ferent operators D1, all denoted by SBP(2s,τ), where 2s is the internal orderof accuracy and τ is the boundary accuracy. For diagonal norm operators wehave τ = s, and for block norms τ = 2s− 1. As we can see, the convergencerate is 2s for all these operators, as opposed to the expected τ + 1.

The reason for this superconvergence is not fully clear to us, and currentlyunder investigation. It might have to do with the super-convergence observedfor first order derivative approximations which in turn is due to the effect ofdual consistency, see [8],[16],[17],[18] for more details.

In Figure 2 we show the same result for a multi-stage implementation.We have used Ni = 2, 8, 12, and 16 in each stage for 2s = 2, 4, 6 and 8

13

100

101

102

10−12

10−10

10−8

10−6

10−4

10−2

100

N

|e|

SBP(2,1)

SBP(4,2)

SBP(4,3)

SBP(6,3)

SBP(6,5)

SBP(8,4)

SBP(8,7) p=8 p=6

p=2

p=4

Figure 1: Convergence of SBP-SAT for a second order scalar constant coefficient problem.

respectively. As can be seen, there is no drop in accuracy compared with theglobal approach.

We also consider the approximation (23) of the wave equation (20) withf = 0, h = 2πcos(2πx), employing the exact solution u = cos(2πt)cos(2πx).In order to minimize the spatial error component, a very accurate spatialdiscretization (SBP(8,7) with M = 256) is employed. The convergence forthis problem is shown in Figure 3. Here the convergence rates are τ + 1 asexpected.

6.2. An example in two dimensions

As a final illustration we consider the wave equation in two dimensions.

utt = uxx + uyy

u(x, 0) = f(x)

ut(x, 0) = h(x)

ut(0, y, t)− ux(0, y, t) = 0 (34)

ut(1, y, t) + ux(1, y, t) = 0

ut(x, 0, t)− uy(x, 0, t) = 0

ut(x, 1, t) + uy(x, 1, t) = 0

14

100

101

102

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

N

|e|

SBP(2,1)

SBP(4,2)

SBP(4,3)

SBP(6,3)

SBP(6,5)

SBP(8,4)

SBP(8,7) p=8p=6

p=4

p=2

Figure 2: Convergence of SBP-SAT for a second order scalar constant coefficient problem,multi-stage version.

100

101

102

10−12

10−10

10−8

10−6

10−4

10−2

100

N

||e

||

SBP(2,1)

SBP(4,2)

SBP(4,3)

SBP(6,3)

SBP(6,5)

SBP(8,4)

SBP(8,7)p=8

p=6

p=2

p=3

p=5

p=4

Figure 3: Temporal convergence for the wave equation. In space we use SBP(8,7) withM = 256.

15

Figure 4: Solution to the two-dimensional wave equations at different time levels, usingSBP(4,3) with grid spacings hx = hy = ht = 1/96.

The spatial and temporal discretizations are carried out in a completely anal-ogous way to the one-dimensional case in section 5 and is not re-iterated here.A fourth order accurate solution on a fine grid is obtained by using SBP(4,3)in both space and time with hx = hy = ht = 1/96. The time integration isdivided into 12 separate steps per time unit using the multi-stage technique.The initial solution in the form of two Gaussian pulses and the resultingmerge of the two propagating waves are shown in Figure 4.

7. Conclusions

We have demonstrated that high order accurate SBP operators can beused to discretize second order time derivatives in a way that leads to optimalfully discrete energy estimates. The initial conditions are imposed with amodified SAT penalty technique together with wide stencil operators in time.

The newly developed method is unconditionally stable, and the imple-mentation can be both fully global in time, or in the form of an implicitmulti-block/stage time marching scheme.

We also discuss the possibility of using of compact stencil operators intime, but conclude that they can probably not be incorporated into thetechnique presented in this paper. The standard spatial operators can clearlynot be used, except for a very special low order case.

16

We demonstrate the technique for scalar second order initial value prob-lems as well as for the one and two-dimensional wave equation with generalboundary conditions. The numerical results illustrate the stability and ac-curacy of the new methodology.

Appendix A. Compact stencil formulations in time

We now return to the scalar constant coefficient problem (7). A compactformulation can be obtained by modifying the definition of the numericalsecond derivative as follows:

~utt = D1~ut + P−1R~u, (A.1)

where ~ut = D1~u + P−1σ0(u0 − f)~e0 as before. The second order operatorused here can be written as

D2 = P−1(QD1 +R). (A.2)

We assume moreover that D2 is at least zeroth order accurate everywhere.Since D2 is scaled by 1/∆t2, this means that first order grid polynomialsmust be differentiated exactly, i.e.

D2~1 = D2

~t = 0. (A.3)

Since the wide operator D21

already satisfies A.3, the same must hold for thedamping term R:

R~1 = R~t = 0. (A.4)

In order to produce an energy estimate, we again multiply the discrete equa-tion (11) from the left with ~uT

t P :

u2

tN + β2u2

N = h2 + β2f 2 − (ut0 − h)2 − β2(u0 − f)2

− ~uT A~u+ σ0(u0 − f)~eT0A~u,

where A = DT1R as before. Thus, in order to obtain an estimate of the

same type as (12) (with possible extra damping from A), the following twoconditions must be satisfied:

A+ AT ≥ 0 (A.5)

~eT0A = 0 (A.6)

In lemma 2 below we will derive an additional condition that is necessary for(A.6) to hold. However, to do this we first need the following lemma.

17

Lemma 1. Let A be an (N + 1) by (N + 1) symmetric matrix, and let ~x bea vector such that ~xTA~x = 0. Then A is indefinite unless A~x = 0

Proof. Note that for ~x = 0, the result is trivial. Now, consider for simplicitythe case where xN is non-zero (completely analogous proofs can be formu-lated assuming any other element to be non-zero). We begin by defining atransformation matrix R as:

R = (~e0, ~e1, . . . , ~eN−1, ~x) =

1 0 . . . 0 x0

1 x1

. . ....

1 xN−1

xN

.

This leads to the transformation:

RTAR =

a00 . . . a0,N−1 ~aT0~x

.... . .

...aN−1,0 aN−1,N−1 ~aTN−1

~x~xT~a0 . . . ~xT~aN−1 0

,

where ~aj denotes the j:th column of A, for j = 0, 1, . . . , N . Now, since R isnon-singular, A is indefinite if and only if RTAR is indefinite. Moreover, dueto the zero on the last diagonal element, RTAR must be indefinite unlessall elements on the last row and column are zero, i.e. unless ~aT

0~x = . . . =

~aTN−1~x = 0. If this holds, then also ~aTN~x must be zero, since

0 = ~xTA~x = x0~aT0~x+ . . .+ xN−1~a

TN−1

~x+ xN~aTN~x = xN~a

TN~x.

Thus, A is indefinite unless ~aT0~x = . . . = ~aTN~x = 0, i.e. unless A~x = 0.

We are now ready to state an additional necessary condition for (A.6) to betrue.

Lemma 2. The symmetric matrix A + AT , where A = DT1R, is indefinite

unless the following condition holds:

~1TPD2 = (~eN − ~e0)TD1. (A.7)

18

Proof. First we show that ~tT (A+ AT )~t = 0, using (??) and (A.4):

~tT (A+ AT )~t = 2~tT A~t = 2(D1~t)T (R~t) = 0

Now assume that A + AT is not indefinite. Then it follows from lemma 1that (A+ AT )~t = 0. This in turn leads to:

0 = (A+ AT )~t

= DT1(R~t) +RT (D1

~t)

= RT~1,

Multiplying D2 from the left with ~1TP finally gives

~1TPD2 = ~1TQD1 +~1TR = (~eN − ~e0)TD1,

which concludes the proof.

We stop here to summarize the results obtained so far in this section. Inorder to produce an energy estimate of the same type as (12) (with possibleextra damping), the compact operator D2 given by (A.2 ) must satisfy thetwo conditions (A.5) and (A.6). Moreover, we derive in lemma 2 that (A.7)is a necessary condition for (A.6) to hold. We argue that these conditions arenot possible to satisfy, and will motivate this by studying the second orderaccurate case in more detail.

From this point on, we assume that a second order accurate compactstencil is employed in the interior of the operator D2. If stability can not beachieved in this special case, it is highly unlikely that higher order accurateoperators would perform better.

The standard second order first derivative operator is

D1 =1

∆t

−1 1−1

20 1

2

. . . . . . . . .

, (A.8)

and P = ∆tDiag(12, 1, . . . , 1, 1

2). This gives the following wide stencil second

derivative operator:

D2

1=

1

∆t2

1

2−1 1

21

2−3

40 1

21

40 −1

20 1

4

. . . . . . . . .

.

19

In order to satisfy (A.5), the first row must be the same in D2 as in D21. For

this reason the ansatz for D2 will be of the following general form, with asecond order compact stencil in the interior and an unknown block of sizer > 2 in the top left corner:

D2 =1

∆t2

1

2−1 1

2

d1,0 . . . d1,r−1

.... . .

...1

dr,0 . . . dr,r−1 −2 11 −2 1

. . . . . . . . .

, (A.9)

To simplify the analysis, we introduce some auxillary variables. First, theunknown coefficients determining the non-zero pattern in D2 is collected intoa matrix D, given by:

D2 =

d1,0 . . . d1,r−1

.... . .

...

dr,0 . . . dr,r−1

.

We will also need the first two monomials of the same dimension as D2:

~1 = (1, 1, . . . , 1), ~t = (0, 1, 2, . . . , r − 1).

Using these definitions, the necessary condition (A.7) along with the twoaccuracy conditions in (A.3) can now be rewritten into the following threesets of conditions:

~1T D2 = (3

4,−

1

2,−

1

4, 0, . . . , 0) (A.10)

D2~1 = (0, . . . , 0,−1, 1)T (A.11)

D2~t = (0, . . . , 0,−r,−1 + r)T . (A.12)

Thus we have 3r equations for r2 unknown coefficients in D2. The three setsof equations above, although consistent, do however include linear dependen-

cies. Indeed, if we we multiply (A.11) with ~1T from the left, and (A.10) with

~1 from the right, we obtain one and the same condition:

~1T D2~1 = 0.

20

Thus we can remove any row in (A.11) without changing the rank of the full

system (A.10)-(A.11). Similarly, multiplying (A.12) with ~1T from the left,

and (A.10) with ~t from the right, we again obtain an identical condition,namely:

~1T D2~t = −1,

and thus we can remove also one arbitrary equation in (A.12) from the systemwithout loosing rank.

The total number of linearly independent equations remaining in (A.10)-(A.11) is now 3r − 2, so the number of free parameters left is r2 − 3r + 2.For instance, if we choose r = 3, then D2 can be written using two freeparameters as

−1

4

1

2−1

4

2 −3 0−1 2 0

+ t1

−1 2 −10 0 01 −2 1

+ t2

−1 2 −11 −2 10 0 0

Using this form of D2, we have examined numerically whether A+AT becomespositive definite or not. We did this on the parameter domain −100 ≤ t1, t2 ≤100 with uniform spacing 0.01. The minimum eigenvalue was found to beless than −0.8 for all these parameter values. In fact, A+ AT was indefinitein all cases except one, namely t1 = 1, t2 = −2, in which case the matrixwas negative semi-definite.

For r > 3, direct numerical investigations like the one described abovebecomes prohibitively expensive, but we find it reasonable to infer that therewould be no solutions for which A+ AT ≥ 0 even in this case. We summarizeby stating this assumption formally.

Assumption 1. Let D1 be the second order accurate first derivative operator(A.8), and let D2 be a compact second derivative operator defined by (A.9),with at least zeroth order of accuracy at the boundaries (A.3). Then (A.5)cannot hold together with (A.6). Thus we can not obtain an energy estimateon the form (12), even with additional damping.

References

[1] K. Mattsson, F. Ham, G. Iaccarino, Stable and accurate wave propa-gation in discontinuous media, Journal of Computational Physics 227(2008) 8753–8767.

21

[2] E. Hairer, S. Nørsett, G. Wanner, Solving Ordinary Differential Equa-tions I: Nonstiff Problems, Springer-Verlag, 1993.

[3] G. Shubin, J. Bell, A modified equation approach to constructing fourthorder methods for acoustic wave propagation, SIAM Journal on Scien-tific and Statistical Computing 8 (1987) 135–151.

[4] H.-O. Kreiss, N. Petersson, J. Yström, Difference approximations forthe second order wave equation, SIAM Journal on Numerical Analysis40 (2002) 1940–1967.

[5] K. Mattsson, Summation by parts operators for finite difference ap-proximations of second-derivatives with variable coefficients, Journal ofScientific Computing 51 (2012) 650–682.

[6] K. Mattsson, J. Nordström, High order finite difference methods forwave propagation in discontinuous media, Journal of ComputationalPhysics 220 (2006) 249–269.

[7] J. Nordström, T. Lundquist, Summation-by-parts in time, Journal ofComputational Physics 251 (2013) 487–499.

[8] T. Lundquist, J. Nordström, The sbp-sat technique for initial valueproblems, Journal of Computational Physics 270 (2014) 86–104.

[9] M. Carpenter, D. Gottlieb, Spectral methods on arbitrary grids, Journalof Computational Physics 129 (1996) 74–86.

[10] D. Del Rey Fernandez, P. Boom, D. Zingg, A generalized framework fornodal first derivative summation-by-parts operators, Journal of Com-putational Physics 266 (2014) 214–239.

[11] M. Carpenter, J. Nordström, D. Gottlieb, A stable and conservativeinterface treatment of arbitrary spatial accuracy, Journal of Computa-tional Physics 148 (1999) 341–365.

[12] K. Mattsson, M. Svärd, M. Shoeybi, Stable and accurate schemes for thecompressible navier-stokes equations, Journal of Computational Physics227 (2008) 2293–2316.

22

[13] B. Engquist, A. Majda, Absorbing boundary conditions for the nu-merical simulation of waves, Mathematics of Computations 139 (1977)629–651.

[14] K. Mattsson, F. Ham, G. Iaccarino, Stable boundary treatment for thewave equation on second-order form, Journal of Scientific Computing41 (2009) 366–383.

[15] M. Svärd, J. Nordström, On the order of accuracy for difference approx-imations of initial-boundary value problems, Journal of ComputationalPhysics 218 (2006) 333–352.

[16] J. E. Hicken, D. W. Zingg, Superconvergent functional estimates fromsummation-by-parts finite-difference discretizations, SIAM Journal onScientific Computing 33 (2011) 893–922.

[17] J. Berg, J. Nordström, Superconvergent functional output for time-dependent problems using finite differences on summation-by-partsform, Journal of Computational Physics 231 (2012) 6846–6860.

[18] J. Berg, J. Nordström, On the impact of boundary conditions on dualconsistent finite difference discretizations, Journal of ComputationalPhysics 236 (2013) 41–55.

23