High Order Finite Difference Schemes for the Heat Equation Whose Convergence Rates are Higher Than Their Truncation Errors, A. Ditkowski arxiv:7.0796v [math.na] Nov 07 Abstract Typically when a semi-discrete approximation to a partial differential equation PDE is constructed a discretization of the spatial operator with a truncation error τ is derived. This discrete operator should be semi-bounded for the scheme to be stable. Under these conditions the Lax Ricchtmyer equivalence theorem assures that the scheme converges and that the error will be, at most, of the order of τ. In most cases the error is in indeed of the order of τ. We demonstrate that for the Heat equation stable schemes can be constructed, whose truncation errors are τ, however, the actual errors are much smaller. This gives more degrees of freedom in the design of schemes which can make them more efficient more accurate or compact than standard schemes. In some cases the accuracy of the schemes can be further enhanced using post-processing procedures. Introduction Consider the differential problem: u ut = 0 = fx. = P u, x Ω R d,t 0 x where u=u,...,u m T and P / x is a linear differential operator with appropriate boundary conditions. It is assumed that this problem is well posed, i.e. Kt< such that ut Kt f, where typically Kt=Ke αt. Let Q be the discretization of P / x where we assume: Assumption : Assumption : Assumption 3: The discrete operator Q is based on grid points{x j }, j =,...,N. Q is semi bounded in some equivalent scalar product, H =,H, i.e w,qw H αw,w H = α w H. The local truncation error vector of Q is T e which is defined, at each entry j by T e j = Pwx j Qw j, 3 where wx is a smooth function and w is the projection of wx onto the grid. It is assumed that T e N 0. Consider the semi discrete approximation: A. Ditkowski School of Mathematical Sciences, Tel Aviv University, Tel Aviv 69978, Israel e-mail: adid@post.tau.ac.il. The final publication is available at link.springer.com via http://dx.doi.org/0.007/978-3-39-9800- 3. In later works these schemes are called Error Inhibiting Schemes EIS.
v = Qv, t 0 4 vt = 0 = f. Proposition: Under Assumptions 3 The semi discrete approximation converges. Proof: Let u is the projection of ux, t onto the grid. Then, from assumption 3, u = Pu = Qu+T e. 5 Let E = u v then by subtracting 4 from 5 one obtains the equation for E, namely E = QE+T e. 6 Next, by taking the H scalar product with E, using assumption and the Schwartz inequality the following estimate can be derived E, E = E,E H = E H E H = E,QE H +E,T e H αe,e H + E H T e H. Thus Therefore: H E H α E H + T e H. 7 E H t E H t = 0e αt + eαt α max T e H 0 τ t N 0. 8 Here we assumed that E H t = 0 is either 0, or at least of the order of machine accuracy. Equation 8 establishes the fact that if the scheme is stable and consistent, the numerical solution v converges to the projection of the exact solution onto the grid, u. Furthermore, it assures that the error will be at most in the truncation error T e H. This is one part of the landmark Lax Richtmyer equivalence theorem for semi discrete approximation. See e.g. [6]. Due to this and similar results the common way for constructing finite difference schemes is to derive a semi bounded Q with proper truncation error. Typically the error E H is indeed of the order of T e H. It should be noted, however, that 6 is the exact equation for the error dynamics, while 8 is an estimate. In this paper we present finite difference schemes in which the errors are smaller than their truncation errors. It is well known that boundary conditions can be of one order lower accuracy without destroying the convergence rate expected from the approximation at inner points, see e.g. [4], [5], [] and [0]. In [5] and [0] it was shown that for parabolic, incompletely parabolic and nd-order hyperbolic equations the boundary conditions can be of two order less. Here, however, we consider low order truncation errors in most or all of the grid points. This paper is constructed as follows; in Section we present a preliminary example and illustrate the mechanism which reduces the error. In Section 3 we present a two point block scheme which has a first order truncation error but has a second or third order error. In Section 4 two three point block schemes are presented. Discussion and remarks are presented in Section 5. Preliminary Example Consider the heat equation u = u + Fx,t, x [0,π,t 0 x ut = 0 = fx 9
with periodic boundary conditions. Let the scheme be: v j = D + D v j + j cv j + F j t ; x j = jh, h=π/n, N is even v j t = 0 = f j 0 where F j t is the projection of Fx,t onto the spatial grid. The truncation error is T e j = h u j xxxx + Oh j cv j = O. Formally, this scheme is not consistent. The scheme 0 was run with the initial condition fx = cosx, F = 0 and N = 3,64,...,04 with forward Euler time propagator. The plots of log 0 E vs. log 0 N, at t final = π, for c=0,0.5, are presented in Figure a. It can be seen that this is a second order scheme. a 0 0 3 c=0, slope:.0069 c=0.5, slope:.005 c=.0, slope:.009 b 0 0 0 4 0 3 0 4 0 5 0 5 0 6 0 7 0 0 3 0 6 0 7 c=0, slope:.0040 c=/6, slope:.00503 c= /6, slope:.895 c= /4, slope: 3.046 0 0 0 3 Fig. Convergence plots, log 0 E vs. log 0 N, for different values of c. a: Scheme 0. b: Scheme 6. In order to understand this phenomenon let us consider one high frequency mode of the error 3. Denote T c j = j cv j. This term can also be written as: T c j = j ch α = ch α e inx j/ For the scheme 0 α = 0. The equation for the error term caused by T c is E c = D + D E c + T c 3 SinceE c j = Ê c e inx j/ π, Ê c C, then the equation for Ê c is 3 This scheme was presented for demonstrating the phenomenon that the error, due to high frequency modes, is lower than the truncation error. As this is not a practical scheme, full analysis of the error is not presented, only a demonstration of the dynamics of high frequency error modes is presented. Full analysis is given for the scheme presented in the next section 3
Ê c = N Êc + c h α 4 Therefore, E c t = Êc t = Êc 0e N t + Ê c 0e N t + O h α+ e N t c h α 5 N Note that the actual error, E c t, is two orders lower that the truncation error, T c. In the next sections we present practical schemes which utilize this idea. 3 Two point Block, 3rd Order Scheme Let the grid be: x j = j h, h=π/n+ and x j+/ = x j + h/, j= 0,...N. Altogether there are N+ points with spacing of h/. For simplicity, we assume that N is even. Consider the approximation: The truncation errors are: d dx u j h/ [ u j / u j + u j+/ + c u j / + 3u j 3u j+/ + u j+ d dx u j+/ h/ [ u j u j+/ + u j+ + c u j / 3u j + 3u j+/ u j+ T e j = T e j+ = h h u j xxxx + c [ h u j+ xxxx + c [ u j xxx + ] h u j xxxx + Oh 3 =Oh h u j+ xxx + h u j+ xxxx ] + Oh 3 =Oh 6 7 The motivation leading to this scheme is that the highly oscillating Oh error terms will be dissipated, as in the previous example, while the Oh terms will be canceled, for the proper value of c. 3. Analysis Let ω { N/,...,N/} and ω N+ ω > 0 ν = 8 ω+n+ ω 0 Then e iωx j = e iνx j and e iωx j+/ = e iνx j+/. 9 We look for eigenvectors in the form of: 4
ψ k ω= α k π. e iωx j e iωx j+/. + β k π. e iνx j e iνx j+/. 0 where, for normalization, it is require that α k + β k =, k =,. The expressions for α k, β k and the eigenvalues symbols ˆQ k are: α = [ + c cos4h/ω+4c cosh/ω+4c7c 8+cosh/ω+35c 3c+8 c sinh/ω+sinh/ω ] i8c 4cosh/ω+ β = csinh/ω+sinh/ωα [ c β = + sinh/ω+sinh/ω c cos4h/ω+4 c cosh/ω+4c7c 8+cosh/ω+35c 3c+8 ] 3 where and the α = icsinh/ω+sinh/ω 4 8ccosh/ω+ β = c cos4h/ω+38c + 8c 3c cosh/ω 3c+8 5 4 ˆQ, ω= 4+ccosh/ω+3± h/. 6 It can be shown that the eigenvalues are real and non positive for c < /. It should be noted that by construction ψ k ω ψ k ν, ω ν. However, for all ω ψ ω and ψ ω are not orthogonal. Nevertheless it can be shown that they are almost perpendicular in the sense that Therefore the scheme is stable. For ωh the eigenvalues and eigenvectors are: cosθω = ψ ω,ψ ω ψ ω ψ ω > 0.9 ˆQ ω= ω + +4cω4 4c h + Oh 4 7 and c α = 3 c ωh 6 + O h 7, β = ic 4 8c ωh 3 + Oh 5 8 ˆQ ω= 4 8c h/ + 4cω + Oh 9 5
If the initial condition is α = ic c ωh + Oh 3, β = +Oh 30 v j 0=e iωx j,v j+ 0=e iωx j+ ; ω h 3 then v j t = e ω t +4cω t 4c ωh + Oh 4 e iωx j + ic 4 8c ωh 3 + Oh 5 e iνx j 3 The same expression hold for x j+. Therefore the scheme is, in general, nd order and it is 3rd order if c= /4. Note that by naive analysis of the truncation error terms, 7, one would expect to get 3rd order with c= /6. We used the approximation 6 for solving the heat equation 9, where Fx, t and the initial condition were chosen such that the exact solution is ux,t = expcosx t. The scheme was run with N = 3,64,...,04. 4th order Runge Kutta scheme was used for time integration. The plots of log 0 E vs. log 0 N for c=0,/6, /6, /4 are presented in Figure b. As can be seen, the results are as predicted by the analysis. 4 Three point Block In this section we briefly present two schemes which are based on three point block. Here we use the grid, x j = j h, h=π/n+ with the internal block nodes x j+/3 = x j + h/3 and x j+/3 = x j + h/3, j= 0,...N. Altogether there are 3N+ points with spacing of h/3. three point block, 3rd order scheme Consider the approximation: d dx u j = d dx u j+/3 = d dx u j+/3 = 4h/3 [ 4u j /3 8u j + 4u j+/3 + c u j /3 + 3u j 3u j+/3 + u j+/3 + Oh 4h/3 [ 4u j 8u j+/3 + 4u j+/3 + Oh 33 4h/3 [ 4u j+/3 8u j+/3 + 4u j+ + c u j 3u j+/3 + 3u j+/3 u j+ + Oh This scheme was run under the same conditions as the example in Section 3. As in the previous example the truncation error is of Oh, however this is a nd order scheme and 3rd order for c =.340. The convergence results are presented in Figure a. 6
a 0 0 0 3 b 0 0 4 c=0, slope: 3.994 c=.0, slope: 4.088 c=.0, slope: 4.085 c= 0.385, slope: 5.0444 0 4 0 5 0 6 0 8 0 6 0 7 0 8 c=0, slope:.0009 c=.0, slope:.007 c=.0, slope:.597 c=.340, slope:.99559 0 0 0 3 0 0 0 0 0 0 3 Fig. Convergence plots, log 0 E vs. log 0 N, for different values of c. a: Scheme 33. b: Scheme 34. three point block, 5th order scheme d dx u j = d dx u j+/3 = d dx u j+/3 = h/3 [ u j /3 + 6u j /3 30u j + 6u j+/3 u j+/3 + c u j /3 5u j /3 + 0u j 0u j+/3 + 5u j+/3 u j + Oh 3 h/3 [ u j /3 + 6u j 30u j+/3 + 6u j+/3 u j + Oh 4 34 h/3 [ u j + 6u j+/3 30u j+/3 + 6u j+ u j+4/3 + c u j /3 + 5u j 0u j+/3 + 0u j+/3 5u j+ + u j+4/3 + Oh 3 This scheme was run under the same conditions as the previous examples, with the exception that now a 6th order Runge Kutta scheme was used for time integration. Here the truncation error is of Oh 3, however this is a 4th order scheme and 5th order for c= 0.385. The convergence results are presented in Figure b. It should be noted that by taking c = the coefficients of u j /3 and u j+4/3 are 0. Therefore the scheme is more compact than standard explicit 4th order scheme in the sense that the scheme depends only on one term, on each side, out of the three point block u j,u j+/3,u j+/3. Potentially, this thinner stencil helps in the derivation of boundary schemes for initial boundary value problems. 5 Summary In this paper we presented a few block finite difference schemes in which the actual errors are much smaller than their truncation errors. This reduction of error was achieved by constructing the truncation errors to be oscillatory and using the dissipative property of the scheme. 7
A comparison between standard and block finite difference schemes in terms of the number of points out of the cell and operation count is presented in Table. As can be seen, in terms of accuracy and computational cost the 3rd and 5th order schemes are between the standards nd and 4th order and 4th and 6th order schemes respectively. Scheme Points out the block Number of operations Scheme Points out the block Number of operations at each side + at each side + standard nd order 3 point block 3rd order 3 4 standard 4th order 4 5 3 point block 3rd order 3 3 3 standard 6th order 3 6 7 3 point block 5th order 4 3 5 3 3 point block 4th order 4 5 compact Table Comparison between standard finite difference schemes and the ones presented on Sections 3,4. If c = /4 in the two point block, 3rd order scheme 6, the leading term in the error is highly oscillatory, see 3. It was suggested by Jennifer K. Ryan [8] that this term can be filtered by post processing. In this technique the high frequency error terms are filtered using convolution with a proper kernel. This method was successfully applied to the discontinuous Galerkin method. As this filtering is done only once, after the final time step, the cost is minimal, see e.g. [9], [], [3]. Here we used a global spectral filter and the local filter suggested in [3]. As can be seen in figure 3, the filtered scheme is 4th order accurate. The difference between both kernels is that the global filter is more computationally expensive, ON logn for proper values of N, but is accurate for small values of N while the local filter requires only ON operation but is accurate only for large values of N. The investigation of which is the optimal filter for these schemes is a topic for future research. 0 0 0 spectral filter, slope: 3.99978 * local filter, slope: 4.04835 no filter, slope: 3.098 0 4 0 6 0 8 0 0 0 0 0 0 3 0 4 Fig. 3 Convergence plots, log 0 E vs. log 0 N, for scheme 6, c /4. with no post processing, with spectral filter and with the filter suggested in [3]. It should be noted that that finite difference representations of discontinuous Galerkin schemes for the heat equation have a similar form to the schemes presented above. They may also present similar enhancing of accuracy. See []. This manuscript was the inspiration to the current work. As was also pointed out in [] the increasing of accuracy may be related to a phenomenon called Supra Convergence [7]. Further research of the properties and implementations of these schemes as well as the existence of these kinds of schemes for hyperbolic problems are topics for future research. 8
Acknowledgments The author would like to thank Jennifer K. Ryan, Chi Wang Shu and Sigal Gottlieb for the fruitful discussions and their help. The author would also like to thank the anonymous reviewers for their useful remarks. References. Saul Abarbanel, Adi Ditkowski, and Bertil Gustafsson, On error bounds of finite difference approximations to partial differential equationstemporal behavior and rate of convergence, Journal of Scientific Computing 5 000, no., 79 6.. Bernardo Cockburn, Mitchell Luskin, Chi-Wang Shu, and Endre Suli, Post-processing of galerkin methods for hyperbolic problems, Springer, 000. 3., Enhanced accuracy by post-processing for finite element methods for hyperbolic equations, Mathematics of Computation 7 003, no. 4, 577 606. 4. Bertil Gustafsson, The convergence rate for difference approximations to mixed initial boundary value problems, Mathematics of Computation 9 975, no. 30, 396 406. 5., The convergence rate for difference approximations to general mixed initial-boundary value problems, SIAM Journal on Numerical Analysis 8 98, no., 79 90. 6. Bertil Gustafsson, Heinz-Otto Kreiss, and Joseph Oliger, Time-dependent problems and difference methods, John Wiley & Sons, 995. 7. H-O Kreiss, Thomas A Manteuffel, B Swartz, B Wendroff, and AB White, Supra-convergent schemes on irregular grids, Mathematics of Computation 47 986, no. 76, 537 554. 8. Jennifer Ryan, Privet communucation. 9. Jennifer Ryan, Chi-Wang Shu, and Harold Atkins, Extension of a post processing technique for the discontinuous galerkin method for hyperbolic equations with application to an aeroacoustic problem, SIAM Journal on Scientific Computing 6 005, no. 3, 8 843. 0. Magnus Svärd and Jan Nordström, On the order of accuracy for difference approximations of initial-boundary value problems, Journal of Computational Physics 8 006, no., 333 35.. Mengping Zhang and Chi-Wang Shu, An analysis of three different formulations of the discontinuous galerkin method for diffusion equations, Mathematical Models and Methods in Applied Sciences 3 003, no. 03, 395 43. 9