spectral methods for time-dependent problems

281

Upload: lei-wang

Post on 22-Oct-2014

224 views

Category:

Documents


8 download

TRANSCRIPT

Page 2: Spectral Methods for Time-Dependent Problems

CAMBRIDGE MONOGRAPHS ONAPPLIED AND COMPUTATIONALMATHEMATICS

Series Editors

M. ABLOWITZ, S. DAVIS, S. HOWISON, A. ISERLES, A. MAJDA,

J. OCKENDON, P. OLVER

21 Spectral Methods for Time-DependentProblems

Page 3: Spectral Methods for Time-Dependent Problems

The Cambridge Monographs on Applied and Computational Mathematics reflects thecrucial role of mathematical and computational techniques in contemporary science. Theseries publishes expositions on all aspects of applicable and numerical mathematics, withan emphasis on new developments in this fast-moving area of research.

State-of-the-art methods and algorithms as well as modern mathematical descriptionsof physical and mechanical ideas are presented in a manner suited to graduate researchstudents and professionals alike. Sound pedagogical presentation is a prerequisite. It isintended that books in the series will serve to inform a new generation of researchers.

Also in this series:

1. A Practical Guide to Pseudospectral Methods, Bengt Fornberg

2. Dynamical Systems and Numerical Analysis, A. M. Stuart and A. R. Humphries

3. Level Set Methods and Fast Marching Methods, J. A. Sethian

4. The Numerical Solution of Integral Equations of the Second Kind, Kendall

E. Atkinson

5. Orthogonal Rational Functions, Adhemar Bultheel, Pablo Gonzalez-Vera, Erik

Hendiksen, and Olav Njastad

6. The Theory of Composites, Graeme W. Milton

7. Geometry and Topology for Mesh Generation, Herbert Edelsbrunner

8. Schwarz-Christoffel Mapping, Tofin A. Driscoll and Lloyd N. Trefethen

9. High-Order Methods for Incompressible Fluid Flow, M. O. Deville, P. F. Fischer,

and E. H. Mund

10. Practical Extrapolation Methods, Avram Sidi

11. Generalized Riemann Problems in Computational Fluid Dynamics, Matania

Ben-Artzi and Joseph Falcovitz

12. Radial Basis Functions: Theory and Implementations, Martin D. Buhmann

13. Iterative Krylov Methods for Large Linear Systems, Henk A. van der Vorst

14. Simulating Hamiltonian Dynamics, Ben Leimkuhler and Sebastian Reich

15. Collocation Methods for Volterra Integral and Related Functional Equations,

Hermann Brunner

16. Topology for computing, Afra J. Zomordia

17. Scattered Data Approximation, Holger Wendland

19. Matrix Preconditioning Techniques and Applications, Ke Chen

22. The Mathematical Foundations of Mixing, Rob Sturman, Julio M. Ottino and

Stephen Wiggins

Page 4: Spectral Methods for Time-Dependent Problems

Spectral Methods for Time-DependentProblems

JAN S. HESTHAVEN

Brown University

SIGAL GOTTLIEB

University of Massachusetts, Dartmouth

DAVID GOTTLIEB

Brown University

Page 5: Spectral Methods for Time-Dependent Problems

For our children and grandchildren

Page 6: Spectral Methods for Time-Dependent Problems

Contents

Introduction 1

1 From local to global approximation 51.1 Comparisons of finite difference schemes 91.2 The Fourier spectral method: first glance 16

2 Trigonometric polynomial approximation 192.1 Trigonometric polynomial expansions 192.2 Discrete trigonometric polynomials 242.3 Approximation theory for smooth functions 34

3 Fourier spectral methods 433.1 Fourier–Galerkin methods 433.2 Fourier–collocation methods 483.3 Stability of the Fourier–Galerkin method 523.4 Stability of the Fourier–collocation method for hyperbolic

problems I 543.5 Stability of the Fourier–collocation method for hyperbolic

problems II 583.6 Stability for parabolic equations 623.7 Stability for nonlinear equations 643.8 Further reading 65

4 Orthogonal polynomials 664.1 The general Sturm–Liouville problem 674.2 Jacobi polynomials 69

5 Polynomial expansions 795.1 The continuous expansion 795.2 Gauss quadrature for ultraspherical polynomials 83

vii

Page 7: Spectral Methods for Time-Dependent Problems

viii Contents

5.3 Discrete inner products and norms 885.4 The discrete expansion 89

6 Polynomial approximation theory for smooth functions 1096.1 The continuous expansion 1096.2 The discrete expansion 114

7 Polynomial spectral methods 1177.1 Galerkin methods 1177.2 Tau methods 1237.3 Collocation methods 1297.4 Penalty method boundary conditions 133

8 Stability of polynomial spectral methods 1358.1 The Galerkin approach 1358.2 The collocation approach 1428.3 Stability of penalty methods 1458.4 Stability theory for nonlinear equations 1508.5 Further reading 152

9 Spectral methods for nonsmooth problems 1539.1 The Gibbs phenomenon 1549.2 Filters 1609.3 The resolution of the Gibbs phenomenon 1749.4 Linear equations with discontinuous solutions 1829.5 Further reading 186

10 Discrete stability and time integration 18710.1 Stability of linear operators 18810.2 Standard time integration schemes 19210.3 Strong stability preserving methods 19710.4 Further reading 202

11 Computational aspects 20411.1 Fast computation of interpolation and differentiation 20411.2 Computation of Gaussian quadrature points and weights 21011.3 Finite precision effects 21411.4 On the use of mappings 225

12 Spectral methods on general grids 23512.1 Representing solutions and operators on general grids 23612.2 Penalty methods 238

Page 8: Spectral Methods for Time-Dependent Problems

Contents ix

12.3 Discontinuous Galerkin methods 24612.4 References and further reading 248

Appendix A Elements of convergence theory 249

Appendix B A zoo of polynomials 252B.1 Legendre polynomials 252B.2 Chebyshev polynomials 255

Bibliography 260Index 272

Page 9: Spectral Methods for Time-Dependent Problems

Introduction

The purpose of this book is to collect, in one volume, all the ingredients nec-essary for the understanding of spectral methods for time-dependent problems,and, in particular, hyperbolic partial differential equations. It is intended asa graduate-level text, covering not only the basic concepts in spectral meth-ods, but some of the modern developments as well. There are already severalexcellent books on spectral methods by authors who are well-known and activeresearchers in this field. This book is distinguished by the exclusive treatmentof time-dependent problems, and so the derivation of spectral methods is influ-enced primarily by the research on finite-difference schemes, and less so by thefinite-element methodology. Furthermore, this book is unique in its focus onthe stability analysis of spectral methods, both for the semi-discrete and fullydiscrete cases. In the book we address advanced topics such as spectral meth-ods for discontinuous problems and spectral methods on arbitrary grids, whichare necessary for the implementation of pseudo-spectral methods on complexmulti-dimensional domains.

In Chapter 1, we demonstrate the benefits of high order methods using phaseerror analysis. Typical finite difference methods use a local stencil to computethe derivative at a given point; higher order methods are then obtained by using awider stencil, i.e., more points. The Fourier spectral method is obtained by usingall the points in the domain. In Chapter 2, we discuss the trigonometric poly-nomial approximations to smooth functions, and the associated approximationtheory for both the continuous and the discrete case. In Chapter 3, we presentFourier spectral methods, using both the Galerkin and collocation approaches,and discuss their stability for both hyperbolic and parabolic equations. We alsopresent ways of stabilizing these methods, through super viscosity or filtering.

Chapter 4 features a discussion of families of orthogonal polynomials whichare eigensolutions of a Sturm–Liouville problem. We focus on the Legendre andChebyshev polynomials, which are suitable for representing functions on finite

1

Page 10: Spectral Methods for Time-Dependent Problems

2 Introduction

domains. In this chapter, we present the properties of Jacobi polynomials, andtheir associated recursion relations. Many useful formulas can be found in thischapter. In Chapter 5, we discuss the continuous and discrete polynomial expan-sions based on Jacobi polynomials; in particular, the Legendre and Chebyshevpolynomials. We present the Gauss-type quadrature formulas, and the differentpoints on which each is accurate. Finally, we discuss the connections betweenLagrange interpolation and electrostatics. Chapter 6 presents the approximationtheory for polynomial expansions of smooth functions using the ultraspheri-cal polynomials. Both the continuous and discrete expansions are discussed.This discussion sets the stage for Chapter 7, in which we introduce polynomialspectral methods, useful for problems with non-periodic boundary conditions.We present the Galerkin, tau, and collocation approaches and give examplesof the formulation of Chebyshev and Legendre spectral methods for a varietyof problems. We also introduce the penalty method approach for dealing withboundary conditions. In Chapter 8 we analyze the stability properties of themethods discussed in Chapter 7.

In the final chapters, we introduce some more advanced topics. In Chapter 9we discuss the spectral approximations of non-smooth problems. We addressthe Gibbs phenomenon and its effect on the convergence rate of these approxi-mations, and present methods which can, partially or completely, overcome theGibbs phenomenon. We present a variety of filters, both for Fourier and poly-nomial methods, and an approximation theory for filters. Finally, we discussthe resolution of the Gibbs phenomenon using spectral reprojection methods.In Chapter 10, we turn to the issues of time discretization and fully discretestability. We discuss the eigenvalue spectrum of each of the spectral spatialdiscretizations, which provides a necessary, but not sufficient, condition forstability. We proceed to the fully discrete analysis of the stability of the forwardEuler time discretization for the Legendre collocation method. We then presentsome of the standard time integration methods, especially the Runge–Kuttamethods. At the end of the chapter, we introduce the class of strong stabilitypreserving methods and present some of the optimal schemes. In Chapter 11, weturn to the computational issues which arise when using spectral methods, suchas the use of the fast Fourier transform for interpolation and differentiation, theefficient computation of the Gauss quadrature points and weights, and the effectof round-off errors on spectral methods. Finally, we address the use of map-pings for treatment of non-standard intervals and for improving accuracy in thecomputation of higher order derivatives. In Chapter 12, we talk about the imple-mentation of spectral methods on general grids. We discuss how the penaltymethod formulation enables the use of spectral methods on general grids in onedimension, and in complex domains in multiple dimensions, and illustrate this

Page 11: Spectral Methods for Time-Dependent Problems

Introduction 3

using both the Galerkin and collocation approaches. We also show how penaltymethods allow us to easily generalize to complicated boundary conditions andon triangular meshes. The discontinuous Galerkin method is an alternative wayof deriving these schemes, and penalty methods can thus be used to constructmethods based on multiple spectral elements.

Chapters 1, 2, 3, 5, 6, 7, 8 of the book comprise a complete first coursein spectral methods, covering the motivation, derivation, approximation the-ory and stability analysis of both Fourier and polynomial spectral methods.Chapters 1, 2, and 3 can be used to introduce Fourier methods within a courseon numerical solution of partial differential equations. Chapters 9, 10, 11, and12 address advanced topics and are thus suitable for an advanced course inspectral methods. However, depending on the focus of the course, many othercombinations are possible.

A good resource for use with this book is PseudoPack. PseudoPack Rioand PseudoPack 2000 are software libraries in Fortran 77 and Fortran 90(respectively) for numerical differentiation by pseudospectral methods, cre-ated by Wai Sun Don and Bruno Costa. More information can be foundat http://www.labma.ufrj.br/bcosta/pseudopack/main.html and http://www.labma.ufrj.br/bcosta/pseudopack2000/main.html.

As the oldest author of this book, I (David Gottlieb) would like to take aparagraph or so to tell you my personal story of involvement in spectral meth-ods. This is a personal narrative, and therefore may not be an accurate historyof spectral methods. In 1973 I was an instructor at MIT, where I met SteveOrszag, who presented me with the problem of stability of polynomial methodsfor hyperbolic equations. Working on this, I became aware of the pioneeringwork of Orszag and his co-authors and of Kreiss and his co-authors on Fourierspectral methods. The work on polynomial spectral methods led to the bookNumerical Analysis of Spectral Methods: Theory and Applications by SteveOrszag and myself, published by SIAM in 1977. At this stage, spectral meth-ods enjoyed popularity among the practitioners, particularly in the meteorol-ogy and turbulence community. However, there were few theoretical results onthese methods. The situation changed after the summer course I gave in 1979 inFrance. P. A. Raviart was a participant in this course, and his interest in spectralmethods was sparked. When he returned to Paris he introduced his postdoc-toral researchers, Claudio Canuto and Alfio Quarteroni, and his students, YvonMaday and Christine Bernardi, to these methods. The work of this Europeangroup led to an explosion of spectral methods, both in theory and applications.After this point, the field became too extensive to further review it. Nowadays,I particularly enjoy the experience of receiving a paper on spectral methodswhich I do not understand. This is an indication of the maturity of the field.

Page 12: Spectral Methods for Time-Dependent Problems

4 Introduction

The following excellent books can be used to deepen one’s understandingof many aspects of spectral methods. For a treatment of spectral methods forincompressible flows, the interested reader is referred to the classical book byC. Canuto, M. Y. Hussaini, A. Quarteroni and T. A. Zang, Spectral Methods:Fundamentals in single domains (2006), the more recent Spectral Methods forIncompressible Viscous Flow (2002) by R. Peyret and the modern text High-Order Methods in Incompressible Fluid Flows (2002) by M. Deville, P. F.Fischer, and E. Mund (2002). The book Spectral/hp Methods in ComputationalFluid Dynamics, by G. E. Karniadakis and S. J. Sherwin (2005), deals withmany important practical aspects of spectral methods computations for largescale fluid dynamics application. A comprehensive discussion of approxima-tion theory may be found in Approximations Spectrales De Problemes AuxLimites Elliptiques (1992) by C. Bernardi and Y. Maday and in PolynomialApproximation of Differential Equations (1992) by D. Funaro. Many interest-ing results can be found in the book by B. -Y. Guo, Spectral Methods andtheir Applications (1998). For those wishing to implement spectral methods inMatlab, a good supplement to this book is Spectral Methods in Matlab (2000), byL. N. Trefethen.

For the treatment of spectral methods as a limit of high order finite differ-ence methods, see A Practical Guide to Pseudospectral Methods (1996) byB. Fornberg. For a discussion of spectral methods to solve boundary value andeigenvalue problems, as well as Hermite, Laguerre, rational Chebyshev, sinc,and spherical harmonic functions, see Chebyshev and Fourier Spectral Methods(2000) by J. P. Boyd.

This text has as its foundation the work of many researchers who make upthe vibrant spectral methods community. A complete bibliography of spectralmethods is a book in and of itself. In our list of references we present only apartial list of those papers which have direct relevance to the text. This necessaryprocess of selection meant that many excellent papers and books were excluded.For this, we apologize.

Page 13: Spectral Methods for Time-Dependent Problems

1

From local to global approximation

Spectral methods are global methods, where the computation at any given pointdepends not only on information at neighboring points, but on information fromthe entire domain. To understand the idea of a global method, we begin byconsidering local methods, and present the global Fourier method as a limit oflocal finite difference approximations of increasing orders of accuracy. We willintroduce phase error analysis, and using this tool we will show the merits ofhigh-order methods, and in particular, their limit: the Fourier method. The phaseerror analysis leads to the conclusion that high-order methods are beneficialfor problems requiring well resolved fine details of the solution or long timeintegrations.

Finite difference methods are obtained by approximating a function u(x) bya local polynomial interpolant. The derivatives of u(x) are then approximatedby differentiating this local polynomial. In this context, local refers to the useof nearby grid points to approximate the function or its derivative at a givenpoint.

For slowly varying functions, the use of local polynomial interpolants basedon a small number of interpolating grid points is very reasonable. Indeed, itseems to make little sense to include function values far away from the point ofinterest in approximating the derivative. However, using low-degree local poly-nomials to approximate solutions containing very significant spatial or temporalvariation requires a very fine grid in order to accurately resolve the function.Clearly, the use of fine grids requires significant computational resources insimulations of interest to science and engineering. In the face of such limita-tions we seek alternative schemes that will allow coarser grids, and thereforefewer computational resources. Spectral methods are such methods; they useall available function values to construct the necessary approximations. Thus,they are global methods.

5

Page 14: Spectral Methods for Time-Dependent Problems

6 From local to global approximation

Example 1.1 Consider the wave equation∂u

∂t= −2π

∂u

∂x0 ≤ x ≤ 2π, (1.1)

u(x, 0) = esin(x),

with periodic boundary conditions.The exact solution to Equation (1.1) is a right-moving wave of the form

u(x, t) = esin(x−2π t),

i.e., the initial condition is propagating with a speed 2π .In the following, we compare three schemes, each of different order of

accuracy, for the solution of Equation (1.1) using the uniform grid

x j = j�x = 2π j

N + 1, j ∈ [0, . . . , N ]

(where N is an even integer).

Second-order finite difference scheme A quadratic local polynomial inter-polant to u(x) in the neighborhood of x j is given by

u(x) = 1

2�x2(x − x j )(x − x j+1)u j−1 − 1

�x2(x − x j−1)(x − x j+1)u j

+ 1

2�x2(x − x j−1)(x − x j )u j+1. (1.2)

Differentiating this formula yields a second-order centered-difference approx-imation to the derivative du/dx at the grid point x j :

du

dx

∣∣∣∣x j

= u j+1 − u j−1

2�x.

High-order finite difference scheme Similarly, differentiating the inter-polant based on the points {x j−2, x j−1, x j , x j+1, x j+2} yields the fourth-ordercentered-difference scheme

du

dx

∣∣∣∣x j

= 1

12�x(u j−2 − 8u j−1 + 8u j+1 − u j+2).

Global scheme Using all the available grid points, we obtain a global scheme.For each point x j we use the interpolating polynomial based on the points{x j−k, . . . , x j+k} where k = N/2. The periodicity of the problem furnishes uswith the needed information at any grid point. The derivative at the grid pointsis calculated using a matrix-vector product

du

dx

∣∣∣∣x j

=N∑

i=0

D j i ui ,

Page 15: Spectral Methods for Time-Dependent Problems

From local to global approximation 7

100 101 102 10310−11

10−9

10−7

10−5

10−3

10−1

L∞

N

Finite difference

Finite difference4th-order

Spectral

CFL << 1CFL ∼ 1

2nd-order

method

Figure 1.1 The maximum pointwise (L∞) error of the numerical solution of Exam-ple 1.1, measured at t = π , obtained using second-order, fourth-order and globalspectral schemes as a function of the total number of points, N . Here the Courant–Friedrichs–Lewy coefficient, CFL = �t/�x .

where the entries of the matrix is D are

D j i ={

(−1) j+i

2

[sin

(( j−i)π

N+1

)]−1i �= j,

0 i = j.

The formal proof of this will be given in Section 1.1.3. This approach is equiv-alent to an infinite-order finite difference method as well as a Fourier spectralmethod.

To advance Equation (1.1) in time, we use the classical fourth-order Runge–Kutta method with a sufficiently small time-step, �t , to ensure stability.

Now, let’s consider the dependence of the maximum pointwise error (theL∞-error) on the number of grid points N . In Figure 1.1 we plot the L∞-errorat t = π for an increasing number of grid points. It is clear that the higher theorder of the method used for approximating the spatial derivative, the moreaccurate it is. Indeed, the error obtained with N = 2048 using the second-orderfinite difference scheme is the same as that computed using the fourth-ordermethod with N = 128, or the global method with only N = 12. It is also evidentthat by lowering �t for the global method one can obtain even more accurateresults, i.e., the error in the global scheme is dominated by time-stepping errorsrather than errors in the spatial discretization.

Figure 1.2 shows a comparison between the local second-order finite differ-ence scheme and the global method following a long time integration. Again,we clearly observe that the global scheme is superior in accuracy to the localscheme, even though the latter scheme employs 20 times as many grid pointsand is significantly slower.

Page 16: Spectral Methods for Time-Dependent Problems

8 From local to global approximation

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 200

t = 0.0

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 10

t = 0.0

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 200

t = 100.0

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 10

t = 100.0

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 200

t = 200.0

x

0.0

0.5

1.0

1.5

2.0

2.5

3.0

U(x

,t)

0 p/2 p 3p/2 2p

N = 10

t = 200.0

Figure 1.2 An illustration of the impact of using a global method for problemsrequiring long time integration. On the left we show the solution of Equation (1.1)computed using a second-order centered-difference scheme. On the right we showthe same problem solved using a global method. The full line represents the com-puted solution, while the dashed line represents the exact solution.

Page 17: Spectral Methods for Time-Dependent Problems

1.1 Comparisons of finite difference schemes 9

1.1 Comparisons of finite difference schemes

The previous example illustrates that global methods are superior in perfor-mance to local methods, not only when very high spatial resolution is requiredbut also when long time integration is important. In this section, we shall intro-duce the concept of phase error analysis in an attempt to clarify the observa-tions made in the previous section. The analysis confirms that high-order and/orglobal methods are a better choice when very accurate solutions or long timeintegrations on coarse grids are required. It is clear that the computing needs ofthe future require both.

1.1.1 Phase error analysis

To analyze the phase error associated with a particular spatial approximationscheme, let’s consider, once again, the linear wave problem

∂u

∂t= −c

∂u

∂x0 ≤ x ≤ 2π, (1.3)

u(x, 0) = eikx ,

with periodic boundary conditions, where i = √−1 and k is the wave number.The solution to Equation (1.3) is a travelling wave

u(x, t) = eik(x−ct), (1.4)

with phase speed c.Once again, we use the equidistant grid

x j = j�x = 2π j

N + 1, j ∈ [0, . . . , N ].

The 2m-order approximation of the derivative of a function f (x) is

d f

dx

∣∣∣∣x j

=m∑

n=1

αmn Dn f (x j ), (1.5)

where

Dn f (x j ) = f (x j + n�x) − f (x j − n�x)

2n�x= f j+n − f j−n

2n�x, (1.6)

and the weights, αmn , are

αmn = −2(−1)n (m!)2

(m − n)!(m + n)!. (1.7)

Page 18: Spectral Methods for Time-Dependent Problems

10 From local to global approximation

In the semi-discrete version of Equation (1.3) we seek a vector v =(v0(t), . . . , vN (t)) which satisfies

dv j

dt= −c

m∑n=1

αmn Dnv j , (1.8)

v j (0) = eikx j .

We may interpret the grid vector, v, as a vector of grid point values of atrigonometric polynomial, v(x, t), with v(x j , t) = v j (t), such that

∂v

∂t= −c

m∑n=1

αmn Dnv(x, t), (1.9)

v(x, 0) = eikx .

If v(x, t) satisfies Equation (1.9), the solution to Equation (1.8) is given byv(x j , t). The solution to Equation (1.9) is

v(x, t) = eik(x−cm (k)t), (1.10)

where cm(k) is the numerical wave speed. The dependence of cm on the wavenumber k is known as the dispersion relation.

The phase error em(k), is defined as the leading term in the relative errorbetween the actual solution u(x, t) and the approximate solution v(x, t):∣∣∣∣u(x, t) − v(x, t)

u(x, t)

∣∣∣∣ = ∣∣1 − eik(c−cm (k))t∣∣ � |k(c − cm(k))t | = em(k).

As there is no difference in the amplitude of the two solutions, the phase erroris the dominant error, as is clearly seen in Figure 1.2.

In the next section we will compare the phase errors of the schemes inExample 1.1. In particular, this analysis allows us to identify the most efficientscheme satisfying the phase accuracy requirement over a specified period oftime.

1.1.2 Finite-order finite difference schemes

Applying phase error analysis to the second-order finite difference schemeintroduced in Example 1.1, i.e.,

∂v(x, t)

∂t= −c

v(x + �x, t) − v(x − �x, t)

2�x,

v(x, 0) = eikx ,

Page 19: Spectral Methods for Time-Dependent Problems

1.1 Comparisons of finite difference schemes 11

we obtain the numerical phase speed

c1(k) = csin(k�x)

k�x.

For �x � 1,

c1(k) = c

(1 − (k�x)2

6+ O((k�x)4)

),

confirming the second-order accuracy of the scheme.For the fourth-order scheme considered in Example 1.1,

∂v(x, t)

∂t= − c

12�x(v(x − 2�x, t) − 8v(x − �x, t) + 8v(x + �x, t)

− v(x + 2�x, t)),

we obtain

c2(k) = c8 sin(k�x) − sin(2k�x)

6k�x.

Again, for �x � 1 we recover the approximation

c2(k) = c

(1 − (k�x)4

30+ O((k�x)6)

),

illustrating the expected fourth-order accuracy.Denoting e1(k, t) as the phase error of the second-order scheme and e2(k, t)

as the phase error of the fourth-order scheme, with the corresponding numericalwave speeds c1(k) and c2(k), we obtain

e1(k, t) = kct

∣∣∣∣1 − sin(k�x)

k�x

∣∣∣∣ , (1.11)

e2(k, t) = kct

∣∣∣∣1 − 8 sin(k�x) − sin(2k�x)

6k�x

∣∣∣∣ .When considering wave phenomena, the critical issue is the number p of gridpoints needed to resolve a wave. Since the solution of Equation (1.3) has kwaves in the domain (0, 2π ), the number of grid points is given by

p = N + 1

k= 2π

k�x.

Note that it takes a minimum of two points per wavelength to uniquely specifya wave, so p has a theoretical minimum of 2.

It is evident that the phase error is also a function of time. In fact, theimportant quantity is not the time elapsed, but rather the number of timesthe solution returns to itself under the assumption of periodicity. We denote thenumber of periods of the phenomenon by ν = kct/2π .

Page 20: Spectral Methods for Time-Dependent Problems

12 From local to global approximation

Rewriting the phase error in terms of p and ν yields

e1(p, ν) = 2πν

∣∣∣∣1 − sin(2πp−1)

2πp−1

∣∣∣∣ , (1.12)

e2(p, ν) = 2πν

∣∣∣∣1 − 8 sin(2πp−1) − sin(4πp−1)

12πp−1

∣∣∣∣ .The leading order approximation to Equation (1.12) is

e1(p, ν) � πν

3

(2π

p

)2

, (1.13)

e2(p, ν) � πν

15

(2π

p

)4

,

from which we immediately observe that the phase error is directly proportionalto the number of periods ν i.e., the error grows linearly in time.

We arrive at a more straightforward measure of the error of the scheme byintroducing pm(εp, ν) as a measure of the number of points per wavelengthrequired to guarantee a phase error, ep ≤ εp, after ν periods for a 2m-orderscheme. Indeed, from Equation (1.13) we directly obtain the lower bounds

p1(ε, ν) ≥ 2π

√νπ

3εp, (1.14)

p2(ε, ν) ≥ 2π 4

√πν

15εp,

on pm , required to ensure a specific error εp.It is immediately apparent that for long time integrations (large ν), p2 � p1,

justifying the use of high-order schemes. In the following examples, we willexamine the required number of points per wavelength as a function of thedesired accuracy.

Example 1.2

εp = 0.1 Consider the case in which the desired phase error is ≤ 10%. Forthis relatively large error,

p1 ≥ 20√

ν, p2 ≥ 7 4√

ν.

We recall that the fourth-order scheme is twice as expensive as the second-order scheme, so not much is gained for short time integration. However, as ν

increases the fourth-order scheme clearly becomes more attractive.

εp = 0.01 When the desired phase error is within 1%, we have

p1 ≥ 64√

ν, p2 ≥ 13 4√

ν.

Page 21: Spectral Methods for Time-Dependent Problems

1.1 Comparisons of finite difference schemes 13

Here we observe a significant advantage in using the fourth-order scheme, evenfor short time integration.

εp = 10−5 This approximately corresponds to the minimum error displayedin Figure 1.1. We obtain

p1 ≥ 643√

ν, p2 ≥ 43 4√

ν,

as is observed in Figure 1.1, which confirms that high-order methods are supe-rior when high accuracy is required.

Sixth-order method As an illustration of the general trend in the behavior ofthe phase error, we give the bound on p3(εp, ν) for the sixth-order centered-difference scheme as

p3(εp, ν) ≥ 2π 6

√πν

70εp,

for which the above special cases become

p3(0.1, ν) = 5 6√

ν, p3(0.01, ν) = 8 6√

ν, p3(10−5, ν) = 26 6√

ν,

confirming that when high accuracy is required, a high-order method is theoptimal choice. Indeed, sixth-order schemes are the methods of choice formany modern turbulence calculations.

While the number of points per wavelength gives us an indication of the meritsof high-order schemes, the true measure of efficiency is the work needed toobtain a predefined bound on the phase error. We thus define a measure of workper wavelength when integrating to time t ,

Wm = 2m × pm × t

�t.

This measure is a product of the number of function evaluations 2m, points perwavelength pm = 2π

k�x , and the total number of time steps t�t . Using ν = kct

we obtain

Wm = 2mpmt

�t

= 2mpm2πν

kc�t

= 2mpm2πν

kc �t�x �x

= 2mpm2πν

kC F Lm�x

= 2mpmνpm

C F Lm,

Page 22: Spectral Methods for Time-Dependent Problems

14 From local to global approximation

0 0.25 0.5 0.75 1n

0

50

100

150

200

250

300

350

ep = 0.1

W1

W2

W3

0 0.25 0.5 0.75 1n

0

500

1000

1500

2000

2500

3000

3500

ep = 0.01

W1

W2

W3

Figure 1.3 The growth of the work function, Wm , for various finite differenceschemes is given as a function of time, ν, in terms of periods. On the left we showthe growth for a required phase error of εp = 0.1, while the right shows the resultof a similar computation with εp = 0.01, i.e., a maximum phase error of less than1%.

where C F Lm = c �t�x refers to the C F L bound for stability. We assume that the

fourth-order Runge–Kutta method will be used for time discretization. For thismethod it can be shown that C F L1 = 2.8, C F L2 = 2.1, and C F L3 = 1.75.Thus, the estimated work for second, fourth, and sixth-order schemes is

W1 � 30νν

εp, W2 � 35ν

√ν

εp, W3 � 48ν 3

√ν

εp. (1.15)

In Figure 1.3 we illustrate the approximate work associated with the differentschemes as a function of required accuracy and time. It is clear that even forshort time integrations, high-order methods are the most appropriate choicewhen accuracy is the primary consideration. Moreover, it is evident that forproblems exhibiting unsteady behavior and thus needing long time integrations,high-order methods are needed to minimize the work required for solving theproblem.

1.1.3 Infinite-order finite difference schemes

In the previous section, we showed the merits of high-order finite differencemethods for time-dependent problems. The natural question is, what happensas we take the order higher and higher? How can we construct an infinite-orderscheme, and how does it perform?

In the following we will show that the limit of finite difference schemes isthe global method presented in Example 1.1. In analogy to Equation (1.5), the

Page 23: Spectral Methods for Time-Dependent Problems

1.1 Comparisons of finite difference schemes 15

infinite-order method is given by

du

dx

∣∣∣∣x j

=∞∑

n=1

α∞n

u j+n − u j−n

2n�x.

To determine the values of α∞n , we consider the function eilx . The approximation

formula should be exact for all such trigonometric polynomials. Thus, α∞n

should satisfy

ileilx =∞∑

n=1

α∞n

ei(x+n�x)l − ei(x−n�x)l

2n�x

=∞∑

n=1

α∞n

ein�xl − e−in�xl

2n�xeilx

=∞∑

n=1

α∞n

2i sin(nl�x)

2n�xeilx ,

so

l =∞∑

n=1

α∞n

sin(nl�x)

n�x.

We denote l�x = ξ , to emphasize that α∞n /n are the coefficients of the Fourier

sine expansion of ξ ,

ξ =∞∑

n=1

α∞n

nsin(nξ ),

and are therefore given by α∞n = 2(−1)n+1, n ≥ 1. Extending this definition

over the integers, we get

α∞n =

{2(−1)n+1 n �= 00 n = 0.

Substituting �x = 2πN+1 , we obtain

du

dx

∣∣∣∣x j

= N + 1

∞∑n=−∞

α∞n

nu j+n.

As we assume that the function u(x, t) is 2π -periodic, we have the identity

u j+n = u j+n+p(N+1), p = 0, ±1, ±2 . . .

Page 24: Spectral Methods for Time-Dependent Problems

16 From local to global approximation

Rearranging the summation in the approximation yields

du

dx

∣∣∣∣x j

= N + 1

N− j∑n=− j

( ∞∑p=−∞

α∞n+p(N+1)

n + p(N + 1)

)u j+n

= 1

N− j∑n=− j

−(−1)n

( ∞∑p=−∞

(−1)p(N+1)

p + n/(N + 1)

)u j+n

= 1

N− j∑n=− j

−(−1)n

( ∞∑p=−∞

(−1)p

p + n/(N + 1)

)u j+n.

Using the identity∑∞

k=−∞(−1)k

k+x = πsin(πx) , and the substitution i = j + n,

du

dx

∣∣∣∣x j

= 1

N− j∑n=− j

−(−1)n π

sin(πn/(N + 1))u j+n

=N∑

i=0

1

2(−1) j+i

[sin

N + 1( j − i)

)]−1

ui .

Hence, we obtain the remarkable result that the infinite-order finite differenceapproximation of the spatial derivative of a periodic function can be exactlyimplemented through the use of the differentiation matrix, D, as we saw inExample 1.1. As we shall see in the next section, the exact same formulationarises from the application of Fourier spectral methods. As we shall also see,the number of points per wavelength for the global scheme attains the minimumof p∞ = 2 for a well-resolved wave.

1.2 The Fourier spectral method: first glance

An alternative way of obtaining the global method is to use trigonometricpolynomials to interpolate the function f (x) at the points xl ,

fN (x) =N∑

l=0

f (xl)hl(x),

where the Lagrange trigonometric polynomials are

hl(x) = 1

N + 1

sin(

N+12 (x − xl)

)sin

(12 (x − xl)

) =N2∑

k=− N2

eik(x−xl ).

The interpolating polynomial is thus exact for all trigonometric polynomials ofdegree N/2.

Page 25: Spectral Methods for Time-Dependent Problems

1.2 The Fourier spectral method: first glance 17

In a Fourier spectral method applied to the partial differential equation

∂u

∂t= −c

∂u

∂x0 ≤ x ≤ 2π,

u(x, 0) = eikx

with periodic boundary conditions, we seek a trigonometric polynomial of theform

v(x, t) =N∑

l=0

v(xl , t)hl(x),

such that

∂v

∂t= −c

∂v

∂x, (1.16)

at the points x = x j , j = 0, . . . , N .

The derivative of v at the points x j is given by

∂v

∂x

∣∣∣∣x j

=N∑

l=0

v(xl , t)h′l(x j ),

where

h′l(x j ) = (−1) j+l

2

[sin

N + 1( j − l)

)]−1

.

Thus,

dv

dt

∣∣∣∣x j

= −cN∑

l=0

(−1) j+l

2

[sin

N + 1( j − l)

)]−1

v(xl , t).

The initial condition v(x, 0) is the interpolant of the function eikx ,

v(x, 0) =N∑

l=0

eikxl hl(x).

This is a Fourier–collocation method, which is identical to the infinite-orderfinite difference scheme derived above.

It is important to note that since both sides of Equation (1.16) are trigono-metric polynomials of degree N/2, and agree at N + 1 points, they must beidentically equal, i.e.,

∂v

∂t= −c

∂v

∂xfor all x .

This is a fundamental argument in spectral methods, and will be seen frequentlyin the analysis.

Page 26: Spectral Methods for Time-Dependent Problems

18 From local to global approximation

Note that if k ≤ N/2, the same argument implies that v(x, 0) = eikx , andtherefore

v(x, t) = eik(x−ct).

Thus, we require two points per wavelength (N/k = p∞ ≥ 2) to resolve theinitial conditions, and thus to resolve the wave. The spectral method requiresonly the theoretical minimum number of points to resolve a wave. Let’s thinkabout how spectral methods behave when an insufficient number of pointsis given: in the case, N = 2k − 2, the spectral approximation to the initialcondition eikx is uniformly zero. This example gives the unique flavor of spectralmethods: when the number of points is insufficient to resolve the wave, the errordoes not decay. However, as soon as a sufficient number of points are used, wesee infinite-order convergence.

Note also that, in contrast to finite difference schemes, the spatial discretiza-tion does not cause deterioration in terms of the phase error as time progresses.The only source contributing to phase error is the temporal discretization.

1.3 Further reading

The phase error analysis first appears in a paper by Kreiss and Oliger (1972), inwhich the limiting Fourier case was discussed as well. These topics have beenfurther explored in the texts by Gustafsson, Kreiss, and Oliger (1995), and byFornberg (1996).

Page 27: Spectral Methods for Time-Dependent Problems

2

Trigonometric polynomial approximation

The first spectral methods computations were simulations of homogeneousturbulence on periodic domains. For that type of problem, the natural choiceof basis functions is the family of (periodic) trigonometric polynomials. In thischapter, we will discuss the behavior of these trigonometric polynomials whenused to approximate smooth functions. We will consider the properties of boththe continuous and discrete Fourier series, and come to an understanding of thefactors determining the behavior of the approximating series.

We begin by discussing the classical approximation theory for the contin-uous case, and continue with the more modern theory for the discrete Fourierapproximation.

For the sake of simplicity, we will consider functions of only one vari-able, u(x), defined on x ∈ [0, 2π ]. Also, we restrict ourselves in this chapterto functions having a continuous periodic extension, i.e., u(x) ∈ C0

p[0, 2π ]. InChapter 9, we will discuss the trigonometric series approximation for functionswhich are non-periodic, or discontinuous but piecewise smooth. We shall seethat although trigonometric series approximations of piecewise smooth func-tions converge very slowly, the approximations contain high-order informationwhich is recoverable through postprocessing.

2.1 Trigonometric polynomial expansions

The classical continuous series of trigonometric polynomials, the Fourier seriesF[u] of a function, u(x) ∈ L2[0, 2π ], is given as

F[u] = a0 +∞∑

n=1

an cos(nx) +∞∑

n=1

bn sin(nx), (2.1)

19

Page 28: Spectral Methods for Time-Dependent Problems

20 Trigonometric polynomial approximation

where the expansion coefficients are

an = 1

cnπ

∫ 2π

0u(x) cos(nx) dx,

with the values

cn ={

2 n = 0,

1 n > 0,

and

bn = 1

π

∫ 2π

0u(x) sin(nx) dx, n > 0.

Alternatively, the Fourier series can be expressed in complex form

F[u] =∑

|n|≤∞uneinx , (2.2)

with expansion coefficients

un = 1

∫ 2π

0u(x)e−inx dx =

a0 n = 0,

(an − i bn)/2 n > 0,

(a−n + i b−n)/2 n < 0.

(2.3)

Remark The following special cases are of interest.

1. If u(x) is a real function, the coefficients an and bn are real numbers and, con-sequently, u−n = un . Thus, only half the coefficients are needed to describethe function.

2. If u(x) is real and even, i.e., u(x) = u(−x), then bn = 0 for all values of n,so the Fourier series becomes a cosine series.

3. If u(x) is real and odd, i.e., u(x) = −u(−x), then an = 0 for all values of n,and the series reduces to a sine series.

For our purposes, the relevant question is how well the truncated Fourier seriesapproximates the function. The truncated Fourier series

PN u(x) =∑

|n|≤N/2

uneinx , (2.4)

is a projection to the finite dimensional space

BN = span{einx | |n| ≤ N/2}, dim(BN ) = N + 1.

The approximation theory results for this series are classical.

Page 29: Spectral Methods for Time-Dependent Problems

2.1 Trigonometric polynomial expansions 21

Theorem 2.1 If the sum of squares of the Fourier coefficients is bounded∑|n|≤∞

|un|2 < ∞ (2.5)

then the truncated series converges in the L2 norm

‖u − PN u‖L2[0,2π] → 0 as N → ∞.

If, moreover, the sum of the absolute values of the Fourier coefficients is bounded∑|n|< ∞

|un| < ∞,

then the truncated series converges uniformly

‖u − PN u‖L∞[0,2π] → 0 as N → ∞.

The fact that the truncated sum converges implies that the error is dominatedby the tail of the series, i.e.,

‖u − PN u‖2L2[0,2π ] = 2π

∑|n|>N/2

|un|2,

and

‖u − PN u‖L∞[0,2π] ≤∑

|n|>N/2

|un|.

Thus, the error committed by replacing u(x) with its N th-order Fourier seriesdepends solely on how fast the expansion coefficients of u(x) decay. This, inturn, depends on the regularity of u(x) in [0, 2π] and the periodicity of thefunction and its derivatives.

To appreciate this, let’s consider a continous function u(x), with derivativeu′(x) ∈ L2[0, 2π]. Then, for n �= 0,

2π un =∫ 2π

0u(x)e−inx dx

= −1

in(u(2π) − u(0)) + 1

in

∫ 2π

0u′(x)e−inx dx .

Clearly, then,

|un| ∝ 1

n.

Repeating this line of argument we have the following result for periodic smoothfunctions.

Page 30: Spectral Methods for Time-Dependent Problems

22 Trigonometric polynomial approximation

0.0 0.2 0.4 0.6 0.8 1.0x /2p

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

PNu

u(x)

N = 16

N = 8

N = 4

(a)

0.0 0.2 0.4 0.6 0.8 1.0

100

10−2

10−4

10−6

10−8

10−10

10−12

10−14

x/2p|u

− P

Nu|

(b)

N = 4

N = 8

N = 16

N = 32

N = 64

Figure 2.1 (a) Continuous Fourier series approximation of Example 2.3 forincreasing resolution. (b) Pointwise error of the approximation for increasingresolution.

Theorem 2.2 If a function u(x), its first (m − 1) derivatives, and their periodicextensions are all continuous and if the mth derivative u(m)(x) ∈ L2[0, 2π ], then∀n �= 0 the Fourier coefficients, un, of u(x) decay as

|un| ∝(

1

n

)m

.

What happens if u(x) ∈ C∞p [0, 2π ]? In this case un decays faster than any

negative power of n. This property is known as spectral convergence. It followsthat the smoother the function, the faster the truncated series converges. Ofcourse, this statement is asymptotic; as we showed in Chapter 1, we need atleast two points per wavelength to reach the asymptotic range of convergence.

Let us consider a few examples.

Example 2.3 Consider the C∞p [0, 2π] function

u(x) = 3

5 − 4 cos(x).

Its expansion coefficients are

un = 2−|n|.

As expected, the expansion coefficients decay faster than any algebraic orderof n. In Figure 2.1 we plot the continuous Fourier series approximation of u(x)and the pointwise error for increasing N .

This example clearly illustrates the fast convergence of the Fourier series andalso that the convergence of the approximation is almost uniform. Note that weonly observe the very fast convergence for N > N0 ∼ 16.

Page 31: Spectral Methods for Time-Dependent Problems

2.1 Trigonometric polynomial expansions 23

(a)

0.0 0.2 0.4 0.6 0.8 1.00.0

0.2

0.4

0.6

0.8

1.0

1.2

1.4

N = 4N = 8N = 16u (x)

x /2p

PN

u

(b)

0.0 0.2 0.4 0.6 0.8 1.0

100

10−1

10−2

10−3

10−4

10−5

10−6

10−7

N = 4

N = 8

N = 16

N = 32N = 64

x/2p|u

− P

Nu|

Figure 2.2 (a) Continuous Fourier series approximation of Example 2.4 forincreasing resolution. (b) Pointwise error of approximation for increasingresolution.

Example 2.4 The expansion coefficients of the function

u(x) = sin( x

2

).

are given by

un = 2

π

1

(1 − 4n2).

Note that the derivative of u(x) is not periodic, and integrating by parts twicewe obtain quadratic decay in n. In Figure 2.2 we plot the continuous Fourierseries approximation and the pointwise error for increasing N . As expected,we find quadratic convergence except near the endpoints where it is only linear,indicating non-uniform convergence. The loss of order of convergence at thediscontinuity points of the periodic extension, as well as the global reduction oforder, is typical of Fourier series (and other global expansion) approximationsof functions that are not sufficiently smooth.

2.1.1 Differentiation of the continuous expansion

When approximating a function u(x) by the finite Fourier series PN u, we caneasily obtain the derivatives of PN u by simply differentiating the basis func-tions. The question is, are the derivatives of PN u good approximations to thederivatives of u?

If u is a sufficiently smooth function, then one can differentiate the sum

PN u(x) =∑

|n|≤ N2

uneinx ,

Page 32: Spectral Methods for Time-Dependent Problems

24 Trigonometric polynomial approximation

term by term, to obtain

dq

dxqPN u(x) =

∑|n|≤ N

2

undq

dxqeinx =

∑|n|≤ N

2

(in)q uneinx .

It follows that the projection and differentiation operators commute

PNdq

dxqu = dq

dxqPN u.

This property implies that for any constant coefficient differention operator L,

PNL (I − PN ) u,

known as the truncation error, vanishes. Thus, the Fourier approximation tothe equation ut = Lu is exactly the projection of the analytic solution.

2.2 Discrete trigonometric polynomials

The continuous Fourier series method requires the evaluation of the coefficients

un = 1

∫ 2π

0u(x)e−inx dx . (2.6)

In general, these integrals cannot be computed analytically, and one resortsto the approximation of the Fourier integrals by using quadrature formulas,yielding the discrete Fourier coefficients. Quadrature formulas differ based onthe exact position of the grid points, and the choice of an even or odd numberof grid points results in slightly different schemes.

2.2.1 The even expansion

Define an equidistant grid, consisting of an even number N of gridpoints x j ∈[0, 2π ), defined by

x j = 2π j

Nj ∈ [0, . . . , N − 1].

The trapezoidal rule yields the discrete Fourier coefficients un , which approxi-mate the continuous Fourier coefficients un ,

un = 1

N

N−1∑j=0

u(x j )e−inx j . (2.7)

As the following theorem shows, the trapezoidal quadrature rule is a very naturalapproximation when trigonometric polynomials are involved.

Page 33: Spectral Methods for Time-Dependent Problems

2.2 Discrete trigonometric polynomials 25

Theorem 2.5 The quadrature formula

1

∫ 2π

0f (x) dx = 1

N

N−1∑j=0

f (x j )

is exact for any trigonometric polynomial f (x) = einx , |n| < N.

Proof: Given a function f (x) = einx ,

1

∫ 2π

0f (x) dx =

{1 if n = 0,

0 otherwise.

On the other hand,

1

N

N−1∑j=0

f (x j ) = 1

N

N−1∑j=0

ein(2π j/N )

= 1

N

N−1∑j=0

q j

where q = ei 2πnN . If n is an integer multiple of N , i.e., n = m N ,

then 1N

∑N−1j=0 f (x j ) = 1. Otherwise, 1

N

∑N−1j=0 f (x j ) = q N −1

q−1 = 0. Thus, the

quadrature formula is exact for any function of the form f (x) = einx , |n| < N .QED

The quadrature formula is exact for f (x) ∈ B2N−2 where BN is the space oftrigonometric polynomials of order N ,

BN = span{einx | |n| ≤ N/2}.Note that the quadrature formula remains valid also for

f (x) = sin(N x),

because sin(N x j ) = 0, but it is not valid for f (x) = cos(N x).Using the trapezoid rule, the discrete Fourier coefficients become

un = 1

Ncn

N−1∑j=0

u(x j )e−inx j , (2.8)

where we introduce the coefficients

cn ={

2 |n| = N/21 |n| < N/2

for ease of notation. These relations define a new projection of u

IN u(x) =∑

|n|≤N/2

uneinx . (2.9)

Page 34: Spectral Methods for Time-Dependent Problems

26 Trigonometric polynomial approximation

This is the complex discrete Fourier transform, based on an even number ofquadrature points. Note that

u−N/2 = uN/2,

so that we have exactly N independent Fourier coefficients, corresponding tothe N quadrature points. As a consequence, IN sin( N

2 x) = 0 so that the functionsin( N

2 x) is not represented in the expansion, Equation (2.9).Onto which finite dimensional space does IN project? Certainly, the space

does not include sin( N2 x), so it is not BN . The correct space is

BN = span{(cos(nx), 0 ≤ n ≤ N/2) ∪ (sin(nx), 1 ≤ n ≤ N/2 − 1)},which has dimension dim(BN ) = N .

The particular definition of the discrete expansion coefficients introduced inEquation (2.8) has the intriguing consequence that the trigonometric polynomialIN u interpolates the function, u(x), at the quadrature nodes of the trapezoidalformula. Thus, IN is the interpolation operator, where the quadrature nodes arethe interpolation points.

Theorem 2.6 Let the discrete Fourier transform be defined by Equations (2.8)–(2.9). For any periodic function, u(x) ∈ C0

p[0, 2π ], we have

IN u(x j ) = u(x j ), ∀x j = 2π j

Nj = 0, . . . , N − 1.

Proof: Substituting Equation (2.8) into Equation (2.9) we obtain

IN u(x) =∑

|n|≤N/2

(1

Ncn

N−1∑j=0

u(x j )e−inx j

)einx .

Exchanging the order of summation yields

IN u(x) =N−1∑j=0

u(x j )g j (x), (2.10)

where

g j (x) =∑

|n|≤N/2

1

Ncnein(x−x j )

= 1

Nsin

[N

x − x j

2

]cot

[x − x j

2

], (2.11)

by summing as a geometric series. It is easily verified that g j (xi ) = δi j as isalso evident from the examples of g j (x) for N = 8 shown in Figure 2.3.

Page 35: Spectral Methods for Time-Dependent Problems

2.2 Discrete trigonometric polynomials 27

0.00 0.25 0.50 0.75 1.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

x /2p

g0(x) g2(x) g4(x) g6(x)

Figure 2.3 The interpolation polynomial, g j (x), for N = 8 for various values of j .

We still need to show that g j (x) ∈ BN . Clearly, g j (x) ∈ BN as g j (x) is apolynomial of degree ≤ N/2. However, since

1

2e−i N

2 x j = 1

2ei N

2 x j = (−1) j

2,

and, by convention u−N/2 = uN/2, we do not get any contribution from the termsin( N

2 x), hence g j (x) ∈ BN .QED

The discrete Fourier series of a function has convergence properties verysimilar to those of the continuous Fourier series approximation. In particular,the discrete approximation is pointwise convergent for C1

p[0, 2π] functions andis convergent in the mean provided only that u(x) ∈ L2[0, 2π ]. Moreover, thecontinuous and discrete approximations share the same asymptotic behavior, inparticular having a convergence rate faster than any algebraic order of N−1 ifu(x) ∈ C∞

p [0, 2π]. We shall return to the proof of these results in Section 2.3.2.Let us at this point illustrate the behavior of the discrete Fourier series by

applying it to the examples considered previously.

Example 2.7 Consider the C∞p [0, 2π ] function

u(x) = 3

5 − 4 cos(x).

In Figure 2.4 we plot the discrete Fourier series approximation of u and thepointwise error for increasing N . This example confirms the spectral conver-gence of the discrete Fourier series. We note in particular that the approximationerror is of the same order as observed for the continuous Fourier series in Exam-ple 2.3. The appearance of “spikes” in the pointwise error approaching zero inFigure 2.4 illustrates the interpolating nature of IN u(x), i.e., IN u(x j ) = u(x j )as expected.

Page 36: Spectral Methods for Time-Dependent Problems

28 Trigonometric polynomial approximation

Figure 2.4 (a) Discrete Fourier series approximation of Example 2.7 forincreasing resolution. (b) Pointwise error of approximation for increasingresolution.

Figure 2.5 (a) Discrete Fourier series approximation of Example 2.8 for increasingresolution. (b) Pointwise error of approximation for increasing resolution.

Example 2.8 Consider again the function

u(x) = sin( x

2

),

and recall that u(x) ∈ C0p[0, 2π ]. In Figure 2.5 we show the discrete Fourier

series approximation and the pointwise error for increasing N . As for the con-tinuous Fourier series approximation we recover a quadratic convergence rateaway from the boundary points at which it is only linear.

2.2.2 The odd expansion

How can this type of interpolation operator be defined for the space BN con-taining an odd number of basis functions? To do so, we define a grid with an

Page 37: Spectral Methods for Time-Dependent Problems

2.2 Discrete trigonometric polynomials 29

0.00 0.25 0.50 0.75 1.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

h0(x) h2(x) h4(x) h6(x)h8(x)

x /2p

Figure 2.6 The interpolation polynomial, h j (x), for N = 8 for various values of j .

odd number of grid points,

x j = 2π

N + 1j, j ∈ [0, . . . , N ], (2.12)

and use the trapezoidal rule

un = 1

N + 1

N∑j=0

u(x j )e−inx j , (2.13)

to obtain the interpolation operator

JN u(x) =∑

|n|≤N/2

uneinx .

Again, the quadrature formula is highly accurate:

Theorem 2.9 The quadrature formula

1

∫ 2π

0f (x) dx = 1

N + 1

N∑j=0

f (x j ),

is exact for any f (x) = einx , |n| ≤ N, i.e., for all f (x) ∈ B2N .

The scheme may also be expressed through the use of a Lagrange interpo-lation polynomial,

JN u(x) =N∑

j=0

u(x j )h j (x),

where

h j (x) = 1

N + 1

sin(

N+12 (x − x j )

)sin

( x−x j

2

) . (2.14)

One easily shows that h j (xl) = δ jl and that h j (x) ∈ BN . Examples of h j (x) areshown in Figure 2.6 for N = 8.

Page 38: Spectral Methods for Time-Dependent Problems

30 Trigonometric polynomial approximation

Historically, the early availability of the fast fourier transform (FFT), whichis highly efficient for 2p points, has motivated the use of the even number ofpoints approach. However, fast methods are now available for an odd as wellas an even number of grid points.

2.2.3 A first look at the aliasing error

Let’s consider the connection between the continuous Fourier series and thediscrete Fourier series based on an even number of grid points. The conclusionsof this discussion are equally valid for the case of an odd number of points.

Note that the discrete Fourier modes are based on the points x j , for whichthe (n + Nm)th mode is indistinguishable from the nth mode,

ei(n+Nm)x j = einx j ei2πmj = einx j .

This phenomenon is known as aliasing.If the Fourier series converges pointwise, e.g., u(x) ∈ C1

p[0, 2π ], the alias-ing phenomenon implies that the relation between the two sets of expansioncoefficients is

cn un = un +∑

|m|≤∞m �=0

un+Nm, (2.15)

In Figure 2.7 we illustrate this phenomenon for N = 8 and we observe that then = −10 wave as well as the n = 6 and the n = −2 wave are all the same atthe grid points.

In Section 2.3.2 we will show that the aliasing error

‖AN u‖L2[0,2π ] =

∥∥∥∥∥∥∥∑

|n|≤N/2

m=∞∑

m=−∞m �=0

un+Nm

einx

∥∥∥∥∥∥∥L2[0,2π ]

, (2.16)

is of the same order as the error, ‖u − PN u‖L2[0,2π], for smooth functions u.If the function is well approximated the aliasing error is generally negligibleand the continuous Fourier series and the discrete Fourier series share similarapproximation properties. However, for poorly resolved or nonsmooth prob-lems, the situation is much more delicate.

2.2.4 Differentiation of the discrete expansions

To implement the Fourier–collocation method, we require the derivatives of thediscrete approximation. Once again, we consider the case of an even numberof grid points. The two mathematically equivalent methods given in Equa-tions (2.8)–(2.9) and Equation (2.10) for expressing the interpolant yield two

Page 39: Spectral Methods for Time-Dependent Problems

2.2 Discrete trigonometric polynomials 31

n = 6

n = −2

n = 10

Figure 2.7 Illustration of aliasing. The three waves, n = 6, n = −2 and n = −10are all interpreted as a n = −2 wave on an 8-point grid. Consequently, the n = −2appears as more energetic after the discrete Fourier transform than in the originalsignal.

computationally different ways to approximate the derivative of a function. Inthe following subsections, we assume that our function u and all its derivativesare continuous and periodic on [0, 2π ].

Using expansion coefficients Given the values of the function u(x) at thepoints x j , differentiating the basis functions in the interpolant yields

d

dxIN u(x) =

∑|n|≤N/2

inuneinx , (2.17)

where

un = 1

Ncn

N−1∑j=0

u(x j )e−inx j ,

are the coefficients of the interpolant IN u(x) given in Equations (2.8)–(2.9).Higher order derivatives can be obtained simply by further differentiating thebasis functions.

Note that, unlike in the case of the continuous approximation, the derivativeof the interpolant is not the interpolant of the derivative, i.e.,

INdu

dx�= IN

d

dxIN u, (2.18)

unless u(x) ∈ BN .

Page 40: Spectral Methods for Time-Dependent Problems

32 Trigonometric polynomial approximation

For example, if

u(x) = sin

(N

2x

),

(i.e., u(x) does not belong to BN ), then IN u ≡ 0 and so d(IN u)/dx = 0.On the other hand, u′(x) = N/2 cos(N x/2) (which is in BN ), and thereforeIN u′(x) = N/2 cos(N x/2) �= IN d(IN u)/dx . If u(x) ∈ BN , thenIN u = u, andtherefore

INdu

dx= IN

d

dxIN u.

Likewise, if we consider the projection based on an odd number of points, wehave

JNdu

dx�= JN

d

dxJN u,

except if u ∈ BN .The procedure for differentiating using expansion coefficients can be

described as follows: first, we transform the point values u(x j ) in physicalspace into the coefficients un in mode space. We then differentiate in modespace by multiplying un by in, and return to physical space. Computationally,the cost of the method is the cost of two transformations, which can be doneby a fast Fourier transform (FFT). The typical cost of an FFT is O(N log N ).Notice that this procedure is a transformation from a finite dimensional spaceto a finite dimensional space, which indicates a matrix multiplication. In thenext section, we give the explicit form of this matrix.

The matrix method The use of the Lagrange interpolation polynomials yields

IN u(x) =N−1∑j=0

u(x j )g j (x),

where

g j (x) = 1

Nsin

[N

x − x j

2

]cot

[x − x j

2

].

An approximation to the derivative of u(x) at the points, xi , is then obtained bydifferentiating the interpolation directly,

d

dxIN u(x)

∣∣∣∣xl

=N−1∑j=0

u(x j )d

dxg j (x)

∣∣∣∣xl

=N−1∑j=0

Dl j u(x j ).

Page 41: Spectral Methods for Time-Dependent Problems

2.2 Discrete trigonometric polynomials 33

The entries of the differentiation matrix are given by

Di j = d

dxg j (x)

∣∣∣∣xi

={ (−1)i+ j

2 cot[ xi −x j

2

]i �= j

0 i = j.(2.19)

It is readily verified that D is circulant and skew-symmetric.The approximation of higher derivatives follows the exact same route as

taken for the first order derivative. The entries of the second order differentiationmatrix D(2), based on an even number of grid points, are

d2

dx2g j (x)

∣∣∣∣xi

= D(2)i j =

− (−1)i+ j

2

[sin

(xi −x j

2

)]−2i �= j

− N 2+212 i = j.

(2.20)

It is interesting to note that, in the case of even number of points, D(2) is notequal to the square of D. i.e.,

INd2

dx2IN �=

(IN

d

dx

)2

IN

To illustrate this, consider the function cos( N2 x),

INd2

dx2IN cos

(N

2x

)= IN

[−

(N

2

)2

cos

(N

2x

)]= −

(N

2

)2

cos

(N

2x

),

on the other hand, since INd

dx IN cos( N2 x) = 0, the two are not the same.

The reason for this discrepancy is that the differentiation operator takeselements of BN out of BN . In the above example, cos( N

2 x) is in the space BN ,but its derivative is not. However, elements of BN , when differentiated, remainin BN and thus,

JNd2

dx2JN =

(JN

d

dx

)2

JN ,

for the interpolation based on an odd number of grid points.For the sake of completeness, we list the entries of the differentiation matrix

D for the interpolation based on an odd number of points,

Di j ={

(−1)i+ j

2

[sin

(xi −x j

2

)]−1i �= j

0 i = j,

which is the limit of the finite difference schemes as the order increases. Onceagain D is a circulant, skew-symmetric matrix. As mentioned above, in this

Page 42: Spectral Methods for Time-Dependent Problems

34 Trigonometric polynomial approximation

case we have

D(q) = JNdq

dxqJN = Dq ,

for all values of q .In this method, we do not go through the mode space at all. The differentiation

matrix takes us from physical space to physical space, and the act of differentia-tion is hidden in the matrix itself. The computational cost of the matrix methodis the cost of a matrix-vector product, which is an O(N 2) operation, rather thanthe cost of O(Nlog(N )) in the method using expansion coefficients. However,the efficiency of the FFT is machine dependent and for small values of N itmay be faster to perform the matrix-vector product. Also, since the differentia-tion matrices are all circulant one need only store one column of the operator,thereby reducing the memory usage to that of the FFT.

2.3 Approximation theory for smooth functions

We will now rigorously justify the behavior of the continuous and discreteFourier approximations of the function u and its derivatives. When using theFourier approximation to discretize the spatial part of the equation

ut = Lu,

where L is a differential operator (e.g., the hyperbolic equation ut = a(x)ux ),it is important that our approximation, both to u and to Lu, be accurate. Toestablish consistency we need to consider not only the difference between u andPN u, but also the distance between Lu and LPN u, measured in an appropriatenorm. This is critical, because the actual rate of convergence of a stable schemeis determined by the truncation error

PNL (I − PN ) u.

The truncation error is thus determined by the behavior of the Fourier approx-imations not only of the function, but of its derivatives as well.

It is natural, therefore, to use the Sobolev q-norm denoted by Hqp [0, 2π ],

which measures the smoothness of the derivatives as well as the function,

‖u‖2Hq

p [0,2π ] =q∑

m=0

∫ 2π

0

∣∣u(m)(x)∣∣2

dx .

Page 43: Spectral Methods for Time-Dependent Problems

2.3 Approximation theory for smooth functions 35

The subscript p indicates the fact that all our functions are periodic, for whichthe Sobolev norm can be written in mode space as

‖u‖2Hq

p [0,2π ] = 2π

q∑m=0

∑|n|≤∞

|n|2m |un|2 = 2π∑

|n|≤∞

(q∑

m=0

|n|2m

)|un|2,

where the interchange of the summation is allowed provided u(x) has sufficientsmoothness, e.g., u(x) ∈ Cq

p[0, 2π], q > 12 .

Since for n �= 0,

(1 + n2q ) ≤q∑

m=0

n2m ≤ (q + 1)(1 + n2q ),

the norm ‖ · ‖W qp [0,2π ] defined by

‖u‖W qp [0,2π] =

( ∑|n|≤∞

(1 + n2q )|un|2)1/2

,

is equivalent to ‖ · ‖Hqp [0,2π ]. It is interesting to note that one can easily define a

norm W qp [0, 2π ] with noninteger values of q .

2.3.1 Results for the continuous expansion

Consider, first, the continuous Fourier series

P2N u(x) =∑

|n|≤N

uneinx .

We start with an L2 estimate for the distance between u and its trigonometricapproximation P2N u.

Theorem 2.10 For any u(x) ∈ Hrp[0, 2π ], there exists a positive constant C,

independent of N , such that

‖u − P2N u‖L2[0,2π ] ≤ C N−q∥∥u(q)

∥∥L2[0,2π],

provided 0 ≤ q ≤ r .

Proof: By Parseval’s identity,

‖u − P2N u‖2L2[0,2π ] = 2π

∑|n|>N

|un|2.

Page 44: Spectral Methods for Time-Dependent Problems

36 Trigonometric polynomial approximation

We rewrite this summation∑|n|>N

|un|2 =∑

|n|>N

1

n2qn2q |un|2

≤ N−2q∑

|n|>N

n2q |un|2

≤ N−2q∑|n|≥0

n2q |un|2

= 1

2πN−2q

∥∥u(q)∥∥2

L2[0,2π].

Putting this all together and taking the square root, we obtain our result.QED

Note that the smoother the function, the larger the value of q , and therefore,the better the approximation. This is in contrast to finite difference or finiteelement approximations, where the rate of convergence is fixed, regardless ofthe smoothness of the function. This rate of convergence is referred to in theliterature as spectral convergence.

If u(x) is analytic then∥∥u(q)∥∥

L2[0,2π ] ≤ Cq! ‖u‖L2[0,2π],

and so

‖u − P2N u‖L2[0,2π] ≤ C N−q∥∥u(q)

∥∥L2[0,2π] ≤ C

q!

N q‖u‖L2[0,2π].

Using Stirling’s formula, q! ∼ qqe−q , and assuming that q ∝ N , we obtain

‖u − P2N u‖L2[0,2π ] ≤∼ C( q

N

)qe−q‖u‖L2[0,2π ] ∼ K e−cN ‖u‖L2[0,2π ].

Thus, for an analytic function, spectral convergence is, in fact, exponentialconvergence.

Since the Fourier method is used for computation of derivatives, we areparticularly interested in estimating the convergence of both the function andits derivative. For this purpose, the Sobolev norm is appropriate.

Theorem 2.11 For any real r and any real q where 0 ≤ q ≤ r , if u(x) ∈W r

p[0, 2π ], then there exists a positive constant C, independent of N , suchthat

‖u − P2N u‖W qp [0,2π ] ≤ C

Nr−q‖u‖W r

p[0,2π ].

Proof: Parseval’s identity yields

‖u − P2N u‖2W q

p [0,2π ] = 2π∑

|n|>N

(1 + |n|2q )|un|2.

Page 45: Spectral Methods for Time-Dependent Problems

2.3 Approximation theory for smooth functions 37

Since |n| + 1 ≥ N , we obtain

(1 + |n|2q ) ≤ (1 + |n|)2q = (1 + |n|)2r

(1 + |n|)2(r−q)≤ (1 + |n|)2r

N 2(r−q)

≤ (1 + r )(1 + n2r )

N 2(r−q),

for any 0 ≤ q ≤ r .This immediately yields

‖u − P2N u‖2W q

p [0,2π] ≤ C∑

|n|>N

(1 + n2r )

N 2(r−q)|un|2 ≤ C

‖u‖2W r

p[0,2π ]

N 2(r−q).

QED

A stricter measure of convergence may be obtained by looking at the point-wise error in the maximum norm.

Theorem 2.12 For any q > 1/2 and u(x) ∈ Cqp[0, 2π], there exists a positive

constant C, independent of N , such that

‖u − P2N u‖L∞ ≤ C1

N q− 12

∥∥u(q)∥∥

L2[0,2π] .

Proof: Provided u(x) ∈ Cqp[0, 2π ], q > 1/2, we have for any x ∈ [0, 2π ],

|u − P2N u| =∣∣∣∣∣∑

|n|>N

uneinx

∣∣∣∣∣=

∣∣∣∣∣∑

|n|>N

nq uneinx

nq

∣∣∣∣∣≤

( ∑|n|>N

1

n2q

)1/2 ( ∑|n|>N

n2q |un|2)1/2

,

using the Cauchy–Schwartz inequality. The second term in the product above isbounded by the norm. The first term is the tail of a power series which convergesfor 2q > 1. Thus, for q > 1

2 , we can bound the tail, and so we obtain

|u − P2N u| ≤ C

N q−1/2

∥∥u(q)∥∥

L2[0,2π ] .

QED

Again, we notice spectral accuracy in the maximum norm, with exponentialaccuracy for analytic functions. Finally, we are ready to use these results tobound the truncation error for the case of a constant coefficient differentialoperator.

Page 46: Spectral Methods for Time-Dependent Problems

38 Trigonometric polynomial approximation

Theorem 2.13 Let L be a constant coefficient differential operator

Lu =s∑

j=1

a jd j u

dx j.

For any real r and any real q where 0 ≤ q + s ≤ r , if u(x) ∈ W rp[0, 2π ], then

there exists a positive constant C, independent of N , such that

‖Lu − LPN u‖W qp [0,2π ] ≤ C N−(r−q−s)‖u‖W r

p[0,2π ].

Proof: Using the definition of L,

‖Lu − LPN u‖W qp [0,2π] =

∥∥∥∥∥s∑

j=1

a jd j u

dx j−

s∑j=1

a jd jPN u

dx j

∥∥∥∥∥W q

p [0,2π]

≤ max0≤ j≤s

|a j |∥∥∥∥∥

s∑j=1

d j

dx j(u − PN u)

∥∥∥∥∥W q

p [0,2π ]

≤ max0≤ j≤s

|a j |s∑

j=1

‖u − PN u‖W q+sp [0,2π ]

≤ C‖u − PN u‖W q+sp [0,2π ]

This last term is bounded in Theorem 2.7, and the result immediately follows.QED

2.3.2 Results for the discrete expansion

The approximation theory for the discrete expansion yields essentially the sameresults as for the continuous expansion, though with more effort. The proofsfor the discrete expansion are based on the convergence results for the contin-uous approximation, and as the fact that the Fourier coefficients of the discreteapproximation are close to those of the continuous approximation.

Recall that the interpolation operator associated with an even number of gridpoints is given by

I2N u =∑

|n|< N

uneinx ,

with expansion coefficients

un = 1

2Ncn

2N−1∑j=0

u(x j )e−inx j , x j = 2π

2Nj.

Page 47: Spectral Methods for Time-Dependent Problems

2.3 Approximation theory for smooth functions 39

Rather than deriving the estimates of the approximation error directly, we shalluse the results obtained in the previous section and then estimate the differencebetween the two different expansions, which we recognize as the aliasing error.

The relationship between the discrete expansion coefficients un , and thecontinuous expansion coefficients un , is given in the following lemma.

Lemma 2.14 Consider u(x) ∈ W qp [0, 2π ], where q > 1/2. For |n| ≤ N we

have

cnun = un +∑

|m|≤∞m �=0

un+2Nm .

Proof: Substituting the continuous Fourier expansion into the discrete expan-sion yields

cn un = 1

2N

2N−1∑j=0

∑|l|≤∞

ulei(l−n)x j .

To interchange the two summations we must ensure uniform convergence, i.e.,∑|l|≤∞ |ul | < ∞. This is satisfied, since∑

|l|≤∞|ul | =

∑|l|≤∞

(1 + |l|)q |ul |(1 + |l|)q

≤(

2q∑|l|≤∞

(1 + l2q )|ul |2)1/2 ( ∑

|l|≤∞(1 + |l|)−2q

)1/2

,

where the last expression follows from the Cauchy–Schwarz inequality. Asu(x) ∈ W q

p [0, 2π] the first part is clearly bounded. Furthermore, the secondterm converges provided q > 1/2, hence ensuring boundedness.

Interchanging the order of summation and using orthogonality of the expo-nential function at the grid yields the desired result.

QED

As before, we first consider the behavior of the approximation in the L2-norm. We will first show that the bound on the aliasing error, AN , in Equa-tion (2.16) is of the same order as the truncation error. The error caused bytruncating the continuous expansion is essentially the same as the error pro-duced by using the discrete coefficients rather than the continuous coefficients.

Lemma 2.15 For any u(x) ∈ W rp[0, 2π], where r > 1/2, the aliasing error

‖AN u‖L2[0,2π ] =( ∑

|n|≤∞|cn un − un|2

)1/2

≤ C N−r∥∥u(r )

∥∥L2[0,2π ].

Page 48: Spectral Methods for Time-Dependent Problems

40 Trigonometric polynomial approximation

Proof: From Lemma 2.14 we have

|cn un − un|2 =

∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

.

To estimate this, we first note that∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

=

∣∣∣∣∣∣∣∑

|m|≤∞m �=0

|n + 2Nm|r un+2Nm1

|n + 2Nm|r

∣∣∣∣∣∣∣2

|m|≤∞m �=0

|n + 2Nm|2r |un+2Nm |2

|m|≤∞m �=0

1

|n + 2Nm|2r

,

using the Cauchy–Schwartz inequality.Since |n| ≤ N , bounding of the second term is ensured by

∑|m|≤∞

m �=0

1

|n + 2Nm|2r≤ 2

N 2r

∞∑m=1

1

(2m − 1)2r= C1 N−2r ,

provided r > 1/2. Here, the constant C1 is a consequence of the fact that thepower series converges, and it is independent of N .

Summing over n, we have

∑|n|≤N

∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

≤∑

|n|≤N

C1 N−2r∑

|m|≤∞m �=0

|n + 2m N |2r |un+2Nm |2

≤ C2 N−2r∥∥u(r )

∥∥2L2[0,2π ].

QED

We are now in a position to state the error estimate for the discreteapproximation.

Theorem 2.16 For any u(x) ∈ W rp[0, 2π ] with r > 1/2, there exists a positive

constant C, independent of N , such that

‖u − I2N u‖L2[0,2π] ≤ C N−r∥∥u(r )

∥∥L2[0,2π].

Page 49: Spectral Methods for Time-Dependent Problems

2.3 Approximation theory for smooth functions 41

Proof: Let’s write the difference between the function and its discreteapproximation

‖u − I2N u‖2L2[0,2π ] = ‖(P2N − I2N )u + u − P2N u‖2

L2[0,2π ]

≤ ‖(P2N − I2N )u‖2L2[0,2π ] + ‖u − P2N u‖2

L2[0,2π ].

Thus, the error has two components. The first one, which is the differencebetween the continuous and discrete expansion coefficients, is the aliasing error,which is bounded in Lemma 2.15. The second, which is the tail of the series,is the truncation error, which is bounded by the result of Theorem 2.10. Thedesired result follows from these error bounds.

QED

Theorem 2.16 confirms that the approximation errors of the continuousexpansion and the discrete expansion are of the same order, as long as u(x)has at least half a derivative. Furthermore, the rate of convergence depends, inboth cases, only on the smoothness of the function being approximated.

The above results are in the L2 norm. We can obtain essentially the sameinformation about the derivatives, using the Sobolev norms. First, we need toobtain a Sobolev norm bound on the aliasing error.

Lemma 2.17 Let u(x) ∈ W rp[0, 2π ], where r > 1/2. For any real q, for which

0 ≤ q ≤ r , the aliasing error

‖AN u‖W qp [0,2π] =

( ∞∑n=−∞

|cn un − un|2)1/2

≤ C N−(r−q)‖u‖W rp[0,2π].

Proof:∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

=

∣∣∣∣∣∣∣∑

|m|≤∞m �=0

(1 + |n + 2Nm|)r un+2Nm1

(1 + |n + 2Nm|)r

∣∣∣∣∣∣∣2

,

such that∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

|m|≤∞m �=0

(1 + |n + 2Nm|)2r |un+2Nm |2

×

|m|≤∞m �=0

1

(1 + |n + 2Nm|)2r

.

Page 50: Spectral Methods for Time-Dependent Problems

42 Trigonometric polynomial approximation

The second factor is, as before, bounded by∑|m|≤∞

m �=0

1

(1 + |n + 2Nm|)2r≤ 2

N 2r

∞∑m=1

1

(2m − 1)2r= C1 N−2r ,

provided r > 1/2 and |n| ≤ N .Also, since (1 + |n|)2q ≤ C2 N 2q for |n| ≤ N we recover

∑|n|≤N

(1 + |n|)2q

∣∣∣∣∣∣∣∑

|m|≤∞m �=0

un+2Nm

∣∣∣∣∣∣∣2

≤∑

|n|≤N

C1C2 N−2(r−q)∑

|m|≤∞m �=0

(1 + |n + 2m N |)2r |un+2Nm |2

≤ C3 N−2(r−q)‖u‖2W r

p[0,2π ].

QEDWith this bound on the aliasing error, and the truncation error bounded by

Theorem 2.11, we are now prepared to state.

Theorem 2.18 Let u(x) ∈ W rp[0, 2π ], where r > 1/2. Then for any real q for

which 0 ≤ q ≤ r , there exists a positive constant, C, independent of N , such that

‖u − I2N u‖W qp [0,2π ] ≤ C N−(r−q)‖u‖W r

p[0,2π ].

The proof follows closely that of Theorem 2.16. As in the case of the continuousexpansion, we use this result to bound the truncation error.

Theorem 2.19 Let L be a constant coefficient differential operator

Lu =s∑

j=1

a jd j u

dx j

then there exists a positive constant, C, independent of N such that

‖Lu − LIN u‖W qp [0,2π ] ≤ C N−(r−q−s)‖u‖W r

p[0,2π ].

2.4 Further reading

The approximation theory for continuous Fourier expansions is classical andcan be found in many sources, e.g. the text by Canuto et al (1988). Many ofthe results on the discrete expansions and the aliasing errors are discussed byOrszag (1972), Gottlieb et al (1983), and Tadmor (1986), while the first instanceof realizing the connection between the discrete expansions and the Lagrangeform appears to be in Gottlieb and Turkel (1983).

Page 51: Spectral Methods for Time-Dependent Problems

3

Fourier spectral methods

We are now ready to formally present and analyze Fourier spectral methodsfor the solution of partial differential equations. As in the previous chapterwe restrict ourselves to problems defined on [0, 2π ] and assume that the solu-tions, u(x), can be periodically extended. Furthermore, we assume that u(x)and its derivatives are smooth enough to allow for any Fourier expansionswhich may become required. The first two sections of this chapter feature theFourier–Galerkin and Fourier–collocation methods. The final section discussesthe stability of these methods.

3.1 Fourier–Galerkin methods

Consider the problem

∂u(x, t)

∂t= Lu(x, t), x ∈ [0, 2π ], t ≥ 0,

u(x, 0) = g(x), x ∈ [0, 2π ], t = 0,

In the Fourier–Galerkin method, we seek solutions uN (x, t) from the spaceBN ∈ span{einx }|n|≤N/2, i.e.,

uN (x, t) =∑

|n|≤N/2

an(t)einx .

Note that an(t) are unknown coefficients which will be determined by themethod. In general, the coefficients an(t) of the approximation are not equal tothe Fourier coefficients un; only if we obtain the exact solution of the problemwill they be equal. In the Fourier–Galerkin method, the coefficients an(t) are

43

Page 52: Spectral Methods for Time-Dependent Problems

44 Fourier spectral methods

determined by the requirement that the residual

RN (x, t) = ∂uN (x, t)

∂t− LuN (x, t),

is orthogonal to BN .If we express the residual in terms of the Fourier series,

R(x, t) =∑

|n|≤∞Rn(t)einx ,

the orthogonality requirement yields

Rn(t) = 1

∫ 2π

0RN (x, t)e−inx dx = 0 ∀ |n| ≤ N

2.

These are (N + 1) ordinary differential equations to determine the (N + 1)unknowns, an(t), and the corresponding initial conditions are

uN (x, 0) =∑

|n|≤N/2

an(0)einx ,

an(0) = 1

∫ 1

−1g(x)e−inx dx .

The method is defined by the requirement that the orthogonal projection ofthe residual onto the space BN is zero. If the residual is smooth enough, thisrequirement implies that the residual itself is small. In particular, if the residualitself lives in the space BN , the orthogonal complement must be zero. This is avery special case which only occurs in a small number of cases, among themlinear constant coefficient problems.

Example 3.1 Consider the linear constant coefficient problem

∂u(x, t)

∂t= c

∂u(x, t)

∂x+ ε

∂2u(x, t)

∂x2,

with the assumption that u(x, 0) ∈ C∞p [0, 2π ], and c and ε are constants.

We seek a trigonometric polynomial,

uN (x, t) =∑

|n|≤N/2

an(t)einx ,

such that the residual

RN (x, t) = ∂uN (x, t)

∂t− c

∂uN (x, t)

∂x− ε

∂2uN (x, t)

∂x2,

is orthogonal to BN .

Page 53: Spectral Methods for Time-Dependent Problems

3.1 Fourier–Galerkin methods 45

Recall that

∂xuN (x, t) =

∑|n|≤N/2

(in)an(t)einx ,

so that the residual is

RN (x, t) =∑

|n|≤N/2

(dan(t)

dt− cin an(t) + εn2an(t)

)einx .

Projecting the residual onto BN and setting to zero, we obtain

dan(t)

dt= (cin − εn2)an(t) ∀ |n| ≤ N

2.

Observe that in this case, RN (x, t) ∈ BN , and therefore setting its projectiononto BN to zero, is equivalent to setting the residual itself equal to zero. The con-stant coefficient operatorL has the propertyPNL = LPN , and so the truncationerror

PNL (I − PN ) u = 0.

In this case, the approximation coefficients an(t) are, in fact, equal to the Fouriercoefficients un and so the approximate solution is the projection of the truesolution, PN u(x, t) = uN (x, t).

Example 3.2 Next, consider the linear, variable coefficient problem

∂u(x, t)

∂t= sin(x)

∂u(x, t)

∂x,

with smooth initial conditions.We seek solutions in the form of a trigonometric polynomial

uN (x, t) =∑

|n|≤N/2

an(t)einx , (3.1)

and require that the residual

RN (x, t) = ∂uN (x, t)

∂t− sin(x)

∂uN (x, t)

∂x,

is orthogonal to BN .The residual is

RN (x, t) =∑

|n|≤N/2

(dan(t)

dt− eix − e−i x

2i(in)an(t)

)einx .

To simplify the expression of RN (x, t) we define a−(N/2+1)(t) = aN/2+1(t) = 0,

Page 54: Spectral Methods for Time-Dependent Problems

46 Fourier spectral methods

and the residual becomes

RN (x, t) =∑

|n|≤N/2

dan(t)

dteinx − 1

2

∑|n|≤N/2

nei(n+1)x an(t)

+ 1

2

∑|n|≤N/2

nei(n−1)x an(t)

=∑

|n|≤N/2

dan(t)

dteinx − 1

2

∑|n|≤N/2

(n − 1)einx an−1(t)

+ 1

2

∑|n|≤N/2

(n + 1)einx an+1(t)

− N

4

(ei N+2

2 x aN/2(t) + e−i N+22 x a−N/2(t)

)

=∑

|n|≤N/2

(dan(t)

dt− n − 1

2an−1(t) + n + 1

2an+1(t)

)einx

− N

4

(ei N+2

2 x aN/2(t) + e−i N+22 x a−N/2(t)

).

The last two terms in this expression are not in the space BN , and so the residualRN (x, t) is not solely in the space of BN , and the truncation error will not beidentically zero. Since the last two terms are not in BN , projecting RN (x, t) tozero in BN yields

dan(t)

dt− n − 1

2an−1(t) + n + 1

2an+1(t) = 0,

with a−(N/2+1)(t) = aN/2+1(t) = 0.

In these two examples we illustrated the fact that the Fourier–Galerkinmethod involves solving the equations in the mode space rather than in physicalspace. Thus, for each problem we need to derive the equations for the expan-sion coefficients of the numerical solution. While this was relatively easy forthe particular variable coefficient case considered in the previous example, thismay be more complicated in general, as seen in the next example.

Example 3.3 Consider the nonlinear problem

∂u(x, t)

∂t= u(x, t)

∂u(x, t)

∂x,

with smooth, periodic initial conditions. The solution of such a problem devel-ops discontinuities, which may lead to stability problems; however, the con-struction of the Fourier–Galerkin method is not affected by this.

Page 55: Spectral Methods for Time-Dependent Problems

3.1 Fourier–Galerkin methods 47

As usual, we seek a solution of the form

uN (x, t) =∑

|n|≤N/2

an(t)einx ,

and require that the residual

RN (x, t) = ∂uN (x, t)

∂t− uN (x, t)

∂xuN (x, t),

be orthogonal to BN .The second term is

uN (x, t)∂

∂xuN (x, t) =

∑|l|≤N/2

∑|k|≤N/2

al(t)(ik)ak(t)ei(l+k)x

=∑

|k|≤N/2

N/2+k∑n=−N/2+k

(ik)an−k(t)ak(t)einx .

As a result of the nonlinearity, the residual RN (x, t) ∈ B2N , and not BN . Pro-jecting this onto BN and setting equal to zero we obtain a set of (N + 1)ODEs

dan(t)

dt=

∑|k|≤N/2

ikan−k(t)ak(t), ∀|n| ≤ N

2.

In this example, we obtain the Fourier–Galerkin equation with relative easedue to the fact that the nonlinearity was only quadratic. Whereas quadraticnonlinearity is quite common in the equations of mathematical physics, thereare many cases in which the nonlinearity is of a more complicated form, andthe derivation of the Fourier–Galerkin equations may become untenable, as inthe next example.

Example 3.4 Consider the strongly nonlinear problem

∂u(x, t)

∂t= eu(x,t) ∂u(x, t)

∂x,

where the initial conditions are, as usual, smooth and periodic.We seek a numerical solution of the form

uN (x, t) =∑

|n|≤ N/2

an(t)einx ,

and require that the residual

RN (x, t) = ∂uN (x, t)

∂t− euN (x,t) ∂

∂xuN (x, t),

Page 56: Spectral Methods for Time-Dependent Problems

48 Fourier spectral methods

is orthogonal to BN . It is exceedingly difficult to obtain the analytic form ofthe resulting system of ODEs. Hence, it is untenable to formulate the Fourier–Galerkin scheme.

To summarize, the Fourier–Galerkin method is very efficient for linear, constantcoefficient problems, but tends to become complicated for variable coefficientand nonlinear problems. The main drawback of the method is the need toderive and solve a different system of governing ODEs for each problem. Thisderivation may prove very difficult, and even impossible.

3.2 Fourier–collocation methods

We can circumvent the need for evaluating the inner products, which causedus such difficulty in the previous section, by using quadrature formulas toapproximate the integrals. This amounts to using the interpolating operator IN

instead of the orthogonal projection operator PN , and is called the Fourier–collocation method. This is also known as the pseudospectral method.

When forming the Fourier–Galerkin method we require that the orthogonalprojection of the residual onto BN vanishes. To form the Fourier–collocationmethod we require, instead, that the residual vanishes identically on some setof gridpoints y j . We refer to this grid as the collocation grid, and note that thisgrid need not be the same as the interpolation grid which we have been usingup to now, comprising the points x j .

In the following, we deal with approximations based on the interpolationgrid

x j = 2π

Nj, j ∈ [0, . . . , N − 1],

where N is even. However, the discussion holds true for approximations basedon an odd number of points, as well.

We assume that the solution, u(x, t) ∈ L2[0, 2π ], is periodic and consider,once again, the general problem

∂u(x, t)

∂t= Lu(x, t), x ∈ [0, 2π ], t ≥ 0,

u(x, 0) = g(x), x ∈ [0, 2π ], t = 0.

In the Fourier–collocation method we seek solutions,

uN ∈ BN = span{(cos(nx), 0 ≤ n ≤ N/2) ∪ (sin(nx), 1 ≤ n ≤ N/2 − 1)},

Page 57: Spectral Methods for Time-Dependent Problems

3.2 Fourier–collocation methods 49

of the form

uN (x, t) =∑

|n|≤N/2

an(t)einx ,

This trigonometric polynomial can also be expressed

uN (x, t) =N−1∑j=0

uN (x j , t)g j (x),

where g j (x) is the Lagrange interpolation polynomial for an even number ofpoints.

Now the difference between the Fourier–Galerkin and the Fourier–collocation method will appear: we require that the residual

RN (x, t) = ∂uN (x, t)

∂t− LuN (x, t),

vanish at the grid points, y j , i.e.,

RN (y j , t) = 0, ∀ j ∈ [0, . . . , N − 1]. (3.2)

This yields N equations to determine the N point values, uN (x j , t), of thenumerical solution. In other words, the pseudospectral approximation uN sat-isfies the equation

∂uN (x, t)

∂t− INLuN (x, t) = 0.

Next, we will revisit some of the examples for the Fourier–Galerkin method.For simplicity, the collocation grid will be the same as the interpolation grid,except when stated explicitly.

Example 3.5 Consider first the linear constant coefficient problem

∂u(x, t)

∂t= c

∂u(x, t)

∂x+ ε

∂2u(x, t)

∂x2,

with the assumption that u(x, t) ∈ C∞p [0, 2π ], and c and ε are constants.

We seek solutions of the form

uN (x, t) =∑

|n|≤N/2

an(t)einx =N−1∑j=0

uN (x j , t)g j (x), (3.3)

such that the residual

RN (x, t) = ∂uN (x, t)

∂t− c

∂xuN (x, t) − ε

∂2

∂x2uN (x, t),

Page 58: Spectral Methods for Time-Dependent Problems

50 Fourier spectral methods

vanishes at a specified set of grid points, y j . In this case we choose y j = x j .This results in N ordinary differential equations for uN (x j , t),

duN (x j , t)

dt= cIN

∂xIN uN (x j , t) + εIN

∂2

∂x2IN uN (x j , t)

=N−1∑k=0

(cD(1)

jk + εD(2)jk

)uN (xk, t),

where D(1) and D(2) are the differentiation matrices. Consequently, the schemeconsists of solving the ODEs only at the grid points. Note that in the case ofvariable coefficient c = c(x), the derivation above remains the same, exceptthat c is replaced by c(xk).

In the collocation method the only use we make of the Fourier approximationis in obtaining the derivatives of the numerical approximation in physical space.As we mentioned in the last chapter, this can be done in two mathematicallyidentical, though computionally different, ways. One way uses the Fourier seriesand possibly a fast Fourier transform (FFT), while the other employs the directmatrix-vector multiplication.

If we require that the residual vanishes at a set of grid points, y j , which isdifferent from x j , we get N equations of the form

duN (y j , t)

dt= c

N−1∑i=0

uN (xi , t)dgi

dx

∣∣∣∣y j

+ ε

N−1∑i=0

uN (xi , t)d2gi

dx2

∣∣∣∣y j

,

where, as in the previous chapter, gi are the interpolating functions based onthe points x j .

In the simple linear case above, the formulation of the collocation methodis straightforward. However, the Galerkin method was not complicated forthis simple linear case either. It is in the realm of nonlinear problems that theadvantage of the collocation method becomes apparent.

Example 3.6 Consider the nonlinear problem

∂u(x, t)

∂t= u(x, t)

∂u(x, t)

∂x,

where the initial conditions are given and the solution and all its derivatives aresmooth and periodic over the time-interval of interest.

We construct the residual

RN (x, t) = ∂uN (x, t)

∂t− uN (x, t)

∂uN (x, t)

∂x,

Page 59: Spectral Methods for Time-Dependent Problems

3.2 Fourier–collocation methods 51

where, as before, uN is a trigonometric polynomial of degree N . The residualis required to vanish at the gridpoints x j , j = 0, . . . , N − 1, leading to

duN (x j , t)

dt− uN (x j , t)

∂uN (x, t)

∂x

∣∣∣∣x=x j

= 0,

i.e.,

duN (x j , t)

dt− uN (x j , t)

N−1∑k=0

D jkuN (xk, t) = 0.

Note that obtaining the equations is equally simple for a nonlinear problemas for a constant coefficient linear problem. This is in marked contrast to theGalerkin case.

Finally, we revisit the problem where the nonlinearity was so strong thatformulating the Fourier–Galerkin method was untenable.

Example 3.7 Consider the strongly nonlinear problem

∂u(x, t)

∂t= eu(x,t) ∂u(x, t)

∂x.

We seek solutions of the form

uN (x, t) =∑

|n|≤N/2

an(t)einx =N−1∑j=0

uN (x j , t)g j (x),

by requiring that the residual

RN (x, t) = ∂uN (x, t)

∂t− euN (x,t) ∂uN (x, t)

∂x,

vanishes at the grid points, x j ,

RN (x j , t) = duN (x j , t)

dt− euN (x j ,t)

∂uN (x, t)

∂x

∣∣∣∣x=x j

= 0.

Once again, the differentiation can be carried out by Fourier series (using FFT)or by matrix-vector multiplication. The nonlinear term is trivial to evaluate,because this is done in physical space.

Thus, the application of the Fourier–collocation method is easy even forproblems where the Fourier–Galerkin method fails. This is due to the fact thatwe can easily evaluate the nonlinear function, F(u), in terms of the point valuesof u(x), while it may be very hard, and in some cases impossible, to expressthe Fourier coefficients of F(u) in terms of the expansion coefficients of u(x).In other words: projection is hard, interpolation is easy.

Page 60: Spectral Methods for Time-Dependent Problems

52 Fourier spectral methods

3.3 Stability of the Fourier–Galerkin method

In Chapter 2, we analyzed the truncation error of the Fourier series. This wasdone for the continuous approximation and for the discrete approximation,which is mainly relevant to the Galerkin and collocation methods, respectively.In this section and the next, we discuss the stability of Fourier spectral methods.This, too, will be done in two parts: the continuous case, which is the Galerkinmethod, will be addressed in this section; and the discrete case, which is thecollocation method, in the next. This analysis is for the semidiscrete form,where only the spatial components are discretized.

We consider the initial boundary value problem

∂u

∂t= Lu, (3.4)

with proper initial data. The solution u(x, t) is in some Hilbert space with thescalar product (·, ·), e.g L2 [0, 2π].

A special case of a well posed problem is if L is semi-bounded in the Hilbertspace scalar product, i.e., L + L∗ ≤ 2αI for some constant α. In this specialcase, the Fourier–Galerkin method is stable.

First, let’s show that Equation (3.4) with a semi-bounded operator L is wellposed. To show this, we estimate the derivative of the norm by considering

d

dt‖u‖2 = d

dt(u, u) =

(du

dt, u

)+

(u,

du

dt

)(3.5)

= (Lu, u) + (u,Lu) = (u,L∗u) + (u,Lu)

= (u, (L + L∗)u).

Since L + L∗ ≤ 2αI, we have ddt ‖u‖2 ≤ 2α‖u‖2 and so d

dt ‖u‖ ≤ α‖u‖, whichmeans that the norm is bounded

‖u(t)‖ ≤ eαt‖u(0)‖,

and the problem is well posed.In the following, we consider two specific examples of semi-bounded oper-

ators in L2.

Example 3.8 Consider the operator

L = a(x)∂

∂x,

operating on the Hilbert space L2[0, 2π ] where a(x) is a real periodic functionwith periodic bounded derivative. The adjoint operator is obtained by integration

Page 61: Spectral Methods for Time-Dependent Problems

3.3 Stability of the Fourier–Galerkin method 53

by parts:

(Lu, v)L2[0,2π] =∫ 2π

0a(x)

∂u

∂xv dx

= −∫ 2π

0u

∂x(a(x)v) dx

=(

u,

[−a(x)

∂x− da(x)

dx

]v

)L2[0,2π ]

.

Thus,

L∗ = − ∂

∂xa(x)I = −a(x)

∂x− a′(x)I.

This means that

L + L∗ = −a′(x)I,

and since the derivative of a(x) is bounded∣∣a′(x)

∣∣ ≤ 2α, we have

L + L∗ ≤ 2αI.

Example 3.9 Consider the operator

L = ∂

∂xb(x)

∂x,

where, once again, L operates on the Hilbert space L2[0, 2π ] and b(x) is a realperiodic nonnegative function with a periodic bounded derivative.

As above,

(u,Lu)L2[0,2π ] =(

u,∂

∂xb(x)

∂xu

)L2[0,2π ]

=(

−b(x)∂

∂xu,

∂xu

)L2[0,2π]

.

Thus,

(u, (L + L∗)u)L2[0,2π] = −2

(b(x)

∂xu,

∂xu

)L2[0,2π]

≤ 0.

The nice thing about the Fourier–Galerkin method is that it is stable providedonly that the operator is semi-bounded.

Theorem 3.10 Given the problem ∂u/∂t = Lu, where the operator L is semi-bounded in the usual L2[0, 2π ] scalar product, then the Fourier–Galerkinmethod is stable.

Proof: First, we show that PN = P∗N . We begin with the simple observation

that,

(u,PN v) = (PN u,PN v) + ((I − PN )u,PN v) .

Page 62: Spectral Methods for Time-Dependent Problems

54 Fourier spectral methods

The second term is the scalar product of the projection of v on the space BN withthe projection of u on the complement of the space BN . Clearly, this is zero,i.e., (u,PN v) = (PN u,PN v). By the same argument, we find that (PN u, v) =(PN u,PN v). Therefore, (u,PN v) = (PN u, v), which means that PN = P∗

N .Now, we notice that the Fourier–Galerkin method involves seeking the

trigonometric polynomial uN such that

∂uN

∂t= PNLPN uN = LN uN .

Notice that

LN + L∗N = PNLPN + PNL∗PN

= PN (L + L∗)PN ≤ 2αPN .

Following Equation (3.5) this leads to the stability estimate

‖uN (t)‖ ≤ eαt‖uN (0)‖,provided that L is semi-bounded.

QED

It is important to note that for the collocation method it is not true thatIN = I∗

N in the usual L2 scalar product. This occurs because of the aliasingerror. Thus, the above proof breaks down for the Fourier–collocation methodand different techniques are needed to establish stability.

3.4 Stability of the Fourier–collocation method forhyperbolic problems I

In the Galerkin case, the fact that the operator is semi-bounded was enough toguarantee stability of the numerical method. However, this is not at all the casefor the collocation method. While the aliasing error in the collocation methoddoes not cause problems for the accuracy of the method, it significantly affectsthe stability of the method.

To establish stability of the pseudospectral method, we can proceed alongtwo different avenues, exploiting the properties of the differentiation matricesor the exactness of quadrature rules for trigonometric polynomials.

Whereas for the continuous Galerkin method we use the L2 continuous innerproduct norm, for the discrete collocation method we define the discrete innerproduct

( fN , gN )N = 1

N + 1

N∑j=0

fN (x j )gN (x j ),

Page 63: Spectral Methods for Time-Dependent Problems

3.4 The Fourier–collocation method for hyperbolic problems I 55

and the associated energy norm

‖ fN ‖2N = ( fN , fN )N

where fN , gN ∈ BN and there are an odd number of grid points x j , j =0, . . . , N . As a consequence of the exactness of the quadrature rule for trigono-metric functions (see Theorem 2.9) we have

( fN , gN )N = 1

∫ 2π

0fN gN dx, ‖ fN ‖L2[0,2π ] = ‖ fN ‖N .

Hence, in BN , the continuous and discrete inner product are the same.The situation is different when we discuss an even number of grid points. If

fN , gN ∈ BN and we have an even number of grid points x j , the discrete innerproduct

( fN , gN )N = 1

N

N−1∑j=0

fN (x j )gN (x j ), ‖ fN ‖2N = ( fN , fN )N

is not equal to the continuous inner product. However, using the fact thatfN ∈ L2[0, 2π ] it can be shown that there exists a K > 0 such that

K −1‖ fN ‖2L2[0,2π] ≤ ‖ fN ‖2

N ≤ K‖ fN ‖2L2[0,2π]. (3.6)

Hence, the continuous and discrete norms are uniformly equivalent.In the following, we attempt to derive bounds on the energy. We shall use

the fact that the differentiation matrices are all symmetric or skew-symmetric.Alternatively, the quadrature rules may, under certain circumstances, allow us topass from the semidiscrete case with summations to the continuous case withintegrals and, thus, simplify the analysis. Unless otherwise stated we focusour attention on the Fourier–collocation methods based on an even number ofgrid points, and we generally take the collocation grid to be the same as theinterpolation grid i.e., y j = x j . However, most of the results can be generalized.

Let us consider the stability of the pseudospectral Fourier approximation tothe periodic hyperbolic problem

∂u

∂t+ a(x)

∂u

∂x= 0, (3.7)

u(x, 0) = g(x).

We first assume that 0 ≤ 1/k ≤ |a(x)| ≤ k for some k; it is critical for stabilitythat a(x) is bounded away from zero. We go on to prove stability for the casein which a(x) is strictly positive. Similar results can be obtained in the sameway if a(x) is strictly negative. However, the case in which a(x) passes throughzero may not be stable as will be discussed in Section 3.5.

Page 64: Spectral Methods for Time-Dependent Problems

56 Fourier spectral methods

Theorem 3.11 Stability via method 1: the pseudospectral Fourier approxi-mation to the variable coefficient hyperbolic problem, Equation (3.7), with0 ≤ 1/k ≤ |a(x)| ≤ k is stable:

N−1∑j=0

u2N (x j , t) ≤ k2

N−1∑j=0

u2N (x j , 0).

Proof: In the collocation method, the approximant uN ∈ BN satisfies

∂uN

∂t

∣∣∣∣x j

+ a(x j )∂uN

∂x

∣∣∣∣x j

= 0, (3.8)

where x j represents the even grid points and we require that the equation besatisfied on these points also. Since a(x) is uniformly bounded away from zero,a(x)−1 exists. Multiplying Equation (3.8) by a(x j )−1uN (x j ) and summing overall collocation points we obtain

1

2

d

dt

N−1∑j=0

1

a(x j )u2

N (x j , t) = −N−1∑j=0

uN (x j , t)∂uN

∂x

∣∣∣∣x j

.

Using the exactness of the quadrature formula, and the fact that uN is periodic,

1

2

d

dt

N−1∑j=0

1

a(x j )u2

N (x j , t) = − N

∫ 2π

0uN (x)

∂uN

∂xdx = 0.

Thus, the summation is not changing over time:N−1∑j=0

1

a(x j )u2

N (x j , t) =N−1∑j=0

1

a(x j )u2

N (x j , 0).

Finally, we observe that, since 0 ≤ 1/k ≤ |a(x)| ≤ k, we have

1

k

N−1∑j=0

u2N (x j , t) ≤

N−1∑j=0

1

a(x j )u2

N (x j , t) =N−1∑j=0

1

a(x j )u2

N (x j , 0)

≤ kN−1∑j=0

u2N (x j , 0),

and soN−1∑j=0

u2N (x j , t) ≤ k2

N−1∑j=0

u2N (x j , 0).

From this we conclude that,

‖uN (x, t)‖N ≤ k‖uN (x, 0)‖N .

The proof for an odd number of points is identical.QED

Page 65: Spectral Methods for Time-Dependent Problems

3.4 The Fourier–collocation method for hyperbolic problems I 57

Another method of proving stability is based on the matrix representation ofthe Fourier–collocation method. The Fourier–collocation approximation to thevariable coefficient hyperbolic problem can be written as

duN (t)

dt+ ADuN (t) = 0, (3.9)

where uN is the vector of unknowns uN (x j , t), and A is a diagonal matrix withentries A j j = a(x j ). The matrix D is our differentiation matrix, Equation (2.19),which is skew-symmetric DT = −D. This fact is the crux of the stability proof,and is true regardless of the use of an even or odd number of collocationpoints.

The solution to Equation (3.9) is given by

u(t) = e−ADt u(0).

In this context, stability means that the matrix exponential is bounded indepen-dent of the number of points N :

‖e−ADt‖ ≤ K (t),

in the L2 spectral norm. In other words,

e−ADt e−(AD)T t ≤ K 2(t).

Note that if a(x j ) = a, a constant, then the matrix A = aI and this simplifiesto

e−aDt e(−aD)T t = e−a(D+DT )t = I,

since D is skew-symmetric and commutes with itself.

Theorem 3.12 Stability via method 2: the pseudospectral Fourier approxi-mation to the variable coefficient hyperbolic problem, Equation (3.7) with0 < 1/k ≤ |a(x)| ≤ k < ∞ is stable:

‖e−ADt‖ ≤ k.

Proof: Once again, we consider the case a(x) > 0. We rewrite

−AD = −A12 A

12 DA

12 A− 1

2 , and so e−ADt = A12 e−A

12 DA

12 t A− 1

2 ,

by using the definition of the matrix exponential eA = ∑∞n=0

1n! An . Since the

matrix is skew-symmetric,(A

12 DA

12)T = A

12 DT A

12 = −A

12 DA

12 ,

Page 66: Spectral Methods for Time-Dependent Problems

58 Fourier spectral methods

we have ‖e−A12 DA

12 t‖ = 1. Now,

‖e−ADt‖ ≤ ∥∥A12∥∥∥∥e−A

12 DA

12 t∥∥∥∥A− 1

2∥∥

= ∥∥A12∥∥∥∥A− 1

2∥∥ ≤

√k

1√k

= k.

We note that the same exact stability proof holds for eADt , i.e., for the equation∂u/∂t − a(x)∂u/∂x = 0. This establishes the proof for the case a(x) < 0 aswell. The same stability proof will also hold for e−DAt , which is the solution of∂u∂t + ∂a(x)u

∂x = 0.QED

3.5 Stability of the Fourier–collocation method forhyperbolic problems II

In the general case where a(x) changes sign, a mild instability can occur. Thesolution operator, rather than being bounded independently of N , grows linearlywith N ,

‖eADt‖ ∼ N .

In a well resolved problem, this mild growth is absorbed in the trucation error,and the numerical solution is still accurate. However, if the problem is onlymarginally resolved, or if there are other perturbations, this linear growth leadsto full-blown instability.

Although the Fourier–collocation approximation to Equation (3.7), in thecase where a(x) vanishes somewhere in the domain, is not stable in general,there are several known techniques of stabilizing the method.

The most straightforward way to derive a stable pseudospectral Fourierapproximation to Equation (3.7) with |ax (x)| bounded, is to consider the skew-symmetric form of the equation

∂u

∂t+ 1

2a(x)

∂u

∂x+ 1

2

∂a(x)u

∂x− 1

2ax (x)u(x, t) = 0. (3.10)

The Fourier–collocation approximation to this equation is stable.

Theorem 3.13 The pseudospectral Fourier approximation to the variable coef-ficient hyperbolic equation, Equation (3.10) is stable:

‖uN (t)‖N ≤ eαt‖uN (0)‖N , (3.11)

Page 67: Spectral Methods for Time-Dependent Problems

3.5 The Fourier–collocation method for hyperbolic problems II 59

where

α = 1

2max

x|ax (x)|.

Proof: In the Fourier collocation method we seek a polynomial satisfying theequation

∂uN

∂t

∣∣∣∣x j

+ 1

2a(x j )

∂uN

∂x

∣∣∣∣x j

+ 1

2

∂JN [a(x)uN ]

∂x

∣∣∣∣x j

− 1

2ax (x j )uN (x j ) = 0

(3.12)

at all grid points, x j . Multiplying by uN (x j ) and summing over all the collocationpoints we obtain

1

2

d

dt

N−1∑j=0

u2N (x j ) = −1

2

N−1∑j=0

a(x j )uN (x j )∂uN

∂x

∣∣∣∣∣x j

− 1

2

N−1∑j=0

uN (x j )∂JN [a(x)uN ]

∂x

∣∣∣∣x j

+ 1

2

N−1∑j=0

ax (x j )u2N (x j ).

Observe that in the second term JN ∂JN [a(x)uN (x)]/∂x ∈ BN , so the quadra-ture rule in Theorem 2.9 is exact. Thus,

1

2

N−1∑j=0

uN (x j )∂JN [a(x)uN (x)]

∂x

∣∣∣∣x j

= N

∫ 2π

0uN (x, t)JN

∂JN [a(x)uN (x)]

∂xdx

= − N

∫ 2π

0JN [a(x)uN (x)]JN

∂uN (x)

∂xdx

= −1

2

N−1∑j=0

a(x j )uN (x j )∂uN (x)

∂x

∣∣∣∣x j

.

Hence,

1

2

d

dt‖uN ‖2

N = 1

2

N−1∑j=0

ax (x j )u2N (x j , t)

≤ 1

2max

x|ax (x)|

N−1∑j=0

u2N (x j , t)

≤ 1

2max

x|ax (x)|‖uN ‖2

N ,

leading to the stability estimate of the theorem.QED

Page 68: Spectral Methods for Time-Dependent Problems

60 Fourier spectral methods

Note that the approximation in Equation (3.12) can be written as

∂uN

∂t+ 1

2JN a(x)

∂uN

∂x+ 1

2

∂xJN [a(x)uN ] − 1

2JN (ax uN ) = 0.

If we write the last term as

JN (ax uN ) = JN∂

∂x(a(x)uN ) − JN a(x)

∂uN

∂x,

the approximation becomes

∂uN

∂t+ JN a(x)

∂uN

∂x+ AN = 0

which is the usual (unstable) Fourier–collocation approximation to Equa-tion (3.7) plus the term

AN = 1

2

(∂

∂xJN [a(x)uN ] − JN

∂x[a(x)uN ]

).

Thus it is this addition of the aliasing term AN which stabilizes the method.Note that, by the aliasing theorem

‖AN ‖L2[0,2π] ≤ N 1−2s∥∥(a(x)uN )(2s)

∥∥L2[0,2π ] ≤ C N 1−2s

∥∥u(2s)N

∥∥L2[0,2π ].

This suggests a different way of stabilizing the Fourier–collocation method byadding a superviscosity term

∂uN

∂t+ JN a(x)

∂uN

∂x= (−1)s+1 ε

N 2s−1

∂2suN

∂x2s. (3.13)

Theorem 3.14 The superviscosity approximation, Equation (3.13), to Equa-tion (3.7) is stable provided that ε is large enough.

Proof: We rewrite Equation (3.13) as

∂uN

∂t+ JN

(a(x)

∂uN

∂x

)+ AN = (−1)s+1 ε

N 2s−1

∂2suN

∂x2s+ AN . (3.14)

Multiplying by uN and summing, we get(uN ,

∂uN

∂t

)N

= −(

uN ,JN

(a(x)

∂uN

∂x

))N

− (uN , AN )N

+ (−1)s+1

N 2s−1ε

(uN ,

∂2suN

∂x2s

)N

+ (uN , AN )N ,

since the quadrature formula is exact, all the scalar products are, in fact,integrals.

Page 69: Spectral Methods for Time-Dependent Problems

3.5 The Fourier–collocation method for hyperbolic problems II 61

Looking at the first term on the right hand side of the equation, we observethat

−(

uN ,JN

(a(x)

∂uN

∂x

))N

− (uN , AN )N = −1

2(uN , ax uN )N

≤ 1

2max |ax | (uN , uN )N .

We proceed to show that the next term is negative: first, note that integrating byparts s times yields

(uN , AN )N = 1

∫ 2π

0uN AN dx = 1

2π(−1)s

∫ 2π

0u(s)

N A(−s)N dx ≤ c

∥∥u(s)N

∥∥2

N 2s−1

and (uN ,

∂ (2s)uN

∂x (2s)

)N

= 1

∫ 2π

0uN

∂ (2s)uN

∂x (2s)dx = (−1)s

∥∥u(s)N

∥∥2.

Putting these together, we obtain(uN ,

∂uN

∂t

)N

= −(

uN ,JN

(a(x)

∂uN

∂x

))N

− (uN , AN )N

+ (−1)s+1

N 2s−1ε

(uN ,

∂2suN

∂x2s

)N

+ (uN , AN )N

≤ 1

2max |ax | (uN , uN )N + (−1)s+1

N 2s−1ε(−1)s

∥∥u(s)N

∥∥2 + c

∥∥u(s)N

∥∥2

N 2s−1

= 1

2max |ax | (uN , uN )N + (c − ε)

∥∥u(s)N

∥∥2

N 2s−1.

If ε > c this last term is negative, and thus we conclude that the scheme isstable: (

uN ,∂uN

∂t

)N

≤ 1

2max |ax | (uN , uN )N .

QED

We note that we are considering the scheme based on an odd number ofpoints. This is only done for simplicity, as it allows us to pass to the integralswithout complications. However, the conclusions we reach remain valid for theeven case, also.

The advantage of working with the skew-symmetric form is in the simplicityof the stability proof. However, there is a significant practical drawback in that itincreases the complexity of the scheme by doubling the number of derivatives.

Page 70: Spectral Methods for Time-Dependent Problems

62 Fourier spectral methods

It would seem that this is also the case in the superviscosity method, but in factthere is a way to use the superviscosity method with no extra cost.

Consider the equation

∂uN

∂t= (−1)s+1 ε

N 2s−1

∂2s

∂x2suN .

Using a Fourier–Galerkin method we solve for the coefficients of uN to get

dak(t)

dt= −ε

k2s

N 2s−1ak(t).

Thus,

ak(t + �t) = e−ε�t N ( kN )2s

ak(t).

The coefficients ak(t) are advanced by the PDE over one time step and thenmultiplied by an exponential filter. The addition of the superviscosity term isthe equivalent of using an exponential filter of the above form. Low pass filtersstabilize the Fourier–collocation method at no extra cost.

3.6 Stability for parabolic equations

Let us now consider the question of stability for the strongly parabolic prototypeproblem

∂u

∂t= b(x)

∂2u

∂x2, (3.15)

u(x, 0) = g(x),

where b(x) > 0 for wellposedness, and u(x, t) as well as g(x) are assumed tobe periodic and smooth.

As before we shall derive two equivalent estimates which address the ques-tion of stability for Equation (3.15).

Theorem 3.15 The Fourier–collocation method approximation to the stronglyparabolic problem, Equation (3.15), is stable:

‖uN (t)‖N ≤√

max b(x)

min b(x)‖uN (0)‖N .

Proof:

Method 1 In matrix form, the Fourier–collocation approximation to theparabolic problem is

du(t)

dt= BD(2)u(t),

Page 71: Spectral Methods for Time-Dependent Problems

3.6 Stability for parabolic equations 63

where u is the grid vector, whose components are uN (x j , t), and x j representthe grid points. B is the diagonal positive matrix with entries B j j = b(x j ). Fur-thermore, D(2) represents the second derivative differentiation matrix discussedin Section 2.2.4. We need to be careful, however, when defining this matrixbecause when using an even number of grid points, D(2) �= D · D. The differ-ence between the two formulations stems from the fact that D(2)u ∈ BN while(D · D)u ∈ BN−1, i.e., the latter reduces the order of the polynomial. To ensurestability of the Fourier–collocation scheme we choose the latter definition,

D(2) ≡ D · D.

Note that this problem does not arise when using a method based on an oddnumber of grid points.

We continue by multiplying with uT B−1 from the left,

uT B−1 d

dtu = uT D(2)u = uT DDu

= (DT u)T (Du) = −(Du)T (Du) ≤ 0,

where we use the fact that D is skew-symmetric. Thus we can say that

d

dtuT B−1u ≤ 0,

and so1

maxx b(x)‖uN (t)‖2

N ≤uT (t)B−1u(t)≤uT (0)B−1u(0) ≤ 1

minx b(x)‖uN (0)‖2

N .

Method 2 The same result may be obtained in scalar form, using the quadraturerules. As usual,

uN (x, t) =N−1∑j=0

uN (x j , t)g j (x),

and we require that

∂uN (x, t)

∂t

∣∣∣∣x j

= b(x j )∂2uN (x, t)

∂x2

∣∣∣∣x j

.

Multiply by b(x j )−1uN (x j , t) and sum over the collocation points to obtain

1

2

d

dt

N−1∑j=0

1

b(x j )u2

N (x j , t) =N−1∑j=0

uN (x j , t)∂2uN (x, t)

∂x2

∣∣∣∣x j

.

We realize that the summation on the right hand side is a polynomial of order2N , for which the quadrature rule based on an even number of grid points x j

is not exact, and so we cannot immediately pass to the integral. As before, we

Page 72: Spectral Methods for Time-Dependent Problems

64 Fourier spectral methods

circumvent this problem by defining the second-order derivative

INd

dxIN

d

dxIN .

This ensures that

∂2uN (x, t)

∂x2= IN

∂xIN

∂xuN (x, t) ∈ BN−1.

Now the quadrature rule is exact and we have

1

2

d

dt

N−1∑j=0

1

b(x j )u2

N (x j , t) =N−1∑j=0

uN (x j , t)

(∂

∂xIN

∂uN

∂x

∣∣∣∣x j

)

= N

∫ 2π

0uN (x, t)IN

(∂

∂xIN

∂uN

∂x

)dx

= − N

∫ 2π

0IN

∂uN

∂xIN

∂uN

∂xdx

= −N−1∑j=0

(∂uN

∂x

∣∣∣∣x j

)2

≤ 0.

The proof continues as in the matrix case. Once again, the case of an odd numberof points is simpler since here the quadrature rule is exact for polynomials oforder 2N and no special definition of the second derivative is necessary.

QED

3.7 Stability for nonlinear equations

In Section 3.5, we showed that the addition of a superviscosity term stabilizes theFourier–collocation methods for the linear equations. For nonlinear equations,similar techniques can be used to stabilize the methods. Consider the nonlinearhyperbolic system

∂U

∂t+ ∂ f (U )

∂x= 0. (3.16)

The Fourier–collocation method can be written as

∂uN

∂t+ IN

∂IN f (uN )

∂x= 0. (3.17)

The method is unstable in general but can be stabilized by either of the followingmethods:

In the Spectral viscosity method (SV), Equation (3.17) is modified by

∂uN

∂t+ IN

∂IN f (uN )

∂x= εN (−1)s+1 ∂s

∂xs

[Qm(x, t) ∗ ∂suN

∂xs

]

Page 73: Spectral Methods for Time-Dependent Problems

3.8 Further reading 65

where the operator Qm keeps only the high modes of the viscosity term ∂2

∂x2 un:

εN (−1)s+1 ∂s

∂xs

[Qm(x, t) ∗ ∂suN

∂xs

]∼ ε

∑m<|k|<N

(ik)2s Qk ukeikx

with

ε ∼ C N 2s−1;

m ∼ N θ , θ <2s − 1

2s;

1 −(

m

|k|) 2s−1

θ

≤ Qk ≤ 1.

The most commonly used SV scheme uses s = 1.A better way to stabilize the scheme is the Super spectral viscosity (SSV)

method.

∂uN

∂t+ IN

∂IN f (uN )

∂x= εN (−1)s+1 ∂2s

∂x2suN . (3.18)

Note that for spectral accuracy the order s must be proportional to N , thenumber of trigonometric polynomials (or grid points) in the approximation.Thus viscosity changes with mesh refinement. As we showed in Section 3.5 theSV and SSV techniques are equivalent to filtering.

The theory developed by Tadmor demonstrates that both the SV and SSVmethods converge to the correct entropy solution for stable Fourier approxima-tions to scalar nonlinear hyperbolic equations. It has been proven that even forsystems, if the solution converges, it converges to the correct entropy solution(the Lax–Wendroff theorem).

3.8 Further reading

The analysis of stability of the Fourier collocation methods for linear problemswas largely completed in the 1970’s with contributions by Fornberg (1973),Kreiss and Oliger (1972), Majda et al (1978) and Goodman et al (1979), with thelatter highlighting the difficulties posed by variable coefficient problem. A goodreview of these results are given by Tadmor (1987), including a more thoroughdiscussion of skew-symmetric forms. The exponential convergence for analyticfunctions is discussed in detail by Tadmor (1986). For the introduction of thevanishing viscosity methods, we refer to the series of papers by Maday andTadmor (1989) and Tadmor (1989, 1990, 1993), as well as the work by Schochet(1990). The more direct use of filters for stabilization as discussed here wasintroduced in Gottlieb and Hesthaven (2001).

Page 74: Spectral Methods for Time-Dependent Problems

4

Orthogonal polynomials

At the heart of spectral methods is the fact that any nice enough function u(x)can be expanded in the form

u(x) =∑

|n|< ∞unφn(x),

where φn(x) are the global basis functions. Fourier spectral methods, which usethe periodic basis φn(x) = einx , perform well and deliver highly accurate resultsfor smooth periodic problems. However, exponential accuracy of the scheme isachieved only when the solution and its derivatives are periodic. Lacking suchhigher-order periodicity globally impacts the convergence rate of the Fourierseries, and reduces the spatial accuracy of the spectral scheme to that of a finitedifference scheme. If the function u(x) or any of its derivatives are not periodic,then it makes sense to use a non-periodic basis, such as a polynomial basis.It is convenient to focus on polynomials which are eigensolutions to Sturm–Liouville problems, since this class of polynomials has been extensively studiedand has nice convergence properties.

The underlying assumption is that u(x) can be well approximated in thefinite dimensional subspace of

BN = span{xn}Nn=0,

that satisfies the boundary conditions. The emphasis shall be on polynomialapproximations of continuous functions, u(x) ∈ C0[a, b], where the interval[a, b] could be bounded or unbounded. For simplicity, we will focus on prob-lems defined on a bounded interval, keeping in mind that similar results can beobtained also for problems defined on the semi-infinite interval, [0, ∞), as wellas the infinite interval, (−∞, ∞).

66

Page 75: Spectral Methods for Time-Dependent Problems

4.1 The general Sturm–Liouville problem 67

4.1 The general Sturm–Liouville problem

The Sturm–Liouville operator is given by

Lφ(x) = − d

dx

(p(x)

dφ(x)

dx

)+ q(x)φ(x) = λw(x)φ(x), (4.1)

subject to the boundary conditions

α−φ(−1) + β−φ′(−1) = 0, α2− + β2

− �= 0, (4.2)

α+φ(1) + β+φ′(1) = 0, α2+ + β2

+ �= 0.

We restrict our attention to the interval [−1, 1] for simplicity. In Equation (4.1),we have the real functions p(x), q(x), and w(x). Note that p(x) ∈ C1[−1, 1] andis strictly positive in (−1, 1); q(x) ∈ C0[−1, 1], is non-negative and bounded;and w(x) ∈ C0[−1, 1] is the non-negative continuous weight function.

Assuming that α−β− ≤ 0 and α+β+ ≥ 0 one can show that the solu-tions to the Sturm–Liouville eigenvalue problem are unique sets of eigen-functions, φn(x), and eigenvalues, λn . The eigenfunctions, φn(x), form anL2[−1, 1]-complete basis while the nonnegative and unique eigenvalues forman unbounded sequence,

0 ≤ λ0 < λ1 < λ2 . . .

Based on this, it is customary to order the eigensolutions in unique pairs (λn, φn).These eigensolutions have the asymptotic behavior

λn � (nπ )2

(∫ 1

−1

√w(x)

p(x)dx

)−2

as n → ∞,

and

φn(x) � An sin

[√λn

∫ x

1

√w(x)

p(x)dx

]as n → ∞.

Furthermore, since L is self-adjoint, the eigenfunctions of the Sturm–Liouvilleproblem are orthogonal in the ‖ · ‖L2

w[−1,1]-norm,

(φn, φm)L2w[−1,1] = (φn, φm)w =

∫ 1

−1φn(x)φm(x)w(x) dx = γnδnm,

where γn = (φn, φn)L2w[−1,1]. These eigenfunctions are complete in L2

w, so thatany function u(x) ∈ L2

w[−1, 1] may be represented as

u(x) =∞∑

n=0

unφn(x).

Page 76: Spectral Methods for Time-Dependent Problems

68 Orthogonal polynomials

A natural approximation to u(x) is then the truncated series

PN u(x) =N∑

n=0

unφn(x),

where the continuous expansion coefficients are obtained from the orthogonalitycondition

un = 1

γn(u, φn)L2

w[−1,1], γn = ‖φn‖2L2

w[−1,1].

The Parseval identity∫ 1

−1u2(x)w(x) dx = (u, u)L2

w[−1,1] =∞∑

n=0

γnu2n

leads to a truncation error of the form∥∥∥∥∥u(x) −N∑

n=0

unφn(x)

∥∥∥∥∥2

L2w[−1,1]

=∞∑

n=N+1

γnu2n.

Convergence thus depends solely on the decay of the expansion coefficients,un , similar to the expansions based on trigonometric polynomials.

The decay of the expansion coefficients, un , can be estimated as

un = 1

γn(u, φn)L2

w[−1,1] = 1

γn

∫ 1

−1u(x)φn(x)w(x) dx

= 1

γnλn

∫ 1

−1u(x)Lφn(x) dx = 1

γnλn

∫ 1

−1u[−(pφ′

n)′ + qφn] dx

= 1

γnλn[−upφ′

n]1−1 + 1

γnλn

∫ 1

−1[u′ pφ′

n + quφn] dx

= 1

γnλn[p(u′φn − uφ′

n)]1−1 + 1

γnλn

∫ 1

−1[Lu(x)] φn(x) dx

= 1

γnλn[p(u′φn − uφ′

n)]1−1 + 1

γnλn(u(1), φn)L2

w[−1,1], (4.3)

where we have introduced the symbol

u(m)(x) = 1

w(x)Lu(m−1)(x) =

( Lw(x)

)m

u(x),

and u(0)(x) = u(x). This derivation is valid provided u(1)(x) ∈ L2w[−1, 1], i.e.,

u(2)(x) ∈ L2w[−1, 1] and w(x)−1 ∈ L1[−1, 1].

In the singular Sturm–Liouville problem, p(x) vanishes at the boundarypoints, i.e., p(±1) = 0. Therefore the boundary term in Equation (4.3) vanishes,

Page 77: Spectral Methods for Time-Dependent Problems

4.2 Jacobi polynomials 69

and repeatedly integrating by parts we obtain

|un| � C1

(λn)m

∥∥u(m)

∥∥L2

w[−1,1],

for u(m)(x) ∈ L2w[a, b], requiring that u(2m)(x) ∈ L2

w[a, b]. Consequently, if thefunction u(x) ∈ C∞[a, b] we recover spectral decay of the expansion coeffi-cients, i.e., |un| decays faster than any algebraic order of λn . This result is validindependent of specific boundary conditions on u(x).

This suggests that the eigensolutions of the singular Sturm–Liouville prob-lem are well suited for expanding arbitrary functions defined in the finite intervalas the eigenfunctions form a complete, orthogonal basis family, and the expan-sion is accurate independent of the boundary terms.

It is interesting to note what happens in the regular Sturm–Liouville prob-lem. In this case, p(x) and the weight function, w(x), are both strictly positive,and p(x) does not, in general, vanish at both boundaries. Thus the boundaryterm in Equation (4.3) does not vanish and forms the major contribution to theerror. However, for periodic problems this term vanishes by periodicity, thusjustifying the use of solutions of the regular Sturm–Liouville problem for peri-odic problems. The Fourier basis exemplifies this; it is a solution of a regularSturm–Liouville problem, and is ideal for periodic problems. However, if theproblem is not periodic, the decay rate plummets, demonstrating the effects ofthe first term in Equation (4.3).

4.2 Jacobi polynomials

Spectral methods typically use special cases of Jacobi polynomials, which arethe polynomial eigenfunctions of the singular Sturm–Liouville problem.

Theorem 4.1 The eigensolutions to the singular Sturm–Liouville problemwith

p(x) = (1 − x)α+1(1 + x)β+1, w(x) = (1 − x)α(1 + x)β, q(x) = cw(x),

for α, β > −1, are polynomials of order n and are known as the Jacobi poly-nomials P (α,β)

n (x). The associated eigenvalues are

λn = n(n + α + β + 1) − c.

A convenient form of the Jacobi polynomial is given by Rodrigues’ formula

(1 − x)α(1 + x)β P (α,β)n (x) = (−1)n

2nn!

dn

dxn[(1 − x)α+n(1 + x)β+n], (4.4)

Page 78: Spectral Methods for Time-Dependent Problems

70 Orthogonal polynomials

for integer n. An explicit formula is given by

P (α,β)n (x) = 1

2n

n∑k=0

(n + α

k

)(n + β

n − k

)(x − 1)n−k(x + 1)k . (4.5)

Furthermore,

d

dxP (α,β)

n (x) = 1

2(n + α + β + 1) P (α+1,β+1)

n−1 (x). (4.6)

The Jacobi polynomials are normalized such that

P (α,β)n (1) =

(n + α

n

)= �(n + α + 1)

n!�(α + 1). (4.7)

An important consequence of the symmetry of the weight function w(x), andthe orthogonality of the Jacobi polynomials, is the symmetry relation

P (α,β)n (x) = (−1)n P (β,α)

n (−x), (4.8)

i.e., the Jacobi polynomials are even and odd depending on the order of thepolynomial.

The expansion of functions u(x) ∈ L2w[−1, 1], using the Jacobi polynomial,

P (α,β)n (x), takes the form

u(x) =∞∑

n=0

un P (α,β)n (x),

where the continuous expansion coefficients un are found through the weightedinner product

un = 1

γn

(u, P (α,β)

n

)L2

w[−1,1] (4.9)

= 1

γn

∫ 1

−1u(x)P (α,β)

n (x)(1 − x)α(1 + x)β dx,

with the normalizing constant, γn , being

γn = ∥∥P (α,β)n

∥∥2

L2w[−1,1] (4.10)

= 2α+β+1

(2n + α + β + 1)n!

�(n + α + 1)�(n + β + 1)

�(n + α + β + 1).

In practice, we compute the Jacobi polynomials using a variety of recurrencerelations. These are now presented in the following theorems:

Page 79: Spectral Methods for Time-Dependent Problems

4.2 Jacobi polynomials 71

Theorem 4.2 All Jacobi polynomials, P (α,β)n (x), satisfy a three-term recurrence

relation of the form

x P (α,β)n (x) = a(α,β)

n−1,n P (α,β)n−1 (x) + a(α,β)

n,n P (α,β)n (x) + a(α,β)

n+1,n P (α,β)n+1 (x),

where a(α,β) are given by

a(α,β)n−1,n = 2(n + α)(n + β)

(2n + α + β + 1)(2n + α + β), (4.11)

a(α,β)n,n = − α2 − β2

(2n + α + β + 2)(2n + α + β),

a(α,β)n+1,n = 2(n + 1)(n + α + β + 1)

(2n + α + β + 2)(2n + α + β + 1),

for n ≥ 0, where for n = 0, a(α,β)−1,0 = 0. To start the recurrence, the first two

polynomials are

Pα,β

0 (x) = 1, Pα,β

1 (x) = 1

2(α + β + 2)x + 1

2(α − β).

Using this recurrence relation, all Jacobi polynomials can be evaluated at anyx ∈ [−1, 1] and for any order polynomial. Another useful recurrence formulais given in the next theorem.

Theorem 4.3 All Jacobi polynomials, P (α,β)n (x), satisfy a three-term recurrence

relation of the form

P (α,β)n (x) = b(α,β)

n−1,n

d P (α,β)n−1 (x)

dx+ b(α,β)

n,n

P (α,β)n (x)

dx+ b(α,β)

n+1,n

P (α,β)n+1 (x)

dx,

where

b(α,β)n−1,n = − 1

n + α + βa(α,β)

n−1,n, (4.12)

b(α,β)n,n = − 2

α + βa(α,β)

n,n ,

b(α,β)n+1,n = 1

n + 1a(α,β)

n+1,n.

Yet another important recurrence property of the Jacobi polynomials is

Theorem 4.4 (Christoffel–Darboux) For any Jacobi polynomial, P (α,β)n (x),

we haveN∑

n=0

1

γnP (α,β)

n (x)P (α,β)n (y) = a(α,β)

N+1,N

γN

P (α,β)N+1 (x)P (α,β)

N (y) − P (α,β)N (x)P (α,β)

N+1 (y)

x − y,

Page 80: Spectral Methods for Time-Dependent Problems

72 Orthogonal polynomials

where

a(α,β)N+1,N

γN= 2−(α+β)

2N + α + β + 2

�(N + 2)�(N + α + β + 2)

�(N + α + 1)�(N + β + 1),

using Equations (4.10) and (4.11).

A consequence of this result is the following theorem.

Theorem 4.5 All Jacobi polynomials, P (α,β)n (x), satisfy a three-term recurrence

relation of the form

(1 − x2)d P (α,β)

n (x)

dx= c(α,β)

n−1,n P (α,β)n−1 (x) + c(α,β)

n,n P (α,β)n (x) + c(α,β)

n+1,n P (α,β)n+1 (x),

where

c(α,β)n−1,n = 2(n + α)(n + β)(n + α + β + 1)

(2n + α + β)(2n + α + β + 1), (4.13)

c(α,β)n,n = 2n(α − β)(n + α + β + 1)

(2n + α + β)(2n + α + β + 2),

c(α,β)n+1,n = − 2n(n + 1)(n + α + β + 1)

(2n + α + β + 1)(2n + α + β + 2).

Clearly, there is a wide variety of Jacobi polynomials to choose from. Whichspecific polynomial family, among all the Jacobi polynomials, is best suited forthe approximation of functions defined on the finite interval? As can only beexpected, the answer to this question depends on what we mean by “best”; inother words, on how the error is measured.

4.2.1 Legendre polynomials

A natural choice of basis functions are those that are orthogonal in L2[−1, 1].In this case, w(x) = 1 and α = β = 0. These polynomials are known asLegendre polynomials, Pn(x), and are eigensolutions to the Sturm–Liouvilleproblem

d

dx(1 − x2)

d Pn(x)

dx+ n(n + 1)Pn(x) = 0,

with eigenvalues λn = n(n + 1).The Rodrigues formula for the Legendre polynomials simplifies to

Pn(x) = (−1)n

2nn!

dn

dxn

[(1 − x2)n

]. (4.14)

Page 81: Spectral Methods for Time-Dependent Problems

4.2 Jacobi polynomials 73

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00

−1.00

−0.75

−0.50

−0.25

0.00

0.25

0.50

0.75

1.00

x

P0

P1

P2P3

P5 P4

Figure 4.1 Plot of the first 5 Legendre polynomials.

An explicit formula can be recovered from Equation (4.5):

Pn(x) = 1

2n

[n/2]∑k=0

(−1)k

(nk

)(2n − 2k

n

)xn−2k, (4.15)

where [n/2] refers to the integer part of the fraction.It can be proven that the Legendre polynomials are bounded

|Pn(x)| ≤ 1, |P ′n(x)| ≤ 1

2n(n + 1),

with boundary values

Pn(±1) = (±1)n, P ′n(±1) = (±1)n+1

2n(n + 1). (4.16)

The first few Legendre polynomials are

P0(x) = 1, P1(x) = x, P2(x) = 1

2(3x2 − 1), P3(x) = 1

2(5x3 − 3x),

and the first 5 Legendre polynomials are shown in Figure 4.1.The three-term recurrence relation (Theorem 4.2) for the Legendre polyno-

mials,

x Pn(x) = n

2n + 1Pn−1(x) + n + 1

2n + 1Pn+1(x), (4.17)

yields a direct way to evaluate legendre polynomials of arbitrary order. Theo-rem 4.3 yields the recurrence relation

Pn(x) = − 1

2n + 1P ′

n−1(x) + 1

2n + 1P ′

n+1(x). (4.18)

Many other properties of the Legendre polynomials are listed in Appendix B.

Page 82: Spectral Methods for Time-Dependent Problems

74 Orthogonal polynomials

4.2.2 Chebyshev polynomials

While the Legendre polynomials were the best from the point of view of min-imizing the L2 error, the Chebyshev polynomial family has a simple explicitformula and is straightforward to compute.

The Chebyshev polynomial, Tn(x), is a solution to the singular Sturm–Liouville problem with p(x) = √

1 − x2, q(x) = 0 and the weight function,w(x) = (

√1 − x2)−1, i.e.,

d

dx

(√1 − x2

dTn(x)

dx

)+ λn√

1 − x2Tn(x) = 0, (4.19)

with λn = n2. The Chebyshev polynomials are related to the Jacobi polyno-mials with α = β = − 1

2 :

Tn(x) = (n!2n)2

(2n)!P

(− 12 ,− 1

2 )n (x) =

[(n − 1

2n

)]−1

P(− 1

2 ,− 12 )

n (x).

Note that the transformation x = cos(ξ ) in Equation (4.19) leads to the constantcoefficient problem

d2Tn(ξ )

dξ 2+ λnTn(ξ ) = 0

so that

Tn(ξ ) = cos(nξ )

is the correct solution. Therefore

Tn(x) = cos (n arccos x)

is a convenient alternative way to write the Chebyshev polynomials.The Rodrigues’ formula for Chebyshev polynomials is obtained directly

from Equation (4.4) by normalizing appropriately;

Tn(x) = (−1)nn!2n

(2n)!

√1 − x2

dn

dxn

{(1 − x2)n− 1

2}, (4.20)

The definition of the Chebyshev polynomials yields the bounds

|Tn(x)| ≤ 1, |T ′n(x)| ≤ n2,

with the boundary values

Tn(±1) = (±1)n, T ′n(±1) = (±1)n+1n2, (4.21)

due to the normalization employed.

Page 83: Spectral Methods for Time-Dependent Problems

4.2 Jacobi polynomials 75

x

T5

T4

T3

T1

T0

T2

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00

−1.00

−0.75

−0.50

−0.25

0.00

0.25

0.50

0.75

1.00

Figure 4.2 Plot of the first 5 Chebyshev polynomials.

For the Chebyshev polynomials, the three-term recurrence relation derivedin Theorem 4.2 yields

xTn(x) = 1

2Tn−1(x) + 1

2Tn+1(x), (4.22)

using the normalized recurrence coefficients in Equation (4.11). In this way, itis simple to compute the first few Chebyshev polynomials

T0(x) = 1, T1(x) = x, T2(x) = 2x2 − 1, T3(x) = 4x3 − 3x .

The first five Chebyshev polynomials are illustrated in Figure 4.2.Likewise, from Theorem 4.3 we obtain the recurrence relation

Tn(x) = − 1

2(n − 1)T ′

n−1(x) + 1

2(n + 1)T ′

n+1(x), (4.23)

while the recurrence of Theorem 4.5 yields a relation of the form

(1 − x2)T ′n(x) = n

2Tn−1(x) − n

2Tn+1(x). (4.24)

In Appendix B, we summarize the properties of Chebyshev polynomials ingeneral, including several results not given here.

A fascinating result is that of all polynomials of degree n, the best approxi-mant (in the maximum norm) to the function xn+1 is the nth-order Chebyshevpolynomial Tn(x). The Chebyshev polynomial is, in this sense, the optimalchoice when the error is measured in the maximum norm.

Page 84: Spectral Methods for Time-Dependent Problems

76 Orthogonal polynomials

4.2.3 Ultraspherical polynomials

The Legendre and Chebyshev polynomials are related to a subclass of Jacobipolynomials known as the ultraspherical polynomials. The ultraspherical poly-nomials are simply Jacobi polynomials with α = β, and normalized differently:

P (α)n (x) = �(α + 1)�(n + 2α + 1)

�(2α + 1)�(n + α + 1)P (α,α)

n (x). (4.25)

The relation between Legendre and Chebyshev polynomials and the ultraspher-ical polynomials is

Pn(x) = P (0)n (x), Tn(x) = n lim

α→− 12

�(2α + 1)P (α)n (x). (4.26)

Note that �(2α + 1) has a pole for α = −1/2, and must be treated carefully.The ultraspherical polynomials, P (α)

n (x), are also known as the Gegenbauerpolynomials, C (λ)

n (x), of the form

C (λ)n (x) = P

(λ− 12 )

n (x).

The ultraspherical polynomials, P (α)n (x), appear as the solution to the Sturm–

Liouville problem

d

dx(1 − x2)α+1 d P (α)

n (x)

dx+ n(n + 2α + 1)(1 − x2)α P (α)

n (x) = 0, (4.27)

which is Equation (4.1), with λn = n(n + 2α + 1) and p(x) = (1 − x2)α+1,q(x) = 0 and w(x) = (1 − x2)α .

The Rodrigues’ formula for the ultraspherical polynomials is obtained fromEquation (4.4) and Equation (4.25);

(1 − x2)P (α)n (x) = �(α + 1)�(n + 2α + 1)

�(2α + 1)�(n + α + 1)

(−1)n

2nn!

dn

dxn{(1 − x2)n+α},

(4.28)

while an explicit formula, as in Equation (4.5) is given by

P (α)n (x) = 1

�(α + 1

2

) [n/2]∑k=0

(−1)k �(α + 1

2 + n − k)

k!(n − 2k)!(2x)n−2k (4.29)

= �(α + 1)�(2n + 2α + 1)

2nn!�(2α + 1)�(n + α + 1)

[xn + · · · ] ,

where [n/2] refers to the integer part of the fraction.The relation between different ultraspherical polynomials is described by

d

dxP (α)

n (x) = (2α + 1) P (α+1)n−1 (x), (4.30)

Page 85: Spectral Methods for Time-Dependent Problems

4.2 Jacobi polynomials 77

while the value of P (α)n (x) at the boundary is

P (α)n (±1) = (±1)n

(n + 2α

n

), (4.31)

from Equation (4.7) and Equation (4.25).Using Equation (4.28) or Equation (4.29) we recover the first two polyno-

mials P (α)0 (x) = 1 and P (α)

1 (x) = (2α + 1)x , while the subsequent polynomialscan be computed through the recurrence relation (in Theorem 4.2) of the form

x P (α)n (x) = a(α)

n−1,n P (α)n−1(x) + a(α)

n+1,n P (α)n+1(x), (4.32)

where the recurrence coefficients, obtained by normalizing Equation (4.11)appropriately, become

a(α)n−1,n = n + 2α

2n + 2α + 1, a(α)

n+1,n = n + 1

2n + 2α + 1. (4.33)

The symmetry of the ultraspherical polynomials is emphasized by the relation

P (α)n (x) = (−1)n P (α)

n (−x). (4.34)

The recurrence relation of the form given in Theorem 4.3 becomes

P (α)n (x) = b(α)

n−1,n

d P (α)n−1(x)

dx+ b(α)

n+1,n

d P (α)n+1(x)

dx, (4.35)

where the recurrence coefficients are obtained directly from Equation (4.12) as

b(α)n−1,n = − 1

2n + 2α + 1, b(α)

n+1,n = 1

2n + 2α + 1. (4.36)

Let us finally also give the result of Theorem 4.5 for the ultraspherical polyno-mials as

(1 − x2)d P (α)

n (x)

dx= c(α)

n−1,n P (α)n−1(x) + c(α)

n+1,n P (α)n+1(x), (4.37)

with the coefficients being

c(α)n−1,n = (n + 2α + 1)(n + 2α)

2n + 2α + 1, c(α)

n+1,n = − n(n + 1)

2n + 2α + 1, (4.38)

from Equation (4.13).In Chapter 1 we introduced the concept of points-per-wavelength required

to accurately represent a wave, e.g., for the Fourier spectral method we foundthat we needed the minimum value of only two points to represent the waveexactly.

It is illustrative to consider this question also for polynomial expansions asit provides guidelines of how fine a grid, or how many modes, one needs toaccurately represent a wave.

Page 86: Spectral Methods for Time-Dependent Problems

78 Orthogonal polynomials

Example 4.6 Consider the case in which the plane wave

u(x) = eiπkx ,

is approximated using a Gegenbauer expansion

uN (x) =N∑

n=0

unCλn (x).

This approximation is given by

uN (x) = �(λ)

(πk

2

)−λ N∑n=0

i n(n + λ)Jn+λ(πk)C (λ)n (x),

where Jn(k) is the Bessel function of the first kind. We have

un = �(λ)

(πk

2

)−λ

i n(n + λ)Jn+λ(πk).

The decay rate of un as n gets large depends on the asymptotic behavior of theBessel function, which is

Jn+λ(πk) �(

eπk

2(n + λ)

)n+λ

.

For the Bessel function to decay, we must have eπk/2(n + λ) < 1, whichrequires eπ/2 < (n + λ)/k. For large values of k, we need

n

k>

2≈ 4,

so about 4 modes-per-wave, and thus points-per-wavelength, are required toobtain exponential convergence. While this is twice the number required forthe Fourier case, it is still dramatically less than needed for the low-order finitedifference schemes discussed in Chapter 1.

4.3 Further reading

The subject of orthogonal polynomials as discussed here is classical material.Most results and many generalizations can be found in the texts by Szego (1930)and Funaro (1992).

Page 87: Spectral Methods for Time-Dependent Problems

5

Polynomial expansions

In the last chapter, we showed that smooth functions can be well representedby polynomial expansions. We now turn our attention to obtaining a qualitativeunderstanding of approximating functions and their derivatives using truncatedcontinuous and discrete polynomial expansions. Although such approxima-tions to smooth problems can be formulated using any Jacobi polynomials, themost commonly used polynomials in spectral methods are the Legendre andChebyshev polynomials, and so we focus on these.

5.1 The continuous expansion

Consider the continuous polynomial expansion of a function

u(x) =∞∑

n=0

un P (α)n (x), (5.1)

with expansion coefficients

un = 1

γn

(u, P (α)

n

)L2

w[−1,1] = 1

γn

∫ 1

−1u(x)P (α)

n (x)(1 − x2)α dx, (5.2)

where w(x) is the weight under which the polynomials P (α)n (x) are orthogonal,

and

γn = ∥∥P (α)n

∥∥2

L2w[−1,1] = 22α+1 �2(α + 1)�(n + 2α + 1)

n!(2n + 2α + 1)�2(2α + 1). (5.3)

The qth derivative of u(x) has a similar expansion

dqu(x)

dxq=

∞∑n=0

u(q)n P (α)

n (x),

79

Page 88: Spectral Methods for Time-Dependent Problems

80 Polynomial expansions

and so the question is how the expansion coefficients, u(q)n , of the derivative are

related to the expansion coefficients, un , of the function. When approximatingthe solution to partial differential equations, this is a central problem. Thefollowing recursion relation gives a solution to this problem:

Theorem 5.1 Given the expansions

u(q)(x) =∞∑

n=0

u(q)n P (α)

n (x),

and

u(q−1)(x) =∞∑

n=0

u(q−1)n P (α,β)

n (x),

then the relation between the coefficients (for n > 0) is given by

u(q−1)n = b(α)

n,n−1 u(q)n−1 + b(α)

n,n+1 u(q)n+1,

where b(α)n,n−1 and b(α)

n,n+1 are defined in Equation (4.36).

Proof: We establish the result by calculating, up to a constant, the expan-sion coefficients un of a function u(x) from the expansion coefficients u(1)

n

of the first derivative of the function. The recurrence relation Equation (4.35)yields

d

dxu(x) =

∞∑n=0

u(1)n P (α)

n (x)

=∞∑

n=0

u(1)n

(b(α)

n−1,n

d P (α)n−1(x)

dx+ b(α)

n+1,n

P (α)n+1(x)

dx

)

=∞∑

m=−1

b(α)m,m+1 u(1)

m+1

d P (α)m (x)

dx+

∞∑m=1

b(α)m,m−1 u(1)

m−1

d P (α)m (x)

dx

=∞∑

m=1

[b(α)

m,m−1 u(1)m−1 + b(α)

m,m+1 u(1)m+1

] d P (α)m (x)

dx

=∞∑

n=0

und P (α)

n (x)

dx,

where we have used the fact that P (α)0 (x) is constant and defined the polynomial

P (α)−1 (x) to be zero. Note that u0 remains undetermined as the operation is

essentially an integration, which leaves a constant undetermined. The extensionto the general case follows directly.

QED

Page 89: Spectral Methods for Time-Dependent Problems

5.1 The continuous expansion 81

The theorem tells us that we can easily obtain the expansion coefficientsof the function from the expansion coefficients of the derivative. However, wehave the opposite problem: given the expansion coefficients of the function,we want the expansion coefficients of the derivative. To obtain them, we invertthe tridiagonal integration operator in Theorem 5.1 and obtain the operator (forα �= −1/2):

u(q)n = (2n + 2α + 1)

∞∑p=n+1

n+p odd

u(q−1)p . (5.4)

At first glance it seems that the computation of u(q)n from u(q−1)

n using Equa-tion (5.4) requires O(N 2) operation. However, in practice this is done moreefficiently. Assume that we have the finite expansion

PNd (q−1)u(x)

dx (q−1)=

N∑n=0

u(q−1)n P (α)

n (x),

and we seek an approximation to the derivative

PNd (q)u(x)

dx (q)=

N∑n=0

u(q)n P (α)

n (x).

Since the projection PN of each expansion is a polynomial of degree N , we canwrite u(q)

n = 0, ∀n > N and u(q−1)n = 0, ∀n > N . Equation (5.4) implies that

u(q)N = 0, as well. Theorem 5.1 then suggests the backward recursion formula

for n ∈ [N , . . . , 1],

u(q)n−1 = (2n + 2α − 1)

[1

2n + 2α + 3u(q)

n+1 + u(q−1)n

]. (5.5)

Applying the backward recursion, Equation (5.5), for the computation of u(q)n ,

the computational workload is reduced to O(N ) for any finite expansion.

5.1.1 The continuous legendre expansion

The Legendre expansion of a function u(x) ∈ L2[−1, 1], is given by

u(x) =∞∑

n=0

un Pn(x), (5.6)

with expansion coefficients

un = 1

γn(u, Pn)L2[−1,1] = 2n + 1

2

∫ 1

−1u(x)Pn(x) dx,

since γn = 2/(2n + 1) using Equation (4.10).

Page 90: Spectral Methods for Time-Dependent Problems

82 Polynomial expansions

Using Theorem 5.1 and the recurrence in Equation (4.18) we obtain the rela-tion between the expansion coefficients, u(q−1)

n , and those of its derivative, u(q)n :

u(q−1)n = 1

2n − 1u(q)

n−1 − 1

2n + 3u(q)

n+1. (5.7)

The inversion of this tridiagonal integration operator yields the differentiationoperator

u(q)n = (2n + 1)

∞∑p=n+1

n+p odd

u(q−1)p ∀n. (5.8)

As before, if we are dealing with a finite approximation we have u(q)N =

u(q)N+1 = 0, so we may compute u(q)

n for the truncated expansion through thebackward recurrence in Equation (5.5),

u(q)n−1 = 2n − 1

2n + 3u(q)

n+1 + (2n − 1)u(q−1)n ∀n ∈ [N , . . . , 1]. (5.9)

5.1.2 The continuous Chebyshev expansion

The continuous Chebyshev expansion of a function u(x),

u(x) =∞∑

n=0

unTn(x),

with expansion coefficients

un = 1

γn(u, Tn)L2

w[−1,1] = 2

cnπ

∫ 1

−1u(x)Tn(x)

1√1 − x2

dx,

where w(x) is the appropriate weight function,

γn =∫ 1

−1Tn(x)Tn(x)

1√1 − x2

dx = π

2cn,

and

cn ={

2 n = 01 n > 0.

(5.10)

This additional constant is a consequence of the normalization we have chosen,i.e. Tn(±1) = (±1)n .

The connection between the expansion coefficients of u(q−1)n and those of its

derivative u(q)n is (for n > 0),

u(q−1)n = cn−1

2nu(q)

n−1 − 1

2nu(q)

n+1, (5.11)

Page 91: Spectral Methods for Time-Dependent Problems

5.2 Gauss quadrature for ultraspherical polynomials 83

where cn−1 enters due to the normalization. Inverting this tridiagonal integrationoperator yields the differentiation operator

u(q)n = 2

cn

∞∑p=n+1

n+p odd

pu(q−1)p ∀n. (5.12)

In the case where u(q)N+1 = u(q)

N = 0, an O(N ) method to compute the expansioncoefficients for the approximate derivative is given by the backward recurrencein Equation (5.11)

cn−1u(q)n−1 = u(q)

n+1 + 2nu(q−1)n ∀n ∈ [N , . . . , 1]. (5.13)

5.2 Gauss quadrature for ultraspherical polynomials

In the previous section we discussed how to obtain the expansion coefficients ofthe derivative from the expansion coefficients of the function itself. However,just obtaining the expansion coefficients may be difficult, as this requires anevaluation of an integral. To obviate this problem we turn to quadrature formulasto approximate these integrals, just as we did for the Fourier expansions. Inthis case, classical Gauss quadratures enable the practical use of polynomialmethods for the approximation of general functions.

Gauss–Lobatto quadrature In the Gauss–Lobatto quadrature for the ultras-pherical polynomial, P (α)

N (x), we approximate the integral∫ 1

−1p(x)w(x) dx =

N∑j=0

p(x j )w j .

The nodes are −1 = x0, x1, . . . , xN−1, xN = 1 where the internal pointsx1, . . . , xN−1 are the roots of the polynomial

d

dxP (α)

N (x). (5.14)

The weights w j are given by

w j ={

(α + 1)�(α)N , j j = 0, N ,

�(α)N , j j ∈ [1, . . . , N − 1],

(5.15)

where

�(α)N , j = 22α+1 �2(α + 1)�(N + 2α + 1)

N N !(N + 2α + 1)�2(2α + 1)

[P (α)

N (x j )]−2

.

Page 92: Spectral Methods for Time-Dependent Problems

84 Polynomial expansions

a

x0 x6 x12

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−1.00

−0.75

−0.50

−0.25

0.00

0.25

0.50

0.75

1.00

Figure 5.1 The ultraspherical Gauss–Lobatto collocation points, xi , for N = 12for the polynomial, P (α)

12 (x), as a function of α.

The Gauss–Lobatto formula is exact for all polynomials p(x) ∈ B2N−1.Note that in general, the quadrature nodes are not given explicitly but must

be computed by finding the zeroes of the polynomial in Equation (5.14), asdiscussed in Chapter 11. At this stage it is worth noting that the nodes clusterclose to the boundaries with the amount of clustering decreasing as α increases,as illustrated in Figure 5.1.

Gauss–Radau quadrature In the Gauss–Radau formula, only one of the end-points of the interval [−1, 1] is included as a node in the summation. If wechoose the endpoint −1, the remaining quadrature points are the roots of thepolynomial

q(y) = P (α)N+1(y) + aN P (α)

N (y), (5.16)

with aN chosen such that q(−1) = 0, and the weights are

v j ={

(α + 1)�(α)N ,0 j = 0,

�(α)N , j j ∈ [1, . . . , N ],

(5.17)

where

�(α)N , j = 22α �2(α + 1)�(N + 2α + 1)

N !(N + α + 1)(N + 2α + 1)�2(2α + 1)(1 − y j )

[P (α)

N (y j )]−2

.

The Gauss–Radau quadrature∫ 1

−1p(y)w(y) dy =

N∑j=0

p(y j )v j ,

is exact for all polynomials p(y) ∈ B2N .

Page 93: Spectral Methods for Time-Dependent Problems

5.2 Gauss quadrature for ultraspherical polynomials 85

y6y0 y12

a

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−1.00

−0.75

−0.50

−0.25

0.00

0.25

0.50

0.75

1.00

Figure 5.2 The Gauss–Radau collocation points, yi , for N = 12, for the ultras-pherical, P (α)

12 (x), as a function of α with the node y0 = −1 being fixed.

As before, the quadrature nodes y j must be obtained numerically. InFigure 5.2 we plot the position of the ultraspherical Gauss–Radau quadraturenodes for N = 12 and α ∈ (−1, 1). As in the case of the Gauss–Lobatto quadra-ture, the nodes cluster close to the boundaries, with the amount of clusteringdecreasing as α increases and only the left boundary is included in the nodal set.

The formulation of a Gauss–Radau quadrature that includes the right end-point follows directly from the above by reflecting the weights v j , as well asthe quadrature nodes y j , around the center of the interval.

Gauss quadrature The quadrature points for the Gauss formula are all in theinterior of the domain [−1, 1]. The quadrature points z j are the roots of thepolynomial,

q(z) = P (α)N+1(z), (5.18)

while the weights, u j , are

u j = 22α+1 �2(α + 1)�(2α + N + 2)

�(N + 2)�2(2α + 1)(1 − z2

j

) [d

dxP (α)

N+1(z j )

]−2

, (5.19)

for all j ∈ [0, . . . , N ].The Gauss formula ∫ 1

−1p(z)w(z) dz =

N∑j=0

p(z j )u j ,

is exact for all p(x) ∈ B2N+1. This is the classical Gauss quadrature, whichprovides the rule of exact integration of a polynomial of maximum order.

Page 94: Spectral Methods for Time-Dependent Problems

86 Polynomial expansions

z0 z6 z12

a

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−1.00

−0.75

−0.50

−0.25

0.00

0.25

0.50

0.75

1.00

Figure 5.3 The Gauss collocation points, zi , for N = 12, for the ultrasphericalpolynomial, P (α)

12 (x), as a function of α.

The quadrature points z j are generally not given in analytic form and inFigure 5.3 we plot, for illustration, the position of the nodes in the case ofthe ultraspherical polynomials for N = 12 and α ∈ (−1, 1). We emphasize, asis also evident from Figure 5.3, that the nodal set associated with the Gaussquadrature does not include any of the endpoints of the interval.

5.2.1 Quadrature for Legendre polynomials

The quadrature formulas for the integration of polynomials specified at theLegendre quadrature points can be obtained directly from the formulas derivedabove by setting α = 0. Due to the extensive use of the Legendre polynomialswe summarize the expressions below.

Legendre Gauss–Lobatto quadrature The Legendre Gauss–Lobatto quadra-ture points, x j , are the roots of the polynomial

q(x) = (1 − x2)d

dxPN (x). (5.20)

The weights, w j are

w j = 2

N (N + 1)[PN (x j )]

−2. (5.21)

Legendre Gauss–Radau quadrature The Legendre Gauss–Radau quadraturepoints, y j , are the roots of the polynomial

q(y) = PN+1(y) + PN (y), (5.22)

Page 95: Spectral Methods for Time-Dependent Problems

5.2 Gauss quadrature for ultraspherical polynomials 87

assuming that y = −1 is included in the set of quadrature points. The weights,v j , are given as

v j = 1

(N + 1)2

1 − y j

[PN (y j )]2. (5.23)

Legendre Gauss quadrature The Legendre Gauss quadrature points z j arethe N + 1 roots of the polynomial

q(z) = PN+1(z). (5.24)

The weights u j are obtained directly from Equation (5.19) for α = 0,

u j = 2

[1 − (z j )2][P ′N+1(z j )]2

. (5.25)

5.2.2 Quadrature for Chebyshev polynomials

The Chebyshev quadrature is distinguished from the previous cases by itsexplicit and simple expressions for the quadrature points as well as the cor-responding weights. This is a compelling motivation for the use of these poly-nomials. Note that these expressions are not recovered directly from the generalresults above when α = −1/2, but must be normalized differently, cf. Equa-tion (4.26).

Chebyshev Gauss–Lobatto quadrature The Chebyshev Gauss–Lobattoquadrature points and weights are given explicitly by

x j = − cos( π

Nj)

, j ∈ [0, . . . , N ], (5.26)

and

w j = π

c j N, c j =

{2 j = 0, N ,

1 j ∈ [1, . . . , N − 1].(5.27)

Chebyshev Gauss–Radau quadrature The Chebyshev Gauss–Radau quadra-ture points, y j , have the explicit expression

y j = − cos

(2π

2N + 1j

), j ∈ [0, . . . , N ]. (5.28)

Assuming that the left endpoint is included in the set of quadrature points, theweights, v j , are given as

v j = π

c j

1

2N + 1, (5.29)

where cn takes the usual meaning, Equation (5.10).

Page 96: Spectral Methods for Time-Dependent Problems

88 Polynomial expansions

Chebyshev Gauss quadrature The Chebyshev Gauss quadrature points andweights are given by:

z j = − cos

((2 j + 1)π

2N + 2

), j ∈ [0, . . . , N ], (5.30)

and

u j = π

N + 1∀ j ∈ [0, . . . , N ]. (5.31)

Note that this is the only quadrature for which the weights are all the same. InChapter 11 we will discuss how to best compute the nodes and weights for thequadrature based on the ultraspherical polynomials.

5.3 Discrete inner products and norms

The identification of the quadrature formulas motivates the introduction ofdiscrete versions of the inner product and the corresponding L2

w-norm. Werecall that in the continuous case, the inner product and norm take the form

( f, g)L2w[−1,1] =

∫ 1

−1f (x)g(x)w(x) dx, ‖ f ‖2

L2w[−1,1] = ( f, f )L2

w[−1,1],

for f, g ∈ L2w[−1, 1]. Using the quadrature formulas it seems natural to define

the corresponding discrete inner product

[ f, g]w =N∑

j=0

f (x j )g(x j )w j , ‖ f ‖2N ,w = [ f, f ]w,

where x j = (x j , y j , z j ) can be any of the Gauss quadrature points with thecorresponding weights, w j = (w j , v j , u j ). If the product f (x)g(x) ∈ B2N , thenthe Gauss–Radau and Gauss quadratures are exact and the discrete inner productbased on these quadrature rules is identical to the continuous inner product. This,however, is not true for the Gauss–Lobatto quadrature, since it is only exact forfunctions in B2N−1.

Recall that the norm, γn , of P (α)n (x) using Gauss or Gauss–Radau quadrature,

is

γn = (P (α)

n , P (α)n

)L2

w[−1,1] = 22α+1 �2(α + 1)�(n + 2α + 1)

n!(2n + 2α + 1)�2(2α + 1), (5.32)

using Equation (5.2). However, for the Gauss–Lobatto quadrature, the quadra-ture is inexact for n = N . The following result allows us to evaluate the innerproduct.

Page 97: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 89

Lemma 5.2 The ultraspherical polynomials, P (α)N (x), satisfy

d

dxP (α)

N−1(x j ) = −N P (α)N (x j ) ∀ j ∈ [1, . . . , N − 1],

where x j represent the interior Gauss–Lobatto quadrature points.

Using this result and the Gauss–Lobatto quadrature, we obtain

γN = ∥∥P (α)N

∥∥2N ,w

= 22α+1 �2(α + 1)�(N + 2α + 1)

N N !�2(2α + 1). (5.33)

While the discrete Gauss–Lobatto norm is slightly different from the continuousnorm, it follows immediately from the above that they are equivalent for anypolynomial, uN ∈ PN , since

‖uN ‖L2w[−1,1] ≤ ‖uN ‖N ,ω ≤

√2 + 2α + 1

N‖uN ‖L2

w[−1,1],

as γN > γN for all values of N and α > −1.

Legendre polynomials For the Legendre polynomials, Pn(x), the discretenorm γn is

γn =

22n+1 n < N ,

22N+1 n = N for Gauss and Gauss–Radau quadrature,2N n = N for Gauss–Lobatto quadrature.

(5.34)

Chebyshev polynomials The results for the Chebyshev polynomials, Tn(x),can likewise be summarized as

γn =

π2 cn n < N ,

π2 n = N for Gauss and Gauss–Radau quadrature,

π n = N for Gauss–Lobatto quadrature,

(5.35)

where cn is as defined in Equation (5.10).

5.4 The discrete expansion

The quadrature rules provide the tools needed for approximating the expansioncoefficients. Recall the definition of the truncated continuous expansion

PN u(x) =N∑

n=0

un P (α)n (x), un = 1

γn

∫ 1

−1u(x)P (α)

n (x)(1 − x2)α dx,

where the normalizing factor, γn , is given in Equation (5.3).

Page 98: Spectral Methods for Time-Dependent Problems

90 Polynomial expansions

Using the Gauss–Lobatto quadrature it is natural to define the discreteapproximation

IN u(x) =N∑

n=0

un P (α)n (x), un = 1

γn

N∑j=0

u(x j )P (α)n (x j )w j , (5.36)

where the nodes, weights, and normalization factors are given in Equa-tions (5.14)–(5.15) and (5.32)–(5.33).

Likewise, the Gauss quadrature gives us the discrete approximation

IN u(z) =N∑

n=0

un P (α)n (z), un = 1

γn

N∑j=0

u(z j )P (α)n (z j )u j , (5.37)

with the nodes, weights and normalization factors given in Equations (5.18),(5.19), and (5.32).

The approximation of the discrete expansion coefficients using the Gaussquadratures has a striking consequence.

Theorem 5.3 Let u(x) be a function defined on all points in the interval [−1, 1],and let the discrete expansion coefficients un, be defined in Equation (5.37).Then IN u interpolates u at all the Gauss quadrature points z j :

IN u(z j ) = u(z j ).

Proof: If we put the discrete expansion coefficients into the polynomial approx-imation we recover

IN u(z) =N∑

n=0

un P (α)n (z)

=N∑

n=0

(1

γn

N∑j=0

u(z j )P (α)n (z j )u j

)P (α)

n (z)

=N∑

j=0

u(z j )

(u j

N∑n=0

1

γnP (α)

n (z)P (α)n (z j )

)

=N∑

j=0

u(z j )l j (z),

where

l j (z) = u j

N∑n=0

1

γnP (α)

n (z)P (α)n (z j ). (5.38)

Page 99: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 91

Here u j are the Gauss quadrature weights (5.19). We note that l j (z) ∈ BN

as expected. We proceed by showing that l j (z) is the Lagrange interpolationpolynomial based on the Gauss quadrature nodes, i.e., l j (zi ) = δi j .

Recalling that γn = γn in the Gauss quadrature, we apply the Christoffel–Darboux formula in Theorem 4.4 to obtain

l j (z) = u j 2−(2α+1) �(N + 2)�2(2α + 1)

�(N + 2α + 1)�2(α + 1)

P (α)N+1(z)P (α)

N (z j )

z − z j,

since P (α)N+1(z j ) = 0 defines the Gauss points. Clearly l j (zi ) = 0 for i �= j . Using

l’Hopital rule we obtain for i = j that

l j (z j ) = u j 2−(2α+1) �(N + 2)�2(2α + 1)

�(N + 2α + 1)�2(α + 1)P (α)

N (z j )d

dxP (α)

N+1(z j ).

Introducing the formula for the Gauss weights, Equation (5.19), yields

l j (z j ) = (N + 2α + 1)P (α)N (z j )

[(1 − z2

j

) d

dxP (α)

N+1(z j )

]−1

= 1,

where the last reduction follows by combining Equations (4.32) and (4.37) andusing the definition of the Gauss quadrature points.

QED

Similar results hold for the Gauss–Radau and Gauss–Lobatto grids. Hence,the discrete approximations based on the Gauss–Radau and Gauss–Lobattoquadratures interpolate the undelying function at their respective points. Thesediscrete approximations are thus known as interpolation methods.

The identification of the discrete approximation with the interpolation poly-nomials suggests a mathematically equivalent but computationally differentway of representing the discrete expansion. We can either calculate the discreteexpansion coefficients from their formulas (Equations (5.36)–(5.37)), or we canmake use of the Lagrange interpolation polynomial l j (x), directly.

To facilitate the use of Lagrange interpolation, we list the Lagrange polyno-mials based on the Gauss–Lobatto, Gauss–Radau, and Gauss quadrature points.

Gauss–Lobatto points The Lagrange interpolation polynomial, l j (x), basedon the Gauss–Lobatto points x j is

l j (x) ={

(α + 1)�(α)N , j (x) j = 0, N ,

�(α)N , j (x) otherwise,

(5.39)

where

�(α)N , j (x) = − 1

N (N + 2α + 1)

(1 − x2)(P (α)

N

)′(x)

(x − x j )P (α)N (x j )

.

Page 100: Spectral Methods for Time-Dependent Problems

92 Polynomial expansions

Gauss–Radau points The Lagrange interpolation polynomial, l j (y), based onthe Gauss–Radau points, y j , is

l j (y) ={

(α + 1)�(α)N , j (y) j = 0, N ,

�(α)N , j (y) otherwise,

(5.40)

where

�(α)N , j (y) = 1

2(N + α + 1)(N + 2α + 1)

(1 − y j )

P (α)N (y j )

× (N + 1)P (α)N+1(y) + (N + 2α + 1)P (α)

N

y − y j.

Gauss points The Lagrange interpolation polynomial, l j (z), based on theGauss quadrature points, z j , is

l j (z) = P (α)N+1(z)

(z − z j )(P (α)

N+1

)′(z)

. (5.41)

Let us now return to the issue of how to obtain an approximation to the derivativeof a function once the discrete approximation, expressed by using the discreteexpansion coefficients or the Lagrange polynomials, is known.

First we focus on the approximation of the derivative resulting from thecomputation of the discrete expansion coefficients by quadrature. If we considerthe Gauss–Lobatto approximation

IN u(x) =N∑

n=0

un P (α)n (x), un = 1

γn

N∑j=0

u(x j )P (α)n (x j )w j ,

we obtain an approximation to the derivative of u(x)

INd

dxu(x) =

N∑n=0

u(1)n P (α)

n (x),

where the new expansion coefficients, u(1)n , are obtained by using the backward

recursion

u(1)n = (2n + 2α + 1)

[1

2n + 2α + 5u(1)

n+2 + un+1

],

from Equation (5.5) and initialized by u(1)N+1 = u(1)

N = 0 asIN u(x) ∈ BN . Higherderivatives are computed by applying the recurrence relation repeatedly. For theChebyshev case, use Equation (5.13).

Of course, the use of the Gauss–Lobatto approximation was just an example;the same procedure can be followed using any of the Gauss quadrature points.

Page 101: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 93

Next, we turn to the mathematically equivalent formulation which utilizesthe Lagrange interpolating polynomial

IN u(x) =N∑

j=0

u(x j )l j (x).

The derivative of u(x) at any point is approximated simply by differentiatingthe global polynomial, l j (x). In particular, if one evaluates it at the quadraturepoints one obtains

INd

dxIN u(xi ) =

N∑j=0

u(x j )dl j (x)

dx

∣∣∣∣xi

=N∑

j=0

Di j u(x j ).

Where Di j are the (i j)-th elements of the (N + 1) × (N + 1) differentiationmatrix, D.

The differentiation matrix, D, can be written explicitly.

Gauss–Lobatto quadrature points

Di j =

α−N (N+2α+1)2(α+2) i = j = 0,

αx j

1−(xi )2 i = j ∈ [1, . . . , N − 1],

α+1xi −x j

P (α)N (xi )

P (α)N (x j )

i �= j, j = 0, N ,

1xi −x j

P (α)N (xi )

P (α)N (x j )

i �= j, j ∈ [1, . . . , N − 1],

−D00 i = j = N .

(5.42)

Gauss quadrature points

Di j =

(α+1)zi

1−(zi )2 i = j,(P (α)

N+1

)′(zi )

(zi −z j )(

P (α)N+1

)′(z j )

i �= j.(5.43)

For an approximation based on the use of the Gauss–Radau quadrature pointsone can obtain an equivalent expression by using the associated Lagrange inter-polation polynomial.

Some of these differentiation matrices D have interesting properties whichshall be useful. In particular, the differentiation matrix, D, derived from theLagrange interpolation polynomial based on any of the Gauss quadrature points,is nilpotent. This property is hardly a surprise, i.e., by differentiating a poly-nomial the order of the polynomial is reduced by one order and after N + 1differentiations the polynomial vanishes identically. The reason this works is

Page 102: Spectral Methods for Time-Dependent Problems

94 Polynomial expansions

that since the interpolating polynomial of degree N is exact for polynomialsof degree N , the differentiation operator D is also exact. D has (N + 1) zeroeigenvalues and only 1 eigenvector, i.e. it has a size (N + 1) Jordan block.

Another interesting property is limited to the differentiation matrix, D, basedon the Gauss or the Gauss–Lobatto quadrature points. In these cases, the dif-ferentiation matrix D is centro-antisymmetric,

Di j = −DN−i,N− j .

This property follows from the expressions for the entries of D in Equation (5.42)and Equation (5.43), the even-odd symmetry of the ultraspherical polynomials,Equation (4.34), and, as a reflection of this, the symmetry of the quadraturepoints around x = 0. As we shall see in Chapter 11, this subtle symmetryenables a factorization of the differentiation matrices that ultimately allows forthe computation of a derivative at a reduced cost. It is worth emphasizing that thedifferentiation matrix based on Gauss–Radau quadrature points does not possessthe centro-antisymmetric property due to the lack of symmetry in the grid points.

The computation of higher derivatives follows the approach for the computa-tion of the first derivative. One may compute entries of the qth-order differenti-ation matrix, D(q) by evaluating the qth derivative of the Lagrange interpolationpolynomial at the quadrature points. Alternatively, one obtains the qth-orderdifferentiation matrix by simply multiplying the first-order differentiation matri-ces, i.e.,

D(q) = (D)q ,

where q ≤ N . Although this latter approach certainly is appealing in terms ofsimplicity, we shall see later that the first method is preferable, in terms ofaccuracy.

5.4.1 The discrete Legendre expansion

The Legendre case (obtained by setting α = 0 or λ = 1/2) is one of the mostfrequently used; thus, we devote this section to summarizing the differentiationformulas for Legendre.

Legendre Gauss–Lobatto In this case we consider

IN u(x) =N∑

n=0

un Pn(x), un = 1

γn

N∑j=0

u(x j )Pn(x j )w j , (5.44)

where γn is given in Equation (5.34) and the quadrature points, x j , and theweights, w j , are given as the solution to Equation (5.20) and in Equation (5.21),respectively. Computation of the expansion coefficients for the derivatives isdone using the backward recurrence relation given in Equation (5.9).

Page 103: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 95

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

l0 l2 l4 l6 l8

x

Figure 5.4 The interpolating Lagrange polynomial, l j (x), based on the LegendreGauss–Lobatto quadrature points with N = 8.

Since IN u(x) is the interpolant of u(x) at the Legendre Gauss–Lobattoquadrature points, we may express the approximation as

IN u(x) =N∑

j=0

u(x j )l j (x), (5.45)

where the Lagrange interpolation polynomial, obtained directly fromEquation (5.39) with α = 0, takes the form

l j (x) = −1

N (N + 1)

(1 − x2)P ′N (x)

(x − x j )PN (x j ). (5.46)

Examples of the Lagrange polynomials based on the Legendre Gauss–Lobattopoints are shown in Figure 5.4.

The differentiation matrix is given by

Di j =

− N (N+1)4 i = j = 0,

0 i = j ∈ [1, . . . , N − 1],

PN (xi )PN (x j )

1xi −x j

i �= j,

N (N+1)4 i = j = N .

(5.47)

Legendre Gauss The discrete Legendre expansion based on the LegendreGauss approximation to the continuous expansion coefficients is

IN u(z) =N∑

n=0

un Pn(z), un = 1

γn

N∑j=0

u(z j )Pn(z j )u j . (5.48)

Page 104: Spectral Methods for Time-Dependent Problems

96 Polynomial expansions

The normalization constant, γn , is given in Equation (5.34), the quadraturepoints, z j , are found as the roots of the polynomial, Equation (5.24), and theweights, u j , are given in Equation (5.25).

We express the interpolation as

IN u(z) =N∑

j=0

u(z j )l j (z), (5.49)

with

l j (z) = PN+1(z)

(z − z j )P ′N+1(z j )

, (5.50)

Leading to the differentiation matrix

Di j =

zi

1−z2i

i = j,

P ′N+1(zi )

(zi −z j )P ′N+1(z j )

i �= j.(5.51)

5.4.2 The discrete Chebyshev expansion

Methods based on Chebyshev polynomials continue to play a key role in thecontext of spectral methods. Their widespread use can be traced back to anumber of reasons. Not only are the polynomials given in a simple form but allthe Gauss quadrature nodes and the associated weights are also given in closedform. Furthermore, the close relationship between Chebyshev expansions andFourier series allows for the fast evaluation of derivatives.

Chebyshev Gauss–Lobatto The discrete expansion is

IN u(x) =N∑

n=0

unTn(x), un = 2

Ncn

N∑j=0

1

c ju(x j )Tn(x j ), (5.52)

where

cn ={

2 n = 0, N ,

1 n ∈ [1, . . . , N − 1].

The Chebyshev Gauss–Lobatto quadrature points are

x j = − cos( π

Nj)

,

which allows us to express the computation of the interpolating polynomial atthe quadrature points as

IN u(x j ) =N∑

n=0

un cos( π

Nnj

), un = 2

Ncn

N∑j=0

1

c ju(x j ) cos

( π

Nnj

),

Page 105: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 97

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

l0 l2 l4 l6 l8

x

Figure 5.5 The Lagrange interpolation polynomial, l j (x), based on the ChebyshevGauss–Lobatto quadrature points with N = 8.

which is the discrete cosine expansion. As we will see in Chapter 11, fast Fouriertransform techniques can be used to evaluate un .

Alternatively, we can use the Lagrange polynomial formulation

IN u(x) =N∑

j=0

u(x j )l j (x), (5.53)

where the Lagrange interpolation polynomial is

l j (x) = (−1)N+ j+1(1 − x2)T ′N (x)

c j N 2(x − x j ). (5.54)

Leading to the differentiation matrix

Di j =

− 2N 2+16 i = j = 0,

cic j

(−1)i+ j

xi −x ji �= j,

− xi

2(1−x2i ) i = j ∈ [1, . . . , N − 1],

2N 2+16 i = j = N .

(5.55)

In Figure 5.5 we show examples of the Lagrange polynomials, l j (x), basedon the Chebyshev Gauss–Lobatto nodes. Comparing these with the polynomialsbased on the Legendre Gauss–Lobatto nodes in Figure 5.4 we observe only smalldifferences; this is a natural consequence of the grid points being qualitativelythe same.

Page 106: Spectral Methods for Time-Dependent Problems

98 Polynomial expansions

∼ ∼∼

−1.00 −0.75 −0.50 −0.25 0.00 0.25 0.50 0.75 1.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

l0 l2 l4∼l6

∼l8

Z

Figure 5.6 The Lagrange interpolation polynomial, l j (z), based on the ChebyshevGauss quadrature points with N = 8.

Chebyshev Gauss In the Chebyshev Gauss method,

IN u(z) =N∑

n=0

unTn(z), un = 2

cn(N + 1)

N∑j=0

u(z j )Tn(z j ), (5.56)

where cn is defined in Equation (5.10). Since the Chebyshev Gauss quadraturepoints are

z j = − cos

((2 j + 1)π

2N + 2

),

the Chebyshev Gauss discrete expansion coefficients may be obtained using amodified Fast Fourier Transform.

Alternatively, using the Lagrange interpolation polynomial approach,

IN u(z) =N∑

j=0

u(z j )l j (z), (5.57)

with

l j (z) = TN+1(z)

(z − z j )T ′N+1(z j )

, (5.58)

leads to the differentiation matrix

Di j =

zi

2(1−z2i )

i = j,

T ′N+1(zi )

(zi −z j )T ′N+1(z j )

i �= j.(5.59)

For the purpose of illustration, in Figure 5.6 we plot the Lagrange polynomialsbased on the Gauss quadrature points. We note, in particular, the different

Page 107: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 99

behavior at the boundaries of the domain as compared to polynomials based onthe Gauss–Lobatto points and shown in Figure 5.5. Once again, we defer thediscussion of the computational aspects of computing the nodes and weights toChapter 11.

5.4.3 On Lagrange interpolation, electrostatics, andthe Lebesgue constant

Up to this point, we have considered the approximation of functions and theirderivatives using both discrete expansions and Lagrange interpolation poly-nomials. We observed that for certain choices of grid points and quadraturerules, these representations are identical. In this section, we will considerapproximations

IN u(x) =N∑

j=0

u(x j )l j (x),

where l j (x) are the Lagrange interpolation polynomials based on the grid pointsx j ,

l j (x) = qN (x)

(x − x j )q ′N (x j )

, qN (x) =N∏

j=0

(x − x j ). (5.60)

Following the approach in previous sections, we obtain the entries of the dif-ferentiation matrix

Di j = 1

q ′N (x j )

{q ′

N (xi )(xi − x j )−1 i �= j,

12 q ′′

N (xi ) i = j.

Now, we must decide how to specify the grid points x j . Although we are freeto chose any set of grid points, the following examples illustrate that we mustchoose x j very carefully.

Example 5.4 We approximate the analytic function,

u(x) = 1

1 + 16x2, x ∈ [−1, 1],

by IN u(x) using Lagrange interpolants as above. We compare the interpolationusing the equidistant points

x j = 2

Nj − 1, j ∈ [0, . . . , N ],

Page 108: Spectral Methods for Time-Dependent Problems

100 Polynomial expansions

with that based on the Chebyshev Gauss–Lobatto quadrature points

x j = − cos( π

Nj)

, j ∈ [0, . . . , N ].

In Figure 5.7 we observe the dramatic differences between the resulting inter-polations. We note that while the one based on the Chebyshev Gauss–Lobattogrid points seems to converge as expected, the interpolation polynomial basedon the equidistant grid is divergent as N increases. Clearly, the choice of thegrid points matters when considering the quality of the global interpolation.

This wildly oscillatory and divergent behavior close to the limits of thedomain is known as the Runge phenomenon.

In the previous example we could easily see which interpolation was goodand which was not, but in general the quality of the interpolation needs to bequantified. A useful measure of the quality of the interpolation is introduced inthe following theorem:

Theorem 5.5 Assume that u(x) ∈ C0[−1, 1] with IN u(x) being the corre-sponding Nth-order polynomial interpolation based on the grid points, x j .Then

‖u − IN u‖∞ ≤ [1 + �N ] ‖u − p∗‖∞,

where p∗ is the best approximating Nth-order polynomial, and

�N = maxx∈[−1,1]

λN (x), λN (x) =N∑

j=0

|l j (x)|,

are the Lebesgue constant and the Lebesgue function, respectively.

Proof: As u(x) ∈ C0[−1, 1], the best approximating polynomial, p∗, existsand we immediately have

‖u − IN u‖∞ ≤ ‖u − p∗‖∞ + ‖p∗ − IN u‖∞.

However, since both p∗ and IN u are N th-order polynomials,

‖p∗ − IN u‖∞ ≤ �N ‖u − p∗‖∞,

where

�N = maxx∈[−1,1]

λN (x), λ(x)N =

N∑j=0

|l j (x)|.

QED

Page 109: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 101

x−1 −0.5 0 0.5 1

−1.5

−1

−0.5

0

0.5

1

1.5

u(x)

IN u(x)

(a)

u(x)

IN u(x)

x−1 −0.5 0 0.5 1

−1.5

−1

−0.5

0

0.5

1

1.5

(d)

u(x)

INu(x)

x−1 −0.5 0 0.5 1

−1.5

−1

−0.5

0

0.5

1

1.5

(b)

u(x)

IN u(x)

x−1 −0.5 0 0.5 1

−1.5

−1

−0.5

0

0.5

1

1.5

(c)

Figure 5.7 (a) Interpolation of u(x) using N = 8 equidistant grid points. (b) Inter-polation of u(x) using N = 8 Chebyshev Gauss–Lobatto distributed grid points.(c) Interpolation of u(x) using N = 16 equidistant grid points. (d) Interpolation ofu(x) using N = 16 Chebyshev Gauss–Lobatto distributed grid points.

The Lebesgue function and the Lebesgue constant both depend only on thechoice of x j . Theorem 5.5 tells us that a good set of grid points is one whichminimizes the Lebesgue constant.

On a more practical matter, the Lebesgue function gives us insight into howcomputational issues such as rounding errors can impact the accuracy of theinterpolation. As an example, assume that uε(x) represents a perturbed versionof u(x)

‖u − uε‖∞ ≤ ε.

Page 110: Spectral Methods for Time-Dependent Problems

102 Polynomial expansions

The difference between the two polynomial representations is then

‖IN u − IN uε‖∞ ≤ ε�N .

Clearly, if the Lebesgue constant �N is large enough the interpolation is illposedand the impact of the rounding is very severe.

It is thus worthwhile to look at the behavior of the Lebesgue function andthe value of �N for various choices of grid points. Indeed, one could hope toidentify families of grid points, x j , for which �N remains a constant. A seminalresult in approximation theory, however, rules out the existence of such a set ofgrid points.

Theorem 5.6 For any set of (N + 1) distinct grid points, x j ∈ [−1, 1], and allvalues of N , the Lebesgue constant is bounded as

�N ≥ 2

πlog(N + 1) + A,

where

A = 2

π

(γ + log

4

π

),

in the limit of large N. Here γ = 0.577221566 is Euler’s constant.

In other words, the Lebesgue constant grows at least logarithmically withN . This has the unfortunate consequence that for any given set of grid pointsthere exist continuous functions for which the polynomial representations willexhibit non-uniform convergence. On the other hand, one can also show thatfor any given continuous function one can always construct a set of grid pointsthat will result in a uniformly convergent polynomial representation.

Thus, we can not in general seek one set of grid points, x j , that will exhibitoptimal behavior for all possible interpolation problems. However, the behav-ior of the Lebesgue constant can serve as a guideline to understand whethercertain families of grid points are likely to result in well behaved interpolationpolynomials.

Let’s consider how the Lebesgue constant varies for different choices of x j .

Theorem 5.7 Assume that the interpolation is based on the equidistributed setof grid points

x j = −1 + 2 j

N, j ∈ [0, . . . , N ].

Then the corresponding Lebesgue constant, �eqN is bounded for N ≥ 1,

2N−2

N 2≤ �

eqN ≤ 2N+3

N.

Page 111: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 103

Asymptotically,

�eqN � 2N+1

eN (log N + γ ).

This is clearly far from optimal, and for large values of N one can notexpect anything meaningful from the interpolation based on the equidistantset of grid points, i.e., for N ≥ 65, �

eqN ∼ 1016 and the interpolation is very

illposed.How can we identify which grid points lead to well behaved interpolations?

To understand this, consider the Cauchy remainder for the interpolation,

u(z) − IN u(z) = RN (z) = u(N+1)(ξ )

(N + 1)!qN (z),

where ξ refers to some position in [−1, 1], qN (z) is as defined in Equation (5.60)and z is the complex extension of x . Note that the grid points, x j , remain real.Considering qN (z) it follows directly that

log |qN (z)| =N∑

j=0

log |z − x j | = −(N + 1)φN (z), (5.61)

where φN (z) can be interpreted as the electrostatic energy associated with N + 1unit mass, unit charge particles interacting according to a logarithmic potential.In the limit of N → ∞ it is natural to model this as

φ∞(z) = limN→∞

1

N + 1

N∑j=0

log |z − x j | =∫ 1

−1ρ(x) log |z − x | dx,

where ρ(x) represents a normalized charge density, reflecting an asymptoticmeasure of the grid point distribution. This implies that

limN→∞

|q(z)|1/N = e−φ∞(z),

for large values of N . Understanding the second part of the remainder, associatedwith the particular function being interpolated, is a bit more difficult. Usingcomplex analysis allows one to derive that

limN→∞

∣∣∣∣u(N+1)(ξ )

(N + 1)!

∣∣∣∣1/N

= eφ∞(z0),

where z0 represents the radius of the largest circle within which u(z) is analytic.Hence, we recover that

limN→∞

|R(z)|1/N = eφ∞(z0)−φ∞(z).

Page 112: Spectral Methods for Time-Dependent Problems

104 Polynomial expansions

Clearly, if φ∞(z0) − φ∞(z) is less than zero throughout the interval [−1, 1], wecan expect exponential convergence in N . On the other hand, if φ∞(z0) − φ∞(z)exceeds zero anywhere in the unit interval we expect exponential divergence ofthe remainder and thus of the error.

Let us first return to the equidistant charge distribution, in which case ρ(x) =12 and the electrostatic energy becomes

φ∞(z) = 1 + 1

2Re [|z − 1| log |z − 1| − |z + 1| log |z + 1|].

We first of all note that while φ∞(0) = 1, we have φ∞(±1) = 1 − log 2, i.e.,we should expect to see the most severe problems of divergence closer to thelimits of the domain, as observed in Figure 5.7. In fact, if we consider the u(x)in Example 5.4, it has a pole at z0 = ±i/4 and

φ∞(±i/4) = 1 − 1

2

[log

17

16+ 1

2 arctan 4

]� 0.63823327 . . .

Thus, the remainder, and hence the polynomial representation of u(x) willdiverge in regions close to [−1, 1] as φ∞(±i/4) − φ∞(z) will exceed zero.Finding the exact point of divergence yields x � ±0.794226. A close inspectionof the results in Figure 5.7 confirms this.

An equidistant distribution of grid points is evidently not a good choicefor high-order polynomial interpolation of analytic functions defined on theinterval. On the other hand, there is evidence in the above that the main problemsare close to the limits of the domain and that clustering the grid points relievesthese problems as illustrated in Example 5.4.

To study this further let us begin by realizing that the continuous chargedistribution leading to the Chebyshev Gauss–Lobatto nodes used in Example 5.4takes the form

ρ(x) = 1

π√

1 − x2, (5.62)

since we have

j = N∫ x j

−1

1

π√

1 − x2dx ⇒ x j = −cos

( π

Nj)

,

where j ∈ [0, . . . , N ] is the charge number. With this, we have the correspond-ing electrostatic energy of the form

φ∞(z) = − log|z − √

z2 − 1|2

.

Page 113: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 105

Inspection reveals that φ∞(z) are level curves associated with an ellipsoid withfoci at ±1. Furthermore, as z becomes purely real, this level curve collapses to aridge spanning the domain of [−1, 1] along which φ∞(z) takes on its maximumvalue. Hence, there are no restrictions on the position of the poles of the function,u(x), being approximated, as we can guarantee that φ∞(z0) − φ∞(x) is negativefor any value of z0. This collapse of the level curve of φ∞(z) to a perfectly flatridge clearly represents the optimal choice when one considers the electrostaticanalysis.

Having identified grid point distributions which lead to well behavedLagrange interpolations, let us now return to the evaluation of these interpola-tions in terms of the Lebesgue constant.

For the symmetric Chebyshev Gauss and Chebyshev Gauss–Lobatto, bothhaving the same asymptotic distribution given in Equation (5.62), we have theLebesgue constant, �CG

N , of the former as

�CGN ≤ 2

πlog(N + 1) + A + 2

πlog 2.

The constant A is given in Theorem 5.6. The Lebesgue constant, �CGLN of the

latter set of grid points is bounded

�CGLN ≤ �CG

N−1,

i.e., the Gauss–Lobatto points are, when measured by the growth of theLebesgue constant, superior to the Gauss points and very close to the theo-retical optimum given in Theorem 5.6.

The particular characteristic of the Chebyshev distributed grid points thatgives the well behaved Lagrange polynomials is the quadratic clustering of thegrid points close to the ends of the domain. This quality is, however, sharedamong the zeros of all the ultraspherical polynomials as they all have a minimumgrid size of the kind

�xmin = 1 − cN 2,

where the constant c depends on the particular polynomial. This difference,however, vanishes as N approaches infinity as the grid distributions of thezeros of the ultraspherical polynomials all share the limiting continuous chargedistribution, Equation (5.62).

With this result, it becomes clear that when choosing grid points well suitedfor high-order polynomial interpolation, we need only impose structural con-ditions on the position of the grid points, e.g., close to the boundaries of thedomain the grid points must cluster quadratically. This means that in terms ofinterpolation, the exact position of the grid points is immaterial, e.g., Legendre

Page 114: Spectral Methods for Time-Dependent Problems

106 Polynomial expansions

Gauss–Lobatto points are as good as the Chebyshev Gauss–Lobatto points asthe basis of the Lagrange polynomials. This is also reflected in the associatedLebesgue constant of the form

�LGLN ≤ 2

πlog(N + 1) + 0.685 . . .

for the Legendre Gauss–Lobatto grid. Having realized, however, that it is thequadratic behavior of the grid points close to the end of the interval that is the keyto high-order convergence, there is nothing that prohibits us from seeking gridpoint distributions with this particular quality. Indeed, the closest to optimal gridpoint distribution as measured through the Lebesgue constant, and for which asimple formula is known, is defined as

xECGj = −cos

( 2 j+12N+2π

)cos

2N+2

) ,

known as the extended Chebyshev Gauss grid points. These are not zeros of anyultraspherical polynomial, yet they have a Lebesgue constant, �ECG

N , boundedas

�ECGN = 2

πlog(N + 1) + A + 2

π

(log 2 − 2

3

),

which is very close to the optimal set of grid points and for all practical purposescan serve as that.

The above discussion of the Lebesgue constant and the electrostatic approachrevolves, to a large extent, around the behavior of the interpolation as it dependson the choice of the grid points in the limit where N is very large. It is, however,illustrative and useful to realize that there is a close connection between the zerosof the ultraspherical polynomials and the solution to a slightly modified versionof the finite dimensional electrostatic problem, Equation (5.61).

Let us define the electrostatic energy, E(x0, . . . , xN ), as

E(x0, . . . , xN ) = −1

2

N∑i=0

N∑j=0j �=i

log |xi − x j |,

for the N + 1 unit mass, unit charge particles interacting according to a loga-rithmic potential and consider the problem as an N -body problem for which weseek the steady state, minimum energy solution if it exists. For this definition,however, the dynamics of the problem are such that all charges would move toinfinity as that would be the minimum energy solution. Let us therefore consider

Page 115: Spectral Methods for Time-Dependent Problems

5.4 The discrete expansion 107

the slightly modified problem

E(p, x0, . . . , xN ) = −N∑

i=0

p log

(1 − x2

i

) + 1

2

N∑j=0j �=i

log |xi − x j |

. (5.63)

This corresponds to forcing the N + 1 charges with an exterior field correspond-ing to two charges, positioned at ±1, of strength p > 0. If we now assume thatall charges initially are positioned in the interior of [−1, 1], they are confinedthere and nontrivial steady-state minimum energy solutions can be sought.

Considering the gradient of E , we find that a condition for minimum energyis

∂ E

∂xi= 1

2

N∑j=0j �=i

1

xi − x j− 2xi p

1 − x2i

= 0.

Using qN (x) as defined in Equation (5.60) we recover

1

2

q ′′N (xi )

q ′N (xi )

− 2xi p

1 − x2i

= 0,

or equivalently (1 − x2

i

)q ′′

N (xi ) − 4pxi q′N (xi ) = 0.

Since this is a polynomial of order N + 1 with N + 1 point constraints whereit vanishes, it must, due to the definition of qN (x), be proportional to qN (x) itself. By matching coefficients we recover

(1 − x2)q ′′N (x) − 4xpq ′

N (x) + (N + 1)(N + 4p)qN (x) = 0. (5.64)

The polynomial solution, qN ∈ BN+1, of Equation (5.64) is the optimal solutionto the electrostatic problem, Equation (5.63), as its N + 1 roots. If, however,we take α = 2p − 1 and multiply Equation (5.63) by (1 − x2)α we recover

d

dx(1 − x2)α+1 dqN

dx+ (N + 1)(N + 2α + 2)(1 − x2)αqN = 0,

which we may recognize as the Sturm–Liouville problem defining the generalultraspherical polynomial, P (α)

N+1(x), i.e., qN (x) = P (α)N+1(x).

Hence, a further manifestation of the close relation between grid points, wellsuited for interpolation, and the solution to problems of electrostatics is realizedby observing that the minimum energy steady state charge distribution solutionto the N -body problem stated in Equation (5.63) is exactly the Gauss quadrature

Page 116: Spectral Methods for Time-Dependent Problems

108 Polynomial expansions

points of the ultraspherical polynomial, P (2p−1)N (x). Using the simple relation

2d P (α)

N

dx= (N + 1 + 2α)P (α+1)

N−1 (x),

we see that the interior part of the Gauss–Lobatto points can be found by takingα = 2(p − 1), e.g., the Chebyshev Gauss–Lobatto grid appears as the steadystate solution for p = 3/4.

It should be noted that by allowing an asymmetric exterior field in Equation(5.63) one can recover the Gauss quadrature nodes for all the Jacobi polynomi-als, P (α,β)

N (x), in Equation (5.63).

5.5 Further reading

The discrete expansions and differential operators are discussed in several ref-erences, e.g., Gottlieb et al (1983), Canuto et al (1986, 2006), and Funaro(1992), albeit in slightly different forms. The connection between interpola-tion and electrostatics is pointed out in Szego (1930) and further elaborated inHesthaven (1998). A good discussion of the Runge phenomenon and its expla-nation through potentials can be found in the texts by Fornberg (1996), Boyd(2000), and Trefethen (2000). In the latter there is also a brief discussion ofresults related to the Lebesgue constants.

Page 117: Spectral Methods for Time-Dependent Problems

6

Polynomial approximation theory forsmooth functions

Since the orthogonal polynomials are solutions of a singular Sturm–Liouvilleproblem, we expect the polynomial expansion of smooth functions to convergeat a rate depending only on the smoothness of the function being approxi-mated. In particular, when approximating a C∞ function by such a polynomialexpansion up to order N , we expect the convergence rate to be spectral, i.e.,faster than any algebraic order of N . In this chapter we will review the majorapproximation results for functions of finite regularity. We restrict our attentionto those results which are most useful in the context of polynomial spectralmethods: namely, those involving ultraspherical polynomials, and in particular,Chebyshev and Legendre polynomials.

6.1 The continuous expansion

Our aim is to estimate the distance between u(x) and its spectral expansion

PN u(x) =N∑

n=0

un P (α)n (x), un = 1

γn

(u, P (α)

n

)w

,

as measured in the weighted Sobolev norm ‖ · ‖H mw [−1,1], where w(x) is the

weight under which the family of polynomials P (α)n (x) is orthogonal.

The following theorem provides the basic approximation results for ultras-pherical polynomial expansions.

Theorem 6.1 For any u(x) ∈ H pw [−1, 1], p ≥ 0, there exists a constant C,

independent of N , such that

‖u − PN u‖L2w[−1,1] ≤ C N−p‖u‖H p

w [−1,1].

109

Page 118: Spectral Methods for Time-Dependent Problems

110 Polynomial approximation theory for smooth functions

Proof: Parseval’s identity implies

‖u − PN u‖2L2

w[−1,1] =∞∑

n=N+1

γn|un|2,

where the expansion coefficients, un , are

un = 1

γn

∫ 1

−1u(x)P (α)

n (x)(1 − x2)α dx,

and P (α)n (x) satisfies the Sturm–Liouville equation

[Q + λn] P (α)n = 0,

where

Qu = (1 − x2)d2u

dx2− 2x(1 + α)

du

dx.

Here λn = n(n + 2α + 1) is the nth eigenvalue.Repeated integration by parts of un yields

un = (−1)m

γnλmn

∫ 1

−1[Qmu(x)]P (α)

n (x)w(x) dx,

and so the Cauchy–Schwartz inequality implies

|un|2 ≤ C1

λ2mn

‖Qmu‖2L2

w[−1,1].

Since |x | ≤ 1, we have

‖Qu‖L2w[−1,1] ≤ C‖u‖H 2

w[−1,1].

By induction,

‖Qmu‖L2w[−1,1] ≤ C‖u‖H 2m

w [−1,1].

Combining the above results,

‖u − PN u‖2L2

w[−1,1] ≤ C‖u‖2H 2m

w [−1,1]

∞∑n=N+1

γnλ−2mn ≤ C N−4m‖u‖2

H 2mw [−1,1].

Taking p = 2m establishes the theorem.QED

This theorem demonstrates that the error, as measured in the weighted L2

norm, decays spectrally. In the next theorem we show that this is also the casewhen the error is measured in the corresponding weighted Sobolev norm.

Page 119: Spectral Methods for Time-Dependent Problems

6.1 The continuous expansion 111

Theorem 6.2 Let u(x) ∈ H pw [−1, 1]; there exists a constant C, independent of

N , such that∥∥∥∥PNdu

dx− d

dxPN u

∥∥∥∥Hq

w[−1,1]

≤ C N 2q−p+3/2 ‖u‖H pw [−1,1] ,

where 1 ≤ q ≤ p.

Proof: Without loss of generality, we consider the case where N is even. Letus first of all recall that

u(x) =∞∑

n=0

un P (α)n (x), and PN u(x) =

N∑n=0

un P (α)n (x),

and so,

d

dxPN u(x) =

N∑n=0

un(P (α)

n (x))′

.

On the other hand, since

d

dxu(x) =

∞∑n=0

un(P (α)

n (x))′

,

we have that

PNd

dxu(x) =

N+1∑n=0

un(P (α)

n (x))′

.

Comparing these two expressions, we see that

PNdu

dx− d

dxPN u = uN+1 P (α)

N+1.

Theorem 6.1 tells us that

|uN+1|2 ≤ ‖u − PN u‖2L2

w[−1,1] ≤ C N−p‖u‖2H p

w [−1,1].

Furthermore, using orthogonality of P (α)k (x) and the fact that that γk is bounded

in k provided |α| ≤ 1/2, we get

∥∥(P (α)N

)′∥∥2L2

w[−1,1] =

∥∥∥∥∥∥∥N−1∑k=0

k+N odd

(2k + 2α + 1)P (α)k

∥∥∥∥∥∥∥2

L2w[−1,1]

≤N−1∑k=0

k+N odd

(2k + 2α + 1)2γk ≤ C N 3.

Page 120: Spectral Methods for Time-Dependent Problems

112 Polynomial approximation theory for smooth functions

Combining these estimates yields∥∥∥∥PNdu

dx− d

dxPN u

∥∥∥∥L2

w[−1,1]

≤ C N32 −p‖u‖H p

w [−1,1].

The Sturm–Liouville equations and the Poincare inequality lead to∣∣∣∣ dm

dxmP (α)

n (x)

∣∣∣∣ ≤ C N 2m∣∣P (α)

n (x)∣∣,

so that any further differentiation causes a loss of N 2 in the error bound. Thus,the error bound in the norm dependent on the qth derivative becomes∥∥∥∥PN

du

dx− d

dxPN u

∥∥∥∥Hq

w[−1,1]

≤ C N 2q−p+ 32 ‖u‖H p

w [−1,1].

QED

Consequently, we obtain the following generalization:

Theorem 6.3 For any u(x) ∈ H pw [−1, 1] there exists a constant C, independent

of N , such that

‖u − PN u‖Hqw[−1,1] ≤ C N σ (q,p) ‖u‖H p

w [−1,1],

where

σ (q, p) ={

32 q − p 0 ≤ q ≤ 1,

2q − p − 12 q ≥ 1,

and 0 ≤ q ≤ p.

These results establish the spectral accuracy of the polynomial expansion.Recall that when approximating the derivative by the Fourier method we losea factor of N in the error estimate. However, as we see in Theorem 6.3, whenapproximating the derivative by the polynomial method we lose a factor of N 2

in the error estimate. This fact limits the number of converging derivatives fora given polynomial approximation. The following example illustrates the lossof convergence.

Example 6.4 Consider the function

u(x) =∞∑

k=1

Pk+1(x) − Pk−1(x)

(2k + 1)kε,

where Pk(x) is the kth degree Legendre polynomial, and ε � 1.Using the recurrence for the Legendre polynomials, Equation (4.18),

P ′k+1(x) − P ′

k−1(x)

2k + 1= Pk(x),

Page 121: Spectral Methods for Time-Dependent Problems

6.1 The continuous expansion 113

we obtain

du

dx=

∞∑k=1

Pk(x)

kε.

We note that this series converges in L2; in fact, since∫

P2k (x)dx = 2

2k+1 , wehave ∥∥∥∥du

dx

∥∥∥∥2

=∞∑

k=1

∫P2

k (x)

k2εdx =

∞∑k=1

1

k2ε

2

2k + 1,

which converges for ε > 0.Approximating u(x) by the truncated Legendre expansion

PN u =N∑

n=0

un Pn(x),

we observe that

PN u =N∑

k=1

Pk+1(x) − Pk−1(x)

(2k + 1)kε− PN+1(x)

(2N + 1)N ε,

so that

d

dxPN u =

N∑k=1

Pk(x)

kε− P ′

N+1(x)

(2N + 1)N ε,

while

PNdu

dx=

N∑k=1

Pk(x)

kε.

Thus, the error in approximating the derivative:

d

dxPN u − PN

du

dx= − 1

(2N + 1)N ε

d PN+1

dx.

The norm of this error is∥∥∥∥ d

dxPN u − PN

du

dx

∥∥∥∥2

= 1

(2N + 1)2 N 2ε

∫(P ′

N+1)2dx

≤ N 3

(2N + 1)2 N 2ε≈ N 1−2ε,

which diverges as N increases. The divergence is caused by the inability of thederivative of the truncated approximation to approximate the derivative of u, aspredicted in Theorem 6.2.

Page 122: Spectral Methods for Time-Dependent Problems

114 Polynomial approximation theory for smooth functions

6.2 The discrete expansion

Similar approximation results are obtained for the discrete expansion,

IN u(x) =N∑

n=0

un P (α)n (x) =

N∑j=0

u(x j )l j (x),

though the proofs are more technically complex than for the continuous expan-sion. The main reason for this added complexity is the aliasing error introducedby using quadrature to approximate the integrals. Under the assumption ofsufficient smoothness, e.g., u(x) ∈ H 1

w[−1, 1], the aliasing error is

un = un + 1

γn

∞∑k>N

[P (α)

n , P (α)k

]w

uk,

where [·, ·]w is the discrete inner product introduced in Section 5.3. From theorthogonality of the polynomial basis, it follows that

‖u − IN u‖2L2

w[−1,1] = ‖u − PN u‖2L2

w[−1,1] + ‖AN u‖2L2

w[−1,1],

where the aliasing error is

AN u(x) =N∑

n=0

1

γn

( ∞∑k>N

[P (α)

n , P (α)k

]w

uk

)P (α)

n (x).

Interchanging the two summations we obtain the simple expression

AN u(x) =∞∑

k>N

(IN P (α)k

)uk .

Thus, the aliasing error can be seen as the error introduced by using the inter-polation of the basis, IN P (α)

k , rather than the basis itself to represent the highermodes. The aliasing error stems from the fact that we cannot distinguish betweenlower and higher modes on a finite grid.

The discrete analog to Theorem 6.1 is:

Theorem 6.5 For u ∈ H pw [−1, 1] where p > 1/2 max(1, 1 + α), there exists a

constant, C, which depends on α and p but not on N, such that

‖u − IN u‖L2w[−1,1] ≤ C N−p‖u‖H p

w [−1,1],

where IN u is constructed using ultraspherical polynomials, Pαn (x), with |α| ≤

1. This holds for Gauss and Gauss–Lobatto based interpolations.

This result confirms that for well resolved smooth functions the qualitativebehavior of the continuous and the discrete expansion is similar for all practicalpurposes.

Page 123: Spectral Methods for Time-Dependent Problems

6.2 The discrete expansion 115

To be more specific and obtain results in higher norms we leave the gen-eral ultraspherical expansion and consider discrete expansions based on Leg-endre and Chebyshev polynomials and the associated Gauss-type quadraturepoints.

Results for the discrete Legendre expansion Consider first the discrete Leg-endre expansion

IN u(x) =N∑

n=0

un Pn(x) =N∑

j=0

u(x j )l j (x).

The most general result is given by the following theorem.

Theorem 6.6 For any u(x) ∈ H p[−1, 1] with p > 1/2 and 0 ≤ q ≤ p, thereexists a positive constant, C, independent of N , such that

‖u − IN u‖Hq [−1,1] ≤ C N 2q−p+1/2‖u‖H p[−1,1].

Results for the discrete Chebyshev expansion The behavior of the discreteChebyshev expansion

IN u(x) =N∑

n=0

unTn(x) =N∑

j=0

u(x j )l j (x),

can be made clear by using the close connection between the Chebyshevexpansion and the Fourier cosine series. If we introduce the transforma-tion, x = cos(θ ), we can use the orthogonality of the exponential functionto get

pn = 1

γn[Tk(x), Tn(x)]N =

{1 k = 2N p ± np = 0, ±1, ±2, . . . ,

0 otherwise,

so that the aliasing error can be expressed simply as

AN u =∞∑

k>N

(IN Tk)uk =p=∞∑

p=−∞p �=0

(u2N p+n + u2N p−n)Tn(x).

The following theorem shows us that we gain a factor of√

N by using theChebyshev method, compared to the Legendre method.

Theorem 6.7 For any u(x) ∈ H pw [−1, 1] with p > 1/2 and 0 ≤ q ≤ p, there

exists a positive constant, C, independent of N , such that

‖u − IN u‖Hqw[−1,1] ≤ C N 2q−p‖u‖H p

w [−1,1].

Page 124: Spectral Methods for Time-Dependent Problems

116 Polynomial approximation theory for smooth functions

When we look at the L∞-error for the discrete Chebyshev expansion, we notethat we lose a factor of

√N .

Theorem 6.8 For any u(x) ∈ H pw [−1, 1] with p > 1/2, there exists a positive

constant, C, independent of N , such that

‖u − IN u‖L∞[−1,1] ≤ C N 1/2−p‖u‖H pw [−1,1].

6.3 Further reading

The polynomial approximation theory was developed mainly by Canuto andQuarteroni (1981) and Bernardi and Maday (1989, 1992, 1999) with a thoroughreview and many results given in the overview paper by Bernardi and Maday(1999) and the texts by Canuto et al (1986, 2006). Some new results for theJacobi case can be found in the text by Funaro (1992).

Page 125: Spectral Methods for Time-Dependent Problems

7

Polynomial spectral methods

In this chapter, we turn our attention to the formulation of polynomial spectralmethods for solving partial differential equations, using the Galerkin, tau, andcollocation approaches. The presence of non-periodic boundary conditions,which provide the motivation for using polynomial methods, further distin-guishes between the methods. Once again we shall restrict ourselves to problemsinvolving smooth solutions and turn to the special issues related to nonsmoothproblems in Chapter 9.

Consider the problem

∂u(x, t)

∂t= Lu(x, t), x ∈ [a, b], t ≥ 0, (7.1)

BLu = 0, t ≥ 0

BRu = 0, t ≥ 0

u(x, 0) = f (x), x ∈ [a, b], t = 0.

where BL ,R are the boundary operators at x = a and x = b, respectively.For simplicity we restrict much of the discussion to methods based on Leg-

endre or Chebyshev expansions on the finite interval [−1, 1]. However, allresults extend in a straightforward manner to schemes based on ultrasphericalpolynomials.

7.1 Galerkin methods

In the Galerkin method we seek solutions, uN (x, t) ∈ BN , of the form

uN (x, t) =N∑

n=0

an(t)φn(x),

117

Page 126: Spectral Methods for Time-Dependent Problems

118 Polynomial spectral methods

where φn(x) is a polynomial taken from the space

BN = span{φn(x) ∈ span{xk}n

k=0 |BLφn = 0, BRφn = 0}N

n=0.

The N + 1 equations for the unknown expansion coefficients, an(t), are obtainedfrom Equation (7.1) by requiring the residual

RN (x, t) = ∂uN

∂t− LuN (x, t),

to be orthogonal to BN , under some weight function w(x). Using the test-functions, φk(x), this yields

N∑n=0

Mkndan

dt=

N∑n=0

Sknan(t) ∀k ∈ [0, . . . , N ],

where

Mkn = 1

γk

∫ 1

−1φk(x)φn(x)w(x) dx ∀k, n ∈ [0, . . . , N ],

are entries of the mass matrix M, and

Skn = 1

γk

∫ 1

−1φk(x)Lφn(x)w(x) dx ∀k, n ∈ [0, . . . , N ]

are the entries of the stiffness matrix S. We note that the mass matrix is symmet-ric and positive definite. The symmetry is obvious, while its positive definitenesscan be seen by considering a general non-zero N -vector, u, consisting of entriesu j , and using the definition of M to obtain

uT Mu =N∑

i, j=0

ui u j Mi j

=N∑

i, j=0

ui u j

∫ 1

−1φi (x)φ j (x)w(x) dx

=∫ 1

−1

(N∑

i=0

uiφi (x)

)2

w(x) dx > 0,

since ‖ · ‖L2w[−1,1] is a norm.

The basis, φn(x), is usually constructed from a linear combination ofP (α)

n (x) to ensure that the boundary conditions are satisfied for all φn(x). Forexample, if the boundary condition is u(1, t) = 0, we can choose the basis{P (α)

n (x) − P (α)n (1)} which satisfies the boundary conditions. Since we are using

the polynomials P (α)n (x) as a basis it is natural to choose the weight function,

w(x), such that (P (α)n , P (α)

k )w = γnδnk .

Page 127: Spectral Methods for Time-Dependent Problems

7.1 Galerkin methods 119

We illustrate this process with some examples.

Example 7.1 Consider the linear hyperbolic problem

∂u

∂t= ∂u

∂x,

with the boundary condition

u(1, t) = 0,

and the initial condition u(x, 0) = f (x).In the Chebyshev Galerkin method we define

φn(x) = Tn(x) − 1,

so that the boundary condition is satisfied by each one of the polynomials. Weseek solutions, uN (x, t) ∈ BN , of the form

uN (x, t) =N∑

n=1

an(t)φn(x) =N∑

n=1

an(t) (Tn(x) − 1).

Note that the sum is from n = 1 rather than n = 0 since φ0(x) = 0. We nowrequire that the residual

RN (x, t) = ∂uN

∂t− ∂uN

∂x,

is orthogonal to φn(x) in L2w[−1, 1]:

2

π

∫ 1

−1RN (x, t)φk(x)

1√1 − x2

dx = 0 ∀k ∈ [1, . . . , N ].

We have chosen w(x) as the weight for which Tn(x) is orthogonal in order tosimplify the scheme. This procedure yields the Chebyshev Galerkin scheme

N∑n=1

Mkndan

dt=

N∑n=1

Sknan(t) ∀k ∈ [1, . . . , N ],

where the mass matrix has the entries

Mkn = 2

π

∫ 1

−1(Tk(x) − 1) (Tn(x) − 1)

1√1 − x2

dx = 2 + δkn.

Computing the entries of the stiffness matrix requires a little more work; theentries are given by

Skn = 2

π

∫ 1

−1(Tk(x) − 1)

dTn(x)

dx

1√1 − x2

dx ∀k, n ∈ [1, . . . , N ].

Page 128: Spectral Methods for Time-Dependent Problems

120 Polynomial spectral methods

From Equation (4.23),

dTn(x)

dx= 2n

n−1∑p=0

p+n odd

Tp(x)

cp,

where c0 = 2 and cp = 1 otherwise. Introducing this into the expression for thestiffness matrix yields

Skn = 2

π

∫ 1

−1(Tk(x) − 1) 2n

n−1∑p=0

p+n odd

Tp(x)

cp

1√1 − x2

dx

= 2nn−1∑p=0

p+n odd

(δkp − δ0p).

This yields N ordinary differential equations (ODEs) for the N unknowns,a = (a1, . . . , aN )T , of the form

dadt

= M−1Sa(t),

with the initial conditions

an(0) = 2

π

∫ 1

−1f (x) (Tn(x) − 1)

1√1 − x2

dx ∀n ∈ [1, . . . , N ].

This example illustrates that the formulation of the Chebyshev Galerkin methodis a bit cumbersome and typically involves the inversion of the mass matrix.Fortunately, this mass matrix is invertible, since it is symmetric positive-definite.

Example 7.2 Consider the linear parabolic problem

∂u

∂t= ∂2u

∂x2,

with boundary conditions

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

and initial condition u(x, 0) = f (x).In the Legendre Galerkin methods we may choose the basis functions in

several different ways. A convenient choice could be

φn(x) = Pn+1(x) − Pn−1(x), n ≥ 1.

An alternative option is

φn(x) ={

Pn(x) − P0(x) n even,

Pn(x) − P1(x) n odd.

Page 129: Spectral Methods for Time-Dependent Problems

7.1 Galerkin methods 121

Both these choices have the desired property, φn(±1) = 0. Choosing the former,we seek solutions, uN (x, t) ∈ BN , of the form

uN (x, t) =N−1∑n=1

an(t)φn(x) =N−1∑n=1

an(t)(Pn+1(x) − Pn−1(x)),

and require the residual

RN (x, t) = ∂uN

∂t− ∂2uN

∂x2

to be L2-orthogonal to φk(x)

2k + 1

2

∫ 1

−1RN (x, t)φk(x) dx = 0 ∀k ∈ [1, . . . , N − 1].

This yields the Legendre Galerkin scheme

N−1∑n=1

Mkndan

dt=

N−1∑n=1

Sknan(t) ∀k ∈ [1, . . . , N − 1],

with the mass matrix given by

Mkn = 2k + 1

2

∫ 1

−1φk(x)φn(x) dx

= 2(2k + 1)2

(2k − 1)(2k + 3)δkn − 2k + 1

2k + 3δk,n+2 − 2k + 1

2k − 1δk,n−2.

Note that the mass matrix is tridiagonal, i.e., the computation of M−1 is straight-forward.

The stiffness matrix is given by

Skn = 2k + 1

2

∫ 1

−1φk(x)

d2φn(x)

dx2dx ∀k, n ∈ [1, . . . , N − 1].

These entries can either be derived by using the properties of the Legendrepolynomials or by using the Gauss quadrature.

This procedure yields an ODE system of (N − 1) equations with N − 1unknowns, a = (a1, . . . , aN−1)T , of the form

dadt

= M−1Sa(t),

with the initial conditions

an(0) = 2n + 1

2

∫ 1

−1f (x) (Pn+1(x) − Pn−1(x)) dx ∀n ∈ [1, . . . , N − 1].

As we will see in the following example, this process becomes much morecomplicated in the nonlinear case.

Page 130: Spectral Methods for Time-Dependent Problems

122 Polynomial spectral methods

Example 7.3 Consider Burgers’ equation

∂u

∂t+ u

∂u

∂x= ν

∂2u

∂x2,

with the homogeneous boundary conditions

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

and the initial condition u(x, 0) = f (x).To use a Chebyshev Galerkin method we choose the basis

φn(x) = Tn+1(x) − Tn−1(x),

(so that φn(±1) = 0), and seek solutions, uN (x, t) ∈ BN , of the form

uN (x, t) =N−1∑n=1

an(t)φn(x) =N−1∑n=1

an(t)(Tn+1(x) − Tn−1(x)).

As usual, we require the residual,

RN (x, t) = ∂uN

∂t+ uN

∂uN

∂x− ν

∂2uN

∂x2

to be orthogonal to φk(x):

2

π

∫ 1

−1RN (x, t)φk(x)

1√1 − x2

dx = 0 ∀k ∈ [1, . . . , N − 1],

yielding the Chebyshev Galerkin scheme

N−1∑n=1

Mkndan

dt=

N−1∑n=1

Skn(a(t))an(t) ∀k ∈ [1, . . . , N − 1],

where a(t) is the vector of elements an(t). The tridiagonal mass matrix is givenby

Mkn = 2

π

∫ 1

−1φk(x)φn(x)

1√1 − x2

dx = 2δkn − δk,n+2 − δk,n−2.

The nonlinearity complicates the expression of the elements of the stiffnessmatrix, since the entries of S now consist of contributions from the nonlinearhyperbolic part, Sh , and the parabolic part, Sp:

Skn(a(t)) = −Shkn(a(t)) + νSp

kn

= − 2

π

∫ 1

−1φk(x)φn(x)

N−1∑l=1

al(t)dφl(x)

dx

1√1 − x2

dx

+ ν2

π

∫ 1

−1φk(x)

d2φn(x)

dx2

1√1 − x2

dx .

Page 131: Spectral Methods for Time-Dependent Problems

7.2 Tau methods 123

To simplify the nonlinear hyperbolic part, we may use the definition of φn(x)and the identity

2Tn(x)Tl(x) = T|n+l|(x) + T|n−l|(x).

However, the computation of the integrals involved in the stiffness matrix isstill expensive.

Once the components of the stiffness matrix are calculated, we have (N − 1)ODEs for the (N − 1) unknowns, a = (a1, . . . , aN−1)T ,

dadt

= M−1(−Sh(a) + νSp)a(t),

with initial conditions

an(0) = 2

π

∫ 1

−1f (x) (Tn+1(x) − Tn−1(x))

1√1 − x2

dx ∀n ∈ [1, . . . , N − 1].

The polynomial Galerkin methods are of considerable complexity, analyti-cally as well as computationally. The requirement that each polynomial from thebasis chosen must satisfy the boundary conditions individually often causes theGalerkin formulation to become complicated, particularly when the boundaryconditions are time-dependent. Furthermore, although the mass matrix dependsonly on the basis being used, the computation of the entries of the stiffnessmatrix has to be completed for each individual problem and is by no meanssimple even for constant coefficient linear problems. The presence of nonlinearterms further complicates the computation of the stiffness matrix, rendering theGalerkin method extremely complex. A simplification of the Galerkin proce-dure is known as the tau method, and is presented in the next section.

7.2 Tau methods

In the tau method, we still seek solutions uN (x, t) ∈ BN . However, we do notproject the residual onto the space BN but rather onto the polynomial space

PN−k = span{xn}N−kn=0 ,

where k is the number of boundary conditions. The approximant is a polyno-mial of degree N but k degrees of freedom are used to enforce the boundaryconditions. The following examples illustrate this procedure.

Example 7.4 Consider the linear hyperbolic problem

∂u

∂t= ∂u

∂x,

Page 132: Spectral Methods for Time-Dependent Problems

124 Polynomial spectral methods

with the boundary condition

u(1, t) = h(t),

and the initial condition, u(x, 0) = f (x).In the Legendre tau method we seek solutions, uN (x, t) ∈ BN , of the form

uN (x, t) =N∑

n=0

an(t)Pn(x),

with the additional constraint thatN∑

n=0

an(t)Pn(1) =N∑

n=0

an(t) = h(t),

to ensure that the solution obeys the boundary condition. The first N equationsare found by requiring that the residual

RN (x, t) = ∂uN

∂t− ∂uN

∂x,

is L2-orthogonal to PN−1

2k + 1

2

∫ 1

−1RN (x, t)Pk(x) dx = 0 ∀k ∈ [0, . . . , N − 1].

This yields

dan

dt= (2n + 1)

N∑p=n+1

p+n odd

ap(t) ∀n ∈ [0, . . . , N − 1].

We see that for the linear constant coefficient problem, the derivatives of thefirst N coefficients are exactly the coefficients of the first derivative. Recall theidentity, Equation (5.8),

a(1)n (t) = (2n + 1)

N∑p=n+1

p+n odd

ap(t).

The last coefficient aN (t) can be obtained explicitly from the other coefficients

aN (t) = −N−1∑n=0

an(t) − h(t).

This reflects the ease by which time dependent boundary conditions are intro-duced into the tau method.

The initial conditions yield

an(0) = 2n + 1

2

∫ 1

−1f (x)Pn(x) dx ∀n ∈ [0, . . . , N − 1],

Page 133: Spectral Methods for Time-Dependent Problems

7.2 Tau methods 125

with the final coefficient

aN (0) = −N−1∑n=0

an(0) − h(0).

Since we project the residual onto PN−1 rather than BN the mass matrix remainsdiagonal due to orthogonality, and the stiffness matrix is obtained directly fromthe properties of the polynomial basis, typically resulting in schemes muchsimpler than the Galerkin approximation.

Example 7.5 Once again, consider the linear parabolic problem

∂u

∂t= ∂2u

∂x2,

with boundary conditions

u(−1, t) = α1u(−1, t) − β1∂u(−1, t)

∂x= g(t)

u(1, t) = α2u(1, t) + β2∂u(1, t)

∂x= h(t),

and initial condition u(x, 0) = f (x).In the Chebyshev tau method we seek solutions uN (x, t) ∈ BN , of the form

uN (x, t) =N∑

n=0

an(t)Tn(x),

with the additional constraints from the boundary conditions

N∑n=0

an(t)(α1Tn(−1) − β1T ′

n(−1)) = g(t),

N∑n=0

an(t)(α2Tn(1) + β2T ′

n(1)) = h(t).

Using the boundary values of Tn(x) and its derivative

Tn(±1) = (±1)n, T ′n(±1) = (±1)n+1n2,

the constraints become

N∑n=0

an(t) (α1(−1)n − β1(−1)n+1n2) = g(t), (7.2)

N∑n=0

an(t) (α2 + β2n2) = h(t),

to ensure that the solution obeys the boundary conditions.

Page 134: Spectral Methods for Time-Dependent Problems

126 Polynomial spectral methods

We now require that the residual

RN (x, t) = ∂uN

∂t− ∂2uN

∂x2,

is orthogonal to PN−2 in L2w[−1, 1]:

2

πck

∫ 1

−1RN (x, t)Tk(x)

1√1 − x2

dx = 0 ∀k ∈ [0, . . . , N − 2].

Using the identity

a(2)n (t) = 1

cn

N∑p=n+2

p+n even

p(p2 − n2)ap(t),

we obtain the first (N − 1) ODEs for the coefficients

dan

dt= 1

cn

N∑p=n+2

p+n even

p(p2 − n2)ap(t) ∀n ∈ [0, . . . , N − 2].

The system is closed by obtaining aN−1(t) and aN (t) from the 2-by-2 linearsystem in Equation (7.2).

The initial conditions for this system of ODEs are

an(0) = 2

cnπ

∫ 1

−1f (x)Tn(x)

1√1 − x2

dx ∀n ∈ [0, . . . , N − 2].

Even though we considered very general time-dependent boundary condi-tions, the resulting Chebyshev tau method remains simple because the effectsof the boundary conditions are separated from the approximation of theoperator L.

While the emphasis in this text is on schemes for the solution of time-dependent problems we would like to take a small detour to illustrate the efficacyof tau methods for the solution of elliptic problems.

Example 7.6 Consider the elliptic problem

∂2u

∂x2= f (x),

subject to the general boundary conditions

α1u(−1) + β1∂u(−1)

∂x= c−,

α2u(1) + β2∂u(1)

∂x= c+.

Page 135: Spectral Methods for Time-Dependent Problems

7.2 Tau methods 127

We now seek a solution, uN (x) ∈ BN , of the form

uN (x, t) =N∑

n=0

an(t)Tn(x),

with the additional constraints from the boundary conditionsN∑

n=0

an(α1(−1)n + β1(−1)n+1n2) = c−, (7.3)

N∑n=0

an(α2 + β2n2) = c+.

The residual is

RN (x) = ∂2uN

∂x2− fN−2(x),

with fN−2(x) ∈ PN−2 given by

fN−2(x) =N−2∑n=0

f nTn(x),

where

f n = 2

cnπ

∫ 1

−1f (x)Tn(x)

1√1 − x2

dx .

Requiring the residual to be L2w-orthogonal to PN−2 yields the first (N − 1)

equations

a(2)n = 1

cn

N∑p=n+2

p+n even

p(p2 − n2)ap = f n ∀n ∈ [0, . . . , N − 2].

The system is closed by considering the two boundary conditions in Equa-tion (7.3). Apart from the two equations appearing from the boundary condi-tions, the matrix is fairly sparse and upper triangular.

The tau formulation of spectral methods may well be the most efficient way tosolve linear elliptic problems or eigenvalue problems, as the resulting matricestypically are sparse and very efficient preconditioners can be developed.

Let us finally consider the formulation of a tau method for the solution ofBurgers’ equation.

Example 7.7 Consider Burgers’ equation

∂u

∂t+ u

∂u

∂x= ν

∂2u

∂x2,

Page 136: Spectral Methods for Time-Dependent Problems

128 Polynomial spectral methods

with boundary conditions

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

and initial conditions u(x, 0) = f (x).To solve Burgers’ equation using a Chebyshev tau method we seek solutions

uN (x, t) ∈ BN of the form

uN (x, t) =N∑

n=0

an(t)Tn(x),

with the constraintsN∑

n=0

an(t)(−1)n =N∑

n=0

an(t) = 0.

We require the residual

RN (x, t) = ∂uN

∂t+ uN

∂uN

∂x− ν

∂2uN

∂x2,

to be L2w-orthogonal to PN−2:

2

ckπ

∫ 1

−1RN (x, t)Tk(x)

1√1 − x2

dx = 0 ∀k ∈ [0, . . . , N − 2],

leading to the system of ODEs

dak

dt+ 2

ckπ

∫ 1

−1uN

∂uN

∂xTk(x)

1√1 − x2

dx = νa(2)k (t) ∀k ∈ [0, . . . , N − 2].

Recall that

a(2)k (t) = 1

ck

N∑p=n+2

p+n even

p(p2 − k2)ap(t).

The calculation of the nonlinear term requires a little more work. Introducingthe expansions for uN (x, t) and its derivative we obtain

2

ckπ

∫ 1

−1uN

∂uN

∂xTk(x)

1√1 − x2

dx

= 2

ckπ

∫ 1

−1

N∑n,l=0

an(t)a(1)l (t)Tn(x)Tl(x)Tk(x)

1√1 − x2

dx .

The identity for Chebyshev polynomials

Tn(x)Tl(x) = 1

2

(Tn+l(x) + T|n−l|(x)

),

Page 137: Spectral Methods for Time-Dependent Problems

7.3 Collocation methods 129

yields

2

ckπ

∫ 1

−1uN

∂uN

∂xTk(x)

1√1 − x2

dx

= 1

2

2

ckπ

∫ 1

−1

N∑n,l=0

an(t)a(1)l (t)

(Tn+l(x) + T|n−l|(x)

)Tk(x)

1√1 − x2

dx

= 1

2

N∑

n,l=0n+l=k

an(t)a(1)l (t) +

N∑k,l=0

|n−l|=k

an(t)a(1)l (t)

,

where

a(1)l (t) = 2

cl

N∑p=l+1

p+l odd

pap(t).

This establishes the equations for the first N − 1 expansion coefficients, ak(t).The remaining two are found by enforcing the boundary conditions

N∑n=0

an(t)(−1)n =N∑

n=0

an(t) = 0.

As usual, the initial conditions are

an(0) = 2

cnπ

∫ 1

−1f (x)Tn(x)

1√1 − x2

dx ∀n ∈ [0, . . . , N − 2].

Although the tau method avoids some of the problems of the Galerkin methodsand allows for the development of fairly simple and efficient methods for solv-ing the partial differential equation it is primarily used for the solution of linearelliptic equations. The main reason is that the tau method still requires one toderive equations for the expansion coefficients for each individual problem. Forvariable coefficient or nonlinear problems this process may be very complicatedand in many cases impossible. However, for linear constant coefficient or spe-cial cases of variable coefficient nonlinear problems the resulting tau methodprovides an efficient approach.

7.3 Collocation methods

The projection operators involved in the Galerkin and tau methods lead tocomplications in deriving the system of ODEs. In both these methods, werequire that the projection of the residual onto some polynomial space be zero.In contrast, the collocation method obtains the system of ODEs by requiring

Page 138: Spectral Methods for Time-Dependent Problems

130 Polynomial spectral methods

that the residual vanish at a certain set of grid points, typically some set ofGauss-type points. As a result, while the Galerkin and tau methods may becomeuntenable for strongly nonlinear problems, the collocation method deals withlinear, variable coefficient, and nonlinear problems with equal ease.

Since we are considering initial boundary value problems, the appropriatechoice of grid is the set of Gauss–Lobatto quadrature points

x j = {x∣∣ (1 − x2)

(P (α)

N

)′(x) = 0

} ∀ j ∈ [0, . . . , N ],

as this includes the boundaries.Once again, we begin by seeking an approximation in the space of N th-order

polynomials which satisfy the boundary conditions, uN (x, t) ∈ BN , such thatthe residual

RN (x, t) = ∂uN

∂t− LuN (x, t),

vanishes at the interior gridpoints,

IN RN (x j , t) = 0 ∀ j ∈ [1, . . . , N − 1],

leading to the N − 1 equations

∂uN

∂t

∣∣∣∣x j

= (LuN ) |x j ∀ j ∈ [1, . . . , N − 1].

The last two equations are prescribed by the boundary conditions. The followingexamples illustrate the simplicity of the collocation method.

Example 7.8 We solve the hyperbolic problem

∂u

∂t= ∂ f (u)

∂x,

with boundary condition

u(1, t) = h(t),

and initial condition u(x, 0) = g(x). Assume that f ′(u) > 0 at the boundaries,so that one boundary condition is sufficient.

In the Chebyshev collocation method, we seek a solution

uN (x, t) =N∑

n=0

an(t)Tn(x) =N∑

j=0

uN (x j , t)l j (x).

We need also to define

fN (uN (x, t)) =N∑

n=0

f n(t)Tn(x) =N∑

j=0

f (uN (x j , t))l j (x),

Page 139: Spectral Methods for Time-Dependent Problems

7.3 Collocation methods 131

where the x j are the Gauss–Lobatto quadrature points

x j = − cos( π

Nj)

∀ j ∈ [0, . . . , N ].

l j (x) = (−1) j+1+N (1 − x2)T ′N (x)

c j N 2(x − x j ).

The coefficients are

an(t) = 2

cn N

N∑j=0

1

c juN (x j , t)Tn(x j ),

and

f n(t) = 2

cn N

N∑j=0

1

c jf(uN (x j , t)

)Tn(x j ),

where c0 = cN = 2 and cn = 1 otherwise. And l j are the interpolating Lagrangepolynomial

The solution is found by requiring the residual

RN (x, t) = ∂uN

∂t− ∂ fN

∂x,

to vanish at the collocation points (which in this case are also chosen to be theGauss–Lobatto points):

IN RN (x j , t) = ∂uN

∂t

∣∣∣∣x j

− IN∂ fN

∂x

∣∣∣∣x j

= 0 ∀ j ∈ [0, . . . , N − 1],

yielding N equations

∂uN

∂t

∣∣∣∣x j

= IN∂ fN

∂x

∣∣∣∣x j

∀ j ∈ [0, . . . , N − 1].

The main computational work is in the derivative evaluation. This can be accom-plished in two different ways. One can use

IN∂ fN

∂x

∣∣∣∣x j

=N∑

j=0

f(1)n (t)Tn(x j ),

where the discrete expansion coefficients are found through the backward recur-sion relation

cn−1 f(1)n−1(t) = f

(1)n+1(t) + 2n f n−1(t).

Page 140: Spectral Methods for Time-Dependent Problems

132 Polynomial spectral methods

Alternatively, we may compute the derivative through the introduction of thedifferentiation matrix, D,

IN∂ fN

∂x

∣∣∣∣x j

=N∑

i=0

D j i fN (xi , t).

The system is closed through the boundary condition

uN (xN , t) = h(t),

with the initial condition

uN (x j , 0) = (IN g)(x j ) = g(x j ).

Note the ease with which the collocation method handles a general nonlinearhyperbolic equation. Now let us consider an example of a polynomial colloca-tion method for the solution of a partial differential equation.

Example 7.9 Consider the linear parabolic problem

∂u

∂t= ∂2u

∂x2,

with boundary conditions

u(−1, t) = α1u(−1, t) − β1∂u(−1, t)

∂x= g(t),

u(1, t) = α2u(1, t) + β2∂u(1, t)

∂x= h(t),

and initial condition u(x, 0) = f (x).In the Legendre Gauss–Lobatto collocation method we seek solutions,

uN (x, t) ∈ BN , of the form

uN (x, t) =N∑

j=0

uN (x j , t)l j (x),

where l j (x) is the interpolating Lagrange polynomial based on the LegendreGauss–Lobatto quadrature points

x j = {x |(1 − x2)P ′

N (x) = 0} ∀ j ∈ [0, . . . , N ],

and we require the residual

RN (x, t) = ∂uN

∂t− ∂2uN

∂x2,

to vanish at the interior points, yielding the (N − 1) equations

duN (x j , t)

dt=

N∑i=0

D(2)j i uN (xi , t) ∀ j ∈ [1, . . . , N − 1].

Page 141: Spectral Methods for Time-Dependent Problems

7.4 Penalty method boundary conditions 133

Here D(2) is the second-order differentiation matrix based on the LegendreGauss–Lobatto quadrature points.

We close the system by using the boundary conditions,

α1uN (x0, t) − β1

N∑j=0

D0 j uN (x j , t) = g(t),

α2uN (xN , t) + β2

N∑j=0

DN j uN (x j , t) = h(t).

where D is the first-order differentiation matrix. This yields a 2-by-2 systemfor the computation of the boundary values

(α1 − β1D00)uN (x0, t) − β1D0N uN (xN , t) = g(t) + β1

N−1∑j=1

D0 j uN (x j , t),

β2DN0uN (x0, t) + (α2 + β2DN N )uN (xN , t) = h(t) − β2

N−1∑j=1

DN j uN (x j , t).

In this way the boundary conditions are enforced exactly.

7.4 Penalty method boundary conditions

Up to now, we have been imposing the boundary conditions exactly. However,it is sufficient to impose the boundary conditions only up to the order of thescheme. This procedure is illustrated in the following example.

Example 7.10 Consider the constant coefficient wave equation

ut + aux = 0 a > 0

with boundary condition u(−1, t) = h(t) and the initial condition u(x, 0) =g(x).

First, we define the polynomial Q−(x) which vanishes on the grid pointsexcept the boundary point x = −1:

Q−(x) = (1 − x)P ′N (x)

2P ′N (−1)

={

1 x = −10 x = x j �= −1

where x j refers to the Legendre Gauss–Lobatto points.In the Legendre collocation method with weakly imposed boundary condi-

tions, we seek polynomial solutions of degree N , uN (x, t), which satisfy

∂uN

∂t+ a

∂uN

∂x= −τaQ−(x)[uN (−1, t) − h(t)],

Page 142: Spectral Methods for Time-Dependent Problems

134 Polynomial spectral methods

where τ is a parameter which we adjust for stability. This means that the equationis satisfied exactly at all the grid points except the boundary point, while at theboundary point we have

∂uN (−1, t)

∂t+ a

∂uN

∂x(−1, t) = −τa[uN (−1, t) − h(t) ].

The scheme is consistent since when the exact solution is used, the right-hand-side is zero. We’ll show shortly that this method is asymptotically stable, andthis fact coupled with stability implies convergence.

Page 143: Spectral Methods for Time-Dependent Problems

8

Stability of polynomial spectral methods

In this chapter, we shall study the stability of Galerkin and collocation polyno-mial methods for a variety of linear problems. We then discuss the stability of thepenalty method approach, and briefly review the stability theory for polynomialspectral methods for nonlinear equations.

8.1 The Galerkin approach

In the Galerkin case, both Fourier and polynomial methods are stable for theequation

ut = Lu,

as long as the operator L is semi-bounded in the norm under which the under-lying approximating basis is orthogonal.

Theorem 8.1 If L satisfies

L + L∗ ≤ 2γ I,

then the Galerkin method is stable.

Proof: When the Galerkin method is applied to

∂u

∂t= Lu,

we seek a solution uN (x, t) ∈ BN such that the residual is orthogonal to thespace BN under the relevant non-negative weight function w(x). Thus, sinceuN ∈ BN we have (

∂uN

∂t− LuN , uN

)w

= 0,

135

Page 144: Spectral Methods for Time-Dependent Problems

136 Stability of polynomial spectral methods

which means (∂uN

∂t, uN

)w

= (LuN , uN )w.

The left hand side becomes(∂uN

∂t, uN

)w

= 1

2

d

dt(uN , uN )w,

while the right hand side is

(LuN , uN )w = 1

2((L + L∗)uN , uN )w.

Since L is semi-bounded, we have:

(uN , uN )w ≤ eγ t (uN (0), uN (0))w.

QED

Let’s consider a few examples of bounded operators. We begin with theparabolic operator.

Example 8.2 The parabolic operator

Lu = uxx,

with boundary conditions u(±1, t) = 0, is semi-bounded under the weightw(x) = (1 − x2)α , for values of −1/2 ≤ α ≤ 1. In this case, L = L∗, and wewill see that L + L∗ ≤ 0.

First, we look at values of −1/2 ≤ α ≤ 0. This case is significant sincethe two most common spectral methods are Legendre for which α = 0, andChebyshev, for which α = −1/2. We rewrite the inner-product

(LuN , uN )w =∫ 1

−1wuuxx dx = −

∫ 1

−1(wu)x ux dx,

by integration by parts and the fact that the boundary values are zero. Now welet v = wu, and we have

ux = (wu)x

w− wx u

w= vx

w+ v

(1

w

)′.

Plugging this in and integrating by parts again, we have

(LuN , uN )w = −∫ 1

−1

v2x

wdx −

∫ 1

−1vvx

(1

w

)′dx

= −∫ 1

−1

v2x

wdx +

∫ 1

−1

1

2v2

(1

w

)′′dx .

Page 145: Spectral Methods for Time-Dependent Problems

8.1 The Galerkin approach 137

The first integrand is non-negative, while the second can be shown to be non-positive by observing that(

1

w

)′′= α(1 − x2)−α−2(x2(4α + 2) + 2) ≤ 0.

Thus, we have (LuN , uN )w ≤ 0.

Next, we look at values of 0 ≤ α ≤ 1, for which the inner product

(LuN , uN )w =∫ 1

−1wuuxx dx = −

∫ 1

−1(wu)x ux dx

= −∫ 1

−1wx uux dx −

∫ 1

−1wu2

x dx

= 1

2

∫ 1

−1wxx u2dx −

∫ 1

−1wu2

x dx.

The second integrand is strictly positive. We can show that the first is non-positive by observing that

wxx = α(1 − x2)α−2(x2(4α − 2) − 2) ≤ 0,

and so, since w(x) ≥ 0, u2 ≥ 0, u2x ≥ 0, and wxx ≤ 0, we have

(LuN , uN )w ≤ 0.

Next, we consider the hyperbolic operator.

Example 8.3 Consider the Legendre Galerkin approximation to the linearhyperbolic problem

∂u

∂t= ∂u

∂x,

with the boundary condition

u(1, t) = 0,

and the initial condition u(x, 0) = g(x).The operator Lu = ux is semi-bounded for the Legendre weight w(x) = 1:(

uN ,∂uN

∂t

)w

=(

uN ,∂uN

∂x

)w

the right hand side is, as usual(uN ,

∂uN

∂t

)w

= 1

2

d

dt(uN , uN )w,

Page 146: Spectral Methods for Time-Dependent Problems

138 Stability of polynomial spectral methods

whereas the left hand side(uN ,

∂uN

∂x

)w

= 1

2

∫ 1

−1

∂u2N

∂xdx

= −1

2u2

N (−1) ≤ 0.

Putting this together, we have

d

dt(uN , uN )w ≤ 0.

The next example shows that this is true for all Jacobi polynomials withα ≥ 0 and β ≤ 0:

Example 8.4 Consider the operator Lu = ux and the weight w(x) =(1 + x)α(1 − x)β . As above, we have

d

dt(uN , uN )w =

∫ 1

−1w(x)

∂u2N

∂xdx = −

∫ 1

−1w′(x)u2

N dx .

Now we observe that, for α > 0 and β < 0,

w′(x) = α(1 + x)α−1(1 − x)β − β(1 + x)α(1 − x)β−1

= (1 + x)α−1(1 − x)β−1 (α(1 − x) − β(1 + x)) ≥ 0,

so that we have

d

dt(uN , uN )w ≤ 0.

This example establishes that the linear hyperbolic equation is wellposed in theJacobi norm provided α ≥ 0 and β ≤ 0. The following example demonstratesthat this equation is not wellposed in the Chebyshev norm. This implies thatwe will not be able to prove stability in this norm.

Example 8.5 Consider the linear hyperbolic equation ut = ux , on x ε[−1, 1]with initial condition

u(x, 0) ={

1 − |x |ε

if |x | < ε,

0 if |x | ≥ ε,

which has the solution at time t = 1

u(x, 1) ={

1 − x+1ε

if |x + 1| < ε,

0 if |x + 1| ≥ ε.

The norms of the solution as ε → 0+ at times t = 0 and t = 1,

‖u(x, 0)‖2w ∼ ε ‖u(x, 1)‖2

w ∼ 2

3

√2ε,

Page 147: Spectral Methods for Time-Dependent Problems

8.1 The Galerkin approach 139

give us insight into the solution’s growth:

‖eL‖w ≥ ‖u(x, 1)‖w

‖u(x, 0)‖w

∼(

8

9

) 14

ε− 14.

In fact, as ε → 0+, we have ‖eLt‖ → ∞ for 0 ≤ t ≤ 1 + ε, and ‖eLt‖ = 0 fort ≥ 1 + ε (i.e., after the initial profile exits the domain), so that this equation isnot wellposed in the Chebyshev norm.

Clearly, if the equation itself is not wellposed in this norm, the Galerkin methodwill certainly not be stable in this norm. However, if we consider the normbased on the weight w(x) = (1 + x)/

√1 − x2, we see that the linear hyperbolic

equation is wellposed in this norm.

Example 8.6 The scalar linear hyperbolic equation is wellposed under the norm(·, ·)w where w(x) = (1 + x)/

√1 − x2. To see this, note that the weight

w(x) = 1 + x√1 − x2

= (1 + x)12 (1 − x)−

12

and recall that we showed in Example 8.4 that in this case w′(x) ≥ 0. Conse-quently,

d

dt

∫ 1

−1wu2dx = 2

∫ 1

−1wuut dx

= 2∫ 1

−1wuux dx =

∫ 1

−1w(u2)x dx

= −∫ 1

−1w′u2dx ≤ 0.

In this norm, the Galerkin method for the linear hyperbolic equation is stablefor a wide variety of Jacobi polynomials with weight w(x) = (1 + x)α(1 − x)β .

Example 8.7 The Jacobi polynomial Galerkin method for the scalar hyperbolicequation

∂u

∂t= ∂u

∂x

with boundary condition

u(1, t) = 0

is stable under the norm (·, ·)w where w(x) = (1 + x)α(1 − x)β for all valuesof α ≥ −1 and β ≤ 0.

Page 148: Spectral Methods for Time-Dependent Problems

140 Stability of polynomial spectral methods

The approximation, using the polynomial basis {Pn(x) − Pn(1)}, wherePn = P (α,β)

n are the Jacobi polynomials, can be written

uN =N∑

n=0

an(t) (Pn(x) − Pn(1)),

where uN satisfies

∂uN

∂t− ∂uN

∂x= τ (t)RN (x). (8.1)

If we multiply this by (1 + x)w(x)uN and integrate over all x , the left hand sidebecomes

L H S =∫ 1

−1(1 + x)w(x)uN

(∂uN

∂t− ∂uN

∂x

)dx

=∫ 1

−1(1 + x)w(x)uN

∂uN

∂tdx −

∫ 1

−1(1 + x)w(x)uN

∂uN

∂xdx

= 1

2

d

dt

∫ 1

−1(1 + x)w(x)(uN )2dx −

∫ 1

−1(1 + x)w(x)uN

∂uN

∂xdx

= 1

2

(d

dt

∥∥uN

∥∥2w(x) +

∫ 1

−1w′(x) (uN )2 dx

)

where w(x) = (1 + x)α+1(1 − x)β . Note that we showed before that w′(x) ≥ 0for α + 1 ≥ 0 and β ≤ 0.

Now, let’s look at the right hand side,

R H S = τ (t)∫ 1

−1(1 + x)w(x)uN RN dx

= τ (t)∫ 1

−1w(x)uN RN dx + τ (t)

∫ 1

−1xw(x)uN RN dx .

Clearly, the first integral is zero because RN is orthogonal to the space of uN

under w(x). The second integral is

∫ 1

−1xw(x)uN RN dx =

∫ 1

−1xw(x)

N∑n=0

an(t) (Pn(x) − Pn(1)) RN dx .

Since each Jacobi polynomial (with parameters α and β) satisfies the recursionin Chapter 4, Theorem 4.2,

x Pn(x) = An Pn−1(x) + Bn Pn(x) + Cn Pn+1(x),

Page 149: Spectral Methods for Time-Dependent Problems

8.1 The Galerkin approach 141

where

An = 2(n + α)(n + β)

(2n + α + β + 1)(2n + α + β),

Bn = − α2 − β2

(2n + α + β + 2)(2n + α + β),

Cn = 2(n + 1)(n + α + β + 1)

(2n + α + β + 2)(2n + α + β + 1),

we can say,∫ 1

−1xw(x)uN RN dx =

∫ 1

−1w(x)

N∑n=0

an(t)[An

(Pn−1(x) − Pn−1(1)

)+ Bn

(Pn(x) − Pn(1)

)+ Cn

(Pn+1(x) − Pn+1(1)

)]RN dx .

Since RN is orthogonal to all (Pn(x) − Pn(1)) in this sum except for n = N + 1,we are left with,∫ 1

−1xw(x)uN RN dx =

∫ 1

−1w(x)aN (t)CN

(PN+1(x) − PN+1(1)

)RN dx .

We can write

RN =N∑

k=0

rk Pk(x),

and so

RH S = aN (t)CN

∫ 1

−1w(x)

(PN+1(x) − PN+1(1)

)RN dx

= aN (t)CN τ (t)∫ 1

−1w(x)

(PN+1(x) − PN+1(1)

) N∑k=0

rk(t)Pk(x)dx

= −aN (t)CN τ (t)r0(t)∫ 1

−1w(x)PN+1(1)P0(x)dx .

To observe that the RHS is negative, we must look at each term. P0(x) = 1 ≥ 0and

PN+1(1) = �(n + α + 1)

n!�(α + 1)≥ 0,

due to the way the Jacobi polynomials are normalized. As we saw above,CN ≥ 0 as long as N + α + β + 1 ≥ 0. Now we are left with aN (t)τ (t)r0(t).

Page 150: Spectral Methods for Time-Dependent Problems

142 Stability of polynomial spectral methods

To determine the signs of these we look at the definition of the residual,

∂uN

∂t= ∂uN

∂x+ τ (t)

N∑k=0

rk(t)Pk(x).

Since the term ∂uN /∂x is a polynomial of degree N − 1, we know that thehighest degree polynomial is present only in the first and third terms. Equatingthese terms, we have

daN

dt= τrN .

Furthermore, since RN is orthogonal to the space of uN ,

0 =(

N∑k=0

rk(t)Pk(x), Pn(x) − Pn(1)

)w

= rn (Pn, Pn)w − r0 (P0, Pn(1))w

so that rn is the same sign as r0 for all n = 1, . . . , N . Thus, we have

d

dt

∥∥uN

∥∥2w(x) +

∫ 1

−1w′(x) (uN )2 dx = −K

d

dt

(a2

N

),

where

K = r0

rNCN

∫ 1

−1w(x)PN+1(1)P0(x)dx ≥ 0.

Thus, we have

d

dt

(∥∥uN

∥∥2w(x) + K a2

N

) ≤ 0,

and so the method is stable∥∥uN (t)∥∥2

w(x) + K a2N (t) ≤ ∥∥uN (0)

∥∥2w(x) + K a2

N (0).

Since w(x) ≤ 2w(x), the method is also consistent in the new norm definedby w(x). Taken with stability, this yields convergence.

8.2 The collocation approach

To analyze the stability for collocation methods, we use the fact that the collo-cation points are related to Gauss-type integration formulas. The properties ofthese quadrature formulas allow us to pass from summation to integration.

Example 8.8 Consider the Chebyshev collocation method for the equation

ut = σ (x)uxx σ (x) > 0,

Page 151: Spectral Methods for Time-Dependent Problems

8.2 The collocation approach 143

with boundary conditions

u(±1, t) = 0.

Recall from Example 8.2 that this problem is wellposed in the Chebyshev norm.In the collocation method we seek solutions uN ∈ BN such that the equation

∂uN

∂t= σ (x)

∂2uN

∂x2

is satisfied at the points

x j = − cos

(π j

N

)j = 1, . . . , N − 1,

and uN (±1) = 0. Multiplying by uN (x j , t) and the weights w j , and summing,we have

N∑j=0

1

σ (x j )uN (x j )

∂uN (x j )

∂tw j =

N∑j=0

uN (x j )∂2uN (x j )

∂x2w j .

Let w j be the Chebyshev Gauss–Lobatto weights; then since uN (∂2uN /∂x2) isa polynomial of degree 2N − 2, the quadrature formula is exact, and the righthand side

N∑j=0

uN (x j )∂2uN (x j )

∂x2w j =

∫ 1

−1

1√1 − x2

uN∂2uN

∂x2dx ≤ 0.

Now, the left hand side

N∑j=0

1

σ (x j )uN (x j )

∂uN (x j )

∂tw j = 1

2

N∑j=0

1

σ (x j )

∂u2N

∂t(x j )w j

= 1

2

d

dt

N∑j=0

1

σ (x j )u2

N (x j )w j ,

and so we can conclude that

d

dt

N∑j=0

1

σ (x j )u2

N (x j )w j ≤ 0.

This implies that

N∑j=0

1

σ (x j )u2

N (x j , t)w j ≤N∑

j=0

1

σ (x j )u2

N (x j , 0)w j

Page 152: Spectral Methods for Time-Dependent Problems

144 Stability of polynomial spectral methods

and since

1

max σ (x j )

N∑j=0

u2N (x j , t)w j ≤

N∑j=0

1

σ (x j )u2

N (x j , t)w j

≤ 1

min σ (x j )

N∑j=0

u2N (x j , t)w j

we have

N∑j=0

u2N (x j , t)w j ≤ max σ (x j )

min σ (x j )

N∑j=0

u2N (x j , 0)w j .

Thus, the method is stable in L2w.

Next, we consider the Chebyshev collocation method based on the inner andthe left boundary Gauss–Lobatto points for the linear hyperbolic equation:

Example 8.9 To approximate the solution to the equation

∂u

∂t= ∂u

∂x

u(1, t) = 0

we seek a polynomial of degree (N − 1), uN (x, t), which satisfies the equation

∂uN

∂t(x)

∣∣∣∣x=x j

= ∂uN

∂x(x)

∣∣∣∣x=x j

at the points

x j = − cos

(π j

N

)j = 1, . . . , N .

If we multiply this equation by (1 + x j )w j and sum over all x j , we obtain

N∑j=0

(1 + x j )uN∂uN

∂tw j =

N∑j=0

(1 + x j )uN∂uN

∂xw j .

Since uN (∂uN /∂x) is a polynomial of degree 2N − 3, the quadrature is exactand we have

N∑j=0

(1 + x j )uN∂uN

∂tw j =

N∑j=0

(1 + x j )uN∂uN

∂xw j

=∫ 1

−1

1 + x√1 − x2

uN∂uN

∂xdx ≤ 0.

Page 153: Spectral Methods for Time-Dependent Problems

8.3 Stability of penalty methods 145

The stability of the Chebyshev method based on Gauss–Lobatto points hasalso been proved, but this proof is more complicated and we will not present ithere.

8.3 Stability of penalty methods

We turn to the stability of the penalty methods introduced in Chapter 7.

Example 8.10 Consider the wave equation

ut = ux ,

with some specified initial condition, and a boundary condition

u(1, t) = g(t).

The Legendre penalty method is

∂uN

∂t= ∂uN

∂x

for x = x j , the zeroes of (1 − x)P ′N (x), where PN (x) is the Legendre polyno-

mial, and

∂uN

∂t= ∂uN

∂x− τ (uN (1) − g(t)),

at x = 1.This scheme is consistent, because the exact solution satisfies the boundary

condition. For stability we consider the case g(t) = 0,

∂uN

∂t= ∂uN

∂xfor −1 ≤ x < 1

and

∂uN

∂t= ∂uN

∂x− τuN (1) for x = 1.

Lemma 8.11 Let τ > 1/2w0, where w0 = 2N (N+1) is the weight on the Legendre

Gauss–Lobatto formula at the endpoints. Then,

N∑j=0

u2N (x j , t)w j ≤

N∑j=0

u2N (x j , 0) w j .

Page 154: Spectral Methods for Time-Dependent Problems

146 Stability of polynomial spectral methods

Proof:

1

2

d

dt

N∑j=0

u2N (x j , t)w j =

N∑j=0

uN∂uN

∂tw j − τu2

N (1)w0

= 1

2

∫ 1

−1

(u2

N

)x

dx − τu2N (1)w0

= 1

2u2

N (1) − 1

2u2

N (−1) − τu2N (1)w0

≤ 0.

QED

In the next example, we prove the stability of the Chebyshev penalty methodfor the linear scalar hyperbolic problem.

Example 8.12 Again we consider the wave equation

∂u

∂t= ∂u

∂x,

with boundary condition given by

u(1, t) = g(t).

Let v = uN−1, so that the Chebyshev penalty method is

∂v

∂t= ∂v

∂xat x j = − cos

(π jN

)∀ j = 1, . . . , N

and

∂v

∂t= ∂v

∂x− τ (v(1, t) − g(t)),

at x = x0 = 1.As before, this scheme is consistent because the exact solution satisfies the

boundary condition. For stability we consider the case g(t) = 0:

Lemma 8.13 There exists some constant β, so that the method is stable forτ > βN 2.

Proof: Let w j be the Chebyshev Gauss–Lobatto weights. Noting that x0 = −1,and using the definition of the method, we have

N∑j=1

v∂v

∂t(1 + x j )w j =

N∑j=0

v∂v

∂t(1 + x j )w j

=N∑

j=0

v∂v

∂x(1 + x j )w j − 2τv2(1, t)wN .

Page 155: Spectral Methods for Time-Dependent Problems

8.3 Stability of penalty methods 147

If we look at the term v(∂v/∂t)(1 + x j ) we see that it is a (2N − 1)-orderpolynomial, so the Gauss–Lobatto quadrature is exact and the left-hand sidebecomes

N∑j=1

v∂v

∂t(1 + x j )w

Nj =

∫ 1

−1

(1 + x)√1 − x2

v∂v

∂tdx = 1

2

d

dt

∫ 1

−1

(1 + x)√1 − x2

v2dx .

Putting this all together,

1

2

d

dt

∫ 1

−1

(1 + x)√1 − x2

v2dx =N∑

j=0

v∂v

∂x(1 + x j )w j − 2τv2(1, t)wN

= 1

2

N∑j=0

∂v2

∂x(1 + x j )w j − 2τv2(1, t)wN .

Now recall that T ′N = 0 for the inner Gauss–Lobatto points, so we add and

subtract these as desired,

1

2

∂t

∫ 1

−1

(1 + x)√1 − x2

v2dx = 1

2

N∑j=0

(1 + x j )

[∂v2

∂x− v2(1)T ′

N

]w j dx

+ N 2wN v2(1, t) − 2τv2(1, t)wN

= −1

2

∫ 1

−1

1

(1 − x)√

1 − x2(v2 − v2(1)TN )dx

+ N 2wN v2(1) − τv2wN

≤ 1

2

∫ 1

−1

1

(1 − x)√

1 − x2v2(1)TN dx

+ N 2wN v2(1) − τv2wN .

Now if we let z j be the Gauss points of the (N + 1)-order polynomial, with thecorresponding weights v j the integral can be converted back into the sum bythe Gauss quadrature,

1

2

∂t

∫ 1

−1

(1 + x)√1 − x2

v2dx ≤ 1

2v2(1, t)

N∑j=1

1

1 − y jTN

(y j

)w j

+ N 2wN v2(1) − τv2wN .

Since the first two terms are of order N 2, and there exists some β so thatτ > βN 2, we can conclude that this term is bounded.

QED

The next result is on the stability of the Legendre collocation penalty methodfor a constant coefficient hyperbolic system.

Page 156: Spectral Methods for Time-Dependent Problems

148 Stability of polynomial spectral methods

Example 8.14 Consider the system

∂u

∂t= A

∂u

∂x

with a set of initial and boundary conditions. If we diagonalize the matrix A,we obtain the diagonal system

∂uI

∂t= �I ∂uI

∂x

uI (1, t) = RuI I (1, t),

∂uI I

∂t= −�I I ∂uI I

∂x

uI I (−1, t) = LuI (−1, t),

where the vector uI = (uI1, uI

2, . . . , uIp) is comprised of all the left-entering

characteristic variables, and uI I = (uI I1 , uI I

2 , . . . , uI Iq ) of the right-entering char-

acteristic variables. The constant matrices Rp×q and Lq×p represent the cou-pling of the system through the boundary conditions. The spectral norms ofthese matrices |R| = r and |L| = l, and we require that rl ≤ 1, so that theenergy of the system is non-increasing. The matrices

�I = diag(λI

1, λI2, . . . , λ

Ip

),

and

�I I = diag(λI I

1 , λI I2 , . . . , λI I

q

),

are the diagonal matrices of eigenvalues.In the Legendre collocation penalty method we seek solution vectors, vI of

polynomials (v I1 (x), . . . , v I

p(x)), and vI I = (v I I1 (x), . . . , v I I

q (x)), which satisfy

∂vI

∂t= �I ∂vI

∂x− �I

(vI (1, t) − RvI I (1, t)

)Q+(x)

∂vI I

∂t= −�I I ∂vI I

∂x− �I I

(vI I (−1, t) − LvI (−1, t)

)Q−(x).

Where Q− (or Q+) is a vector of polynomials which vanishes on all thegrid points except the left (or right, respectively) boundary, and has the value1/ω0 at the boundary, where ω0 is the Legendre Gauss–Lobatto weight associ-ated with the boundary points.

We assume that each polynomial v Ij (x, t) (where 1 ≤ j ≤ p) and v I I

k (x, t)(where 1 ≤ k ≤ q) is a good approximation to the corresponding uI

j and uI Ik . To

see this, we recall that consistency is assured by the penalty method formulation,and we proceed to prove stability.

Page 157: Spectral Methods for Time-Dependent Problems

8.3 Stability of penalty methods 149

Let’s look at the j th element of the vI vector. It satisfies

1

λIj

∂v Ij

∂t= ∂v I

j

∂x− [

vI (1, t) − RvI I (1, t)]

j Q+ ∀x .

Let’s multiply this expression by v Ij (xl)ωl and sum over the Legendre Gauss–

Lobatto points xl , to obtain

1

λIj

1

2

d

dt

N∑l=0

(v I

j (xl))2

w j =N∑

l=0

ωlvIj (xl)

∂v Ij

∂x

∣∣∣∣∣x=xl

− [vI (1, t) − RvI I (1, t)] jvIj (1).

The first term on the right-hand side,

N∑l=0

ωlvIj (xl)

∂v Ij

∂x

∣∣∣∣∣x=xl

= 1

2

∫ 1

−1

∂(v I

j (x))2

∂xdx = 1

2

(v I

j (1))2 − 1

2

(v I

j (−1))2

.

Let

(u, v)w =N∑

l=0

u(xl)v(xl)wl ,

and

<uI ,vI >p=p∑

j=0

(uI , vI )w, and <uI I ,vI I >q=q∑

j=0

(uI I , vI I )w.

Summing over all points, we obtain

1

2l(�I )−1 d

dt< vI ,vI >p = l

2(vI (1))2 − l

2(vI (−1))2 − l(vI (1))2

− l <vI , RvI I >p (1)

1

2r (�I I )−1 d

dt<vI I ,vI I >q = r

2(vI I (−1))2 − r

2(vI I (1))2 − r (vI I (−1))2

+ r <vI I , L vI >q (−1).

Adding these, we have

1

2l(�I )−1 d

dt<vI , vI >p +1

2r (�I I )−1 d

dt<vI I ,vI I >q

≤ −1

2

(l(vI (1))2 − 2lr |vI (1)||vI I (1)| + r (vI I (1))2

)−1

2

(l(vI (−1))2 + 2lr |vI (−1)||vI I (−1)| − r (vI I (−1))2

)≤ 0,

Page 158: Spectral Methods for Time-Dependent Problems

150 Stability of polynomial spectral methods

since each of the terms in brackets is positive as long as (lr )2 ≤ lr , which iscorrect since rl ≤ 1.

Remark A polynomial Galerkin penalty method consists of finding a poly-nomial solution which has the property that the residual is orthogonal to thepolynomial space, and the boundary conditions are enforced using a penaltymethod. This is exactly the same process employed in each subdomain of the dis-continuous Galerkin method. Thus, the multi-domain spectral penalty methodbears a striking similarity to the discontinuous Galerkin method. This topic willbe further discussed in Chapter 12.

8.4 Stability theory for nonlinear equations

Consider the nonlinear hyperbolic system

∂U

∂t+ ∂ f (U )

∂x= 0 (8.2)

Polynomial spectral methods for this equation are unstable in general but canbe stabilized by the Super Spectral Viscosity (SSV) method.

∂uN

∂t+ ∂PN f (uN )

∂x= εN (−1)s−1

(√1 − x2

∂x

)2s

uN , (8.3)

for the Chebyshev polynomial basis and

∂uN

∂t+ ∂PN f (uN )

∂x= εN (−1)s−1

(∂

∂x(1 − x2)

∂x

)s

uN , (8.4)

for the Legendre polynomial basis.Note that for spectral accuracy the order, s, must be proportional to N , the

number of polynomials (or grid points) in the approximation. Thus viscositychanges with mesh refinement.

Maday and Tadmor (1989) showed that the SSV methods converge to thecorrect entropy solution for Legendre approximations to scalar nonlinear hyper-bolic equations. Furthermore, it has been proven that even for systems, if thesolution converges it converges to the correct entropy solution.

The straightforward use of the SSV method requires extra derivative compu-tations thus effectively doubling the computational cost. For this reason, mostof the large scale spectral codes for high Mach number flows use filtering tostabilize the code. In fact, as will be explained in this section, filtering can beseen as an efficient way of applying the SSV method.

Page 159: Spectral Methods for Time-Dependent Problems

8.4 Stability theory for nonlinear equations 151

To understand the relationship between SSV and filtering let

uN (x, t) =N∑

k=0

ak(t)φk(x)

where φk are the basis function used (Chebyshev or Legendre). Also, letbk(a0, . . . , aN ) be the coefficients in the expansion

PN f (uN ) =N∑

k=0

bk(t)φk(x).

Because we include the terms (√

1 − x2) in the Chebyshev, the right-hand sideis (√

1 − x2d

dx

)2s

Tk = k2s Tk,

by the Sturm–Liouville equation. And so Equation (8.3) becomes

∂ak

∂t= bk − cεN k2sak . (8.5)

Similarly, for the Legendre case

d

dx

((√

1 − x2)d

dx

)s

Pk = ks(1 + k)s Pk,

and so Equation (8.4) becomes

∂ak

∂t= bk − cεN ks(1 + k)sak . (8.6)

Thus a typical step in a Runge–Kutta method for the Chebyshev SSV methodis

an+1k = an

k + �tbnk − �tcεN k2san+1

k .

Note that the stabilizing term is implicit, to prevent further limitation on thetime step. In the filtering method we change slightly the last term,

an+1k = an

k + �tbnk + (

1 − e�tcεN k2s )an+1

k

yielding

an+1k = e−�tcεN k2s (

ank + �tbn

k

).

This is an exponential filter. The benefit of this method is that it does notrequire any extra derivative computation and therefore does not increase thecomputational cost. Similar results can be obtained for the Legendre method.

Page 160: Spectral Methods for Time-Dependent Problems

152 Stability of polynomial spectral methods

We note here that the parameter s can be a function of x . This means that indifferent regions one can use viscosity terms of different orders. In the presenceof local sharp gradients one should reduce the order of the filter. To maintainspectral accuracy, though, s should be an increasing function of N .

Thus the local adaptive filter is defined by

uσN =

N∑k=0

σ

(k

N

)ak(t)φ(x), (8.7)

where

σ (ω) = e−αω2γ s,

and γ = γ (x) can change within the domain.

8.5 Further reading

The stability theory for the polynomial case has largely been developed byGottlieb and collaborators (1981, 1983, 1987) with contributions also by Canutoand Quarteroni (1981, 1986), Bressan and Quarteroni (1986). Further results andoverviews can be found in the review by Gottlieb and Hesthaven (2001) and inthe texts by Canuto et al (1986, 2006) and by Guo (1998). The penalty methodswere proposed for hyperbolic problems by Funaro and Gottlieb (1988, 1991).For the stability and convergence for nonlinear problems we refer to the papersby Maday and Tadmor (1989), Maday et al (1993), Tadmor (1997), and Ma(1998). More details on stabilization using filters can be found in the review byGottlieb and Hesthaven (2001) and the papers by Don and collaborators (1994,1995, 1998, 2003).

Page 161: Spectral Methods for Time-Dependent Problems

9

Spectral methods for nonsmooth problems

The error estimates for spectral approximations of solutions of PDEs rely heav-ily on the fact that the solution is smooth everywhere in the interval of interest.If the function has a discontinuity, even at one point, the error estimates fail.Moreover, the rate of convergence deteriorates to first order. It would seem thatspectral methods are not designed for problems with discontinuities. However,in this chapter we will show that spectral methods retain high resolution infor-mation even for discontinuous solutions, and that high-order approximationscan be obtained by appropriate postprocessing in smooth regions.

Let’s consider a simple example.

Example 9.1 We approximate the solution of the scalar hyperbolic equation

∂u

∂t= −2π

∂u

∂x, (9.1)

u(0, t) = u(2π, t),

with initial conditions

u(x, 0) ={

x 0 ≤ x ≤ π,

x − 2π π < x ≤ 2π,

and periodic boundary conditions, using a Fourier collocation method withN = 64 grid points in space and a fourth-order Runge–Kutta method in time.The initial profile, a saw-tooth function which is linear in each of the regions0 ≤ x < π and π < x ≤ 2π with a discontinuity at x = π , is convected aroundthe domain.

In Figure 9.1 we plot the computed approximation at t = 0 and after 100periodic revolutions. This simple experiment demonstrates many of the issueswhich arise in the spectral solution of discontinuous problems. The initialapproximation (t = 0), features strong oscillations, particularly near the shock.Although the steep gradient characterizing the discontinuity is fairly clear, the

153

Page 162: Spectral Methods for Time-Dependent Problems

154 Spectral methods for nonsmooth problems

x

−5

−4

−3

−2

−1

0

1

2

3

4

5

u(x)

0 p 2p

N = 64t = 0.0

(a)

x

−5

−4

−3

−2

−1

0

1

2

3

4

5

u(x)

0 p 2p

(b)

N = 64t = 100.0

Figure 9.1 (a) The initial saw-tooth function and the associated discrete Fourierseries approximation. (b) The saw-tooth function and the convected Fourier approx-imation at t = 100 obtained by solving Equation (9.1).

approximation of the solution is not very good in the neighborhood of the dis-continuity. However, the discontinuity remains well approximated even aftera very long time (t = 100) and only little smearing of the initial front can beobserved. All in all, although the approximation itself is oscillatory, the initialprofile is advected accurately.

While the initial spectral approximation of nonsmooth functions introducesvery significant oscillations, the superior phase properties of the Fourier methodremain intact. In the first section of this chapter, we will discuss in detail theappearance of the oscillations, known as the Gibbs phenomenon, and the non-uniform convergence which characterizes this phenomenon. The second partof this chapter is devoted to techniques, such as filtering and postprocessing,that will allow us to overcome or at least decrease the effect of the Gibbsphenomenon when solving general partial differential equations. This generaltheory shows that we can recover exponentially convergent series for piecewiseanalytic problems, and completely overcome the Gibbs phenomenon. Finally,we show that this methodology can be applied in the context of the numericalsolution of PDEs.

9.1 The Gibbs phenomenon

Let us begin by considering the behavior of trigonometric expansions of piece-wise continuous functions. To understand the problems which we saw inExample 9.1, we focus on the approximation of the initial profile.

Page 163: Spectral Methods for Time-Dependent Problems

9.1 The Gibbs phenomenon 155

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu

N = 4

N = 16 N = 64

u(x)

(a)

0.0 0.5 1.0 1.5 2.0x/p

10−5

10−4

10−3

10−2

10−1

100

101

|u−

PNu|

N = 4

N = 16

N = 64

N = 256

(b)

Figure 9.2 On the left we show the continuous Fourier series approximation of adiscontinuous function illustrating the appearance of the Gibbs phenomenon. Thefigure on the right displays the pointwise error of the continuous Fourier seriesapproximation for increasing resolution. Note that the value of the pointwise errorat the discontinuity corresponds exactly to (u(π+) + u(π−))/2.

Example 9.2 Consider the function

u(x) ={

x 0 ≤ x ≤ π,

x − 2π π < x ≤ 2π,

and assume that it is periodically extended. The continuous Fourier series expan-sion coefficients are

un ={

i(−1)|n|/n n �= 0,

0 n = 0.

In Figure 9.2 we show the Fourier series approximation to u(x). Observe thatthe strong oscillations around the discontinuity do not decay as we increase thenumber of points, but that the approximation converges, albeit slowly, awayfrom the discontinuity. The convergence of the approximation away from thediscontinuity can be seen in Figure 9.2 (right) where we plot the pointwiseerror. The convergence is, at most, linear, corresponding to the decay of theexpansion coefficients.

As Figure 9.2 shows, the error at the discontinuity does not disappear aswe increase the resolution. Thus, although the approximation converges in themean, the approximation is not uniformly convergent. To see that the approx-imation converges in the mean, we can estimate the L2-error using Parseval’sidentity,

‖u − PN u‖L2[0,2π ] = 2π

( ∑|n|>N

1

n2

)1/2

� 1√N

.

Page 164: Spectral Methods for Time-Dependent Problems

156 Spectral methods for nonsmooth problems

Although the function is smooth and periodic away from the discontinuity, theglobal rate of convergence is dominated by the presence of the discontinuity.Thus, we see two aspects of the problem: the slow convergence away from thediscontinuity, and the non-uniform convergence near the discontinuity. Thischaracteristic behavior is known as the Gibbs phenomenon.

To study the Gibbs phenomenon in more detail, we look at the truncatedFourier series sum

PN u(x) =∑

|n|≤N/2

uneinx ,

where the continuous expansion coefficients are

un = 1

∫ 2π

0u(x)e−inx dx .

Theorem 9.3 Every piecewise continuous function, u(x) ∈ L2[0, 2π ], has aconverging Fourier series

PN u(x) → u(x+) + u(x−)

2as N → ∞.

Proof: We begin by rewriting the truncated series

PN u(x) = 1

∑|n|≤N/2

(∫ 2π

0u(t)e−int dt

)einx

= 1

∫ 2π

0u(t)

( ∑|n|≤N/2

ein(x−t)

)dt

= 1

∫ x

x−2π

DN (t)u(x − t) dt,

where

DN (y) =∑

|n|≤N/2

einy = sin((N + 1)t/2)

sin(t/2), (9.2)

is the Dirichlet kernel. The Dirichlet kernel can be viewed as the projectionof a delta function onto the space spanned by the Fourier basis and is an evenfunction in y, which oscillates while changing signs at t j = 2π j/(N + 1). Thekernel is shown for increasing values of N in Figure 9.3.

Since the main contribution of the integral originates from a narrow regionaround zero, we have

PN u(x) � 1

∫ ε

−ε

DN (t)u(x − t) dt,

Page 165: Spectral Methods for Time-Dependent Problems

9.1 The Gibbs phenomenon 157

0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00−0.25

0.00

0.25

0.50

0.75

1.00

1.25

t

N = 8

N = 16

N = 32

Sin[(N + 1)t /2]

(N + 1)Sin[t /2]

Figure 9.3 The normalized Dirichlet kernel for various values of N .

where ε � 1. Because u(x) is at least piecewise continuous we may assume thatu(x − t) � u(x−) for 0 ≤ t ≤ ε and u(x − t) � u(x+) for 0 ≥ t ≥ −ε. Sincet is small, we can also assume sin(t/2) � t/2, and therefore

PN u(x) � 1

π(u(x+) + u(x−))

∫ ε

0

sin[(N + 1)t/2]

tdt.

This integral goes to 1/2 as N → ∞,

1

π

∫ ε

0

sin[(N + 1)t/2]

tdt = 1

π

∫ (N+1)ε/2

0

sin s

sds

� 1

π

∫ ∞

0

sin s

sds = 1

2as N → ∞,

which yields

PN u(x) → u(x+) + u(x−)

2as N → ∞.

QED

This theorem confirms that the trigonometric polynomial approximationconverges pointwise for each point of continuity, while at the discontinuity itconverges to the average. However, as we saw in the example, the convergence isnon-uniform close to a discontinuity. To explain why this happens we look at theapproximation at x0 + 2z/(N + 1) (where z is a parameter) in the neighborhoodof the point of discontinuity x0. We will need to use the assymptotic behaviormentioned in the proof above, as well as the Sine integral function (plotted inFigure 9.4),

Si(z) =∫ z

0

sin s

sds

and its properties

limz→∞ Si(z) = π

2, Si(−z) = −Si(z).

Page 166: Spectral Methods for Time-Dependent Problems

158 Spectral methods for nonsmooth problems

0.00 5.00 10.00 15.00 20.00 25.000.00

0.50

1.00

1.50

2.00

z

Si(z)

z = p

Si(z) = p/2

Figure 9.4 The Sine integral function, Si(z).

With these facts in place, the truncated sum

PN u

(x0 + 2z

N + 1

)� 1

∫ ε

−ε

DN (t)u

(x0 + 2z

N + 1− t

)dt,

becomes

PN u

(x0 + 2z

N + 1

)� u(x+

0 )

π

∫ z

−∞

sin s

sds + u(x−

0 )

π

∫ ∞

z

sin s

sds

� 1

2(u(x+

0 ) + u(x−0 )) + 1

π(u(x+

0 ) − u(x−0 ))Si(z).

If u(x) were continuous at x0, the second part would vanish, and we wouldrecover the pointwise convergence result. However, in the case of a discontinu-ity, this second term will cause a problem. For each N , if we look at a point xsuch that x − x0 = O(1/N ), the approximation

PN u(x) − 1

2(u(x+

0 ) + u(x−0 )) = O(1).

This means that as the point x approaches x0 (i.e., as N → ∞), the truncatedseries does not converge to the function. Thus, even though we have pointwiseconvergence at any point of continuity, the convergence is not uniform. We cansee this non-uniform convergence in Figure 9.2, where the overshoot comescloser to the discontinuity as N is increased, but it does not decay.

The maximum size of the overshoot occurs at z = π , which is where theSine integral obtains its maximum,

1

πSi(π ) = 0.58949.

Thus, the maximum overshoot or undershoot at a point of discontinuity asymp-totically approaches

PN u(x) − u(x−0 ) � 1.08949(u(x+

0 ) − u(x−0 )).

Page 167: Spectral Methods for Time-Dependent Problems

9.1 The Gibbs phenomenon 159

Hence, it is approximately 9% of the magnitude of the jump, and happensfor x ≈ x0 ± 2π/(N + 1). The following examples illustrate this aspect of theGibbs phenomenon.

Example 9.4 Once again, we look at the function

u(x) ={

x 0 ≤ x ≤ π,

x − 2π π < x ≤ 2π,

and assume that it is periodically extended. Using the theory above we expectthe maximum overshoot around x0 = π to be

|PN u(x) − u(π±)| � 0.08949|u(π+) − u(π−)| = 0.08949 2π � 0.5623,

which agrees well with the results displayed in Figure 9.2.

Example 9.5 [Fornberg (1996)] Let’s consider the periodically extended unitstep function

u(x) ={− 1

2 −π < x < 0,

12 0 < x < π.

The continuous Fourier series expansion is

u(x) = 2

π

∞∑k=0

sin(2k + 1)x

2k + 1.

The extremum of the truncated expansion

PN u(x) = 2

π

N∑k=0

sin(2k + 1)x

2k + 1,

can be found by taking its derivative

(PN u(x))′ = 2

π

N∑k=0

cos(2k + 1)x = sin 2(N + 1)x

π sin x,

and observing that this vanishes for x = π2(N+1) . If we insert this into the trun-

cated expansion and identify this with a Riemann sum, we obtain the asymptoticresult

PN u(π/(2(N + 1))

) = 1

π (N + 1)

N∑k=0

sin (2k+1)π2(N+1)

2k+12(N+1)

� 1

π

∫ 1

0

sin π t

tdt = 1

πSi(π ) = 0.58949.

The above discussion concerned continuous expansions of a discontinu-ous function. The Gibbs phenomenon also appears in the same way in dis-crete expansions, and so we will not discuss this topic explicitly. The Gibbs

Page 168: Spectral Methods for Time-Dependent Problems

160 Spectral methods for nonsmooth problems

phenomenon also appears in polynomial approximations and Bessel functionexpansions. For example, Chebyshev expansions do not exhibit the Gibbs phe-nomenon at the boundaries x = ±1, but they do exhibit the phenomenon atinterior discontinuities of the function.

9.2 Filters

One of the manifestations of the Gibbs phenomenon is that the expansion coef-ficients decay slowly. This is due to the global nature of the approximation:the expansion coefficients are obtained by integration or summation over theentire domain, including the point(s) of discontinuity. The idea of filtering isto alter the expansion coefficients so that they decay faster. While, as we shallsee, this will not impact the non-uniform convergence near the shock, a wellchosen filter will speed convergence away from the discontinuity.

Before we can discuss the design or effect of a filter, we need to define it.

Definition 9.6 A filter of order q is a real and even function σ (η) ∈Cq−1[−∞, ∞] with the following properties:

(a) σ (η) = 0 for |η| > 1.

(b) σ (0) = 1 and σ (1) = 0.

(c) σ (m)(0) = σ (m)(1) = 0 ∀m ∈ [1, . . . , q − 1].

A filtered truncated continuous polynomial approximation can be written as

PN u(x) = uσN (x) =

N∑n=0

σ( n

N

)unφn(x), (9.3)

where un are the continuous expansion coefficients and σ (n/N ) is the filter.Note that the filter is a continuous function which does not affect the lowmodes, only the high modes. Cutting the high modes abruptly (correspondingto a step function filter) does not enhance the convergence rate even in smoothregions.

The filter can also be defined in physical space. For a Fourier space filterσ (n/N ), the physical filter function

S(x, y) =N∑

n=0

σ( n

N

) 1

γnφn(x)φn(y), (9.4)

enters into the filtered approximation

uσN (x) =

∫D

u(y)w(y)S(x, y) dy.

Page 169: Spectral Methods for Time-Dependent Problems

9.2 Filters 161

Note that if we let σ (η) = 1, the filter function is just the polynomial Dirichletkernel. Since the highly oscillatory behavior of the Dirichlet kernel is a repre-sentation of the global nature of the approximation, one could attempt to specifyσ (η) with the aim of localizing the influence of S(x, y). As it turns out, properlocalization of the Dirichlet kernel is at least as complex as that of increasingthe decay rate and it is indeed the latter procedure that has received most of theattention in the past.

9.2.1 A first look at filters and their use

Let’s look at some examples of filters, and see how the filtered approximationsbehave. For the sake of simplicity we restrict our examples to continuous Fourierseries. Similar results apply when filtering polynomial expansions.

Example 9.7 (Cesaro filter) The filter

σ (η) = 1 − η,

results from an arithmetic mean of the truncated series, and is only linear (q =1).In Figure 9.5 we have plotted the Cesaro filtered Fourier series approximationof the discontinuous saw-tooth function and compared it with the un-smoothedapproximation. We observe that the Cesaro filter eliminates the oscillations andovershoot characteristic of the Gibbs phenomenon, however it also produces aheavily smeared approximation to the original function. Although the CesaroFilter allows us to recover uniform convergence, nothing is gained in termsof accuracy away from the discontinuity, since the filter is only first order. InFigure 9.6 we plot the pointwise error of the filtered approximation as comparedto the un-filtered approximation.

The effect of the Cesaro filter in physical space can be understood by con-sidering the modified Dirichlet kernel

S(x) = 2

N + 2

{sin2((N/2+1)x/2)

sin2(x/2)x �= 2πp

1 x = 2πpp = 0, ±1, ±2, . . .

First, we observe that S(x) ≥ 0, i.e., the Cesaro filtered Fourier series approx-imation can be expected to be non-oscillatory in physical space as observed inFigure 9.5. Next, we notice that the first zero of the modified kernel appearsat x = 4π/(N + 2) while the original Dirichlet kernel has it first zero atx = 2π/(N + 1). As a consequence, we expect the significant smearing ofthe discontinuity observed in Figure 9.5. Indeed, the smearing is so severe thatwe lose the ability to accurately identify the location of the discontinuity, inreality reducing the Cesaro filter to an analytical tool, rather than a practical one.

Page 170: Spectral Methods for Time-Dependent Problems

162 Spectral methods for nonsmooth problems

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu

N = 4

N = 16 N = 64

u(x)

(a)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu

N = 4

N = 16N = 64

N = 256

u(x)

(b)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu

N = 4

N = 16 N = 64

N = 256

u(x)

(c)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu

N = 4

N = 16 N = 64

N = 256

u(x)

(d)

Figure 9.5 Effects on the smoothness of the approximation when applying var-ious filters to a Fourier approximation of a discontinuous function. (a) Un-filtered approximation. (b) Cesaro filtered approximation. (c) Raised cosine filteredapproximation. (d) Lanczos filtered approximation.

Example 9.8 (Raised cosine filter) The filter

σ (η) = 1

2(1 + cos(πη)),

is formally of second order. In fact the application of this filter is equivalent totaking the spatial average

u j � u j+1 + 2u j + u j−1

4,

and has the modified kernel

S(x) = 1

4

[DN

(x − 2π

N

)+ 2DN (x) + DN

(x + 2π

N

)],

where DN (x) is the Dirichlet kernel discussed in the previous section.

Page 171: Spectral Methods for Time-Dependent Problems

9.2 Filters 163

0.0 0.5 1.0 1.5 2.0x/p

10−5

10−4

10−3

10−2

10−1

100

101

|u−

PNu|

N = 4

N = 16

N = 64

N = 256

(a)

0.0 0.5 1.0 1.5 2.0x/p

10−10

10−8

10−6

10−4

10−2

100

102

|u−

PNu|

N = 4

N = 16N = 64

N = 256

(b)

0.0 0.5 1.0 1.5 2.0x/p

10−10

10−8

10−6

10−4

10−2

100

102

N = 4

N = 16

N = 64

N = 256

|u−

PNu|

(c)

0.0 0.5 1.0 1.5 2.0x/p

10−10

10−8

10−6

10−4

10−2

100

102

|u−

PNu|

N = 4

N = 16

N = 64

N = 256

(d)

Figure 9.6 Pointwise errors of the approximation when applying various filters toa Fourier approximation of a discontinuous function. (a) Un-filtered approximation(Note different scale). (b) Cesaro filtered approximation. (c) Raised cosine filteredapproximation. (d) Lanczos filtered approximation.

From Figure 9.5 we observe that the raised cosine filter reduces the oscil-lations present in the un-filtered approximation, but does not eliminate theovershoot near the discontinuity. Figure 9.6 demonstrates that away from thediscontinuity the approximation error is clearly reduced by applying the filter.

Example 9.9 (Lanczos filter) The Lanczos filter

σ (η) = sin πη

πη,

is also second order. As is evident from Figure 9.5, the Lanczos filter elimi-nates the oscillations away from the discontinuity, but not the overshoot at thediscontinuity. Figure 9.6 shows that the pointwise error indeed decreases ascompared to the un-filtered approximation. However, in this case the error isslightly larger than that obtained by using the raised cosine filter.

Page 172: Spectral Methods for Time-Dependent Problems

164 Spectral methods for nonsmooth problems

The classical filters considered so far lead to a significant reduction of theGibbs phenomenon away from the discontinuity. However, the pointwise con-vergence remains first or second-order in N . Is it possible to recover higher-orderaccuracy away from the discontinuity?

Example 9.10 (Exponential filters) We have the family of exponential filters

σ (η) ={

1 |η| ≤ ηc,

e(−α( η−ηc1−ηc

)p)η > ηc,

where α is a measure of how strongly the modes should be filtered and p is theorder of the filter. Note that the exponential filter does not conform with thedefinition of a filter in Definition 9.6 because σ (1) = e−α . However, in practicewe choose α such that σ (1) � O(εM ) where εM is the machine accuracy, sothat the ±N/2 modes are completely removed.

In Figure 9.7 and Figure 9.8 we illustrate the effect of applying exponentialfilters of various orders to the saw-tooth function. We observe that even thoughthe Gibbs phenomenon remains, as evidenced by the overshoot near the dis-continuity, we recover p-order convergence in N away from the discontinuity.Choosing p as a linear function of N yields exponential accuracy away from thediscontinuity. The recovery of convergence of any desired order has made theexponential filter a popular choice when performing simulations of nonlinearpartial differential equations, where the Gibbs phenomenon may cause a stablescheme to become unstable due to amplification of oscillations. As we haveseen in Chapter 3, filtering may also serve to stabilize a scheme.

9.2.2 Filtering Fourier spectral methods

Recall that, in Fourier spectral methods, the use of continuous and discreteexpansion coefficients leads to different methods and different implementationswhen computing derivatives. This is seen in filtering, as well.

Filtering the continuous expansion Filtering the continuous expansion isstraightforward as it only involves summing the filtered series

uσN =

∑|n|≤N/2

σ

( |n|N/2

)uneinx ,

and the filtered differentiation operators

dq

dxquσ

N =∑

|n|≤N/2

σ

( |n|N/2

)u(q)

n einx .

Page 173: Spectral Methods for Time-Dependent Problems

9.2 Filters 165

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PN

u

N = 4

N = 16

N = 64 N = 256u(x)

(a)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu N = 4

N = 16N = 64

N = 256

u(x)

(b)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PNu N = 4

N = 16

N = 64N = 256u(x)

(c)

0.0 0.5 1.0 1.5 2.0x/p

−4

−3

−2

−1

0

1

2

3

4

PN

u

N = 4

N = 16

N = 64 N = 256u(x)

(d)

Figure 9.7 Effects on the smoothness of the approximation when applying expo-nential filters of increasing order to a Fourier approximation of a discontinuousfunction. In all cases we used α = − log εM ∼ 35. (a) Un-filtered approximation.(b) Exponential filter of order 2. (c) Exponential filter of order 6. (d) Exponentialfilter of order 10.

In both these contexts, filtering consists of multiplying the expansion coeffi-cients by the filter function, and then summing as usual. There is no significantincrease in the computational work involved.

Filtering the discrete expansion As we have seen previously, there are twomathematically equivalent but computationally different methods of express-ing the discrete expansions, leading to two different ways of filtering theexpansions.

The first method follows the approach used for the continuous expansion:we multiply the expansion coefficients by the filter and proceed as usual. Theonly difference is that we use the discrete expansion coefficients rather than thecontinuous ones.

Page 174: Spectral Methods for Time-Dependent Problems

166 Spectral methods for nonsmooth problems

0.0 0.5 1.0 1.5 2.0x/p

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

|u−

PNu|

N = 4 N = 16

N = 64

N = 256

(a)

0.0 0.5 1.0 1.5 2.0x/p

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

|u−

PNu|

|u−

PNu|

N = 4

N = 16

N = 64

N = 256

(b)

0.0 0.5 1.0 1.5 2.0x/p

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

|u−

PNu|

N = 4

N = 16

N = 64

N = 256

(c)

0.0 0.5 1.0 1.5 2.0x/p

N = 4

N = 16

N = 64

N = 256

(d)

Figure 9.8 Pointwise error of the approximation when applying exponential filtersof increasing order to a Fourier approximation of a discontinuous function. In allcases we used α = − log εM ∼ 35. (a) Un-filtered approximation. (b) Exponentialfilter of order 2. (c) Exponential filter of order 6. (d) Exponential filter of order 10.

The second method involves matrices rather than summation of series. First,consider the case of an even number of points

x j = 2π

Nj, j ∈ [0, . . . , N − 1],

with the corresponding approximation

IN u(x) =N−1∑j=0

u(x j )g j (x),

where g j (x) is the interpolating Lagrange polynomial. To obtain the filteredapproximation

uσN (x) =

N−1∑j=0

u(x j )gσj (x),

Page 175: Spectral Methods for Time-Dependent Problems

9.2 Filters 167

we need the filtered version of the interpolating Lagrange polynomial, gσj (x).

Since the filter σ (η) is even, we have

gσj (x) = 2

N

N/2∑n=0

1

cσn

σ

(n

N/2

)cos[n(x − x j )],

where cσ0 = cσ

N/2 = 2 and cσn = 1 otherwise.

This allows us to express filtering as a matrix operation

uσN (xl) =

N−1∑j=0

uN (x j )gσj (xl).

Note that the filter matrix is a symmetric, Toeplitz matrix. Similarly, we canobtain matrix forms for the combination of filtering and differentiation

D(q),σl j = 2

N

N/2∑n=0

1

cσn

σ

(n

N/2

){(in)q cos[n(xl − x j )] q even,

i(in)q sin[n(xl − x j )] q odd,,

so that the filtered and differentiated approximation is

dq

dxquσ

N (xl) =N−1∑j=0

D(q),σl j uN (x j ).

Note that D(q),σ has the same properties as D(q), i.e., it is a circulant Toeplitzmatrix that is symmetric when q is even and skew-symmetric when qis odd.

The filtered versions of the Lagrange interpolation polynomials and thedifferentiation matrices for an odd number of collocation points

y j = 2π

N + 1j, j ∈ [0, . . . , N ],

can be obtained for the above results by setting cσn = 1 for all values of n.

9.2.3 The use of filters in polynomial methods

Now we turn our attention to the use of filters in continuous and discrete poly-nomial expansions.

Filtering of the continuous expansion Once again, the filtering of the contin-uous expansions is a multiplication of the coefficients by the filter,

uσN =

N∑n=0

σ( n

N

)unφn(x),

Page 176: Spectral Methods for Time-Dependent Problems

168 Spectral methods for nonsmooth problems

and likewise, the filtered differentiation operators

dq

dxquσ

N =N∑

n=0

σ( n

N

)u(q)

n φn(x).

Filtering of the discrete expansion As before, the two equivalent formula-tions of the discrete polynomial approximation result in two equivalent waysin which to apply a filter. The first approach is the same as the one we usefor filtering the continuous expansion, a straightforward multiplication of theexpansion coefficients (in this case, the discrete ones) by the filter, and theusual summation. However, if we wish to employ the Lagrange polynomialformulation, we have

IN u(x) =N∑

j=0

u(x j )l j (x),

where x j is some chosen set of grid points and l j (x) are the associated Lagrangepolynomials. For simplicity, we’ll use the Gauss–Lobatto quadrature pointsassociated with the ultraspherical polynomials, P (α)

n (x), in which case theLagrange polynomials are

l j (x) = w j

N∑n=0

P (α)n (x)P (α)

n (x j )

γn,

with the Gauss–Lobatto quadrature weights w j .The filtered approximation

uσN (x) =

N∑j=0

u(x j )lσj (x),

is obtained by filtering the Lagrange polynomials

lσj (x) = w j

N∑n=0

σ( n

N

) P (α)n (x)P (α)

n (x j )

γn,

which we can not, in general, express in a simple form. However, we can expressthe action of the filter at the grid points by a filter matrix Fi j = lσj (xi ), so thatthe filtered expansion is

uσN (xi ) =

N∑j=0

Fi j u(x j ).

Note that Fi j is centro-symmetric as a consequence of the symmetry of thequadrature points. A similar approach can be taken if the Gauss quadraturepoints are chosen.

Page 177: Spectral Methods for Time-Dependent Problems

9.2 Filters 169

Likewise, we obtain matrix forms for the combination of filtering anddifferentiation,

D(q),σi j = w j

N∑n=0

σ( n

N

) P (α)n (x j )

γn

dq P (α)n

dxq

∣∣∣∣xi

,

so that the filtered and differentiated approximation is

dq

dxquσ

N (xi ) =N∑

j=0

D(q),σi j u(x j ).

The filtered matrices, D(q),σi j , share the properties of the unfiltered versions, i.e.,

they are centro-antisymmetric when q is odd and centro-symmetric when q iseven.

9.2.4 Approximation theory for filters

In the previous section we saw that filtering improves convergence away fromthe discontinuity. In this section we shall prove this result in a more rigoroussense. The theory is more complete for filtering of trigonometric expansionsthan for polynomial expansions, and we review it here.

We assume that we know the first (2N + 1) expansion coefficients, un , ofa piecewise analytic function, u, and that the function is known to have adiscontinuity at x = ξ . The aim is to recover the value of u at any point in theinterval [0, 2π ]. For this purpose we introduce a filter σ (|n|/N ) with the hopethat the modified approximation

uσN (x) =

∑n≤N

σ

( |n|N

)uneinx ,

converges faster than the original series

uN (x) =∑n≤N

uneinx .

The filter σ has the property that σ (η) = 0 for η ≥ 1, so that the modifiedapproximation can be written as

uσN (x) =

∑|n|<∞

σ

( |n|N

)uneinx .

If we use the definition of un and rearrange the terms, the filtered approximationcan be expressed in terms of the filter function

S(z) =∑

|n|<∞σ (η)einz . (9.5)

Page 178: Spectral Methods for Time-Dependent Problems

170 Spectral methods for nonsmooth problems

and the function u,

uσN (x) = 1

∫ 2π

0S(x − y)u(y) dy. (9.6)

On our way to an understanding of the properties of filters, we need to introducethe concept of a filter function family, which will play an important role.

Definition 9.11 A filter function S(z) has an associated family of functions,Sl(z), defined recursively,

S0(z) = S(z)

S′l (z) = Sl−1(z)∫ 2π

0Sl(z) dz = 0, l ≥ 1.

The filter function defined in Equation (9.5) leads to several equivalent repre-sentations of the corresponding filter family, as stated in the following lemma.

Lemma 9.12 Assume that σ (η) is a filter of order p, as defined in Definition 9.6,with the associated filter function

S(z) = S0(z) =∑

|n|<∞σ (η)einz,

where η = |n|/N. The corresponding filter family, Sl(z), defined in Defini-tion 9.11, has the following equivalent representations (1 ≤ l ≤ p);

(a)

Sl(z) = 1

Nl

∑|n|<∞

Gl(η)i leinz,

where

Gl(η) = σ (η) − 1

ηl.

(b)

Sl(z) = 1

Nl−1

∑|m|<∞

∫ ∞

−∞ei N (z+2πm)ηGl(η)i l dz.

(c)

l = 1: S1(z) = z − π +∑

|n|<∞n �=0

σ (η)(in)−1einx ,

l ≥ 2: Sl(z) = Bl(z) +∑

|n|<∞n �=0

σ (η)(in)−l einx .

The polynomials Bl(z) are the Bernoulli polynomial of order l.

Page 179: Spectral Methods for Time-Dependent Problems

9.2 Filters 171

The filter family and its integrals will be important for the following theorem.This theorem shows the difference between the filtered approximation and thefunction u(x) in terms of the filter function.

Theorem 9.13 Let u(x) be a piecewise C p[0, 2π] function with a single pointof discontinuity at x = ξ . Then

uσN (x) − u(x) = 1

p−1∑l=0

Sl+1(c)(u(l)(ξ+) − u(l)(ξ−)

)

+ 1

∫ 2π

0Sp(x − y)u(p)(y) dy

where c = x − ξ for x > ξ and c = 2π + x − ξ for x < ξ .

Proof: First, we note that by using expression (c) in Lemma 9.12 for S1(z) andthe integral condition on Sl(z) for l > 1,

S1(2π) − S1(0) = 2π (9.7)

Sl(2π ) − Sl(0) = 0, l ≥ 2.

Consider the case x > ξ . Integrating Equation (9.6) by parts p times, takingcare not to integrate over the point of discontinuity, yields

2πuσN (x) =

∫ ξ−

0S(x − y)u(y) dy +

∫ 2π

ξ+S(x − y)u(y) dy

=p−1∑l=0

(Sl+1(2π ) − Sl+1(0)) u(l)(x)

+p−1∑l=0

Sl+1(x − ξ )(u(l)(ξ+) − u(l)(ξ−)

)

+∫ 2π

0Sp(x − y)u(p)(y) dy

= 2πu(x) +p−1∑l=0

Sl+1(x − ξ )(u(l)(ξ+) − u(l)(ξ−)

)

+∫ 2π

0Sp(x − y)u(p)(y) dy,

where the last reduction follows from Equation (9.7), and we used the fact thatu as well as Sl are periodically extended.

Page 180: Spectral Methods for Time-Dependent Problems

172 Spectral methods for nonsmooth problems

Likewise, for x < ξ we obtain the result

2πuσN (x) =

∫ ξ−

0S(x − y)u(y) dy +

∫ 2π

ξ+S(x − y)u(y) dy

=p−1∑l=0

(Sl+1(2π ) − Sl+1(0)) u(l)(x)

+p−1∑l=0

Sl+1(2π + x − ξ )(u(l)(ξ+) − u(l)(ξ−)

)

+∫ 2π

0Sp(x − y)u(p)(y) dy

= 2πu(x) +p−1∑l=0

Sl+1(2π + x − ξ )(u(l)(ξ+) − u(l)(ξ−)

)

+∫ 2π

0Sp(x − y)u(p)(y) dy.

QED

This result provides a precise expression of the error between the unknownpoint value of u(x) and its filtered and truncated approximation, uσ

N (x). Now wewould like to estimate the two terms on the right hand side of the expression inTheorem 9.13, to get a clearer idea of how well the filtered series approximatesthe function.

If u(x) ∈ C p−1[0, 2π ], then the first term of Theorem 9.13 vanishes and weare left with the last term. Thus, this last term is really the error term for smoothfunctions. We estimate this last term in the following lemma.

Lemma 9.14 Let Sl(x) be defined as in Definition 9.11, then

1

∣∣∣∣∫ 2π

0Sp(x − y)u(p)(y) dy

∣∣∣∣ ≤ C

√N

N p

(∫ 2π

0

∣∣u(p)∣∣2

dx

)1/2

,

where C is independent of N and u.

Proof: The Cauchy–Schwarz inequality yields

1

∣∣∣∣∫ 2π

0Sp(x − y)u(p)(y) dy

∣∣∣∣≤ 1

(∫ 2π

0S2

p(x) dx

)1/2 (∫ 2π

0

∣∣u(p)(x)∣∣2

dx

)1/2

because Sp is periodic. To estimate the first term we express Sp using (a) of

Page 181: Spectral Methods for Time-Dependent Problems

9.2 Filters 173

Lemma 9.12

1

∫ 2π

0S2

p(x) dx = 1

∫ 2π

0

∑|n|<∞

(1

N p

σ (η) − 1

ηpi peinx

)2

=∑

|n|<∞

1

N 2p

(σ (η) − 1

ηp

)2

= 1

N 2p−1

∑|n|≤N

2

2N

(σ (η) − 1

ηp

)2

+∑

|n|>N

1

n2p

≤ 1

N 2p−1

∫ 1

−1

(σ (η) − 1

ηp

)2

dη + 1

N 2p−1

≤ CN

N 2p,

where we have used the orthogonality of exponential functions and boundedthe Riemann sum by its integral, which is convergent under condition (c) ofDefinition 9.6.

QED

If the function is not smooth, we must also consider the first term on theright-hand side of Theorem 9.13. The conditions given in Lemma 9.12 will beenough to show that this term diminishes away from the discontinuity.

Lemma 9.15 Let Sl(x) be defined by Definition 9.11 for l ≥ 1, with

S0(x) =∑

|n|≤N

σ (η)einx ,

then

|Sl(x)| ≤ C1

N p−1

(1

|x |p−l+ 1

|2π − x |p−l

)∫ ∞

−∞

∣∣G(p−l)l (η)

∣∣ dη,

where Gl(η) is defined in Lemma 9.12.

Proof: Consider Sl(x) (in part (b) of Lemma 9.12); since Gl(x) is p − 1 timesdifferentiable and the filter is defined such that σ (l)(0) = σ (l)(1) = 0, we obtainby integrating by parts p − l times,

|Sl(x)| = 1

Nl−1

∣∣∣∣∣∑

|m|<∞

∫ ∞

−∞

ei N (x+2πm)η

N p−l(x + 2πm)p−lG(p−l)

l (η) dη

∣∣∣∣∣ .Since x ∈ [0, 2π ], the dominating terms are found for m = 0 and m = −1.Using the triangle inequality and taking these two contributions outside theintegral we obtain the result.

QED

Page 182: Spectral Methods for Time-Dependent Problems

174 Spectral methods for nonsmooth problems

Finally, we are ready to estimate the error between the filtered approximationand the function itself.

Theorem 9.16 Let u(x) be a piecewise C p[0, 2π ] function with only one pointof discontinuity at x = xd . Let σ (η) be a filter function according to Defini-tion 9.6. Let d(x) = |x − xd | be the distance between a point x ∈ [0, 2π ] andthe discontinuity, and

uσN (x) =

N∑n=−N

σ (η)uN einx ,

is the filtered truncated series approximation to u(x).Then the pointwise difference between u(x) and uσ

N (x) at all x �= xd isbounded by

∣∣u(x) − uσN (x)

∣∣ ≤ C11

N p−1

1

d(x)p−1K (u) + C2

√N

N p

(∫ 2π

0

∣∣u(p)∣∣2

dx

)1/2

,

where

K (u) =p−1∑l=0

d(x)l∣∣u(l)(x+

d ) − u(l)(x−d )

∣∣ ∫ ∞

−∞

∣∣G(p−l)l (η)

∣∣ dη.

Proof: The second part of the estimate follows from Lemma 9.14. FromLemma 9.15 we know that the first part of the expression in Theorem 9.13is bounded. Since c = x − xd for x > xd and c = 2π + x − xd for x < xd inTheorem 9.13 we have that

1

|c|p−l+ 1

|2π − c|p−l≤ 2

d(x)p−l.

Combining this with the estimate of Lemma 9.15 yields the result.QED

This theorem proves that filtering raises the rate of convergence away fromthe discontinuity (d(x) > 0), as all terms can be bounded by O(N 1−p) depend-ing only on the regularity of the piecewise continuous function and the orderof the filter. In the case where u(x) is piecewise analytic, one can take the orderof the filter p ∝ N to yield exponential accuracy away from the discontinuity.The extension to multiple points of discontinuity is straightforward.

9.3 The resolution of the Gibbs phenomenon

While filtering may remove the Gibbs Phenomenon away from the discon-tinuity, the order of accuracy decreases with proximity to the discontinuity.

Page 183: Spectral Methods for Time-Dependent Problems

9.3 The resolution of the Gibbs phenomenon 175

However, the Gibbs phenomenon may be completely removed for all expan-sions commonly used in spectral methods, by re-expanding a slowly convergingglobal expansion using a different set of basis functions.

We begin with an L2[−1, 1] function, f (x), which is analytic on somesubinterval [a, b] ⊂ [−1, 1]. Let {�k(x)} be an orthonormal family under someinner product ( · , · ). We focus on the Fourier basis or the Jacobi polynomialbasis, since they are commonly used in spectral methods. Denote the finitecontinuous expansion in this basis by

fN (x) =N∑

k=0

( f, �k)�k(x) (9.8)

and assume that

|( f, �k)| ≤ C (9.9)

for C independent of k, and that

limN→∞

| f (x) − fN (x)| = 0 (9.10)

almost everywhere in x ∈ [−1, 1]. This expansion may converge slowly inthe presence of a discontinuity outside of the interval of analyticity [a, b].This is due to the global nature of the expansion: since the coefficients arecomputed over the entire domain [−1, 1], any discontinuity in that domain willcontaminate the expansion even in the interval of analyticity [a, b]. However,under certain conditions, fN (x) retains sufficient information to enable us torecover a high order approximation to f (x) in the interval [a, b].

First, let’s define the local variable ξ ∈ [−1, 1] by the transformation

ξ = −1 + 2

(x − a

b − a

)(9.11)

such that if a ≤ x ≤ b then −1 ≤ ξ ≤ 1.Now we re-expand fN (x) (an expansion in the basis �k), by an orthonormal

family of functions {�λk } defined in an interval of analyticity [a, b],

f λN (x) =

N∑k=0

< fN , �λk >λ �λ

k (ξ (x)) . (9.12)

For each fixed λ, the family {�λk } is orthonormal under some inner product

< · , · >λ.This new expansion converges exponentially fast in the interval [a, b] if the

family {�λk } is Gibbs Complementary.

Page 184: Spectral Methods for Time-Dependent Problems

176 Spectral methods for nonsmooth problems

Definition 9.17 The family {�λk (ξ )} is Gibbs complementary to the family

{�k(x)} if the following three conditions are satisfied:

(a) Orthonormality

< �λk (ξ ), �λ

l (ξ ) >λ = δkl (9.13)

for any fixed λ.(b) Spectral convergence The expansion of a function g(ξ ) which is analytic

in −1 ≤ ξ ≤ 1 (corresponding to a ≤ x ≤ b), in the basis �λk (ξ ), converges

exponentially fast with λ, i.e.,

max−1≤ξ≤1

∣∣∣∣∣g(ξ ) −λ∑

k=0

< g, �λk >λ �λ

k (ξ )

∣∣∣∣∣ ≤ e−q1λ, q1 > 0. (9.14)

(c) The Gibbs condition There exists a number β < 1 such that if λ = βN,then

∣∣< �λl (ξ ), �k(x(ξ )) >λ

∣∣ max−1≤ξ≤1

∣∣�λl (ξ )

∣∣ ≤(

αN

k

(9.15)

k > N , l ≤ λ, α < 1. (9.16)

This means that the projection of the high modes of the basis {�k} (largek) on the low modes in � (�λ

l (ξ ) with small l) is exponentially small in theinterval −1 ≤ ξ ≤ 1 for λ proportional to N.

In the following we will show that f λN (x), the re-expansion of fN (x) in a

Gibbs complementary basis, approximates the original function f (x) exponen-tially in N everywhere in the domain [a, b].

Theorem 9.18 Let f (x) ∈ L2[−1, 1] be analytic in [a, b] ⊂ [−1, 1]. Supposethat {�k(x)} is an orthonormal family with the inner product ( · , · ) that satisfiesEquations (9.9) and (9.10), and {�λ

k (ξ )} is a Gibbs complementary basis to thefamily {�k(x)}, with λ = βN. Furthermore, assume

< f − fN , �λl >λ =

∞∑k=N+1

( f, �k) < �λl , �k >λ . (9.17)

Then

maxa≤x≤b

∣∣∣∣∣ f (x) −λ∑

l=0

< fN , �λl >λ �λ

l (ξ (x))

∣∣∣∣∣ ≤ e−q N , q > 0. (9.18)

Proof: The proof is divided into two parts. We first note that since f (x) isanalytic in [a, b] then condition (b), Equation (9.14), means that the expansion

Page 185: Spectral Methods for Time-Dependent Problems

9.3 The resolution of the Gibbs phenomenon 177

in the new basis converges exponentially

maxa≤x≤b

∣∣∣∣∣ f (x) −λ∑

l=0

< f, �λl >λ �λ

l (ξ (x))

∣∣∣∣∣ ≤ e−q2λ, q2 > 0. (9.19)

However, we do not have < f, �λl >λ, but only < fN , �λ

l >λ. We thereforehave to estimate

maxa≤x≤b

∣∣∣∣∣λ∑

l=0

< f − fN , �λl >λ �λ

l (ξ (x))

∣∣∣∣∣ .Using Equations (9.9), (9.10) and (9.17),

max−1≤ξ≤1

∣∣∣∣∣λ∑

l=0

< f − fN , �λl >λ �λ

l (ξ )

∣∣∣∣∣≤ max

−1≤ξ≤1

λ∑l=0

∞∑k=N+1

∣∣( f, �k) < �λl , �k >λ �λ

l (ξ )∣∣

≤ Cλ∑

l=0

∞∑k=N+1

(αN

k

≤ e−q N , q > 0.

where the second inequality follows from Equation (9.9) and condition (c).To conclude the proof we realize that∣∣∣∣∣ f (x) −

λ∑l=0

< fN , �λl >λ �λ

l (ξ (x))

∣∣∣∣∣≤

∣∣∣∣∣ f (x) −λ∑

l=0

< f, �λl >λ �λ

l (ξ (x))

∣∣∣∣∣ +∣∣∣∣∣

λ∑l=0

< f − fN , �λl >λ �λ

l (ξ )

∣∣∣∣∣QED

This Theorem implies that even if we have a slowly converging series

fN (x) =N∑

k=0

( f, �k)�k(x),

it is still possible to get a rapidly converging approximation to f (x), if one canfind another basis set that yields a rapidly converging series to f , as long as theprojection of the high modes in the basis {�} on the low modes in the new basisis exponentially small. The basis �k(x) does not provide a good approximation,but it contains meaningful information such that a better approximation can beconstructed. The fact that the expansion in �k(x) contains enough informationis manifested by the fact that the projection of the high modes in �k(x) on the

Page 186: Spectral Methods for Time-Dependent Problems

178 Spectral methods for nonsmooth problems

low modes in �λl is small, thus a finite expansion in �k(x) neglects modes with

low information contents.This is the way that the Gibbs phenomenon can be resolved: if we can find

a Gibbs complementary basis to the expansions that converge slowly and non-uniformly then we can remove the Gibbs phenomenon.

In the following examples we present a Gibbs complementary basis for themost commonly used spectral bases.

Example 9.19 The Fourier basis is

�k(x) = 1√2

eikπx , (9.20)

where k runs from −∞ to ∞. A Gibbs complementary basis (a complementarybasis need not be unique) is

�λk (ξ ) = 1√

γ (λk )C (λ)

k (ξ ) (9.21)

where C (λ)k (ξ ) is the Gegenbauer polynomial and γ

(λ)k is the normalization factor.

The λ inner product is defined by

< f, g >λ =∫ 1

−1(1 − x2)λ− 1

2 f (ξ )g(ξ ) dξ (9.22)

To show that this basis is Gibbs complementary, we must check the three con-ditions.

The orthogonality condition, Equation (9.13), follows from the definitionof C (λ)

k (ξ ) and γ(λ)k .

To prove the spectral convergence condition, Equation (9.14), we beginby assuming that f (x) is an analytic function on [−1, 1], and that there existconstants ρ ≥ 1 and C(ρ) such that, for every k ≥ 0,

max−1≤x≤1

∣∣∣∣dk f

dxk(x)

∣∣∣∣ ≤ C(ρ)k!

ρk. (9.23)

The spectral convergence condition is proved by estimating the approximationerror of using a finite (first m + 1 terms) Gegenbauer expansion to approximatean analytic function f (x) in [−1, 1]:

max−1≤x≤1

∣∣∣∣∣ f (x) −m∑

l=0

f λl C (λ)

l (x)

∣∣∣∣∣ . (9.24)

What makes this different from the usual approximation results, is that werequire λ, the exponent in the weight function (1 − x2)λ− 1

2 , to be growing

Page 187: Spectral Methods for Time-Dependent Problems

9.3 The resolution of the Gibbs phenomenon 179

linearly with m, the number of terms retained in the Gegenbauer expansion.Recall that the Gegenbauer coefficients, f λ

l , are

f λl = 1

γ(λ)l

∫ 1

−1(1 − x2)λ−1/2 f (x)C (λ)

l (x)dx .

We use the Rodrigues’ formula

(1 − x2)λ−1/2C (λ)l (x) = (−1)l

2l l!G(λ, l)

dl

dxl

[(1 − x2)l+λ−1/2

]where

G(λ, l) = �(λ + 1

2

)� (l + 2λ)

� (2λ) �(l + λ + 1

2

) ,

to obtain

f λl = (−1)l

γ(λ)l 2l l!

G(λ, l)∫ 1

−1

dl

dxl

[(1 − x2)l+λ−1/2

]f (x)dx

= G(λ, l)

γ(λ)l 2l l!

∫ 1

−1

dl f (x)

dxl(1 − x2)l+λ−1/2dx

by integrating by parts l times. We can now use the assumption in Equa-tion (9.23) on f (x) to get the bound

∣∣ f λl

∣∣ ≤ G(λ, l)C(ρ)

γ(λ)l 2lρl!

∫ 1

−1(1 − x2)l+λ−1/2dx .

Noting that ∫ 1

−1(1 − x2)l+λ−1/2dx = √

π�(l + λ + 1

2

)(l + λ)�(l + λ)

,

we bound the Gegenbauer coefficients

∣∣ f λl

∣∣ ≤ √π

G(λ, l)C(ρ)�(l + λ + 1

2

(λ)l (l + λ)�(l + λ)2lρl

,

that is,

∣∣ f λl

∣∣ ≤ √π

C(ρ)�(λ + 1

2

)�(l + 2λ)

γ(λ)l (2ρ)l�(2λ)

�(l + λ + 1),

Next, we use the bound on the Gegenbauer coefficients and the fact that theGegenbauer polynomial is bounded

∣∣C (λ)l (x)

∣∣ ≤ C (λ)l (1) ≤ A

l + λ√λ

γ(λ)l

Page 188: Spectral Methods for Time-Dependent Problems

180 Spectral methods for nonsmooth problems

for some constant, A, to obtain

∣∣ f λl

∣∣ C (λ)l (1) ≤ K

C(ρ)�(λ + 1

2

)�(l + 2λ)√

λ(2ρ)l�(2λ)�(l + λ).

Define

Bl = KC(ρ)�

(λ + 1

2

)�(l + 2λ)√

λ(2ρ)l�(2λ)�(l + λ),

and so, since ρ ≥ 1,

Bl+1

Bl= l + 2λ

2ρ(l + λ)≤ l + 2λ

2(l + λ).

Finally, we look at the approximation error

max−1≤x≤1

∣∣∣∣∣ f (x) −m∑

l=0

f λl C (λ)

l (x)

∣∣∣∣∣ ≤∞∑

l=m+1

∣∣ f λl

∣∣ C (λ)l (1)

≤∞∑

l=m+1

Bl ≤ Bm+1

∞∑q=0

(m + 2λ

2(m + λ)

)q

.

The last expression is a geometric series which converges for m > 0,

∞∑q=0

(m + 2λ

2(m + λ)

)q

= 1

1 − m+2λ2(m+λ)

= 2(m + λ)

m,

so we have

max−1≤x≤1

∣∣∣∣∣ f (x) −m∑

l=0

f λl C (λ)

l (x)

∣∣∣∣∣≤ Bm+1

2(m + λ)

m= K

2(m + λ)

m

C(ρ)�(λ + 1

2

)�(m + 1 + 2λ)√

λm(2ρ)m+1�(2λ)�(m + λ). (9.25)

If we let λ = γ m for a constant γ > 0, this bound becomes

RE(γ m, m) ≤ Aqm (9.26)

where q is given by

q = (1 + 2γ )1+2γ

21+2γ ργ γ (1 + γ )1+γ(9.27)

which always satisfies q < 1 since ρ ≥ 1.In fact, the assumption (9.23) is too strong, and a similar result can be

obtained by assuming only that there exists a constant 0 ≤ ρ < 1 and an analytic

Page 189: Spectral Methods for Time-Dependent Problems

9.3 The resolution of the Gibbs phenomenon 181

extension of f (x) onto the elliptic domain

Dρ ={

z : z = 1

2

(reiθ + 1

re−iθ

), 0 ≤ θ ≤ 2π, ρ ≤ r ≤ 1

}(9.28)

This assumption is satisfied by all analytic functions defined on [−1, 1]. Infact, the smallest ρ for which Equation (9.23) is satisfied is characterized bythe following property

limm→∞ (Em( f ))

1m = ρ (9.29)

with Em( f ) defined by

Em( f ) = minP∈Pm

max−1≤x≤1

| f (x) − P(x)| (9.30)

where Pm is the set of all polynomials of degree at most m.If f (x) is analytic not in the whole interval [−1, 1] but in a sub-interval

[a, b] ⊂ [−1, 1], we use the change of variable x = εξ + δ with ε = (b − a)/2and δ = (a + b)/2, such that g(ξ ) = f (x(ξ )) is defined and is analytic on−1 ≤ ξ ≤ 1. The previous estimates will then apply to g(ξ ), which can betranslated back to the function f (x) with a suitable factor involving ε.

Now we turn to the verification of the Gibbs condition (9.15), whichbecomes ∣∣∣∣

∫ 1

−1(1 − x2)λ− 1

2 eikπx(ξ )C (λ)l (ξ ) dξ

∣∣∣∣ ≤(

αN

k

, (9.31)

for k > N , l ≤ λ = βN , 0 < α < 1. Fortunately, there is an explicit formulafor the integral in (9.31):∫ 1

−1(1 − x2)λ− 1

2 eikπx(ξ )C (λ)l (ξ ) dξ = γ

(λ)l �(λ)

(2

πkε

i l(l + λ)Jl+λ(πkε),

(9.32)

where ε = b − a and Jν(x) is the Bessel function. Using the fact that |Jν(x)| ≤ 1for all x and ν > 0, and Stirling’s formula, the Gibbs condition is satisfied whenβ ≥ 2πε/27.

Example 9.20 The Legendre polynomial basis is

�k(x) = 1√γ

(1/2)k

C (1/2)k (x). (9.33)

Once again,

�λk (ξ ) = 1√

γ(λ)k

C (λ)k (ξ ) (9.34)

Page 190: Spectral Methods for Time-Dependent Problems

182 Spectral methods for nonsmooth problems

is a Gibbs complementary basis. To verify this, we note that the orthonormalityand the spectral convergence conditions depend only on the basis �λ

k , and wereproved above. Unlike the first two conditions, the Gibbs condition depends onboth �λ

k and �k . To show that the Gibbs condition holds we need to provethat

1√γ

(1/2)k

∣∣∣∣∫ 1

−1(1 − x2)λ− 1

2 C (1/2)k (x(ξ ))C (λ)

l (ξ ) dξ

∣∣∣∣ ≤(

αN

k

, (9.35)

for k > N , l ≤ λ = βN , 0 < α < 1. We use the explicit formula for the Fouriercoefficients of Pk(x):

Pk(x) =∞∑

l=−∞ak

l eilπx , akl = i k

√2l

Jk+1/2(−πl).

Thus, Equation (9.32) can be used to estimate the Gibbs condition (9.35).

Example 9.21 In general, for the Gegenbauer basis

�k(x) = 1√γ

(µ)k

C (µ)k (x) (9.36)

the same

�λk (ξ ) = 1√

γ(λ)k

C (λ)k (ξ ) (9.37)

is a Gibbs complementary basis. To verify this, we must show that

1√γ

(µ)k

∣∣∣∣∫ 1

−1(1 − x2)λ− 1

2 C (µ)k (x(ξ ))C (λ)

l (ξ ) dξ

∣∣∣∣ ≤(

αN

k

,

for k > N , l ≤ λ = βN , 0 < α < 1. This time, the explicit formula in Equa-tion (9.32) does not apply.

9.4 Linear equations with discontinuous solutions

We have demonstrated that the Gibbs phenomenon can be overcome, and spec-tral accuracy recovered in the case of a Fourier or polynomial expansion. Weconsider now a linear hyperbolic equation with discontinuous initial condi-tions, such as the one used in Example 9.1, and show that a re-expansion ofthe Fourier–Galerkin method solution in a Gibbs complementary basis is a

Page 191: Spectral Methods for Time-Dependent Problems

9.4 Linear equations with discontinuous solutions 183

spectrally accurate solution. This means that we can convect this profile for-ward in time with a spectral method, and when we have reached our final time,the numerical solution will still contain the necessary information to extract ahigh-order approximation to the exact solution.

Consider the hyperbolic problem

Ut = LU

(where L is a semi-bounded operator) with initial condition

U (x, 0) = U0(x).

The Galerkin approximation is(∂u

∂t− Lu, φk

)L2[0,2π ]

= 0,

where φ is a trigonometric polynomial in all directions x j . When U0(x) iscontinuous we have the usual error estimate

‖u − U‖L2[0,2π ] ≤ cN−s‖U0‖H sp[0,2π].

However, when U0(x) is discontinuous this error estimate is no longer valid,but we have a corresponding result in the weak sense:

Theorem 9.22 For every smooth function ψ(x),

|(u − U, ψ)|L2[0,2π] ≤ cN−s‖ψ‖H sp[0,2π ].

Proof: Given a smooth function ψ(x, t), we can always find a function V (x, t)which is the solution of

∂V

∂t= −L∗V with V (x, 0) = V0(x),

such that at time t = τ , the two are equal ψ(x, τ ) = V (x, τ ). This is alwayspossible because we can solve the hyperbolic equation backwards and forwards,and so can pick initial conditions which give us the solution we want at time τ .Let v(x, t) be the Galerkin approximation(

∂v

∂t+ L∗v, φk

)L2[0,2π]

= 0,

where φk(x, t) is a trigonometric polynomial in x , and v(x, 0) = PN V0. Thesolutions U and V satisfy Green’s identity

(U (τ ), V (τ ))L2[0,2π] = (U0, V0)L2[0,2π ],

Page 192: Spectral Methods for Time-Dependent Problems

184 Spectral methods for nonsmooth problems

as can be seen from

∂t(U, V )L2[0,2π] = (Ut , V )L2[0,2π ] + (U, Vt )L2[0,2π ]

= (LU, V )L2[0,2π ] + (U, −L∗V )L2[0,2π]

= (LU, V )L2[0,2π ] − (U,L∗V )L2[0,2π] = 0

Similarly, by observing that both u and v are trigonometric polynomials in x ,we have (

∂u

∂t, v

)L2[0,2π ]

= (Lu, v)L2[0,2π ]

and (∂v

∂t, u

)L2[0,2π]

= −(L∗v, u)L2[0,2π ]

and so u and v also satisfy Green’s identity

(u(τ ), v(τ ))L2[0,2π] = (u0, v0)L2[0,2π ].

Recall that the terms (U0 − u0, v0)L2[0,2π] and (u0, V0 − v0)L2[0,2π], are zerobecause (U0 − u0) and (V0 − v0) are orthogonal to the space of trigonometricpolynomials in which u0 and v0 live. By using Green’s identity and adding andsubtracting these zero terms, we obtain

(U (τ ) − u(τ ), V (τ )) = (U (τ ), V (τ )) − (u(τ ), V (τ ))

= (U0, V0) − (u(τ ), V (τ ) − v(τ )) − (u0, v0)

= (U0, V0) − (u0, v0) − (U0 − u0, v0) + (u0, V0 − v0)

− (u(τ ), V (τ ) − v(τ ))

= (U0, V0) − (U0, v0) + (u0, V0 − v0)

− (u(τ ), V (τ ) − v(τ ))

= (U0 + u0, V0 − v0) − (u(τ ), V (τ ) − v(τ )).

Since L is semi-bounded, the Galerkin approximation is stable, and spectralaccuracy follows:

(U (τ ) − u(τ ), V (τ )) ≤ k1 N−s‖V0‖H sp[0,2π ] + k2 N−s‖V (·, τ )‖H s

p[0,2π]

≤ cN−s‖V0‖H sp[0,2π ].

QED

Although spectral methods for scalar nonlinear equations with discontinuoussolutions are stable with appropriate filtering, the issue of recovering high-orderaccuracy is still open. Lax (1978) argued that high order information is retained

Page 193: Spectral Methods for Time-Dependent Problems

9.4 Linear equations with discontinuous solutions 185

−0.5 0.0 0.5 1.010−12

10−11

10−10

10−9

10−8

10−7

10−6

10−5

10−4

10−3

10−2

10−1

100

101

N = 10

N = 20

N = 40

N = 80

−0.5 0.0 0.5 1.010−12

10−11

10−10

10−9

10−8

10−7

10−6

10−5

10−4

10−3

10−2

10−1

100

101

N = 10

N = 20

N = 40

N = 80

(a)

(b)

Figure 9.9 Pointwise errors in log scale, Burgers’ equation. Fourier–Galerkinusing 2N + 1 modes with exponential solution filters of order r. r = 4 for N =10; r = 6 for N = 20; r = 8 for N = 40 and r = 12 for N = 80. (a) Beforepostprocessing. (b) After postprocessing with parameters λ = 2, m = 1 for N =10; λ = 3, m = 3 for N = 20; λ = 12, m = 7 for N = 40 and λ = 62, m = 15for N = 80.

in a convergent high resolution scheme. Numerical evidence has confirmed thisfor the following example.

Example 9.23 Consider the scalar Burgers’ equation

∂u

∂t+ ∂

∂x

(u2

2

)= 0, −1 ≤ x < 1

u(x, 0) = 0.3 + 0.7 sin(πx).

Page 194: Spectral Methods for Time-Dependent Problems

186 Spectral methods for nonsmooth problems

The solution develops a shock at t = 1/(0.7π ) and we compute the solutionup to t = 1. The initial condition is chosen such that the shock is moving withtime. We use a Fourier spectral method with filtering to stabilize the method, toapproximate the solution to this equation. In Figure 9.9 (a) we plot the pointwiseerror u(x, t) − vN (x, t) before postprocessing, which is only first order accurate.Next, we apply the Gegenbauer postprocessor to vN (x, t). The pointwise errorsof the postprocessed solution are plotted in Figure 9.9 (b). We can observe goodaccuracy everywhere, including at the discontinuity x = ±1 + 0.3.

These arguments demonstrate that it may be possible to recover high-orderaccuracy even in the case of nonlinear equations.

9.5 Further reading

The detailed analysis of filters was first pursued by Vandeven (1991) withfurther studies by Boyd (1998). Similar techniques was proposed by Majdaet al (1984). Many applications of such techniques can be found in papers byDon and coworkers (1994, 2003). The use of one-sided filters was first discussedin Gottlieb and Tadmor (1985) and further extensive developed by Tanner andTadmor (2002) . The theory for the polynomial case is incomplete with partialresults by Ould Kaber (1994) and Hesthaven and Kirby (2006). The resolutionof the Gibbs phenomenon by reprojection was developed in a series of papersby Gottlieb and Shu (1992, 1994, 1995, 1996, 1998) with a review paper byGottlieb and Shu (1997). Further developments have been pursued by Gelb andco-workers (1997, 2000, 2003, 2004, 2006) and by Lurati (2006). The resulton spectral convergence by reconstruction after propagation was obtained byAbarbanel et al (1986) and demonstrated for the nonlinear case by Shu andWong (1995) and Gelb and Tadmor (2000).

Page 195: Spectral Methods for Time-Dependent Problems

10

Discrete stability and time integration

All spectral discretizations of the spatial operator in a PDE, result in a systemof ODEs of the form

duN

dt= LN (uN (x, t), x, t).

This system is then solved numerically. In this chapter, we explore numericalmethods which can be used to solve this system of ODEs.

Although numerical ODE solvers are successfully used for nonlinear prob-lems, stability analysis will be performed, as usual, for the linear problem

duN

dt= LN uN (x, t), (10.1)

where uN (x, t) is a vector of length M(N + 1) which contains the (N + 1)expansion coefficients (in the case of a Galerkin or a tau method) or the gridpoint values (in the case of a collocation method) for each of the M equations,andLN is a M(N + 1) × M(N + 1) matrix. It is convenient to write the methodin vector form

dudt

= Lu(x, t),

which has the exact solution

u(x, t) = eLt u(x, 0),

where eLt is the matrix exponential. Methods based on approximating thematrix exponential by ultraspherical polynomials have been successfully usedto approximate the solution u; however, usually explicit or implicit finite dif-ference schemes are used for this purpose. In either case, the exponential ez isessentially approximated either as a finite Taylor series

eL�t � K(L, �t) =m∑

i=0

(L�t)i

i!,

187

Page 196: Spectral Methods for Time-Dependent Problems

188 Discrete stability and time integration

or through a Pade approximation

eL�t � K(L, �t) =∑m

i=0 ai (L�t)i∑ni=0 bi (L�t)i

,

with the expansion coefficients ai and bi determined by the requirement thatthe approximation agrees with the Taylor expansion. For a sufficiently small�t , such an approximation is accurate enough.

The combination of spectral methods in space and finite difference methodsin time is generally justified, because the time step is typically sufficientlyrestricted in size so that the temporal error is comparable to the spatial error.

10.1 Stability of linear operators

The finite difference approximation is

u(x, t + �t) = un+1 = K(L, �t)un,

where t = n�t , with step size �t , and the matrix K(L, �t) is the approximationto the matrix exponential eL�t . The fully discrete scheme is strongly stableprovided that

‖ [K(L, �t)]n ‖L2w

≤ K (�t),

where ‖ · ‖L2w

is the matrix norm. A sufficient condition for strong stability isthat

‖K(L, �t)‖L2w

≤ 1 + κ�t,

for some bounded κ and all sufficiently small values of �t . In practice, a better,though more restrictive, condition is the above with κ = 0. In the following,we show how the discrete stability of a scheme is analyzed.

10.1.1 Eigenvalue analysis

The eigenvalues of K(L, �t) provide a necessary, but generally not sufficient,condition for stability. In the special case where K is a normal matrix, i.e.,KT K = KKT , strong stability is ensured in L2 through the von Neumann sta-bility condition

max |λK | ≤ 1 + κ�t,

where λK are the eigenvalues of K(L, �t). In the following we shall discussthe eigenvalue spectrum of various discrete operators obtained using Fourier orpolynomial methods.

Page 197: Spectral Methods for Time-Dependent Problems

10.1 Stability of linear operators 189

Fourier methods The eigenvalue spectra of the Fourier–Galerkin approxima-tion of the first and second derivatives are

{−i N/2, . . . ,−i, 0, i, . . . , N/2},and

{−N 2/4, . . . ,−1, 0, −1, . . . ,−N 2/4},respectively. The maximum eigenvalue for the m-order differentiation is

max∣∣λ(m)

∣∣ =(

N

2

)m

.

In the Fourier–collocation method the last mode is aliased to zero, and thereforethe eigenvalues are {(in)meinx : n = −N/2 + 1, . . . , N/2 − 1}. In practicethe Galerkin and the collocation methods behave in the same way and it is safeto assume that the eigenvalue spectra for the different methods are identical forall practical purposes. Since the Fourier method involves normal differentiationmatrices, the von Neumann stability condition is sufficient to ensure stability.For linear problems all we need to do is bound K (λk, �t) for all λk to ensurefull discrete stability.

Polynomial methods When using polynomial methods for the approximationof the spatial operators, we cannot obtain the eigenvalues analytically. Fur-thermore, since the matrices are not normal, the eigenvalues provide only anecessary, but not sufficient, condition for stability.

Consider the eigenvalue spectrum of the diffusive operator

Lu = d2u

dx2.

There is little quantitative difference between the Legendre and Chebyshevmethods, or between the tau and collocation approaches. The eigenvalue spec-trum is in all cases strictly negative, real and distinct, and bounded by

−c1 N 4 ≤ λ ≤ c2 < 0,

for some constants c1 and c2. In all these cases, the maximum eigenvalue scalesas N 4 asymptotically.

However, the eigenvalue spectrum of the advective operator

Lu = du

dx

varies depending on the choice of polynomial and the use of the Galerkin,collocation, or tau approaches. The Chebyshev Gauss–Lobatto collocation

Page 198: Spectral Methods for Time-Dependent Problems

190 Discrete stability and time integration

−60 −40 −20 0 20 40 60−60

−40

−20

0

20

40

60

lr

li

N = 8

N = 16

N = 24

Figure 10.1 Eigenvalue spectra of a Chebyshev Gauss–Lobatto advection operatorfor increasing resolution, N .

approximation to the advective operator with homogeneous Dirichlet boundaryconditions is illustrated in Figure 10.1. Observe that the real parts are strictlynegative while the maximum eigenvalue scales as

max∣∣λ(1)

∣∣ = O(N 2).

In contrast to Fourier methods, here the eigenvalues grow at a rate propor-tional to N 2 rather than linearly in N . Numerical studies of the spectrum of theChebyshev tau approximation of the advection operator show that the maximumeigenvalue is slightly smaller than that obtained in the collocation approxima-tion, but overall the behavior is qualitatively the same.

The eigenvalue spectrum for the Legendre Gauss–Lobatto differentiationmatrix is shown in Figure 10.2. Note that all real parts of the spectrum are strictlynegative (as a result of the stability of the method), albeit with a very smallreal part for the extreme eigenvalues. Although the spectrum is qualitativelydifferent from that of the Chebyshev Gauss–Lobatto, the maximum eigenvaluealso scales as N 2.

The spectrum for the Legendre tau approximation of the advective operatoris quite different. Indeed, it is possibly to show analytically that asymptoticallythe maximum eigenvalue scales like

max∣∣λ(1)

∣∣ = O(N ).

Page 199: Spectral Methods for Time-Dependent Problems

10.1 Stability of linear operators 191

−40 −20 0 20 40

−40

−20

0

20

40

lr

li

N = 8

N = 16

N = 24

Figure 10.2 Eigenvalue spectra of a Legendre Gauss–Lobatto advection operatorfor increasing resolution, N .

However, since the matrix is not normal, the eigenvalue analysis does not giveus sufficient conditions for stability. Indeed, in the next section we will showthat in this case, too, the stability condition is that �t must scale like 1/N 2. Thisis a good example of the shortcomings of eigenvalue analysis for non-normaloperators.

10.1.2 Fully discrete analysis

A more relevant analysis for the stability condition of the advective operatoris performed on the fully discrete method. Consider the forward Euler schemefor the pseudospectral Legendre method based on the inner collocation points.Let u = un+1 and v = un , so that Euler’s method is

u = v + �tvx − �tvx (1)P ′

N (x)

P ′N (1)

,

where we collocate at the zeroes of P ′N (x) and satisfy the boundary conditions

u(1) = v(1) = 0. Thus,

u2 = v2 + 2�tvvx − 2(�t)vvx (1)P ′

N (x)

P ′N (1)

+ (�t)2v2x − 2(�t)2vxvx (1)

P ′N (x)

P ′N (1)

+ (�t)2v2x (1)

(P ′

N (x)

P ′N (1)

)2

.

Page 200: Spectral Methods for Time-Dependent Problems

192 Discrete stability and time integration

We multiply by (1 + x j )w j and sum over all j , and use the fact that P ′N (x j ) =

0 for the inner points, to obtainN∑

j=0

(1 + x j )u2(x j )w j =

N∑j=0

(1 + x j )v2(x j )w j

+ 2�tN∑

j=0

(1 + x j )v(x j )vx (x j )w j

+ (�t)2N∑

j=0

(1 + x j )v2x (x j )w j − 2(�t)2v2

x (1)w0,

where w j are the Gauss quadrature weights. For stability, we need

N∑j=0

(1 + x j )u2(x j )w j ≤

N∑j=0

(1 + x j )v2(x j )w j ,

which means that

2�tN∑

j=0

(1+x j )v(x j )vx (x j )w j +(�t)2N∑

j=0

(1+x j )v2xw j − 2(�t)2v2

x (1)w0 ≤ 0.

Note that using the exactness of the quadrature and integration by parts,

2�tN∑

j=0

(1 + x j )vvxw j = 2∫ 1

−1(1 + x)vvx dx = −

∫ 1

−1v2dx

so that for stability we need

�t

(∫ 1

−1(1 + x)v2

x dx − 2v2x (1)w0

)≤

∫ 1

−1v2dx .

This results in the condition

�t ≤∫ 1−1 v2dx∫ 1

−1(1 + x)v2x dx

≈ O(

1

N 2

).

This energy method analysis allows us to obtain an accurate stability conditionfor the fully discrete method.

10.2 Standard time integration schemes

The choice of time integration method is influenced by several factors such asdesired accuracy, available memory and computer speed. In the following weshall briefly discuss the most commonly used numerical methods for integrating

Page 201: Spectral Methods for Time-Dependent Problems

10.2 Standard time integration schemes 193

time-dependent ODEs resulting from a method of lines formulation where thespatial operators are approximated using spectral methods.

10.2.1 Multi-step schemes

The general multi-step scheme is

p∑i=0

αi un−i = �tp∑

i=0

βi Ln−i ,

where p refers to the order of the scheme. If β0 = 0 we can obtain the solutionat t = n�t from knowledge of the solution at previous time-steps only, i.e., thescheme is explicit. Multi-step schemes require that solutions at one or moreprevious time-steps are retained, thus making such schemes memory intensive,in particular when solving large multi-dimensional problems. However, onlyone evaluation of Ln is required to advance one time-step, thereby reducing thecomputational workload. The choice of memory storage over computationalspeed is problem dependent and it is hard to give general guidelines.

Initially, we may not have the solution at the required number of time-stepsbackward in time. Indeed, we typically have the solution at only one time-step.Thus, it is necessary to start out with a few iterations of a one-step method ofappropriate order and use these approximations as starting values. Since oneis only taking very few steps with this initial method, the question of stabilitymay be neglected and even unconditionally unstable schemes can be used forinitializing multi-step schemes. However, accuracy is still important and wemust begin with a start-up method of the same order p as the multi-step methodwe wish to use. If the old time-steps only enter in L and so are multiplied witha �t , a start-up method of order (p − 1) is sufficient.

10.2.2 Runge–Kutta schemes

A popular and highly efficient alternative to the multi-step schemes is the familyof Runge–Kutta methods. An s-stage explicit Runge–Kutta scheme is

k1 = L(un, n�t) = Ln

ki = L

(un + �t

i−1∑j=1

ai j ki , (n + ci )�t

)

un+1 = un + �ts∑

i=1

bi ki ,

Page 202: Spectral Methods for Time-Dependent Problems

194 Discrete stability and time integration

where the choice of the constants ai j , ci and bi determines the accuracy andefficiency of the overall scheme.

For linear operators L, the s-stage Runge–Kutta schemes are simply the Tay-lor expansion of the matrix exponential to order s. The Runge–Kutta schemesrequire more evaluations of L than the multi-step schemes require to advance atime-step. However, unlike the multi-step schemes, the Runge–Kutta methodsrequire no information from previous time-steps.

Standard schemes A popular second-order scheme is given by c2 = a21 = 1/2and b2 = 1 and the remaining coefficients equal to zero,

k1 = L(un, n�t) = Ln

k2 = L(un + 1

2�tk1,(n + 1

2

)�t

)un+1 = un + �tk2.

This scheme is known as the midpoint method. Alternatively, we can use

k1 = L(un, n�t) = Ln

k2 = L(un + �tk1, (n + 1)�t

)un+1 = un + �t

2(k1 + k2).

A popular third-order three-stage scheme is

k1 = L(un, n�t) = Ln

k2 = L(un + 1

3�tk1,(n + 1

3

)�t

)k3 = L

(un + 2

3�tk2,(n + 2

3

)�t

)un+1 = un + �t

4(k1 + 3k3),

which requires only two levels of storage.The classical fourth-order accurate, four-stage scheme is

k1 = L(un, n�t) = Ln

k2 = L(un + 1

2�tk1,(n + 1

2

)�t

)k3 = L

(un + 1

2�tk2,(n + 1

2

)�t

)k4 = L

(un + �tk3, (n + 1)�t

)un+1 = un + �t

6(k1 + 2k2 + 2k3 + k4),

requiring four storage levels.

Page 203: Spectral Methods for Time-Dependent Problems

10.2 Standard time integration schemes 195

Figure 10.3 Stability regions for Runge–Kutta methods.

To study the linear stability of these schemes we consider the linear scalarequation

du

dt= λu,

for which the general s-stage scheme can be expressed as a truncated Taylorexpansion of the exponential functions

un+1 =s∑

i=1

(λ�t)i

i!un.

Thus, the scheme is stable for a region of λ�t for which∣∣∣∣∣s∑

i=1

(λ�t)i

i!

∣∣∣∣∣ ≤ 1.

In Figure 10.3 we display the linear stability regions for the three Runge–Kuttamethods. Note that the stability regions expand with increasing number ofstages. However, increasing the order of the scheme also increases the amountof memory and computation required for each step.

Observe that the second-order Runge–Kutta scheme is only marginally stableat the imaginary axis, and is thus ill suited for Fourier and Legendre basedschemes for approximating advective operators.

Low-storage methods Runge–Kutta methods require storing the solution atseveral levels for higher orders (e.g., four for the classical fourth-order Runge–Kutta method). This may lead to excessive memory requirements when dealing

Page 204: Spectral Methods for Time-Dependent Problems

196 Discrete stability and time integration

with multi-dimensional problems. However, by defining the constants of theRunge–Kutta method in a clever way it is possible to arrive at methods thatrequire only two storage levels. This saving in memory requires the additionalcomputational expense of performing one extra evaluation of L. The introduc-tion of the additional step introduces extra degrees of freedom in the design ofthe scheme such that the resulting schemes also have a larger stability region,making the work per time unit about the same at the classical methods, but withlower memory requirements.

The s-stage low-storage method is

u0 = un

∀ j ∈ [1, . . . , s] :

{k j = a j k j−1 + �tL

(u j , (n + c j )�t

)u j = u j−1 + b j k j

un+1 = us,

where the constants a j , b j and c j are chosen to yield the desired order, s − 1,of the scheme. For the scheme to be self-starting we require that a1 = 0. Weneed only two storage levels containing k j and u j to advance the solution.

A four-stage third-order Runge–Kutta scheme is obtained using the constants

a1 = 0 b1 = 13 c1 = 0 a2 = − 11

15 b2 = 56 c2 = 1

3

a3 = − 53 b3 = 3

5 c3 = 59 a4 = −1 b4 = 1

4 c4 = 89 .

The constants for a five-stage fourth-order Runge–Kutta scheme are

a1 = 0 b1 = 14329971744779575080441755 c1 = 0

a2 = − 5673018057731357537059087 b2 = 5161836677717

13612068292357 c2 = 14329971744779575080441755

a3 = − 24042679903932016746695238 b3 = 1720146321549

2090206949498 c3 = 25262693414296820363962896

a4 = − 35509186866462091501179385 b4 = 3134564353537

4481467310338 c4 = 20063455193173224310063776

a5 = − 1275806237668842570457699 b5 = 2277821191437

14882151754819 c5 = 28023216131382924317926251 .

These constants are accurate up to 26 digits, which is sufficient for most imple-mentations.

The asymptotic stability regions for these low storage methods are onlyslightly larger than those of the classical methods. In particular, both low storageschemes contain the imaginary axis as part of the stability region.

Page 205: Spectral Methods for Time-Dependent Problems

10.3 Strong stability preserving methods 197

Remark When using multi-stage methods such as the Runge–Kutta meth-ods, we need to decide where to impose the boundary conditions. For spectralmethods, boundary conditions can be imposed at each stage or only at thefinal stage. For hyperbolic equations, it has been our experience that the lat-ter approach results in a slightly larger CFL condition. Even using the penaltymethod approach, one can add the penalty term at each intermediate stage oronly at the final stage.

10.3 Strong stability preserving methods

As discussed above, eigenvalue analysis is not generally sufficient for stabil-ity. However, the energy method analysis we performed for the Legendre–collocation method with Euler’s method has the drawback that it must be per-formed for each time discretization we wish to use. It would be convenientto have a way of extending this analysis from Euler’s method to higher ordermethods. Furthermore, if we know of any nonlinear stability properties of thespatial discretization coupled with forward Euler, we would like to be ableto extend these to higher order time discretizations as well. Strong stabilitypreserving (SSP) Runge–Kutta and multi-step methods preserve any nonlin-ear stability property satisfied by forward Euler, allowing us to extend thesestability properties to higher order methods.

10.3.1 SSP theory

In this section we review the SSP theory for explicit Runge–Kutta methodswhich approximate the solution of the ODE

ut = L(u) (10.2)

which arises from the discretization of the spatial derivative in a PDE. Thespatial discretization L(u) is chosen so that

un+1 = un + �tL(un), (10.3)

satisfies the strong stability requirement ||un+1|| ≤ ||un|| in some norm || · ||,under the CFL condition

�t ≤ �tF E . (10.4)

Page 206: Spectral Methods for Time-Dependent Problems

198 Discrete stability and time integration

If we write the m-stage Runge–Kutta method in the form

u(0) = un,

u(i) =i−1∑k=0

(αi,ku(k) + �tβi,kL

(u(k)

)), αi,k ≥ 0, i = 1, . . . , s (10.5)

un+1 = u(s),

we observe that if αi,k ≥ 0 and βi,k ≥ 0, all the intermediate stages u(i)

are simply convex combinations of forward Euler operators. If the forwardEuler method combined with the spatial discretization L in (10.3) is stronglystable

‖un + �tL(un)‖ ≤ ‖un‖, for �t ≤ �tF E ,

then the intermediate stages can be bounded

∥∥u(i)∥∥ =

∥∥∥∥∥i−1∑k=0

αi,ku(k) + �tβi,k

αi,kL(

u(k))∥∥∥∥∥

≤i−1∑k=0

αi,k

∥∥∥∥u(k) + �tβi,k

αi,kL(

u(k))∥∥∥∥

≤i−1∑k=0

αi,k

∥∥u(0)∥∥ for �t βi,k

αi,k≤ �tF E ,

and, since consistency requires that∑i−1

k=0 αi,k = 1, the method is strongly stable

‖un+1‖ ≤ ‖un‖under the CFL restriction

�t ≤ c�tF E , c = mini,k

αi,k

βi,k. (10.6)

In fact, any norm, semi-norm or convex function property satisfied by forwardEuler will be preserved by the SSP Runge–Kutta method, under a suitable time-step restriction. The research in the field of SSP methods centers around thesearch for high order SSP methods where the CFL coefficient c in the time-steprestriction (10.6) is as large as possible.

10.3.2 SSP methods for linear operators

In this section, we review the optimal SSP Runge–Kutta methods for the casewhere L is a linear constant coefficient operator. We present the major classes ofoptimal methods. In the following, (s,p) denotes an s-stage pth-order method:

Page 207: Spectral Methods for Time-Dependent Problems

10.3 Strong stability preserving methods 199

SSPRK linear (s,s) The class of m stage schemes given by:

u(i) = u(i−1) + �t Lu(i−1), i = 1, . . . , s − 1

u(s) =m−2∑k=0

αm,ku(k) + αs,s−1(u(s−1) + �t Lu(s−1)

),

where α1,0 = 1 and

αs,k = 1

kαs−1,k−1, k = 1, . . . , s − 2

αs,s−1 = 1

s!, αs,0 = 1 −

s−1∑s=1

αs,k

is an m-order linear Runge–Kutta method which is SSP with c = 1, which isoptimal among all s-stage, p = s-order SSPRK methods.

Although the stability limit is the same as forward Euler, the computationalcost is m times that. Thus, we find it useful to define the effective CFL ascef f = c/ l, where l is the number of computations of L required per time step.In the case of SSPRK linear (s,s), the effective CFL is ceff = 1/s.

If we increase the number of stages, s, without increasing the order, p, weobtain SSP Runge–Kutta methods with higher CFL coefficients. Although theadditional stages increase the computational cost, this is usually more thanoffset by the larger stepsize that may be taken.

SSPRK linear (m,1) The m-stage, first-order SSP Runge–Kutta method givenby

u(0) = un

u(i) =(

1 + �t

sL

)u(i−1) i = 1, . . . , s

un+1 = u(s),

has CFL coefficient c = s, which is optimal among the class of m-stage, orderp = 1 methods with non-negative coefficients. The effective CFL is ceff = 1.

SSPRK linear (m,2) The m-stage, second-order SSP methods:

u(0) = un

u(i) =(

1 + �t

m − 1L

)u(i−1) i = 1, . . . , s − 1

us = 1

mu(0) + s − 1

s

(1 + �t

s − 1L

)u(s−1)

un+1 = u(s),

have an optimal CFL coefficient c = m − 1 among all methods with non-negative coefficients. Although these methods were designed for linear

Page 208: Spectral Methods for Time-Dependent Problems

200 Discrete stability and time integration

problems, they are also second-order for nonlinear operators. Each such methoduses m stages to attain the order usually obtained by a two-stage method,but has CFL coefficient c = s − 1, thus the effective CFL coefficient here isceff = (s − 1)/s.

SSPRK linear (s,s-1) The m-stage, order p = s − 1 method:

u(0) = un

u(i) = u(i−1) + 1

2�t Lu(i−1) i = 1, . . . , s − 1

u(s) =m−2∑k=0

αs,ku(k) + αm,m−1

(u(s−1) + 1

2�t Lu(s−1)

)

un+1 = u(s).

Where the coefficients are defined recursively,

α2,0 = 0 α2,1 = 1

αs,k = 2

kαs−1,k−1 k = 1, . . . , s − 2

αs,s−1 = 2

sαs−1,s−2 αs,0 = 1 −

m−1∑k=1

αs,k

is SSP with optimal CFL coefficient c = 2. The effective CFL for these methodsis ceff = 2/s.

These methods can also be extended to linear operators with time-dependentboundary conditions or forcing functions.

10.3.3 Optimal SSP Runge–Kutta methods fornonlinear problems

In this section we present Runge–Kutta methods which are SSP and accurate fornonlinear operators. Unlike in the case of linear operators, we have no stabilityresults for fully discrete methods where L(u) is nonlinear. However, the SSPmethods guarantee that any stability properties expected of the forward Eulermethod can still be expected of the higher order SSP methods.

SSPRK (2,2) An optimal second-order SSP Runge–Kutta method is

u(1) = un + �tL(un)

un+1 = 1

2un + 1

2u(1) + 1

2�tL(

u(1))

with a CFL coefficient c = 1.

Page 209: Spectral Methods for Time-Dependent Problems

10.3 Strong stability preserving methods 201

SSPRK (3,3) An optimal third-order SSP Runge–Kutta method is

u(1) = un + �tL(un)

u(2) = 3

4un + 1

4u(1) + 1

4�tL(

u(1))

un+1 = 1

3un + 2

3u(2) + 2

3�tL(

u(2))

with a CFL coefficient c = 1.Although the computational costs are double and triple (respectively) that of

the forward Euler, the increase in the order of the method makes this additionalcomputational cost acceptable. SSPRK(3,3) is widely known as the Shu–Oshermethod, and is probably the most commonly used SSP Runge–Kutta method.Although this method is only third-order accurate, it is most popular becauseof its simplicity, its classical linear stability properties, and because finding afourth-order four-stage SSP Runge–Kutta method proved difficult. In fact, allfour-stage, fourth-order Runge–Kutta methods with positive CFL coefficient,c must have at least one negative βi,k . However, a popular fourth-order methodis the s = 5-stage method with nonnegative βi,k , given below. Unfortunately,any SSPRK of order p > 4 with nonzero CFL will have negative βi,k .

SSPRK(5,4) The five-stage fourth-order SSPRK

u(1) = un + 0.391752226571890�tL(un)

u(2) = 0.444370493651235un + 0.555629506348765u(1)

+ 0.368410593050371�tL(u(1)

)u(3) = 0.620101851488403un + 0.379898148511597u(2)

+ 0.251891774271694�tL(u(2)

)u(4) = 0.178079954393132un + 0.821920045606868u(3)

0.544974750228521�tL(u(3)

)un+1 = 0.517231671970585u(2)

+ 0.096059710526147u(3) + 0.063692468666290�tL(u(3)

)+ 0.386708617503269u(4) + 0.226007483236906�tL(

u(4))

is SSP with CFL coefficient c = 1.508, and effective CFL cef f = 0.377, whichmeans that this method is more efficient, as well as higher order, than the popularSSPRK(3,3).

Finally, here is a useful low storage SSPRK method.

Page 210: Spectral Methods for Time-Dependent Problems

202 Discrete stability and time integration

LS(5,3) The m = 5, p = 3 Williamson low storage method

U (0) = un

dU (1) = �tL(U (0)

)U (1) = U (0) + 0.713497331193829dU (0)

dU (2) = −4.344339134485095dU (1) + �tL(U (1)

)U (2) = U (1) + 0.133505249805329dU (1)

dU (3) = �tL(U (2)

)U (3) = U (2) + 0.713497331193929dU (2)

dU (4) = −3.770024161386381dU (3) + �tL(U (3)

)U (4) = U (3) + 0.149579395628565dU (3)

dU (5) = −3.046347284573284dU (4) + �tL(U (4)

)U (5) = U (4) + 0.384471116121269dU (4)

un+1 = U (5)

is numerically optimal, with CFL coefficient c = 1.4. This method may be usedinstead of SSPRK(3,3) with almost the same computational cost: SSPRK(3,3)has ceff = 1/3 and the low storage method LS(5,3) has cef f = 0.28. Thisincrease in cost is reasonable when storage is a critical need.

10.3.4 SSP multi-step methods

Explicit SSP multi-step methods

un+1 =s∑

i=1

(αi un+1−i + �tβiL(un+1−i )

), αi ≥ 0. (10.7)

are also easy to manipulate into convex combinations of forward Euler steps. Ifthe forward Euler method combined with the spatial discretization L in (10.3)is strongly stable under the CFL restriction (10.4), ‖un + �tL(un)‖ ≤ ‖un‖,then the multi-step method is SSP ‖un+1‖ ≤ ‖un‖, under the CFL restriction

�t ≤ c�tF E , c = mini

αi

|βi | .Table 10.1 features the coefficients of some of the most useful SSP multi-stepmethods. Those denoted with an * were proven optimal.

10.4 Further reading

The results on asymptotic linear growth of the eigenvalues of the Tau method isgiven by Dubiner (1987) while the general properties of the eigenvalue spectra

Page 211: Spectral Methods for Time-Dependent Problems

10.4 Further reading 203

Table 10.1 Coefficients of SSP multi-step methods with order p and s steps.The methods marked with an * were proven optimal.

steps order CFL αi βi

s p c

3* 2* 12

34 , 0, 1

432 , 0, 0

4 2 23

89 , 0, 0, 1

943 , 0, 0, 0

4 3 13

1627 , 0, 0, 11

27169 , 0, 0, 4

9

5 3 12

2532 , 0, 0, 0, 7

322516 , 0, 0, 0, 5

16

6* 3* 0.567 108125 , 0, 0, 0, 0, 17

1253625 , 0, 0, 0, 0, 6

25

5 4 0.021 155732000 , 1

32000 , 1120 , 2063

48000 , 910

53235612304000 , 2659

2304000 , 9049872304000 , 1567579

768000 , 0

for the spectral operators have been studied by Gottlieb and Lustman (1983),Welfert (1994), and Trefethen and co-workers (1988, 1990, 1994). A thoroughdiscussion of nonnormality and pseudospectra can be found in the text byCanuto et al (2006).

For the stability analysis of the fully discrete methods, see Gottlieb andTadmor’s work (1991), and Levy and Tadmor’s paper (1998). For more aboutthe SSP methods, see Shu and Osher’s 1988 paper, and Shu’s papers in 1988and 2002, as well as the 2001 review by Gottlieb, Shu, and Tadmor.

Much recent work in the subject has been done by Ruuth and by Spiteri,and important and exciting connections between SSP theory and contractivitytheory have been recently examined by Ferracina and Spijker (2005) and byHigueras (2005).

Page 212: Spectral Methods for Time-Dependent Problems

11

Computational aspects

Up to this point, we have mainly discussed the theoretical aspects of spectralmethods. We now turn to some of the computational issues surrounding thesemethods, and discuss the tools needed for efficient implementation of trigono-metric and polynomial spectral methods. We shall also discuss the practicalproblems of round-off errors and aliasing errors. Finally, we address problemsrequiring the use of mappings.

11.1 Fast computation of interpolation and differentiation

The appearance of the fast Fourier transform (FFT) in 1965 revolutionized entirefields within science and engineering. By establishing a fast way of evaluatingdiscrete Fourier series and their inverses, this single algorithm allowed the useof methods that were previously impractical due to excessive computationalcost.

Fourier spectral methods emerged as efficient methods of computation dueto the introduction of the FFT, and a significant part of the fundamental theoryof Fourier spectral methods was developed in the decade immediately followingthe introduction of the FFT. In the following we briefly discuss the key ideabehind the FFT. However, the idea behind the FFT is valid only when dealingwith trigonometric polynomials, and by extension, Chebyshev polynomials; itis not, in general, applicable to polynomial spectral methods. Therefore, weshall continue by discussing alternative fast methods for the computation ofinterpolation and differentiation for polynomial based methods. We concludewith a brief section on how to compute the general Gaussian quadrature pointsand weights needed to compute the discrete polynomial expansion coefficients.

204

Page 213: Spectral Methods for Time-Dependent Problems

11.1 Fast computation of interpolation and differentiation 205

11.1.1 Fast Fourier transforms

The discrete Fourier series expansion of a function u ∈ L2[0, 2π ] using an evennumber of points,

x j = 2π

Nj, j ∈ [0, N − 1],

is

IN u(x) =∑

|n|≤N/2

une−inx , un = 1

cn N

N−1∑j=0

u(x j )einx j .

If we look at the interpolation at x = x j and recall that u−N/2 = uN/2 is assumedfor uniqueness, we have

IN u(x j ) =N/2−1∑

n=−N/2

une−i 2πN jn, un = 1

N

N−1∑j=0

u(x j )ei 2π

N jn. (11.1)

The cost of computing the discrete Fourier expansion is determined by the factthat there are N terms in each. Direct evaluation of the expansion coefficientsor interpolation to the grid, x j , requires O(8N 2) real operations since un is, ingeneral, a complex number.

Let us now assume that N is a power of two, i.e., N = 2M , and introducethe new index, j1, as

j ={

2 j1 j even,

2 j1 + 1 j odd,j1 ∈ [0, . . . , N/2 − 1].

Using this new index, the discrete expansion coefficients are

un = 1

N

(N/2−1∑

j1=0

u(x2 j1 )ei 2πN (2 j1)n +

N/2−1∑j1=0

u(x2 j1+1)ei 2πN (2 j1+1)n

)

If we let N1 = N/2, this becomes

un = 1

N

(N1−1∑j1=0

u(x2 j1 )ei 2πN1

j1n + ei 2πN n

N1−1∑j1=0

u(x2 j1+1)ei 2πN1

j1n

).

At this point we realize that the two sums, each of half the length of the originalsum, have exactly the same form as the original sum, Equation (11.1). Thus,we may repeat the process and break the computation down to four sums eachof length N/4. Repeating this process results in an algorithm that computes thediscrete expansion coefficients in O(5N log2 N ) real operations provided thetwiddle factors, e2πn/N , e2πn/N1 and so on, are precomputed. This is the essenceof what is known as the fast Fourier transform and it is indeed much faster thanthe straightforward computation of the Fourier transform.

Page 214: Spectral Methods for Time-Dependent Problems

206 Computational aspects

Along the same lines, the FFT can be used for computing the discrete expan-sion coefficients as well as the interpolation at the collocation points. Further-more, a fast transform can be designed also if N is a power of three, by splittingthe original sum into three sums each of length 1/3N ; such an algorithm isknown as a radix-3 transform. In fact, the algorithm can be formulated for anyprime decomposition of a given number.

If u(x) is a real function, the complex FFT is unnecessarily expensive. Areal function of length N can be expressed as a complex function, v, of half thelength;

v j = u(x2 j ) + iu(x2 j+1), j ∈[

0, . . . ,N

2− 1

].

We can use the FFT to obtain the complex expansion coefficients of v, and thenobtain the expansion coefficients of u by

un = 1

2

(vn + vN/2−n

) − i

2ei 2π

N n(vn − vN/2−n

).

The fast transformation using the complex FFT yields an O( 52 N log2 N ) algo-

rithm for the radix-2 scheme, i.e., twice as fast as just performing the complexFFT with all imaginary components equal to zero.

The FFT may also be applied for the fast computation of sine and cosinetransforms. To compute the discrete cosine expansion coefficients

un =N∑

j=0

u(x j ) cos( π

Nnj

),

we form a new even function ∀k ∈ [0, . . . , 2N − 1]

v(xk) ={

u(xk) k ≤ Nu(x2N−k) k > N ,

such that the cosine expansion coefficients of u(x) are given by the Fouriercoefficients of v,

vn =2N−1∑k=0

v(xk)ei 2π2N kn = 2

N∑j=0

u(x j ) cos( π

Nnj

).

We use the complex transform of a real function to minimize the computationalworkload, and now have a fast transform for the cosine series which is very closeto the Chebyshev expansion. Indeed, if we recall the Chebyshev Gauss–Lobattoquadrature rule and expansion

IN u(x j ) =N∑

n=0

un cos( π

Nnj

), un = 1

cn N

N∑j=0

1

c ju(x j ) cos

( π

Nnj

),

Page 215: Spectral Methods for Time-Dependent Problems

11.1 Fast computation of interpolation and differentiation 207

it is clear that the FFT can be used to compute both sums with a computationalcost of O( 5

2 N log2 N + 4N ), where the latter contribution appears from thepacking and unpacking required to utilize the FFT. The option of using the FFTfor computing the Chebyshev Gauss–Lobatto expansion is yet another reasonfor the widespread early use of Chebyshev spectral methods.

At this time, implementations of the cosine transform are of very varyingquality and it is not possible to estimate, in general, when a fast cosine transformshould be used at a specific machine rather than a matrix multiplication directly.However, a good rule of thumb is that if N > 64, the fast cosine transform isworth using.

11.1.2 The even-odd decomposition

Unfortunately, the approach that leads to the fast Fourier transform does notextend directly to orthogonal polynomials beyond the Chebyshev polynomials.Hence, if we want to use the expansion coefficients, un , to compute the derivativeat the collocation points, there is usually no way around summing the seriesdirectly, unless N is very large.

However, when using the interpolating Lagrange polynomials and the asso-ciated differentiation matrices, there is still room for improvement. Considerthe vector, u = (u(x0), . . . , u(xN )), and the differentiation matrix, D, associatedwith the chosen set of collocation points, x j . We recall that the derivative of uat the grid points, u′, is

u′ = Du.

Using ultraspherical polynomials as the basis for the approximation weobserved that D is centro-antisymmetric,

Di j = −DN−i,N− j .

This property allows us to develop a fast algorithm for the computation of u′.We decompose u into its even (e) and odd (o) parts,

u = e + o.

The two new vectors have the entries

e j = 1

2(u j + uN− j ), o j = 1

2(u j − uN− j ),

where u j is the j th entry in u, and similarly for e j and o j . Observe that

e j = eN− j , o j = −oN− j .

Page 216: Spectral Methods for Time-Dependent Problems

208 Computational aspects

The linearity of the differentiation operation implies

u′ = Du = De + Do = e′ + o′.

Let us now first consider the case where N is odd such that we have an eventotal number of collocation points.

If we compute the derivative of e we obtain

e′j =

N∑i=0

D j i ei =(N−1)/2∑

i=0

D j i ei + D j,N−i eN−i

=(N−1)/2∑

i=0

(D j i + D j,N−i )ei .

Moreover,

e′N− j =

N∑i=0

DN− j,i ei =(N−1)/2∑

i=0

(DN− j,i + DN− j,N−i )ei

=(N−1)/2∑

i=0

−(D j,N−i + D j i )ei = −e′j ,

so it is only necessary to compute the first half of e′. If we introduce the matrix,De, with the entries

Dei j = Di j + Di,N− j ∀i, j ∈ [0, . . . , (N − 1)/2],

the computation is simply a matrix multiplication

e′ = Dee,

where e = (e0, . . . , e(N−1)/2)T .The computation of o′ yields

o′j =

N∑i=0

D j i oi =(N−1)/2∑

i=0

D j i oi + D j,N−i oN−i

=(N−1)/2∑

i=0

(D j i − D j,N−i )oi ,

and

o′N− j =

N∑i=0

DN− j,i oi =(N−1)/2∑

i=0

(DN− j,i − DN− j,N−i )oi

=(N−1)/2∑

i=0

(−D j,N−i + D j i )oi = o′j ,

so in this case it also suffices to compute half of the elements in the vector.

Page 217: Spectral Methods for Time-Dependent Problems

11.1 Fast computation of interpolation and differentiation 209

Introducing the matrix Do with the entries

Doi j = Di j − Di,N− j , ∀i, j ∈ [0, . . . , (N − 1)/2],

differentiation can be written as a matrix multiplication

o′ = Doo,

where o = (o0, . . . , o(N−1)/2)T . Finally, we can write the derivative

u′ = e′ + o′,

using

u′j = e′

j + o′j , u′

N− j = e′N− j + o′

N− j = −e′j + o′

j ,

for j ∈ [0, . . . , (N − 1)/2].Consequently, to compute the derivative of u at the collocation points we

need to construct e and o, perform two matrix-vector products of length N/2and reconstruct u′. The total operation count for this process becomes

2N

2+ 2

(2

(N

2

)2

− N

2

)+ 2

N

2= N 2 + N ,

provided the differentiation matrices are precomputed. This is in contrast to thedirect computation of u′ which requires 2N 2 − N operations. Hence, utilizingthe centro-antisymmetry of the differentiation matrix allows for decreasing thecomputational work by close to a factor of two.

Finally, we consider the case where N is even. If we follow the same approachas above we obtain

e′j =

N∑i=0

D j i ei =N/2∑i=0

D j i ei + D j,N−i eN−i ,

where the term from i = N/2 is computed twice. This, however, is easily fixedby slightly redefining De

Dei j =

{Di j + Di,N− j j �= N/2Di,N/2 j = N/2

∀i ∈ [0, . . . , N/2−1], j ∈ [0, . . . , N/2].

In the same way we define a modified Do

Doi j = Di j − Di,N− j ∀i ∈ [0, . . . , N/2], j ∈ [0, . . . , N/2 − 1],

since o is odd, so that the problem of counting the last entry twice does notappear. This also implies that Do is rectangular, since o′ is even and thereforeo′

N/2 needs to be computed.

Page 218: Spectral Methods for Time-Dependent Problems

210 Computational aspects

In the situation where D is centro-symmetric

Di j = DN−i,N− j ,

the exact same even-odd splitting can be applied with the only difference beingthat e′ is even and o′ is odd such that the final reconstruction becomes

u′j = e′

j + o′j , u′

N− j = e′N− j + o′

N− j = e′j − o′

j .

Indeed, all even-order differentiation matrices appearing from the ultrasphericalpolynomials share the property of centro-symmetry, which allows us to applythis splitting technique directly.

11.2 Computation of Gaussian quadraturepoints and weights

When using polynomial methods we must first establish collocation points,which are the quadrature points of some Gauss quadrature rule. However, withthe exception of a few special cases, like the Chebyshev polynomials, no closedform expressions for the quadrature nodes are known. Nevertheless, there is asimple and elegant way of computing these nodes as well as the correspondingweights, although the latter can be computed using explicit forms.

We restrict our presentation to the case of ultraspherical polynomi-als, P (α)

n (x), although everything generalizes to the general case of Jacobipolynomials.

First, let’s recall the three-term recurrence relation for ultrasphericalpolynomials

x P (α)n (x) = an−1,n P (α)

n−1(x) + an+1,n P (α)n+1(x), (11.2)

where the recurrence coefficients are

an−1,n = n + 2α

2n + 2α + 1, an+1,n = n + 1

2n + 2α + 1.

If we normalize the polynomials slightly differently and introduce the modifiedpolynomials

P (α)n (x) = 1√

γnP (α)

n (x),

such that (P (α)n , P (α)

k )w = δnk , the recurrence coefficients become

an−1,n =√

γn−1

γnan−1,n =

√n(n + 2α)

(2n + 2α + 1)(2n + 2α − 1),

Page 219: Spectral Methods for Time-Dependent Problems

11.2 Computation of Gaussian quadrature points and weights 211

and

an+1,n =√

γn+1

γnan+1,n =

√(n + 1)(n + 2α + 1)

(2n + 2α + 3)(2n + 2α + 1).

A key observation is that

an+1,n = an,n+1.

We define

βn = an+1,n

so that Equation (11.2) reduces to

x P (α)n (x) = βn−1 P (α)

n−1(x) + βn P (α)n+1(x). (11.3)

We introduce the vector P(α)

(x) = (P (α)0 (x), . . . , P (α)

N (x))T , and the symmetricbi-diagonal matrix

JN =

0 β1 0 0 0 · · · 0β1 0 β2 0 0 · · · 00 β2 0 β3 0 · · · 00 0 β3 0 β4 · · · 0

0 0 0 β4 0. . . 0

......

......

. . .. . . βN−1

0 0 0 0 0 βN−1 0

,

so that Equation (11.3) becomes

x P(α)

(x) = JN P(α)

(x) + βN P (α)N+1(x).

Gauss Since the Gauss quadrature points, z j , are defined as the roots ofP (α)

N+1(x), and therefore also of P (α)N+1 we realize that the real grid points, z j ,

are the eigenvalues of the symmetric bi-diagonal matrix, JN . The eigenvalueproblem may be solved using the QR algorithm and the corresponding weightsmay be computed using their exact formulas. However, we may alternativelyrecover the weights from the eigenvectors of JN . To understand this, recallthat the formula for the interpolating Lagrange polynomial associated with theGauss quadrature points is

l j (z) = u j

N∑n=0

Pαn (z)Pα

n (z j )

γn= u j

(P

(α)(z)

)TP

(α)(z j ).

Using the Christoffel–Darboux identity we established that

l j (z j ) = u j(P

(α)(z j )

)TP

(α)(z j ) = 1.

Page 220: Spectral Methods for Time-Dependent Problems

212 Computational aspects

In other words, the normalized eigenvector Q(z j ) corresponding to the eigen-value z j of JN is

Q(z j ) = √u j P

(α)(z j ),

from which, by equating the first components of the two vectors, we obtain theexpression of the weight

u j =(

Q0(z j )

P (α)0 (z j )

)2

= γ0(Q0(z j ))2 = √

π�(α + 1)

�(α + 3/2)(Q0(z j ))

2,

since P (α)0 (z j ) = 1/

√γ0. Here Q0(z j ) signifies the first component of the eigen-

vector, Q(z j ). Hence, the quadrature points as well as the weights may beobtained directly by computing the N + 1 eigenvalues and the first componentof the corresponding eigenvectors.

Gauss–Radau The algorithm for computing the Gauss–Radau quadraturepoints and weights is very similar, the main difference is due to the definitionof the Gauss–Radau quadrature points, which are the roots of the polynomial

q(y) = P (α)N+1(y) + αN P (α)

N (y) = 0,

where αN is chosen such that q(y) vanish at one of the two boundaries,

αN = − P (α)N+1(±1)

P (α)N (±1)

= (∓1)N + 1 + 2α

N + 1,

where the upper sign corresponds to q(1) = 0 while the lower sign yields αN

for q(−1) = 0.The three-term recurrence relation, Equation (11.3), yields

y P(α)

(y) = JN P(α)

(y) + βN P (α)N+1(y).

Using the definition of the Gauss–Radau quadrature points,

P (α)N+1(±1) = αN P (α)

N (±1),

where

αN = −√

γN

γN+1αN = (±1)

√(N + 1 + 2α)(2N + 2α + 3)

(N + 1)(2N + 2α + 1).

Thus, the last row of JN is modified so that

(±1)P (α)N (±1) = βN−1 P (α)

N−1(±1) + βN P (α)N+1(±1)

= βN−1 P (α)N−1(±1) + βN αN P (α)

N (±1),

Page 221: Spectral Methods for Time-Dependent Problems

11.2 Computation of Gaussian quadrature points and weights 213

i.e., only the element (i, j) = (N , N ) of JN needs to be modified while theremaining part of the algorithm follows the description above. The Gauss–Radau quadrature points are thus found by solving the modified eigenvalueproblem while the corresponding weights, v j , are found from the first compo-nents of the corresponding eigenvectors as discussed in connection with theGauss quadratures.

Gauss–Lobatto Finally, we consider the modifications necessary to computethe Gauss–Lobatto quadrature points and weights. In this case, the quadraturepoints are the roots of the polynomial

q(x) = P (α)N+1(x) + αN P (α)

N (x) + αN−1 P (α)N−1(x),

where the coefficients, αN−1 and αN , are found by requiring q(±1) = 0, i.e.,by solving the system

αN P (α)N (−1) + αN−1 P (α)

N−1(−1) = −P (α)N+1(−1)

αN P (α)N (1) + αN−1 P (α)

N−1(1) = −P (α)N+1(1).

If we then normalize the polynomials as above, these constants become

αN =√

γN

γN+1αN , αN−1 =

√γN−1

γN+1αN−1,

and the equation for the quadrature points is

P (α)N+1(x) + αN P (α)

N (x) + αN−1 P (α)N−1(x) = 0.

This requirement is enforced on the eigenvalue problem by changing twoelements of JN

(JN )N ,N−1 = βN−1 − βN αN−1, (JN )N ,N = −βN αN ,

while the remaining part of the algorithm remains unchanged. Unfortunately,using this approach for computing the Gauss–Lobatto quadrature points, JN

looses its symmetry, thereby making the solution of the resulting eigensystemslightly harder.

A different approach can be taken by recalling that

d P (α)N (x)

dx= (2α + 1)P (α+1)

N−1 (x),

i.e., the interior Gauss–Lobatto quadrature points for P (α)N (x) are the roots of the

polynomial P (α+1)N−1 (x), which are also the Gauss quadrature points of the poly-

nomial P (α+1)N−2 (x). The latter may be computed using the symmetric approach

discussed above, and the weights computed using the exact formula.

Page 222: Spectral Methods for Time-Dependent Problems

214 Computational aspects

11.3 Finite precision effects

In the idealized world of approximation and stability theory, the accuracy ofspectral methods depends, as we have seen, only on the regularity of the functionbeing approximated and the operators involved. However, in the non-ideal worldof computation, the finite precision of the computer has a very significant effecton any algorithm being implemented.

For spectral methods the effect of round-off errors is most pronounced whenderivatives are computed, with a very significant difference between the behav-ior of derivatives computed using continuous expansion coefficients and discreteexpansion coefficients or interpolating Lagrange polynomials.

For polynomial spectral methods in particular, the effects of the finite preci-sion can have a significant impact on the overall accuracy of the scheme. Indeed,for certain problems the results are essentially useless due to the overwhelmingamplification of round-off errors.

11.3.1 Finite precision effects in Fourier methods

Consider a given function u(x) ∈ L2[0, 2π ], approximated using a continuousFourier series

PN u(x) =∑

|n|≤N/2

uneinx , un = 1

∫ 2π

0u(x)e−inx dx .

The approximation to the m-derivative of u(x) is

PN u(m)(x) =∑

|n| ≤ N/2

(in)muneinx ,

which means that the highest modes are amplified. Let us study the effect ofthis phenomenon through an example.

Example 11.1 Let us consider the C∞[0, 2π ] and periodic function

u(x) = 3

5 − 4 cos(x),

with the continuous expansion coefficients

un = 2−|n|,

from which we directly obtain the approximation to the m-derivative

PN u(m)(x) =∑

|n|≤N/2

(in)m2−|n|einx .

Page 223: Spectral Methods for Time-Dependent Problems

11.3 Finite precision effects 215

Table 11.1 Maximum pointwise error of a spatial Fourier m-derivative forincreasing resolution, N , as obtained using the continuous expansion

coefficients of Example 11.1. The number, N0, represents the number of modesrequired to approximate the function, u(x), to O(εM ), i.e., such that

uN0/2 � εM . For this case N0 ≈ 100 with a machine accuracy ofεM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.438E+00 0.575E+01 0.119E+02 0.255E+0316 0.477E−01 0.105E+01 0.522E+01 0.106E+0332 0.360E−03 0.139E−01 0.114E+00 0.434E+0164 0.104E−07 0.778E−06 0.119E−04 0.873E−03

128 0.222E−14 0.160E−13 0.524E−13 0.335E−11256 0.311E−14 0.160E−13 0.782E−13 0.398E−12512 0.355E−14 0.160E−13 0.782E−13 0.568E−12

1024 0.355E−14 0.195E−13 0.853E−13 0.568E−12

Accuracy O(εM (N0/2)) O(εM (N0/2)2) O(εM (N0/2)3) O(εM (N0/2)4)

In Table 11.1 we show the maximum pointwise error of this approximation tou(m)(x) with increasing number of modes N .

We observe that once the function is well resolved the error approachesmachine zero, εM , faster than any algebraic order of N . However, a close inspec-tion reveals that the accuracy of the approximation decays with increasing orderof the derivative

maxx∈[0,2π ]

∣∣u(m)(x) − PN u(m)(x)∣∣ ∼ O(εM (N0/2)m) as N → ∞.

Here N0 corresponds to the number of modes required to approximate thefunction, u(x), to O(εM ). For N � N0 we have un � εM and, since un decaysexponentially in this limit, u(m)

k � εM , i.e., the last term that contributes to theaccuracy is uN0/2 ∼ O(εM ). This is the limiting factor on accuracy.

The key observation to make is that, in the continuous case, the effect of thefinite precision is independent of N once the function is well resolved and onlya slight dependency of the order of the derivative on the accuracy is observed.Unfortunately, such behavior does not carry over to the discrete case.

We now consider the case where the same function u(x) ∈ L2[0, 2π ] isapproximated using the discrete expansion coefficients

IN u(x) =N/2∑

n=−N/2

uneinx , un = 1

Ncn

N−1∑j=0

u(x j )e−inx j ,

Page 224: Spectral Methods for Time-Dependent Problems

216 Computational aspects

Table 11.2 Maximum pointwise error of a spatial Fourier m-derivative forincreasing resolution, N , as obtained using the discrete expansion coefficients

of Example 11.2. Machine accuracy is εM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.654E+00 0.402E+01 0.134E+02 0.233E+0316 0.814E−01 0.500E+00 0.618E+01 0.770E+0232 0.648E−03 0.391E−02 0.173E+00 0.210E+0164 0.198E−07 0.119E−06 0.205E−04 0.247E−03

128 0.380E−13 0.216E−11 0.116E−09 0.715E−08256 0.657E−13 0.705E−11 0.680E−09 0.954E−07512 0.272E−12 0.605E−10 0.132E−07 0.110E−05

1024 0.447E−12 0.253E−09 0.844E−07 0.157E−04

Accuracy O(εM (N/2)) O(εM (N/2)2) O(εM (N/2)3) O(εM (N/2)4)

where we use the even grid

x j = 2π

Nj, j ∈ [0, . . . , N − 1].

The actual computation of the expansion coefficients may be performed usingthe FFT or by simply summing the series. Once the expansion coefficientsare obtained, computation of the approximation to the m-derivative of u(x) isobtained, just as for the continuous expansion,

IN u(m)(x) =∑

|n|≤N/2

(in)muneinx .

Let’s see the effect of finite precision on the discrete expansion in the followingexample.

Example 11.2 Consider, again, the C∞[0, 2π ], and periodic, function

u(x) = 3

5 − 4 cos(x).

The expansion coefficients are now found using an FFT, from which we imme-diately obtain the expansion coefficients for the mth derivative

u(m)n = (in)mun.

In Table 11.2 we show the maximum pointwise error of this approximation tou(m)(x) with increasing number of modes, N .

Note the pronounced difference in the accuracy of the derivatives as com-pared to the results in Table 11.1, where the error is constant for a given m once

Page 225: Spectral Methods for Time-Dependent Problems

11.3 Finite precision effects 217

the function is well resolved. We find that when using the FFT to compute thecoefficients, the accuracy deteriorates with increasing order of the derivative,as in Table 11.1, but also for increasing N . Indeed, we observe that the errorscales like

maxx∈[0,2π ]

∣∣u(m)(x) − IN u(m)(x)∣∣ ∼ O(εM (N/2)m) as N → ∞,

which is a significant reduction in the accuracy, in particular for high orderderivatives. This is a consequence of the uniform error of O(εM ) introduced bythe numerical computation of the discrete expansion coefficients. As a result,un ∼ O(εM ) even for N � N0, where we would expect the expansion coeffi-cients to decay exponentially. However, due to the finite accuracy, it is impos-sible to obtain these very small numbers. Thus, the maximum error is obtainedfrom the maximum mode number N/2 and the effect of this term, introducedby the uniform noise-level, is clearly seen in Table 11.2.

There is no way of avoiding the round-off error in the calculation of theexpansion coefficients, but its effect can be reduced by computing the FFT withthe highest possible accuracy. It is also important to attempt to formulate thedifferential equations using the lowest order derivatives possible.

In the discussion above, we illustrated the problem of round-off errors usingthe FFT and the discrete expansion coefficients. The general picture remainsthe same when differentiation matrices are used instead. Indeed, it is usuallyfound that using the FFT and the expansion coefficients results in an algorithmwhich suffers least from effects of the finite precision. However, if the entriesof the differentiation matrices are carefully computed, i.e., the exact entriesare computed for high-order derivatives rather than obtained by multiplyingseveral first-order differentiation matrices, the two different algorithms yield acomparable accuracy.

11.3.2 Finite precision in polynomial methods

Polynomial methods are considerably more sensitive to round-off error than thediscrete Fourier expansion. For simplicity, we restrict our discussion to the caseof Chebyshev expansions and derivatives. However, unless otherwise stated,the results carry over to the case of general ultraspherical polynomials.

Let’s begin by considering the continuous Chebyshev expansion ofu(x) ∈ L2

w[−1, 1]

PN u(x) =N∑

n=0

unTn(x), un = 2

cnπ

∫ 1

−1u(x)Tn(x)

1√1 − x2

dx .

Page 226: Spectral Methods for Time-Dependent Problems

218 Computational aspects

The approximation to the m-derivative of u(x) is

PN u(m)(x) =N∑

n=0

u(m)n Tn(x),

where the continuous expansion coefficients for u(m)(x) are found by repeateduse of the backward recursion formula

cn−1u(m)n−1 = u(m)

n+1 + 2nu(m−1)n ∀n ∈ [N , . . . , 1],

with the assumption that u(m)N = u(m)

N+1 = 0. Let’s examine the accuracy of thistransform-recurrence-transform method through an example.

Example 11.3 Consider the function u(x) ∈ C∞[−1, 1]

u(x) = 1

x + a, a > 1,

for which the continuous expansion coefficients are

un = 2

cn

1√a2 − 1

(√a2 − 1 − a

)n.

Since the function is smooth we see that the expansion coefficients decay expo-nentially in n. Note that when a approaches 1 the function develops a stronggradient at x = −1 and becomes singular in the limit. In this example we useda = 1.1.

Using the backward recursion formula for Chebyshev polynomials, we cal-culated the expansion coefficients for higher derivatives. In Table 11.3 we listthe maximum pointwise error of the expansion as a function of N , the order ofthe approximating polynomial.

Again we find that once the function is well approximated the error is closeto machine zero, εM . However, a closer look shows the rate of decay of themaximum pointwise error

maxx∈[−1,1]

∣∣u(m)(x) − PN u(m)(x)∣∣ ∼ O(

εM N m0

)as N → ∞,

where N0 corresponds to the minimum mode number required to approximateu(x) to O(εM ). Due to the rapid decay of the expansion coefficients, we knowthat for N � N0, un � εM , i.e., the last term that contributes to the accuracy is2N0uN0 which isO(εM ). Unlike the Fourier series, the expansion coefficient u(m)

n

depends on all coefficients with higher n. However, due to the rapid decay of thecoefficients, the backward recursion is stable, i.e., the last term of order O(εM )is carried backwards in the recursion without being amplified, thus leading tothe observed scaling.

Page 227: Spectral Methods for Time-Dependent Problems

11.3 Finite precision effects 219

Table 11.3 Maximum pointwise error of a spatial Chebyshev m-derivative forincreasing resolution, N , as obtained using the analytic Chebyshev expansioncoefficients in Example 11.3. The number N0 represents the number of modesrequired to approximate the function, u(x), such that 2N0uN0 � O(εM ). For

this case N0 ≈ 100 and the machine accuracy is εM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.273E+02 0.136E+04 0.552E+05 0.237E+0716 0.232E+01 0.295E+03 0.247E+05 0.168E+0732 0.651E−02 0.268E+01 0.678E+03 0.126E+0664 0.164E−07 0.245E−04 0.221E−01 0.143E+02

128 0.568E−13 0.125E−11 0.582E−10 0.931E−09256 0.568E−13 0.296E−11 0.873E−10 0.349E−08512 0.568E−13 0.341E−11 0.873E−10 0.442E−08

1024 0.853E−13 0.341E−11 0.873E−10 0.442E−08

Accuracy O(εM N0) O(εM N 2

0

) O(εM N 3

0

) O(εM N 4

0

)

The situation for the discrete expansion is rather different. Consider theChebyshev Gauss–Lobatto expansion

IN u(x) =N∑

n=0

unTn(x), un = 2

cn N

N∑j=0

1

c ju(x j )Tn(x j ),

where the Gauss–Lobatto quadrature points are

x j = − cos( π

Nj)

, j ∈ [0, N ].

The discrete approximation to the mth derivative of u(x) is obtained, just asfor the continuous expansion, using the backward recursion repeatedly. In thefollowing example we consider the accuracy of this approach.

Example 11.4 Let us again consider the function, u(x) ∈ C∞[−1, 1],

u(x) = 1

x + a, a > 1,

where we compute the discrete Chebyshev expansion coefficients using a stan-dard fast cosine transform algorithm and we use the analytic backward recur-sion formulas to calculate the expansion coefficients for the higher derivatives.In Table 11.4 we list the maximum pointwise errors, for increasing resolu-tion and order of derivative, for a = 1.1. Compare these results with those inTable 11.3.

Page 228: Spectral Methods for Time-Dependent Problems

220 Computational aspects

Table 11.4 Maximum pointwise error of a discrete spatial Chebyshevm-derivative for increasing resolution, N . The test function is given in

Example 11.4. Machine accuracy is εM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.571E+01 0.403E+02 0.276E+04 0.119E+0616 0.485E+00 0.936E+01 0.436E+04 0.443E+0632 0.912E−03 0.771E−01 0.129E+03 0.404E+0564 0.130E−08 0.514E−06 0.289E−02 0.333E+01

128 0.154E−09 0.474E−06 0.104E−02 0.179E+01256 0.527E−08 0.636E−04 0.560E+00 0.390E+04512 0.237E−08 0.374E−03 0.203E+02 0.723E+06

1024 0.227E−07 0.362E−01 0.458E+04 0.457E+09

Accuracy O(εM N 3) O(εM N 5) O(εM N 7) O(εM N 9)

The errors resulting from the use of the discrete Chebyshev expansion coeffi-cients are significantly larger than those resulting from the use of the continuouscoefficients. The error increases rapidly with the number of modes and with theorder of the derivative and we see that the decay of the error

maxx∈[−1,1]

∣∣u(m)(x) − IN u(m)(x)∣∣ ∼ O(εM N 2m+1) as N → ∞.

The strong dependence on N observed in Table 11.4 implies that for high valuesof N and/or m it is impossible to approximate the derivative of the functionwith any reasonable accuracy.

The problem lies in the combination of the cosine transform and the backwardrecursion used to determine the expansion coefficients for the higher derivatives.The backward recursion leads to anO(N 2) amplification of the initial round-offerror of O(εM N ) resulting from the transform. This last term could be avoidedby using a direct summation, but this may be prohibitively expensive for large N .The ill-conditioning of the backward recursion has the unfortunate consequencethat the approximation of high-order derivatives remains a non-trivial task whenusing polynomial methods and must be done carefully. Comparing the resultsillustrated in Example 11.3 and Example 11.4 it becomes clear that the mostimportant issue here is the accuracy of the computation of the discrete expansioncoefficients. Once again we conclude that the discrete expansion coefficientsshould always be computed with the highest possible accuracy.

Using the expansion coefficients and backward recursion is mathematicallyequivalent to using the differentiation matrices, but the two methods are numeri-cally very different. Let us consider the discrete Chebyshev approximation using

Page 229: Spectral Methods for Time-Dependent Problems

11.3 Finite precision effects 221

the interpolating Lagrange polynomials

IN u(x) =N∑

j=0

u(x j )l j (x) =N∑

j=0

u(x j )(−1)N+ j+1(1 − x2)T ′

N (x)

c j N 2(x − x j ),

based on the Chebyshev Gauss–Lobatto quadrature points

x j = − cos( π

Nj)

, j ∈ [0, . . . , N ].

Differentiation is then accomplished through a matrix vector product

dIN u

dx

∣∣∣∣x j

=N∑

i=0

D j i u(xi ),

where the entries of the differentiation matrix are

Di j =

− 2N 2+16 i = j = 0

cic j

(−1)i+ j

xi −x ji �= j

− xi

2(

1−x2i

) i = j ∈ [1, . . . , N − 1]

2N 2+16 i = j = N .

(11.4)

We consider the accuracy of this approach in the following example.

Example 11.5 Consider the function,

u(x) = 1

x + a, a > 1.

We compute its derivatives using the differentiation matrix D,

u(1) = Du, u(m) = Dmu.

In Table 11.5 we list the maximum pointwise error, for increasing resolutionand order of derivative, for a = 1.1.

The decay of the errors is clearly very disappointing,

maxx∈[−1,1]

∣∣u(m)(x) − IN u(m)(x)∣∣ ∼ O(

εM N 2m+2)

as N → ∞.

Fortunately, there are several things that can be done to improve on this result.But first we must understand what causes the sensitivity to round-off errors.

All off-diagonal entries of the matrix D are

Di j ∼ C1

xi − x j.

Page 230: Spectral Methods for Time-Dependent Problems

222 Computational aspects

Table 11.5 Maximum pointwise error of a discrete spatial Chebyshevm-derivative for increasing resolution, N . The test function is given in

Example 11.5. Machine accuracy is εM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.201E+02 0.127E+04 0.545E+05 0.237E+0716 0.116E+01 0.221E+03 0.218E+05 0.160E+0732 0.191E−02 0.134E+01 0.441E+03 0.956E+0564 0.276E−08 0.741E−05 0.917E−02 0.731E+01

128 0.633E−08 0.458E−04 0.161E+00 0.386E+03256 0.139E−06 0.406E−02 0.589E+02 0.578E+06512 0.178E−05 0.178E+00 0.983E+04 0.379E+09

1024 0.202E−04 0.837E+01 0.200E+07 0.325E+12

Accuracy O(εM N 4) O(εM N 6) O(εM N 8) O(εM N 10)

Close to the boundary, x = ±1, this term scales like

Di j ∼ 1

xi − x j∼ 1

1 − cos(π/N )∼ 1

O(N−2) + εM

∼ O(N 2)

1 + O(εM N 2

) ∼ O(N 2)(1 − O(εM N 2

))

∼ O(N 2) + O(εM N 4

),

i.e., the differentiation matrix scales asO(εM N 4) reflecting the observed scalingin Table 11.5. What can be done about this? The subtraction of almost equalnumbers can be avoided by using trigonometric identities so that the entries ofD are initialized

Di j =

− 2N 2+16 i = j = 0

ci2c j

(−1)i+ j

sin(

i+ j2N π

)sin

(i− j2N π

) i �= j

− xi

2 sin2(

πN i) i = j ∈ [1, . . . , N − 1]

2N 2+16 i = j = N .

A direct implementation of this matrix reduces the error, making the accuracyscale like

maxx∈[−1,1]

∣∣u(m)(x) − IN u(m)(x)∣∣ ∼ O(

εM N 2m+1)

as N → ∞,

which is similar to the scaling using the fast cosine transform and the backwardrecursion. However, it is in fact possible to make the matrix-vector methodperform even better, as indicated by the scaling which isO(N 2). The solution lieshidden in the computation of the elements for i ∼ j ∼ N . For these elements,

Page 231: Spectral Methods for Time-Dependent Problems

11.3 Finite precision effects 223

the computation we perform is similar to an evaluation of the function sin(π−δ),where δ � π , i.e., this operation is sensitive to round-off error effects. Indeed,by making an estimate of the condition number, as above, we obtain

Di j ∼ 1

sin(δ) sin(π − δ)∼ 1

O(N−1)(O(N−1) + εM )

∼ O(N 2)

1 + O(εM N )∼ O(N 2) + O(εM N 3),

and recover a condition number of O(εM N 3) as expected. This analysis alsosuggests a way to avoid this problem since it happens only for i ∼ j ∼ N .The remedy is to use the centro-antisymmetry of D so that the entries of thedifferentiation matrix are

Di j =

− 2N 2+16 i = j = 0

ci2c j

(−1)i+ j

sin(

i+ j2N π

)sin

(i− j2N π

) i ∈ [0, . . . , N/2] �= j ∈ [0, . . . , N ]

− xi

2 sin2(

πN i) i = j ∈ [1, N/2]

−DN−i,N− j i ∈ [N/2+1, . . . , N ], j ∈ [0, . . . , N ]

(11.5)

i.e., only the upper half of the matrix is computed while the lower half is obtainedby using the centro-antisymmetry. We illustrate the accuracy of this approachin the next example.

Example 11.6 Consider the function

u(x) = 1

x + a, a > 1,

where we compute derivatives using the differentiation matrix, D, implementedusing the trigonometric identities and the centro-antisymmetry, Equation (11.5).Higher derivatives are computed by repeatedly multiplying by the differentia-tion matrix

u(1) = Du, u(m) = Dmu.

In Table 11.6 we list the maximum pointwise error as obtained for increasingresolution and order of derivative for a = 1.1.

From Table 11.6 we recover an estimate of error decay

maxx∈[−1,1]

∣∣u(m)(x) − IN u(m)(x)∣∣ ∼ O(

εM N 2m)

as N → ∞,

which is even better than using a standard cosine transform and the backwardrecursion. It also illustrates the care that has to be exercised when initializingthe entries of differentiation matrices for polynomial methods.

Page 232: Spectral Methods for Time-Dependent Problems

224 Computational aspects

Table 11.6 Maximum pointwise error of a discrete spatial Chebyshevm-derivative for increasing resolution, N . The test function is given in

Example 11.6. Machine accuracy is εM ∼ 1.0E–16.

N m = 1 m = 2 m = 3 m = 4

8 0.201E+02 0.127E+04 0.545E+05 0.237E+0716 0.116E+01 0.221E+03 0.218E+05 0.160E+0732 0.191E−02 0.134E+01 0.441E+03 0.956E+0564 0.262E−08 0.721E−05 0.901E−02 0.721E+01

128 0.203E−10 0.467E−07 0.437E−04 0.196E+00256 0.554E−10 0.113E−05 0.128E−01 0.109E+03512 0.354E−09 0.201E−04 0.871E+00 0.304E+05

1024 0.182E−08 0.744E−03 0.153E+03 0.214E+08

Accuracy O(εM N 2) O(εM N 4) O(εM N 6) O(εM N 8)

For methods other than the Chebyshev, the situation is worse. Trigonometricidentities can only be used for the Chebyshev case. The centro-antisymmetryof D, on the other hand, is shared among all the differentiation matrices. How-ever, the effect of using this for more general polynomials remains unknown.Nevertheless, using the even-odd splitting for computing derivatives results inan error that scales somewhat like that seen in Example 11.6 also for Legendredifferentiation matrices, provided care is exercised in computing the entries ofD. This suggests that the use of the centro-antisymmetry, which is implicit inthe even-odd splitting, does indeed result in a smaller condition number of thedifferentiation matrices. We also emphasize that, whenever available, the exactentries of D(m) should be used rather than computed by multiplying matrices.

For the general polynomial case, one could also use the assumption that thedifferentiation of a constant has to vanish, i.e.,

N∑j=0

Di j = 0.

One may then compute the diagonal elements of the differentiation matrix

Di i = −N∑

j=0j �=i

Di j ∀i ∈ [0, . . . , N ],

so that the round-off errors incurred in the computation of the entries aresomehow accounted for in the diagonal elements. However, for Chebyshevpolynomials the techniques listed above are superior, and in general this lasttechnique should only be used when nothing more specific is available.

Page 233: Spectral Methods for Time-Dependent Problems

11.4 On the use of mappings 225

11.4 On the use of mappings

Mappings are used most frequently for the treatment of geometries differentfrom the standard (0, 2π ) or (−1, 1) intervals. Mappings can also be used forimproving accuracy in the computation of high-order derivatives.

Consider the function, u(x) ∈ L2[a, b], where a < b while a and/or b maybe infinite. We make a change of variables through the mapping function ψ(ξ )

ψ(ξ ) : I → [a, b] as x = ψ(ξ ),

where I = [ξmin, ξmax] represents the Fourier methods interval [0, 2π ], or thepolynomial expansions interval [−1, 1]; a differentiation gives

dx = ψ ′(ξ )dξ,

so that the magnitude of ψ ′ supplies a measure of how the nodes are distortedrelative to the standard grid given in I. For ψ ′ < 1 the grid is compressed,whereas it is dilated when ψ ′ > 1.

When mapping in spectral methods we need to compute derivatives in x ,but we only know how to compute derivatives with respect to ξ , so we use thechain rule for differentiation

d

dx= 1

ψ ′d

dξ,

d2

dx2= 1

(ψ ′)3

(ψ ′ d2

dξ 2− ψ ′′ d

),

and similarly for higher derivatives.The simplest example of a mapping function is for mapping I onto the finite

interval [a, b],

x = ψ(ξ ) = a + ξmax + ξ

ξmax − ξmin(b − a), ψ ′(ξ ) = b − a

2.

Before discussing more general mapping functions, we need to address the issueof implementation. We will restrict our attention to polynomial expansions, butnote that everything in this discussion carries over to Fourier methods.

In the case of Galerkin or tau methods, we consider approximations of theform

PN u(ψ(ξ )) =N∑

n=0

un P (α)n (ξ ),

where

un = 1

γn

∫ 1

−1u(ψ(ξ ))P (α)

n (ξ )w(ξ ) dξ.

Page 234: Spectral Methods for Time-Dependent Problems

226 Computational aspects

Within this formulation, we can get an approximation of the derivative of themapped function u(x)

PN u(1)(ψ(ξ )) = 1

ψ ′(ξ )

N∑n=0

u(1)n P (α)

n (ξ ),

where u(1)n are the expansion coefficients for the first derivative, which are

obtained through the backward recursion. In the case of Galerkin and tau meth-ods the unknowns are the expansion coefficients, un , for which we need toobtain equations. So we also need to expand the mapping function, ψ ′(ξ )

PN

(1

ψ ′(ξ )

)=

N∑n=0

ψn P (α)n (ξ ),

such that

PN u(1)(ψ(ξ )) =N∑

n,l=0

ψl un P (α)l (ξ )P (α)

n (ξ ),

which is a convolution sum. Although there is an expression for the convolutionof the polynomials, it is usually very complicated, with the exception of a fewspecial cases such as the Chebyshev polynomials. Thus, the expression for theexpansion coefficients becomes complicated and general mappings are, for thisreason, rarely used in Galerkin and tau methods. The exception is in cases wherethe mapping is particularly simple, e.g., the linear mapping, where the mappingderivative becomes a constant and the convolution reduces to a multiplication.Another example where the mapping is reasonably simple is the case where themapping function, 1/ψ ′(ξ ), is a non-singular rational function in ξ , in whichcase the convolution operator becomes a banded and sparse matrix operatoras a consequence of the three-term recurrence relations valid for orthogonalpolynomials.

In collocation methods, the use of mapping is much simpler. In this case weseek approximations of the form

IN u(ψ(ξ )) =N∑

n=0

un P (α)n (ξ ) =

N∑j=0

u(ψ(ξ j ))l j (ξ ),

where ξ j are gridpoints in the standard interval I. The discrete expansion coef-ficients, un , are found using a quadrature formula and l j (ξ ) is the interpolatingLagrange polynomial associated with the grid points. In this case we wish tocompute derivatives of u(x) at the grid points

IN u(1)(ψ(ξi )) = 1

ψ ′(ξi )

N∑n=0

u(1)n P (α)

n (ξi ) = 1

ψ ′(ξi )

N∑j=0

u(ψ(ξ j ))Di j ,

Page 235: Spectral Methods for Time-Dependent Problems

11.4 On the use of mappings 227

where D represents the differentiation matrix associated with l j (ξ ) and the gridpoints, ξi . However, since everything is done in point-space the mapping justcorresponds to multiplying with a constant at each grid point. If we introducethe diagonal matrix

M(m)i i = ψ (m)(ξi ),

the mapping is accomplished by multiplying the inverse of this matrix with thesolution vector following the computation of the derivative, at the grid points.When using the m-order differentiation matrix, D(m), for the computation of thederivative, we obtain

u(1) = (M(1)

)−1Du, u(2) = (

M(1))−3 (

M(1)D(2) − M(2)D(1))

u,

where u is the solution vector at the grid points and similarly u(1) and u(2) arethe first and second derivative, respectively, at the nodal points. Mapped higherderivatives may be obtained similarly, in this easy way. Note that since M(m) isdiagonal very little computational overhead is introduced.

11.4.1 Local refinement using Fourier methods

What are the general properties that the mapping functions must satisfy so thatthe mapped functions retain spectral accuracy?

Consider the general function, u(x) ∈ L2[a, b] and the mapping, ψ(ξ ) : I →[a, b]; the continuous expansion coefficients are

2π un =∫ 2π

0u(ψ(ξ ))e−inξ dξ

= −1

in[u(ψ(2π )) − u(ψ(0))] + 1

in

∫ 2π

0ψ ′(ξ )u′(ψ(ξ ))e−inξ dξ.

To maintain spectral accuracy ψ(ξ ) must satisfy the same requirements as u(x),i.e., ψ(ξ ) and its derivatives have to be periodic and smooth.

Now let’s consider two mappings which are useful in connection with Fouriermethods. Many problems have periodic solutions which are rapidly changingin some regions and slowly changing in others. For such problems it seemsnatural to cluster the grid points around the steep gradients of the solution. Thiscan be done by mapping the equidistant grid to increase the local resolution.

One choice of a mapping function having this effect on a periodic functiondefined on the interval ξ ∈ [−π, π ], is the arctan mapping

x = ψ(ξ ) = 2 arctan

(L tan

ξ − ξ0

2

), ψ ′(ξ ) = L

(1 + tan2 ξ−ξ0

2

)1 + L2 tan2 ξ−ξ0

2

, (11.6)

where L ≤ 1 is a control parameter for the amount of clustering that is required

Page 236: Spectral Methods for Time-Dependent Problems

228 Computational aspects

−3 −2 −1 0 1 2 30

1

2

3

4

5

L = 0.25

L = 0.50

L = 0.75

L = 1.00

x

y' (x)

Figure 11.1 Illustration of clustering of grid points around ξ0 = 0 using the arctanmapping, Equation (11.6), for different values of the mapping parameter, L .

around ξ0. Clearly, for L = 1 the mapping reduces to a unity mapping. The bestway to understand the effect of this mapping is to recall that

dx = ψ ′(ξ )dξ,

i.e., since dξ is a constant on the equidistant grid we obtain clustering whereψ ′(ξ ) < 1 and stretching of the grid where ψ ′(ξ ) > 1. This is illustrated inFigure 11.1 where we plot the value of ψ ′(ξ ) for different values of the mappingparameter, L .

We observe a clear clustering of the grid points around ξ0 = 0 and findthat the size of L controls the amount of clustering, with increasing clusteringaround ξ0 for decreasing L .

Since ψ ′(ξ ) consists of trigonometric functions, periodicity of u(x) is pre-served through the mapping, for any order of differentiation. Moreover, themapping function is smooth and introduces no singularities in the domain.Consequently, we expect the mapping to preserve spectral accuracy of theapproximation of a smooth function.

An alternative mapping with similar properties is

x = ψ(ξ ) = arctan

((1 − β2) sin(ξ − ξ0)

(1 + β2) cos(ξ − ξ0) + 2β

), (11.7)

ψ ′(ξ ) = 1 − β2

1 + β2 + 2β cos(ξ − ξ0),

where |β| < 1 controls the clustering around ξ0 ∈ [−π, π ]. For reasons of com-parison we plot in Figure 11.2 the mapping derivative for several values of β.Note that the mapping becomes singular for β = 1, while β = 0 corresponds to

Page 237: Spectral Methods for Time-Dependent Problems

11.4 On the use of mappings 229

0 1 2 30

1

2

3

4

5

6

7

8

b = 0.00

b = 0.25

b = 0.50

b = 0.75

x

y' (x)

−3 −2 −1

Figure 11.2 Illustration of clustering of grid points around ξ0 = 0 using the map-ping (11.7) for different values of the mapping parameter, β.

a unity mapping. This mapping also preserves periodicity and spectral accuracyof the approximation. Comparing the two schemes as illustrated in Figure 11.1and Figure 11.2, we observe that the latter mapping leads to a less localizedclustering around ξ0 which is, in many cases, a desirable property.

11.4.2 Mapping functions for polynomial methods

In the following we examine mappings for methods based on the ultrasphericalpolynomials.

Consider a function u(x) ∈ L2w[a, b] expanded in ultraspherical polynomials

IN u(ψ(ξ )) =N∑

n=0

un P (α)n (ξ ) =

N∑j=0

u(ψ(ξ j ))l j (ξ ).

Performing the usual integration by parts procedure to study the rate of decayof the expansion coefficients, it is easily established that ψ(ξ ) must be a smoothfunction to maintain spectral convergence and ψ(±1) must be bounded to avoidboundary effects.

In the following we shall discuss mappings that allow for the use of ultras-pherical polynomials, and in particular Chebyshev polynomials, for the approx-imation of problems in the semi-infinite and infinite interval. However, we shallalso discuss a different use of mappings that results in an increased accuracywith which derivatives may be computed.

Treatment of semi-infinite intervals The most straightforward way of approx-imating problems in the semi-infinite interval is to use expansions of Laguerrepolynomials. However, the lack of fast Laguerre transforms and the poor

Page 238: Spectral Methods for Time-Dependent Problems

230 Computational aspects

convergence properties of these polynomials suggests that alternative meth-ods should be considered.

While methods based on ultraspherical polynomials are attractive, they arelimited to finite domains. Attention has to be paid to the approximation ofthe mapped function since we have to impose a singular mapping in orderto map infinity into a finite value. An appropriate guideline is that uniformspectral convergence may be maintained if the function, u(x), and the mappingfunction, x = ψ(ξ ), both are sufficiently smooth, and the function, u(x), decaysfast enough without severe oscillations towards infinity.

A widely used mapping is the exponential mapping, ψ(ξ ) : I → [0, ∞), as

x = ψ(ξ ) = −L ln

(1 − ξ

2

), ψ ′(ξ ) = L

1 − ξ,

where L is a scale length of the mapping. We note that the grid is distortedwith a linear rate towards infinity and that no singular behavior at x = 0 isintroduced. This mapping has been given significant attention due to its rathercomplicated behavior. It has been shown that we can expect to maintain thespectral convergence only for functions that decay at least exponentially towardsinfinity. This result, however, is based on asymptotic arguments and good resultshave been reported. The reason is the logarithmic behavior which results in astrong stretching of the grid. This may behave well in many cases, while inother situations it may result in a slowly convergent approximation.

An alternative to the exponential map is the algebraic mapping

x = ψ(ξ ) = L1 + ξ

1 − ξ, ψ ′(ξ ) = 2L

(1 − ξ )2,

where L again plays the role of a scale length. This mapping has been studied ingreat detail and, used in Chebyshev approximations, the mapped basis functionshave been dubbed rational Chebyshev polynomials, defined as

T Ln(x) = Tn

(x − L

x + L

).

This family is defined for x ∈ [0, ∞) and orthogonality can be shown. Conse-quently, we may expect spectral accuracy for approximation of smooth func-tions. The advantage of using the algebraic mapping is that the function, u(x),only needs to decay algebraically towards infinity or asymptotically towards aconstant value in order for the approximation to maintain spectral accuracy. Thisis contrary to the exponential mapping which requires at least exponential decay.Several authors have found that algebraic mappings are more accurate androbust than exponential mappings, which is the reason for their widespread use.

One should observe that when applying a singular mapping it is not alwaysconvenient to choose the Gauss–Lobatto points as collocation points as they

Page 239: Spectral Methods for Time-Dependent Problems

11.4 On the use of mappings 231

include the singular point. The proper choice may be the Gauss–Radau pointsfor the polynomial family.

As an alternative to using a singular mapping, one may truncate the domainand apply a mapping. At first it may seem natural to just apply a linear mappingafter the truncation. However, this has the effect of wasting a significant amountof resolution towards infinity where only little is needed. If this is not the case,truncation becomes obsolete.

The idea behind domain truncation is that if the function decays exponen-tially fast towards infinity, then we will only make an exponentially small errorby truncating the interval. This approach yields spectral convergence of theapproximation for increasing resolution.

An often-used mapping is the logarithmic mapping function, ψ(ξ ) : I →[0, Lmax], defined as

x = ψ(ξ ) = Lmaxea(1−ξ ) − e2a

1 − e2a, ψ ′(ξ ) = −aψ(ξ ),

where a is a tuning parameter.However, the problem with domain truncation in that for increasing res-

olution we need to increase the domain size so that the error introduced bytruncating the domain will not dominate over the error of the approximation.

Treatment of infinite intervals When approximating functions defined on theinfinite interval, we can develop singular mappings which may be used to mapthe infinite interval into the standard interval such that ultraspherical polyno-mials can be applied for approximating the function. Similar to the guidelinesused for choosing the mapping function on the semi-infinite interval, we canexpect that spectral convergence is conserved under the mapping provided thefunction, u(x), is exponentially decaying and non-oscillatory when approachinginfinity. Clearly, the mapping function needs to be singular at both endpointsto allow for mapping of the infinite interval onto the finite standard interval.

As in the semi-infinite case, we can construct an exponential mapping func-tion, ψ(ξ ) : I → (−∞, ∞),

x = ψ(ξ ) = L tanh−1 ξ, ψ ′(ξ ) = L

1 − ξ 2,

where L plays the role of a scale length. This mapping requires exponentialdecay of the function towards infinity to yield spectral accuracy.

Alternatively, we use an algebraic mapping

x = ψ(ξ ) = Lξ√

1 − ξ 2, ψ ′(ξ ) = L√

(1 − ξ 2)3,

where L again plays the role of a scale length. This mapping has been given

Page 240: Spectral Methods for Time-Dependent Problems

232 Computational aspects

significant attention and, used in Chebyshev approximations, a special symbolhas been introduced for the rational Chebyshev polynomials

T Bn(x) = Tn

(x√

L2 + x2

),

for which one may prove orthogonality as well as completeness. The advantageof applying this mapping is that spectral accuracy of the approximation may beobtained even when the function decays only algebraically or asymptoticallyconverges towards a constant value at infinity.

We note that the proper choice of collocation points on the infinite intervalmay, in certain cases, not be the usual Gauss–Lobatto points but rather the Gaussquadrature points.

Mappings for accuracy improvement As a final example of the use of map-pings we return to the problem of round-off errors in pseudospectral methods.In many problems in physics the partial differential equation includes deriva-tives of high order, e.g., third-order derivatives in the Korteweg–de Vries equa-tion. Additionally, such equations often introduce very complex behavior, thusrequiring a large number of modes in the polynomial expansion. For problemsof this type, the effect of round-off error becomes a significant issue as thepolynomial differential operators are ill conditioned. Even for moderate valuesof m and N , this problem can ruin the numerical scheme.

To alleviate this problem, at least partially, one may apply the mapping,ψ(ξ ) : I → I, as

x = ψ(ξ ) = arcsin(αξ )

arcsin α, ψ ′(ξ ) = α

arcsin α

1√1 − (αξ )2

, (11.8)

where α controls the mapping. This mapping is singular for ξ = ±α−1. It maybe shown that the error, ε, introduced by applying the mapping is related to α by

α = cosh−1

( | ln ε|N

),

i.e., by choosing ε ∼ εM , the error introduced by the mapping is guaranteed tobe harmless.

The effect of the mapping is to stretch the grid close to the boundary points.This is easily realized by considering the two limiting values of α;

α → 0 �minx → 1 − cos πN ,

α → 1 �minx → 2N ,

where �minx represents the minimum grid spacing. We observe that for α

approaching one, the grid is mapped to an equidistant grid. In the opposite

Page 241: Spectral Methods for Time-Dependent Problems

11.4 On the use of mappings 233

−1.0 −0.5 0.0 0.5 1.00

1

2

3

4

5

x

y' (x)

N = 256

N = 128

N = 64

N = 32

N = 16

Figure 11.3 Illustration of the effect of the mapping used for accuracy improve-ment (Equation (11.8)) when evaluating spatial derivatives at increasing resolution.

limit, the grid is equivalent to the well known Chebyshev Gauss–Lobatto grid.One should note that the limit of one is approached when increasing N , i.e.,it is advantageous to evaluate high-order derivatives with high resolution atan almost equidistant grid. In Figure 11.3 we plot the mapping derivative fordifferent resolution with the optimal value of α. This clearly illustrates that themapping gets stronger for increasing resolution. Another strategy is to chooseε to be of the order of the approximation, hence balancing the error.

Example 11.7 Consider the function

u(x) = sin(2x), x ∈ [−1, 1].

We wish to evaluate the first four derivatives of this function using a standardChebyshev collocation method with the entries given in Equation (11.5). InTable 11.7 we list the maximum pointwise error that is obtained for increasingresolution.

We clearly observe the effect of the round-off error and it is obvious thatonly very moderate resolution can be used in connection with the evaluation ofhigh-order derivatives.

We apply the singular mapping in the hope that the accuracy of the derivativesimprove. In Table 11.8 we list the maximum pointwise error for derivatives withincreasing resolution. For information we also list the optimal value for α asfound for a machine accuracy of εM � 1.0E–16.

The effect of applying the mapping is to gain at least an order of magnitudein accuracy and significantly more for high derivatives and large N .

Page 242: Spectral Methods for Time-Dependent Problems

234 Computational aspects

Table 11.7 Maximum pointwise error of a spatial derivative of order m, forincreasing resolution, N , for the function in Example 11.7, as obtained using

a standard Chebyshev collocation method.

N m = 1 m = 2 m = 3 m = 4

8 0.155E−03 0.665E−02 0.126E+00 0.142E+0116 0.316E−12 0.553E−10 0.428E−08 0.207E−0632 0.563E−13 0.171E−10 0.331E−08 0.484E−0664 0.574E−13 0.159E−09 0.174E−06 0.111E−03

128 0.512E−12 0.331E−08 0.124E−04 0.321E−01256 0.758E−12 0.708E−08 0.303E−03 0.432E+01512 0.186E−10 0.233E−05 0.143E+00 0.587E+04

1024 0.913E−10 0.361E−04 0.756E+01 0.109E+07

Table 11.8 Maximum pointwise error of a spatial derivative of order m, forincreasing resolution, N , as obtained using a mapped Chebyshev collocation

method. The mapping is given in Equation 11.8.

N α m = 1 m = 2 m = 3 m = 4

8 0.0202 0.154E−03 0.659E−02 0.124E+00 0.141E+0116 0.1989 0.290E−13 0.383E−11 0.236E−09 0.953E−0832 0.5760 0.211E−13 0.847E−11 0.231E−08 0.360E−0664 0.8550 0.180E−12 0.225E−09 0.118E−06 0.436E−04

128 0.9601 0.138E−12 0.227E−09 0.334E−06 0.282E−03256 0.9898 0.549E−12 0.201E−08 0.262E−05 0.521E−02512 0.9974 0.949E−11 0.857E−07 0.467E−03 0.180E+01

1024 0.9994 0.198E−10 0.379E−06 0.433E−02 0.344E+02

11.5 Further reading

The even-odd splitting of the differentiation matrices was introduced bySolomonoff (1992) while the classic approach to the computation of Gaussianweights and nodes is due to Golub and Welsch (1969). The study of round-offeffects has been initiated by Breuer and Everson (1992), Bayliss et al (1994)and Don and Solomonoff (1995) where the use of the mapping by Kosloff andTal-Ezer (1993) is also introduced. Choices of the mapping parameter was dis-cussed in Hesthaven et al (1999). The general use of mappings, their analysisand properties is discussed in detail in the text by Boyd (2000) with some earlyanalysis by Bayliss and Turkel (1992).

Page 243: Spectral Methods for Time-Dependent Problems

12

Spectral methods on general grids

So far, we have generally sought to obtain an approximate solution, uN , byrequiring that the residual RN vanishes in a certain way. Imposing boundaryconditions is then done by special choice of the basis, as in the Galerkin method,or by imposing the boundary conditions strongly, i.e., exactly, as in the collo-cation method.

For the Galerkin method, this causes problems for more complex boundaryconditions as one is required to indentify a suitable basis. This is partiallyovercome in the collocation method, in particular if we have collocation pointsat the boundary points, although imposing more general boundary operators isalso somewhat complex in this approach. A downside of the collocation methodis, however, the complexity often associated with establishing stability of theresulting schemes.

These difficulties are often caused by the requirement of having to imposethe boundary conditions exactly. However, as we have already seen, this can becircumvented by the use of the penalty method in which the boundary conditionis added later. Thus, the construction of uN and RN are done independently,e.g., we do not need to use the same points to construct uN and to require RN

to vanish at.This expansion of the basic formulation highlights the individual importance

of how to approximate the solution, enabling accuracy, and how to satisfy theequations, which accounts for stability, and enables new families of schemes,e.g., stable spectral methods on general grids.

235

Page 244: Spectral Methods for Time-Dependent Problems

236 Spectral methods on general grids

12.1 Representing solutions and operators on general grids

In the previous chapters, we have considered two different ways to representthe approximation uN (x) the modal N th order polynomial expansion

uN (x) =N∑

n=0

anφn(x),

where φn(x) is some suitably chosen basis, most often a Legendre or Chebyshevpolynomial, and an are the expansion coefficients; and alternatively, the nodalrepresentation

uN (x) =N∑

i=0

uN (xi )li (x),

where li (x) is the N th order Lagrange polynomial based on any (N + 1) inde-pendent grid points, xi .

If we require the modal and nodal expansion to be identical, e.g., by definingan to be the discrete expansion coefficents, we have the connection between theexpansion coefficients an and the grid values uN (xi ),

Va = uN ,

where a = [a0, . . . , aN ]T and u = [uN (x0), . . . , uN (xN )]T . The matrix V isdefined as

Vi j = φi (x j ),

and we recover the identity

aTφ(x) = uTN l(x) ⇒ VT l(x) = φ(x),

where again φ(x) = [φ0(x), . . . , φN (x)]T and l(x) = [l0(x), . . . , lN (x)]T .Thus, the matrix, V, transforms between the modal and nodal bases, and canlikewise be used to evaluate l(x).

An advantage of this approach is that one can define all operators and oper-ations on general selections of points in higher dimensions, e.g., two or threedimensions, as long as the nodal set allows unique polynomial interpolation.Computing derivatives of the general expansion at the grid points, xi , amounts to

duN

dx

∣∣∣∣xi

=N∑

j=0

uN (x j )dl j

dx

∣∣∣∣xi

=N∑

j=0

uN (x j )Di j ,

where D is the differentiation matrix. Instead of explicitly computing dl j

dx toobtain the differentiation matrix, we can use the relation

VT l ′(x) = φ′(x) ⇒ VT DT = (V′)T ⇒ D = V′V−1,

Page 245: Spectral Methods for Time-Dependent Problems

12.1 Representing solutions and operators on general grids 237

where

V′i j = dφ j

dx

∣∣∣∣xi

.

In the formulation of the Legendre Galerkin method, to be explained later, thesymmetric mass matrix, M, is

Mi j =∫ 1

−1li (x)l j (x) dx .

Given an (N + 1) long vector, u,

uT Mu =N∑

i=0

N∑j=0

ui Mi j u j

=∫ 1

−1

N∑i=0

ui li (x)N∑

j=0

u j l j (x) dx

=∫ 1

−1u2 dx = ‖u‖2

L2[−1,1].

Hence, M is also positive definite and uT Mu is the L2 norm of the N th-orderpolynomial, uN , defined by the values ui at the grid points, xi , i.e.,

u(x) =N∑

i=0

ui li (x).

In one dimension, one can easily perform this integration in order to obtain theelements Mi j . This is less easy in multiple dimensions on complex domains.In such cases, we want to avoid this integration. To efficiently compute themass matrix we would like to use the Legendre basis φ(x). We will use V togo between the two bases. Thus we have

(VT MV)i j =N∑

k=0

N∑l=0

Vki MklVl j

=∫ 1

−1

N∑k=0

φi (xk)lk(x)N∑

l=0

φi (xl)ll(x) dx

=∫ 1

−1φi (x)φ j (x) dx .

Since φi (x) = Pi (x) is the Legendre polynomial, which is orthogonal inL2[−1, 1], the entries in M can be computed using only the transformationmatrix, V, and the Legendre normalization, γn = 2/(2n + 1).

Page 246: Spectral Methods for Time-Dependent Problems

238 Spectral methods on general grids

The stiffness matrix is

Si j =∫ 1

−1li (x)l ′j (x) dx .

To compute this, consider

(MD)i j =N∑

k=0

MikDk j

=∫ 1

−1li (x)

(N∑

k=0

lk(x)dl j (xk)

dx

)dx

=∫ 1

−1li (x)l ′j (x) dx = Si j .

A property of the stiffness matrix is that

uT Su =N∑

i=0

N∑j=0

ui Si j u j

=∫ 1

−1

N∑i=0

ui li (x)N∑

j=0

u j l′j (x) dx

=∫ 1

−1uu′ dx = 1

2

(u2

N − u20

).

Hence, uT Su plays the role of an integration by parts of the polynomial, uN (x).Using the above formulation, one is free to use any set of points which may

be found acceptable, e.g., they may cluster quadratically close to the edges butotherwise be equidistant with the aim of having a more uniform resolution ascompared to the Gauss–Lobatto quadrature points.

12.2 Penalty methods

As mentioned before, the penalty method enables us to use spectral methods ongeneral grids in one dimension, and in complex domains in multiple dimensions.We illustrate this with the following example of the simple wave equation.

∂u

∂t+ a

∂u

∂x= 0, x ∈ [−1, 1], (12.1)

u(−1, t) = g(t),

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

where a ≥ 0.

Page 247: Spectral Methods for Time-Dependent Problems

12.2 Penalty methods 239

The residual

RN (x, t) = ∂uN

∂t+ a

∂uN

∂x,

must satisfy∫ 1

−1RN ψ

(1)i (x) dx =

∮ 1

−1n[uN (−1, t) − g(t)]ψ (2)

i (x) dx, (12.2)

where we have extended the usual approach by now allowing two families ofN + 1 test functions, ψ

(1)i (x) and ψ

(2)i (x). The vector n represents an outward

pointing normal vector and takes, in the one-dimensional case, the simple valuesof n = ±1 at x = ±1. Equation (12.2) is the most general form of spectralpenalty methods.

Observe that the methods we are familiar with from previous chapters canbe found as a subset of the statement in Equation (12.2) by ensuring that a totalof N + 1 test functions are different from zero. Indeed, a classic collocationapproach is obtained by defining ψ

(1)i (x) = δ(x − xi ) and ψ

(2)i (x) = 0 for i =

1, . . . , N and ψ(1)0 (x) = 0, ψ

(2)0 (x) = δ(x + 1).

The possibilities in the generalization are, however, realized when we allowboth the test functions to be nonzero simultaneously. The effect of this is thatwe do not enforce the equation or boundary conditions separately but ratherwe enforce both terms at the same time. As we shall see shortly, this leads toschemes with some interesting properties.

These schemes are clearly consistent since the exact solution satisfies theboundary condition, hence making the right hand side vanish.

12.2.1 Galerkin methods

In the Galerkin method we seek a solution of the form

uN (x, t) =N∑

i=0

uN (xi , t)li (x)

such that

Mdudt

+ aSu = −τ l L [uN (−1, t) − g(t)], (12.3)

where l L = [l0(−1), . . . , lN (−1)]T , and u = [uN (x0), . . . , uN (xN )]T are theunknowns at the grid points, xi .

This scheme is stable provided

τ ≥ a

2.

Page 248: Spectral Methods for Time-Dependent Problems

240 Spectral methods on general grids

In practice, taking τ = a/2 gives the best CFL condition. The scheme is

Mdudt

+ aSu = −a

2l L [uN (−1, t) − g(t)]. (12.4)

The choice of arbitrary gridpoints is possible, since we have separated thespatial operators from the boundary conditions. At the point x = −1 we do notenforce the boundary condition exactly but rather weakly in combination withthe equation itself.

Upon inverting the matrix M in Equation (12.4) we have

dudt

+ aDu = −a

2M−1l L [uN (−1, t) − g(t)]. (12.5)

The connection between this method and the Legendre Galerkin method isexplained in the following theorem.

Theorem 12.1 Let M and l L be defined as above. Then

M−1l L = r = [r0, . . . , rN ]T ,

for

ri = (−1)N P ′N+1(xi ) − P ′

N (xi )

2,

where xi are the grid points on which the approximation is based.

Proof: We shall prove the theorem by showing that r satisfies

Mr = l L ⇒ (Mr )i = li (−1).

In fact,

(Mr )i =∫ 1

−1li (x)

N∑k=0

lk(x)rk dx

=∫ 1

−1li (x)(−1)N P ′

N+1(x) − P ′N (x)

2dx

= (−1)N li (1)PN+1(1) − PN (1)

2− (−1)N li (−1)

PN+1(−1) − PN (−1)

2

−∫ 1

−1l ′i (x)

PN+1(x) − PN (x)

2dx .

However, since PN (±1) = (±1)N and PN and PN+1 are orthogonal to all poly-nomials of order less than N , we have

(Mr )i = li (−1),

as stated.QED

Page 249: Spectral Methods for Time-Dependent Problems

12.2 Penalty methods 241

We see from this theorem that the polynomial uN (x, t) satisfies theequation

∂uN

∂t+ a

∂uN

∂x= −τ (−1)N P ′

N+1(x) − P ′N (x)

2[uN (−1, t) − g(t)].

Since the right hand side in the above is orthogonal to any polynomial whichvanishes at the boundary, x = −1, the solution, uN (x, t) is identical to thatof the Legendre Galerkin method. This formulation of the Galerkin methodenables one to impose complex boundary conditions without having to red-erive the method and/or seek a special basis as in the classical Galerkinmethod.

12.2.2 Collocation methods

The solution of the Legendre collocation penalty method satisfies the followingerror equation

∂uN

∂t+ a

∂uN

∂x= −τ

(1 − x)P ′N (x)

2P ′n(−1)

[uN (−1, t) − g(t)]. (12.6)

Note that the residual vanishes at all interior Gauss–Lobatto points and theboundary conditions are satisfied weakly via the penalty formulation. Thisscheme is stable provided

τ ≥ a

2ω0= a

N (N + 1)

4,

as we showed in Chapter 8.In our new formulation, the Legendre collocation method can be obtained

by approximating the mass and stiffness matrices as follows;

Mci j =

N∑k=0

li (yk)l j (yk)ωk,

and

Sci j =

N∑k=0

li (yk)l ′j (yk)ωk .

Note that since li l ′j is a polynomial of degree 2N − 1, the quadrature is exactand so Sc = S.

The resulting scheme then becomes

Mc dudt

+ aSu = −τ l L [uN (−1, t) − g(t)], (12.7)

where, as usual, u is the vector of unknowns at the grid points, xi .

Page 250: Spectral Methods for Time-Dependent Problems

242 Spectral methods on general grids

The following theorem shows that Equation (12.7) is the Legendre colloca-tion method.

Theorem 12.2 Let Mc and l L be defined as in the above. Then

(Mc)−1l L = r = [r0, . . . , rN ]T ,

for

ri = (1 − xi )P ′N (xi )

2ω0 P ′N (−1)

,

where xi are the grid points on which the approximation is based.

Proof: We shall prove this by considering

Mcr = l L ⇒ (Mr )i = li (−1).

Consider

2ω0 P ′N (−1)(Mcr )i = (−1)N

N∑k=0

N∑l=0

li (yl)lk(yl)ωl(1 − xk)P ′N (xk)

= (−1)NN∑

l=0

li (yl)ωl

(N∑

k=0

(1 − xk)P ′N (xk)

)

= (−1)NN∑

l=0

li (yl)(1 − yl)P ′N (yl)ωl

= 2ω0 P ′N (−1)li (−1).

QED

The scheme written at the arbitrary points, xi , is

dui (t)

dt+ a(Du)i = −τ

(1 − xi )P ′N (xi )

2ω0 P ′N (−1)

[uN (−1, t) − g(t)], (12.8)

with τ ≥ a/2 as the stability condition.An interesting special case of this latter scheme is obtained by taking xi to

be the Chebyshev Gauss–Lobatto quadrature points while yi , i.e., the points atwhich the equation is satisfied, are the Legendre Gauss–Lobatto points. In thiscase we have

dui (t)

dt+ a(Du)i = −τ

(1 − xi )P ′N (xi )

2P ′N (−1)ω0

[uN (−1, t) − g(t)],

known as a Chebyshev–Legendre method. In this case, the penalty term is addedat each grid point, not only the boundary. It is in fact a Legendre collocationmethod although it computes derivatives at Chebyshev Gauss–Lobatto points.

Page 251: Spectral Methods for Time-Dependent Problems

12.2 Penalty methods 243

This latter operation can benefit from the fast Fourier transform for large valuesof N . Fast transform methods do also exist for Legendre transforms but theyare less efficient than FFT-based methods.

12.2.3 Generalizations of penalty methods

The penalty formulation treats, with equal ease, complex boundary conditions.Consider the parabolic equation

∂u

∂t= ∂2u

∂x2, x ∈ [−1, 1], (12.9)

u(−1, t) = g(t),∂u

∂x(1, t) = h(t),

u(x, 0) = f (x).

In the penalty formulation, we seek solutions of the form

uN (x, t) =N∑

i=0

uN (xi , t)li (x),

and require uN to satisfy

∂uN

∂t− ∂2uN

∂x2= −τ1

(1 − x)P ′N (x)

2P ′N (−1)

[uN (−1, t) − g(t)]

+ τ2(1 + x)P ′

N (x)

2P ′N (1)

[(uN )x (1, t) − h(t)].

Assume, for simplicity, that the approximation is based on the Legendre Gauss–Lobatto points and we also choose to satisfy the equation at these points, thenthe scheme is stable for

τ1 ≥ 1

4ω2, τ2 = 1

ω,

with

ω = 2

N (N + 1).

We can easily consider more complex boundary operators, e.g., for the problemin Equation (12.9) one could encounter boundary conditions of the form

u(1, t) + ∂u

∂x(1, t) = g(t).

The implementation via penalty methods is likewise straightforward as one onlyneeds to change the scheme at the boundaries.

Page 252: Spectral Methods for Time-Dependent Problems

244 Spectral methods on general grids

The ease of the penalty formulation carries over to nonlinear problems.Consider, for example,

∂u

∂t+ ∂ f (u)

∂x= 0, x ∈ [−1, 1],

with suitable initial conditions. Assume for simplicity that

∂ f

∂u(±1, t) ≥ 0,

such that x = −1 is an inflow and x = 1 an outflow boundary and assume thatu(−1, t) = g(t) is the boundary condition. Following the formulation above,we seek a solution, uN (x, t), which satisfies the equation

∂uN

∂t+ ∂ fN (uN )

∂x= −τa(t)

(1 − x)P ′N (x)

2P ′N (−1)

[uN (−1, t) − g(t)],

where

a(t) = ∂ f

∂u(−1, t).

If the solution u(x, t) is smooth, a necessary (but not sufficient) condition forstability can be obtained by considering the linearized method, resulting in thecondition

τ ≥ 1

2ω,

as discussed previously.The extension to nonlinear systems follows the exact same path, i.e., one

enforces the boundary conditions via the penalty method and establishes nec-essary conditions for stability by analyzing the linearized constant coefficientcase.

Example 12.3 To highlight the flexibilities of this approach, let us consider aslightly more complex case, in which we wish to solve the advection problem

∂u

∂t+ v · u = 0, x ∈ D = {x, y ≥ −1, x + y ≤ 0},

i.e., a two-dimensional triangular domain. As usual, we assume that we havean initial condition, u(x, 0) = f (x), as well as a boundary condition, u(x, t) =g(t) at all points of the triangular boundary where n · v ≤ 0. Let us now seeksolutions of the usual kind,

uN (x, t) =Np∑

i=1

ui (t)Li (x),

Page 253: Spectral Methods for Time-Dependent Problems

12.2 Penalty methods 245

where Li (x) are the two-dimensional Lagrange polynomials defined on thetriangular domain through the grid points, xi , of which there are

Np = (N + 1)(N + 2)

2.

This is exactly the number of terms in a two-dimensional polynomial of order N.Just as in the one-dimensional case, we choose some grids, preferably good

for interpolation, as well as a polynomial basis, φi (x), which is orthogonal onthe triangle. The latter can be found by, e.g., using a Gram–Schmidt orthogonal-ization on the simple basis, xi y j . With this, we can follow the one-dimensionalapproach and define a transformation matrix, V, with the entries

Vi j = φ j (xi ).

This allows us to evaluate the Lagrange polynomial, which in this general caseis not known in closed form, as well as initialize the mass matrix, M, and thedifferentiation matrices, Dx and Dy .

Let us consider the following penalty scheme∫D

(∂uN

∂t+ v · uN

)Li (x) dx

= τ

∫∂ D

( |n · v| − n · v2

)[uN (x, t) − g(t)]Li (x) dx.

Note that the right hand side is constructed such that the penalty term is onlyimposed at the inflow boundaries where n · v ≤ 0.

In a more compact form this becomes

dudt

+ (vx Dx + vyDy)u

= τM−1∫

∂ D

( |n · v| − n · v2

)[uN (x, t) − g(t)]L(x) dx.

Using the exact same approach as for the one-dimensional Galerkin case, e.g.,expanding MDx by integration by parts along x , one easily proves that thisscheme is stable for

τ ≥ 1

2.

This last example highlights the strength of the combination of the general gridsand the penalty methods in that one can now formulate stable and spectrallyaccurate schemes on very general domains, requiring only that a robust localinterpolation is possible. This extends to general dimensions and, at least inprinciple, to general domains, although finding interpolations points in generaldomains is a challenge.

Page 254: Spectral Methods for Time-Dependent Problems

246 Spectral methods on general grids

12.3 Discontinuous Galerkin methods

The discontinuous Galerkin method is a different approach to the derivation ofthe schemes. Consider the nonlinear scalar problem

∂u

∂t+ ∂ f (u)

∂x= 0, x ∈ [−1, 1],

again, we assume that x = −1 is an inflow boundary with u(−1, t) = g(t). Weseek solutions, uN (x, t), of the form

uN (x, t) =N∑

i=0

uN (xi , t)li (x),

where xi represents an arbitrary set of grid points.In the Galerkin approach, we require that the residual is orthogonal to the

set of test functions, li (x),∫ 1

−1

(∂uN

∂t+ ∂ fN (uN )

∂x

)li (x) dx = 0.

Integration by parts yields∫ 1

−1

(∂uN

∂tli (x) − fN (uN )l ′i (x)

)dx = −[ fN (1)li (1) − fN (−1)li (−1)],

where we denote fN (±1) = fN (uN (±1)). We now need to specifyfN (uN (±1)). A reasonable choice could be

fN (uN (−1, t)) = f (g(t)),

while we leave fN (uN (1, t)) unchanged. This would lead to the scheme∫ 1

−1

∂uN

∂tli (x) − fN (uN )l ′i (x) dx = −[ fN (1)li (1) − f (g(t))li (−1)].

Using the mass and stiffness matrix formulation, this becomes

Mdudt

− ST f = l L f (g(t)) − l R fN (1),

where l L = [l0(−1), . . . , lN (−1)]T and l R = [l0(1), . . . , lN (1)]T . This is thestandard weak form of the discontinuous Galerkin method with a pure upwindflux. To associate it with the schemes we have discussed in the above, repeatthe integration by parts to obtain

Mdudt

+ S f = −l L [ fN (−1, t) − f (g(t))] ,

Page 255: Spectral Methods for Time-Dependent Problems

12.3 Discontinuous Galerkin methods 247

as the strong form of the discontinuous Galerkin method. Clearly, this is aspecial case of the general class of schemes in Equation (12.2) with the minordifference that the penalty term is on the flux function, f (u), rather than on uitself.

Let us denote the choices we made in defining fN (±1, t), as the generalnumerical flux, f ∗. Clearly, f ∗ depends on both the local solution and the kindof boundary being considered. With this general form the schemes become

Mdudt

− ST f = l L f ∗(−1) − l R f ∗(−1),

and

Mdudt

+ S f = l N ( fN (1) − f ∗(1)) − l0( fN (−1) − f ∗(−1)),

as the weak and strong form, respectively.The choice of the numerical flux, f ∗(u−, u+), with u− the local solution and

u+ the exterior solution/boundary condition, is now the key issue to address.Many options are available for the construction of numerical fluxes. A generallysuitable and robust choice is the Lax–Friedrich flux

f ∗(a, b) = f (a) + f (b)

2+ C

2(a − b),

where C = max | fu |, and the maximum is taken globally or locally (a localLax–Friedrich flux).

Discontinuous Galerkin methods have been analyzed extensively, and havebeen shown to have many attractive properties, in particular for nonlinearconservation laws. The brief discussion in the above can be generalized tosystems of nonlinear equations as well as higher order equations by intro-ducing additional equations to maintain the first-order nature of the spatialoperator.

The boundary conditions, g(t), which we assume to be specified could also bea solution computed in a neighboring element, i.e., we can construct methodsbased on multiple spectral elements, coupled by the penalty term and/or thenumerical flux in the discontinuous Galerkin formulation. With no restrictionson local polynomial approximation and the position of the grid points, thisapproach can be extended straightforwardly to multiple dimensions and fullyunstructured grids, simply by defining elements of a desired type and sets ofgrid points which are well suited for interpolation on this element. This leadsto the development of stable and robust spectral methods on fully unstructuredgrids, hence bringing this class of methods to within reach of being applied tosolve large scale applications of realistic complexity.

Page 256: Spectral Methods for Time-Dependent Problems

248 Spectral methods on general grids

12.4 Further reading

The use of weakly imposed boundary conditions, ultimately leading to thepenalty methods, was first proposed for spectral methods in Funaro (1986) fora simple elliptic problem and extended to hyperbolic problems in Funaro andGottlieb (1988 and 1991). In a sequence of papers by Hesthaven and Gottlieb(1996), and Hesthaven (1997 and 1999), this technique was vastly expandedto include nonlinear systems and complex boundary operators. In Don andGottlieb (1994) the Chebyshev–Legendre method is proposed and in Trujilloand Karniadakis (1999) it is demonstrated how to impose constraints using apenalty term. A recent review of the development of these techniques can befound in Hesthaven (2000).

The use of these techniques to formulate stable spectral methods on gen-eral grids was first proposed in Carpenter and Gottlieb (1996) for simple linearwave equations, and extended to general elements and fully unstructured grids inHesthaven and Gottlieb (1999), and Hesthaven and Teng (2000), where the dis-tribution of grid points is also discussed. The general form of defining operatorson general grids as discussed here was introduced in Hesthaven and Warburton(2002).

The design and analysis of discontinuous Galerkin methods already has avast literature. A good mathematical introduction can be found in Cockburn,Karniadakis and Shu (2000), which also has a vast list of references and ahistorical overview. Warburton, Lomtev, Du, Sherwin, and Karniadakis (1999),and Karniadakis and Sherwin (2005) illustrate the general formulation and largescale application of such methods using spectral elements.

Page 257: Spectral Methods for Time-Dependent Problems

Appendix A

Elements of convergence theory

The single most important property of a numerical scheme for PDEs, is that thenumerical solution approximates the exact solution and that the level of accuracyimproves as we refine the grid in time and space. Such behavior is known asconvergence. In this appendix we define the concepts and state the theoremswhich are necessary for convergence analysis of all numerical methods. Theseare the terms employed in Chapter 3 and in Chapter 8.

It is simpler to present these concepts in terms of a one-dimensional, scalar,linear, constant coefficient initial boundary value problem.

∂u(x, t)

∂t= Lu(x, t), x ∈ D, t ≥ 0, (A.1)

Bu(x, t) = 0, x ∈ δD, t > 0,

u(x, 0) = g(x), x ∈ D, t = 0,

where L is independent of time and space. We can assume that the boundaryoperator B[D] is included in the operator L.

Definition A.1 (Wellposedness) Equation (A.1) is wellposed if, for everyg ∈ Cr

0 and for each time T0 > 0 there exists a unique solution u(x, t), whichis a classical solution, and such that

‖u(t)‖ ≤ Ceαt‖g‖H p[D], 0 ≤ t ≤ T0

for p ≤ r and some positive constants C and α. It is strongly well posed if thisis true for p = 0, i.e., when ‖ · ‖H p[D] is the L2 norm.

Let us here assume that the solution, u(x, t), belongs to a Hilbert space, H,with norm ‖ · ‖L2

w[D], in which the problem is wellposed. The boundary operator,B, restricts the allowable solution space to the Hilbert space B ⊂ H, consistingof all u(x, t) ∈ H for which Bu(x, t) = 0 on δD. Wellposedness implies thatthe operator, L, is a bounded operator from H into B, i.e., L[D] : H → B.

249

Page 258: Spectral Methods for Time-Dependent Problems

250 A. Elements of convergence theory

The formulation of any numerical scheme for the solution of partial differ-ential equations begins with the choice of finite dimensional space, BN whichapproximates the continuous space, B. Next, we define a projection operator,PN [D] : H → BN . This choice specifies the way in which the equation is satis-fied, e.g., Galerkin, collocation, tau. Here N is the dimension of the subspace,BN ∈ B, and of the projection operator, PN .

The projection is often defined through the method of weighted residuals(MWR), by enforcing the requirement that the numerical solution, uN (x, t) ∈BN , satisfies

∂uN

∂t− LN uN = 0, (A.2)

uN (0) − gN = 0,

where we have introduced the approximated operator, LN [D] : B → BN ,defined as LN = PNLPN , and gN = PN g.

The aim of the convergence analysis is to derive conditions under which uN

approaches u as N tends to infinity for any t ∈ [0, T ]. However, since uN andu occupy different spaces, it is unclear how to measure the difference betweenthem. It is more natural to compare uN and the projection, PN u, as they bothbelong to the space BN . This approach makes sense when we consider theinequality

‖u(t) − uN (t)‖L2w[D] ≤ ‖u(t) − PN u(t)‖L2

w[D] + ‖uN (t) − PN u(t)‖L2w[D]

and the fact that, due to the regularity of the solution and the nature of the spacechosen,

‖u(t) − PN u(t)‖L2w[D] → 0 as N → ∞ ∀t ∈ [0, T ].

However, the convergence rate of the first term may be different from that ofthe second term.

The projection of Equation (A.1) is

∂PN u

∂t= PNLu. (A.3)

If uN ∈ BN , then the projection PN uN = uN . Thus, combining Equation (A.2)and Equation (A.3) yields the error equation

∂t(PN u − uN ) = LN (PN u − uN ) + PNL (I − PN ) u. (A.4)

If PN u(0) − uN (0) = 0 and the truncation error,

PNL(I − PN )u, (A.5)

Page 259: Spectral Methods for Time-Dependent Problems

A. Elements of convergence theory 251

vanishes, we see that the error, PN u − uN , is zero for all t ∈ [0, T ].We now define the concept of convergence.

Definition A.2 (Convergence) An approximation is convergent if

‖PN u(t) − uN (t)‖L2w[D] → 0 as N → ∞,

for all t ∈ [0, T ], u(0) ∈ B, and uN (0) ∈ BN .

It is generally very difficult to prove convergence of a specific schemedirectly. However, there fortunately is an alternative avenue along which toproceed. For this, we need the concepts of consistency and stability.

Definition A.3 (Consistency) An approximation is consistent if

‖PNL (I − PN ) u‖L2w[D] → 0

‖PN u(0) − uN (0)‖L2w[D] → 0

as N → ∞,

for all u(0) ∈ B and uN (0) ∈ BN .

Consistency requires that the truncation error introduced by the approximationvanishes as N approaches infinity.

Definition A.4 (Stability) An approximation is stable if

‖eLN t‖L2w[D] ≤ C(t), ∀N ,

with the associated operator norm

‖eLN t‖L2w[D] = sup

u∈B

‖eLN t u‖L2w[D]

‖u‖L2w[D]

,

and C(t) is independent of N and bounded for any t ∈ [0, T ].

Stability guarantees that the solution remains bounded as N approaches infinity.Stability of the approximation is closely related to the question of wellposednessfor the partial differential equation.

These concepts are connected through one of the principal results in theconvergence theory of the numerical approximation of linear partial differentialequations.

Theorem A.5 (Lax–Richtmyer equivalence theorem) A consistent approxi-mation to a linear wellposed partial differential equation is convergent if andonly if it is stable.

Note that the consistency, stability and wellposedness of the problem has to beestablished in equivalent spaces, i.e., using equivalent norms, for the theoremto remain valid.

Page 260: Spectral Methods for Time-Dependent Problems

Appendix B

A zoo of polynomials

B.1 Legendre polynomials

The Legendre polynomials, Pn(x), are defined as the solution to the Sturm–Liouville problem with p(x) = 1 − x2, q(x) = 0 and w(x) = 1,

d

dx(1 − x2)

d Pn(x)

dx+ n(n + 1)Pn(x) = 0,

where Pn(x) is assumed bounded for x ∈ [−1, 1].The Legendre polynomials are given as P0(x) = 1, P1(x) = x , P2(x) =

12 (3x2 − 1), P3(x) = 1

2 (5x3 − 3x) and are orthogonal in L2w[−1, 1] with

w(x) = 1, ∫ 1

−1Pn(x)Pm(x) dx = 2

2n + 1δmn.

B.1.1 The Legendre expansion

The continuous expansion is given as

u(x) =N∑

n=0

un Pn(x), un = 2n + 1

2

∫ 1

−1u(x)Pn(x) dx .

The discrete expansion coefficients depend on what family of Gauss points arechosen.

Legendre Gauss quadrature

z j = {z |PN+1(z) = 0}, u j = 2(1 − z2

j

)[P ′

N+1(z j )]2, j ∈ [0, . . . , N ].

252

Page 261: Spectral Methods for Time-Dependent Problems

B.1 Legendre polynomials 253

The normalization constant is given as

γn = 2

2n + 1,

resulting in the expansion coefficients,

un = 1

γn

N∑j=0

u(z j )Pn(z j )u j .

Legendre Gauss–Radau quadrature

y j = {y |PN (y) + PN+1(y) = 0},

v j ={ 2

(N+1)2 j = 01

(N+1)21−y j

[PN (y j )]2 j ∈ [1, . . . , N ].

The normalization constant is given as

γn = 2

2n + 1,

yielding the discrete expansion coefficients

un = 1

γn

N∑j=0

u(y j )Pn(y j )v j .

Legendre Gauss–Lobatto quadrature

x j = {x |(1 − x2)P ′N (x) = 0}, w j = 2

N (N + 1)

1

[PN (x j )]2.

The normalization constant is given as

γn ={

22n+1 j ∈ [0, N − 1]2N j = N ,

from which the discrete expansion coefficients become

un = 1

γn

N∑j=0

u(x j )Pn(x j )w j .

Page 262: Spectral Methods for Time-Dependent Problems

254 A zoo of polynomials

B.1.2 Recurrence and other relations

Here we give a number of useful recurrence relations.

(n + 1)Pn+1(x) = (2n + 1)x Pn(x) − n Pn−1(x).

Pn(x) = 1

2n + 1P ′

n+1(x) − 1

2n + 1P ′

n−1(x), P0(x) = P ′1(x).

We also have

∫Pn(x) dx =

P1(x) n = 0

16 (2P2(x) + 1) n = 1

12n+1 Pn+1(x) − 1

2n+1 Pn−1(x) n ≥ 2

Pn(−x) = (−1)n Pn(x).

B.1.3 Special values

The Legendre polynomials have the following special values.

|Pn(x)| ≤ 1, |P ′n(x)| ≤ 1

2n(n + 1).

Pn(±1) = (±1)n, P ′n(±1) = (±1)n+1

2n(n + 1).

The values of Pn at the center x = 0 behave as

P2n(0) = (−1)n (n − 1)!(∏n/2i=1 2i

)2 , P2n+1(0) = 0.

Finally, we obtain the results for integration,∫ 1

−1Pn(x) dx = 2δ0n.

B.1.4 Operators

In the following we will consider this question for Legendre expansions: Givena polynomial approximation,

f (x) =∞∑

n=0

an Pn(x), L f (x) =∞∑

n=0

bn Pn(x),

where L is a given operator, what is the relation between an and bn? We will

Page 263: Spectral Methods for Time-Dependent Problems

B.2 Chebyshev polynomials 255

give the result for the most commonly used operators, L.

L = d

dx: bn = (2n + 1)

∞∑p=n+1

p+n odd

ap.

L = d2

dx2: bn = 2n + 1

2

∞∑p=n+2

p+n even

(p(p + 1) − n(n + 1)

)ap.

L = x : bn = n

2n − 1an−1 + n + 1

2n + 3an+1.

Finally, if we have

dq

dxqu(x) =

∞∑n=0

u(q)n Pn(x),

then

1

2n − 1u(q)

n−1 − 1

2n + 3u(q)

n+1 = u(q−1)n .

B.2 Chebyshev polynomials

The Chebyshev polynomials of the first kind, Tn(x), appear as a solution to thesingular Sturm–Liouville problem with p(x) = √

1 − x2, q(x) = 0 and w(x) =(√

1 − x2)−1,

d

dx

(√1 − x2

dTn(x)

dx

)+ n2

√1 − x2

Tn(x) = 0,

where Tn(x) is assumed bounded for x ∈ [−1, 1].The Chebyshev polynomials may be given on explicit form as

Tn(x) = cos(n arccos x).

Thus, T0(x) = 1, T1(x) = x , T2(x) = 2x2 − 1, T3(x) = 4x3 − 3x , etc.The Chebyshev polynomials are orthogonal in L2

w[−1, 1],∫ 1

−1Tn(x)Tm(x)

1√1 − x2

dx = π

2cnδmn,

where

cn ={

2 n = 0,

1 otherwise.

Page 264: Spectral Methods for Time-Dependent Problems

256 A zoo of polynomials

B.2.1 The Chebyshev expansion

The continuous expansion is given as

u(x) =N∑

n=0

unTn(x), un = 2

πcn

∫ 1

−1u(x)Tn(x)

1√1 − x2

dx,

where the details of the discrete expansion depend on which family of Gausspoints are chosen.

Chebyshev Gauss quadrature

z j = − cos

((2 j + 1)π

2N + 2

), u j = π

N + 1, j ∈ [0, . . . , N ].

The normalization constant is given as

γn ={

π n = 0π2 n ∈ [1, . . . , N ],

with the discrete expansion coefficients being

un = 1

γn

N∑j=0

u(z j )Tn(z j )u j .

Chebyshev Gauss–Radau quadrature

y j = − cos

(2 jπ

2N + 1

), v j =

2N+1 j = 0

2π2N+2 j ∈ [1, . . . , N ].

The normalization constant is given as

γn ={

π n = 0π2 n ∈ [1, . . . , N ],

yielding the discrete expansion coefficients,

un = 1

γn

N∑j=0

u(y j )Tn(y j )v j .

Chebyshev Gauss–Lobatto quadrature

x j = − cos

(π j

N

), w j =

2N j = 0, N

πN j ∈ [1, . . . , N − 1].

Page 265: Spectral Methods for Time-Dependent Problems

B.2 Chebyshev polynomials 257

The normalization constant is given as

γn ={

π2 j ∈ [1, . . . , N − 1]

π j = 0, N ,

resulting in the discrete expansion coefficients being

un = 1

γn

N∑j=0

u(x j )Tn(x j )w j .

B.2.2 Recurrence and other relations

The number of recurrence relations is large and we will only give the mostuseful ones.

Tn+1(x) = 2xTn(x) − Tn−1(x).

Tn = 1

2(n + 1)T ′

n+1(x) − 1

2(n − 1)T ′

n−1(x), T0(x) = T ′1(x).

Other useful relations are:

2T 2n (x) = 1 + T2n(x).

2Tn(x)Tm(x) = T|n+m|(x) + T|n−m|(x).

∫Tn(x) dx =

T1(x) n = 014 (T2(x) + 1) n = 1

12(n+1) Tn+1(x) − 1

2(n−1) Tn−1(x) n ≥ 2.

Tn(−x) = (−1)nTn(x).

B.2.3 Special values

From the definition of the Chebyshev polynomials we may make the followingobservations.

|Tn(x)| ≤ 1, |T ′n(x)| ≤ n2.

dq

dxqTn(±1) = (±1)n+q

q−1∏k=0

n2 − k2

2k + 1,

Page 266: Spectral Methods for Time-Dependent Problems

258 A zoo of polynomials

with the special cases

Tn(±1) = (±1)n, T ′n(±1) = (±1)n+1n2.

The values of Tn at the center x = 0 behave as

T2n(0) = (−1)n, T2n+1(0) = 0.

T ′2n(0) = 0, T ′

2n+1(0) = (−1)nn.

Finally, we obtain the results for integration,

∫ 1

−1Tn(x) dx =

{− 2n2−1 n even

0 n odd.

B.2.4 Operators

Now we consider the following question for Chebyshev expansions: Given apolynomial approximation,

f (x) =∞∑

n=0

anTn(x), L f (x) =∞∑

n=0

bnTn(x),

where L is a given operator, what is the relation between an and bn? We givethe result for the most commonly used operators, L.

L = d

dx: bn = 2

cn

∞∑p=n+1

p+n odd

pap.

L = d2

dx2: bn = 1

cn

∞∑p=n+2

p+n even

p(p2 − n2)ap.

L = d3

dx3: bn = 1

4cn

∞∑p=n+3

p+n odd

p(

p2(p2 − 2) − 2p2n2 + (n2 − 1)2)ap.

L = d4

dx4: bn = 1

24cn

∞∑p=n+4

p+n even

p(

p2(p2−4)2−3p4n2+3p2n4−n2(n2−4)2)ap.

L = x : bn = 1

2(cn−1an−1 + an+1).

L = x2: bn = 1

4(cn−2an−2 + (cn + cn−1)an + an+2).

Page 267: Spectral Methods for Time-Dependent Problems

B.2 Chebyshev polynomials 259

Finally, if we have

dq

dxqu(x) =

∞∑n=0

u(q)n Tn(x),

then

cn−1u(q)n−1 − u(q)

n+1 = 2nu(q−1)n .

Page 268: Spectral Methods for Time-Dependent Problems

Bibliography

S. Abarbanel and D. Gottlieb, Information content in spectral calculations. In Progressand Supercomputing in Computational Fluid Dynamics, eds. E. M. Murman andS. S. Abarbanel, No. 6 in Proceedings of U.S.–Israel Workshop. Boston: Birkhauser(1985), pp. 345–356.

S. Abarbanel, D. Gottlieb, and E. Tadmor, Spectral methods for discontinuous problems.In Numerical Methods for Fluid Dynamics II, eds. K. W. Morton and M. J. Baines.Oxford: Clarendon Press (1986), pp. 129–153.

O. Andreassen, I. Lie, and C. E. Wasberg, The spectral viscosity method applied tosimulation of waves in a stratified atmosphere. Journal of Computational Physics,110 (1994), 257–273.

O. Andreassen and I. Lie, Simulation of acoustical and elastic waves and interaction.Journal of the Acoustical Society of America, 95 (1994), 171–186.

R. Archibald and A. Gelb, A method to reduce the gibbs ringing artifact in MRIscans while keeping tissue boundary integrity. IEEE Medical Imaging, 21:4 (2002).

R. Archibald and A. Gelb, Reducing the effects of noise in image reconstruction. Journalof Scientific Computing, 17 (2002), 167–180.

R. Archibald, K. Chen, A. Gelb, and R. Renaut, Improving tissue segmentation of humanbrain MRI through pre-processing by the Gegenbauer reconstruction method.NeuroImage, 20:1 (2003), 489–502.

J. M. Augenbaum, An adaptive pseudospectral method for discontinuous problems.Applied Numerical Mathematics, 5 (1989), 459–480.

M. D. Baker, Endre Suli, and Antony F. Ware, Stability and convergence of the spectralLagrange–Galerkin method for periodic and non-periodic convection-dominateddiffusion problems. Technical Report 92/19, Oxford University Computing Labo-ratory, Numerical Analysis Group, (1992).

S. Balachandar and D. A. Yuen, Three-dimensional fully spectral numerical methodfor mantle convection with depth-dependent properties. Journal of ComputationalPhysics, 113 (1994), 62–74.

C. Basdevant, M. Deville, P. Haldenvvang, J. M. Lacroix, D. Orlandi, A. Patera, R. Peyret,and J. Quazzani, Spectral and finite difference solutions of Burgers’ equation.Comput & Fluids, 14 (1986), 23–41.

260

Page 269: Spectral Methods for Time-Dependent Problems

Bibliography 261

A. Bayliss, A. Class, and B. J. Matkowsky, Roundoff error in computing derivativesusing the Chebyshev differentiation matrix. Journal of Computational Physics,116 (1994), 380–383.

A. Bayliss, D. Gottlieb, B. J. Matkowsky, and M. Minkoff, An adaptive pseudo-spectralmethod for reaction-diffusion problems. Journal of Computational Physics, 81(1989), 421–443.

A. Bayliss and B. Matkowsky, Fronts, relaxation oscillations, and period-doublingin solid fuel combustion. Journal of Computational Physics, 71 (1987), 147–168.

A. Bayliss and E. Turkel, Mappings and accuracy for Chebyshev pseudospectral approx-imations. Journal of Computational Physics, 101 (1992), 349–359.

A. Bayliss, A. Class, and B. J. Matkowsky, Adaptive approximation of solutions toproblems with multiple layers by Chebyshev pseudo-spectral methods. Journal ofComputational Physics, 116 (1995), 160–172.

F. Ben Belgacem and Y. Maday, A spectral element methodology tuned to parallelimplementations. In Analysis, Algorithms and Applications of Spectral and HighOrder Methods for Partial Differential Equations, Christine Bernardi and YvonMaday, eds. Selected Papers from the International Conference on Spectral andHigh Order Methods (ICOSAHOM ’92). Amsterdam, (1994).

C. Bernardi and Y. Maday, A collocation method over staggered grids for theStokes problem. International Journal of Numerical Methods in Fluids, 8 (1988),537–557.

C. Bernardi and Y. Maday, Properties of some weighted sobolev spaces and applicationto spectral approximations. SIAM Journal on Numerical Analysis, 26 (1989), 769–829.

C. Bernardi and Y. Maday, Approximations Spectrales de Problemes aux Limites Ellip-tiques. Paris: Springer-Verlag, (1992).

C. Bernardi and Y. Maday, Polynomial interpolation results in Sobolev spaces. Journalof Computational Applied Mathematics, 43 (1992), 53–80.

C. Bernardi and Y. Maday, Spectral methods. In Handbook of Numerical Analysis V,ed. P. G. Ciarlet and J. L. Lions. Amsterdam: Elsevier Sciences, (1999).

M. Berzins and P. M. Dew, A note on the extension of the Chebyshev method to quasi-linear parabolic PDEs with mixed boundary conditions. International Journal onComputer Mathematics, 8 (1980), 249–263.

M. Berzins and P. M. Dew, A generalized Chebyshev method for non-linear parabolicequations in one space variable. IMA Journal of Numerical Analysis, 1 (1981),469–487.

R. H. Bisseling and R. Kosloff, Optimal choice of grid points in multidimensionalpseudospectral Fourier methods. Journal of Computational Physics, 76 (1988),243–262.

K. Black, Polynomial collocation using a domain decomposition solution to parabolicPDEs via the penalty method and explicit/implicit time-marching. Journal of Sci-entific Computing, 7 (1992), 313–338.

P. Bontoux, B. Bondet De La Bernardie, and B. Roux, Spectral methods for naturalconvection problems. In Numerical Methods for Coupled Problems, eds. E. Hinton,P. Bettess, and R. W. Lewis. Swansea: Pineridge, (1981), pp. 1018–1030.

Page 270: Spectral Methods for Time-Dependent Problems

262 Bibliography

J. P. Boyd, Two comments on filtering (artificial viscosity) for Chebyshev and Legendrespectral and spectral element methods: preserving boundary conditions and inter-pretation of the filter as a diffusion. Journal of Computational Physics, 143 (1998),283–288.

J. P. Boyd, Chebyshev and Fourier Spectral Methods, 2nd edn. New York: Dover Pub-lishers, (2000).

N. Bressan and Alfio Quarteroni, Analysis of Chebyshev collocation methods forparabolic equations. SIAM Journal of Numerical Analysis, 23 (1986), 1138–1154.

K. S. Breuer and R. M. Everson, On the errors incurred calculating derivatives usingChebyshev polynomials. Journal of Computational Physics, 99 (1992), 56–67.

D. L. Brown and M. L. Minion, Performance of under-resolved two-dimensional flowsimulations. Journal of Computational Physics, 122 (1995), 165–183.

W. Cai, D. Gottlieb, and C.-W. Shu, Essentially nonoscillatory spectral Fourier methodsfor shock wave calculation. Mathematics of Computation, 52 (1989), 389–410.

W. Cai, D. Gottlieb, and C. W. Shu, On one-sided filters for spectral Fourier approxima-tion of discontinuous functions. SIAM Journal of Numerical Analysis, 29 (1992),905–916.

W. Cai and C.-W. Shu, Uniform high-order spectral methods for one- and two-dimensional Euler equations. Journal of Computational Physics, 104 (1993), 427–443.

C. Canuto, Boundary conditions in Legendre and Chebyshev methods. SIAM Journal ofNumerical Analysis, 23 (1986), 815–831.

C. Canuto and A. Quarteroni, Approximation Results for Orthogonal Polynomials inSobolev Spaces, Math. Comp. 38(1982), pp. 67–86.

C. Canuto, and A. Quarteroni, Error Estimates for Spectral and Pseudospectral Approx-imations of Hyperbolic Equations, SIAM J. Numer. Anal. 19(1982), pp. 629–642.

C. Canuto and A. Quarteroni, Spectral and pseudo-spectral methods for parabolic prob-lems with nonperiodic boundary conditions. Calcolo, 18 (1981), 197–218.

C. Canuto and A. Quarteroni, Spectral methods for hyperbolic equations. Rendiconti delSeminario Matermatico Universitae Politecnico di Torino, 39 (1981), 21–31.

C. Canuto, M. Y. Hussaini, A. Quarteroni, and T. A. Zang, Spectral Methods in FluidDynamics. Springer Series in Computational Physics. New York: Springer-Verlag,(1988).

C. Canuto, M. Y. Hussaini, A. Quarteroni, and T. A. Zang, Spectral Methods – Funda-mentals in Single Domains. Springer Verlag, 2006.

A. Canuto and A. Quarteroni, (eds.), Spectral and high order methods for partial dif-ferential equations. Proceedings of the Icosahom 1989 Conference. Como, Italy.Elsevier Science (1990).

W.-M. Cao and B.-Y. Guo, A Fourier–Chebyshev spectral method for three-dimensionalvorticity equations with unilaterally periodic boundary conditions. Applied Math-ematics Journal of Chinese Universities, 7 (1992), 350–366.

M. H. Carpenter and D. Gottlieb, Spectral methods on arbitrary grids. Journal of Com-putational Physics, 129 (1996), 74–86.

G. Q. Chen, Q. Du, and E. Tadmor, Spectral viscosity approximations to multidimen-sional scalar conservation laws. Mathematics of Computation, 61 (1993), 629–643.

Page 271: Spectral Methods for Time-Dependent Problems

Bibliography 263

B. Cockburn, G. Karniadakis and C.-W. Shu (eds.), Discontinuous Galerkin Methods:Theory, Computation and Applications. Lecture Notes in Computational Scienceand Engineering, 11. Springer, (2000).

L. Dettori and B. Yang, On the Chebyshev method for parabolic and hyperbolic equa-tions. M2 AN, 30 (1996), 907–920.

M. Deville, P. F. Fischer, and E. Mund, High-Order Methods in Incompressible FluidFlows. Cambridge: Cambridge University Press, (2002).

P. G. Dinesen, J. S. Hesthaven, and J. P. Lynov, A pseudospectral collocation time-domain method for diffractive optics. Applied Numerical Mathematics, 33 (2000),199–206.

W. S. Don, Numerical study of pseudospectral methods in shock wave applications.Journal of Computational Physics, 110 (1994), 103–111.

W. S. Don and D. Gottlieb, Spectral simulation of unsteady flow past a cylinder. Com-puter Methods in Applied Mechanics and Engineering, 80 (1990), 39–58.

W. S. Don and D. Gottlieb, The Chebyshev–Legendre method: implementing Legendremethods on Chebyshev points. SIAM Journal on Numerical Analysis, 31 (1994),1519–1534.

W. S. Don and D. Gottlieb, High order methods for complicated flows interacting withshock waves. AIAA 97-0538, Reno Nevada, (1997).

W. S. Don and D. Gottlieb, Spectral simulation of supersonic reactive flows. SIAMJournal on Numerical Analysis, 35 (1998), 2370–2384.

W. S. Don and C. B. Quillen, Numerical Simulation of Reactive Flow. Part I: Resolution.Journal of Computional Physics, 122 (1995), 244–265.

W. S. Don and A. Solomonoff, Accuracy enhancement for higher derivatives usingChebyshev collocation and a mapping technique. SIAM Journal on Scientific Com-puting, (1995).

W. S. Don, D. Gottlieb, and J. H. Jung, A multidomain spectral method for supersonicreactive flows. Journal of Computational Physics, 192 (2003), 325–354.

M. Dubiner, Asymptotic analysis of spectral methods. Journal of Scientific Computing,2 (1987), 3–32.

M. Dubiner, Spectral methods on triangles and other domains. Journal of ScientificComputing, 6 (1991), 345–390.

L. Ferracina and M. N. Spijker, An extension and analysis of the Shu–Osher representa-tion of Runge–Kutta Methods. Mathematics of Computation, 74 (2005), 201–219.

P. F. Fischer and A. T. Patera, Parallel spectral element methods for the incompressibleNavier–stokes equations. In Solution of Super Large Problems in ComputationalMechanics, eds. J. H. Kane and A. D. Carlson. New York: Plenum, (1989).

P. F. Fischer and A. T. Patera, Parallel spectral element solutions of eddy-promoter chan-nel flow. In Proceedings of the European Research Community on Flow Turbulenceand Combustion Workshop, Laussane, Switzerland. Cambridge: Cambridge Uni-versity Press, (1992).

D. Fishelov, Spectral methods for the small disturbance equation of transonic flows.SIAM Journal of Scientific and Statistical Computing, 9 (1988), 232–251.

D. Fishelov, The spectrum and stability of the Chebyshev collocation operator for tran-sonic flow. Mathematics of Computation, 51 (1988), 599–579.

B. Fornberg, A Practical Guide to Pseudospectral Methods. Cambridge: CambridgeUniversity Press, (1996).

Page 272: Spectral Methods for Time-Dependent Problems

264 Bibliography

B. Fornberg, On A Fourier Method for the Integration of Hyperbolic Problems, SIAMJ. Numer. Anal. 12(1975), pp. 509–528.

D. Funaro, A multidomain spectral approximation of elliptic equations. NumericalMethod for Partial Differential Equations. 2:3 (1986), 187–205.

D. Funaro, Computing the inverse of the Chebyshev collocation derivative matrix. SIAMJournal of Scientific and Statistical Computing, 9 (1988), 1050–1058.

D. Funaro, Domain decomposition methods for pseudo spectral approximations. PartI. Second order equations in one dimension. Numerische Mathematik, 52 (1988),329–344.

D. Funaro, Pseudospectral approximation of a PDE defined on a triangle. Applied Math-ematics and Computation, 42 (1991), 121–138.

D. Funaro, Polynomial Approximation of Differential Equations. Lecture Notes inPhysics, 8. Berlin: Springer-Verlag, (1992).

D. Funaro, Some remarks about the collocation method on a modified Legendre grid.Computers and Mathematics with Applications, 33 (1997), 95–103.

D. Funaro and D. Gottlieb, A new method of imposing boundary conditions in pseu-dospectral approximations of hyperbolic equations. Mathematics of Composition,51 (1988), 599–613.

D. Funaro and D. Gottlieb, Convergence results for pseudospectral approximations ofhyperbolic systems by a penalty-type boundary treatment. Mathematics of Com-putation, 57 (1991), 585–596.

D. Funaro and W. Heinrichs, Some results about the pseudospectral approximation of onedimensional fourth order problems. Numerische Mathematik, 58 (1990), 399–418.

A. Gelb, Parameter optimization and reduction of round off error for the Gegenbauerreconstruction method. Journal of Scientific Computing, 20 (2004), 433–459.

A. Gelb and D. Gottlieb, The resolution of the Gibbs phenomenon for spliced functionsin one and two dimensions, Computers and Mathematics with Applications, 33(1997), 35–58.

A. Gelb and E. Tadmor, Enhanced spectral viscosity approximations for conservationlaws. Applied Numerical Mathematics, 33 (2000), 1–21.

A. Gelb and J. Tanner, Robust reprojection methods for the resolution of Gibbs phe-nomenon. Applied and Computational Harmonic Analysis, 20 (2006), 3–25.

F. X. Giraldo, J. S. Hesthaven, and T. Warburton, Nodal high order discontinuousGalerkin method for the spherical shallow water equations. Journal of Compu-tational Physics, 181 (2002), 499–525.

G. H. Golub and J. H. Welsch, Calculation of Gauss Quadraturs Rules, Math. Comp23(1969), 221–230.

J. Goodman, T. Hou, and E. Tadmor, On the stability of the unsmoothed Fourier methodfor hyperbolic equations. Numerische Mathematik, 67 (1994), 93–129.

D. Gottlieb, The stability of pseudospectral Chebyshev methods. Mathematics of Com-putation, 36 (1981), 107–118.

D. Gottlieb, Spectral methods for compressible flow problems. In Proceedings of the9th International Conference on Numerical Methods in Fluid Dynamics, Saclay,France, eds. Soubbaramayer and Boujot. Lecture Notes in Physics. New York:Springer-Verlag, 218 (1984), pp. 48–61.

Page 273: Spectral Methods for Time-Dependent Problems

Bibliography 265

D. Gottlieb and P. F. Fischer, On the optimal number of subdomains for hyperbolic prob-lems on parallel computers. International Journal of Supercomputer Applicationsand High Performance Computing, 11 (1997), 65–76.

D. Gottlieb and S. Gottlieb, Spectral methods for discontinuous problems. Proceedingsof the 20th Biennial Conference on Numerical Analysis, eds. D. F. Griffiths andG. A. Watson, (2003).

S. Gottlieb and L.-J. Gottlieb, Strong stability preserving properties of Runge–Kuttatime discretization methods for linear constant coefficient operators. Journal ofScientific Computing, 18 (2003), 83–110.

D. Gottlieb and S. Gottlieb, Spectral methods for compressible reactive flows. ComptesRendus Mecanique, 333 (2005), 3–16.

D. Gottlieb and J. S. Hesthaven, Spectral methods for hyperbolic problems. Journal ofComputational and Applied Mathematics, 128 (2001), 83–181.

D. Gottlieb and L. Lustman, The Dufort–Frankel Chebyshev method for parabolic initialvalue problems. Computers and Fluids, 11 (1983), 107–120.

D. Gottlieb and L. Lustman, The spectrum of the Chebyshev collocation operator forthe heat equation. SIAM Journal of Numerical Analysis, 20 (1983), 909–921.

D. Gottlieb and S. A. Orszag, Numerical Analysis of Spectral Methods: Theory andApplications. CBMS-NSF 26. Philadelphia: SIAM, (1977).

D. Gottlieb and S. A. Orszag, High resolution spectral calculations of inviscid com-pressible flows. In Approximation Methods for Navier–Stokes Problems. New York:Springer-Verlag, (1980), pp. 381–398.

D. Gottlieb and C.-W. Shu, Resolution properties of the Fourier method for discontinuouswaves. Computer Methods in Applied Mechanics and Engineering, 116 (1994), 27–37.

D. Gottlieb and C.-W. Shu, On the Gibbs phenomenon IV: Recovering exponentialaccuracy in a subinterval from a Gegenbauer partial sum of a piecewise analyticfunction. Mathematics of Computation, 64 (1995), 1081–1095.

D. Gottlieb and C.W. Shu, On the Gibbs phenomenon V: Recovering exponential accu-racy from collocation point values of a piecewise analytic function. NumerischeMathematik, 71 (1995), 511–526.

D. Gottlieb and C.-W. Shu, On the Gibbs phenomenon III: Recovering exponential accu-racy in a sub-interval from a spectral partial sum of a piecewise analytic function.SIAM Journal on Numerical Analysis, 33 (1996), 280–290.

D. Gottlieb and C.-W. Shu, On the Gibbs Phenomenon and its Resolution, SIAM Review,39 (1997), 644–668.

D. Gottlieb and C.-W. Shu, A general theory for the resolution of the Gibbs phenomenon.In Tricomi’s Ideas and Contemporary Applied Mathematics, Accademia NazionaleDei Lincey, National Italian Academy of Science, 147 (1998), 39–48.

S. Gottlieb and C.-W. Shu, Total variation diminishing Runge–Kutta schemes. Mathe-matics of Computation, 67 (1998), 73–85.

D. Gottlieb and E. Tadmor, Recovering pointwise values of discontinuous data withinspectral accuracy. In Progress and Supercomputing in Computational FluidDynamics, eds. E. M. Murman and S. S. Abarbanel. Boston: Birkhauser (1985),pp. 357–375.

Page 274: Spectral Methods for Time-Dependent Problems

266 Bibliography

D. Gottlieb and E. Tadmor, The CFL condition for spectral approximations to hyper-bolic initial-boundary value problems. Mathematics of Computation, 56 (1991),565–588.

D. Gottlieb and E. Turkel, On time discretization for spectral methods. Studies inApplied Mathematics, 63 (1980), 67–86.

D. Gottlieb and E. Turkel, Topics in spectral methods for time dependent problems. InNumerical Methods in Fluid Dynamics, ed. F. Brezzi. New York: Springer-Verlag(1985), pp. 115–155.

D. Gottlieb and E. Turkel, Spectral Methods for Time Dependent Partial Differ-ential. Equations. 1983 CIME Session (Italy), Lecture Notes in Mathematics.Springer-Verlag, 1127 (1985), 115–155.

D. Gottlieb and C. E. Wasberg, Optimal strategy in domain decomposition spectralmethods. The Ninth International Conference on Domain Decomposition Methodsfor Wave-like Phenomena. Siam Journal on Scientific Computing, 22:2 (2002),617–632.

D. Gottlieb, L. Lustman, and S. A. Orszag, Spectral calculations of one-dimensionalinviscid compressible flows. SIAM Journal on Scientific Computing, 2 (1981),296–310.

D. Gottlieb, S. A. Orszag, and E. Turkel, Stability of pseudospectral and finite differ-ence methods for variable coefficient problems. Mathematics of Computation, 37(1981), 293–305.

D. Gottlieb, M. Y. Hussaini, and S. A. Orszag, Theory and application of spectralmethods. In Spectral Methods for Partial Differential Equations, eds. R. G. Voigt,D. Gottlieb, and M. Y. Hussaini. Philadelphia: SIAM (1984), pp. 1–54.

D. Gottlieb, L. Lustman, and C. L. Streett, Spectral methods for two-dimensionalshocks. In Spectral Methods for Partial Differential Equations, eds. R. G. Voigt,D. Gottlieb, and M. Y. Hussaini. Philadelphia: SIAM (1984), pp. 79–96.

D. Gottlieb, L. Lustman, and E. Tadmor, Stability analysis of spectral methods forhyperbolic initial-value problems. SIAM Journal of Numerical Analysis, 24 (1987),241–258.

D. Gottlieb, L. Lustman, and E. Tadmor, Convergence of spectral methods for hyper-bolic initial-value problems. SIAM Journal of Numerical Analysis, 24 (1987), 532–537.

S. Gottlieb, C.-W. Shu and E. Tadmor, Strong stability preserving high-order timediscretization methods, SIAM Review, 43 (2001), 89–112.

D. Gottlieb, C.-W. Shu, A. Solomonoff, and H. Vandeven, On the Gibbs phenomenonI: recovering exponential accuracy from the Fourier partial sum of a nonperiodicanalytic function. Journal of Computational and Applied Mathematics, 43 (1992),81–98.

S. Gottlieb, D. Gottlieb and C.-W. Shu, Recovering high order accuracy in WENOcomputations of steady state hyperbolic systems. Journal of Scientific Computing,to appear 2006.

D. Gottlieb, J. S. Hesthaven, G. E. Karniadakis, and C.-W. Shu, eds. Proceedings ofthe 6th International Conference on Spectral and High-Order Methods. Journal ofScientific Computing, to appear (2006).

B.-Y. Guo, Spectral Methods and Their Applications. Singapore: World Scientific,(1998).

Page 275: Spectral Methods for Time-Dependent Problems

Bibliography 267

B. Gustafsson, H. O. Kreiss, and J. Oliger, Partial Differential Equations and DifferenceApproximations. John Wiley & Sons, 2001.

J. S. Hesthaven, A Stable Penalty Method for the compressible Navier–Stokesequations: II. One-dimensional domain decomposition schemes. SIAM Journal onScientific Computing, 18 (1997), 658–685.

J. S. Hesthaven, From electrostatics to almost optimal nodal sets for polynomial inter-polation in a simplex. SIAM Journal on Numerical Analysis, 35 (1998), 655–676.

J. S. Hesthaven, A Stable Penalty Method for the Compressible Navier-StokesEquations: III. Multidimensional Domain Decomposition Schemes. SIAM Journalon Scientific Computing, 20 (1999), 62–93.

J. S. Hesthaven, Spectral Penalty Methods. Applied Numerical Mathematics, 33 (2000),23–41.

J. S. Hesthaven and D. Gottlieb, A stable penalty method for the compressibleNavier–Stokes equations. I. Open boundary conditions. SIAM Journal on ScientificComputing, 17 (1996), 579–612.

J. S. Hesthaven and D. Gottlieb, Stable spectral methods for conservation lawson triangles with unstructured grids. Computer Methods in Applied MechanicEngineering, 175 (1999), 361–381.

J. S. Hesthaven and C. H. Teng, Stable spectral methods on tetrahedral elements. SIAMJournal on Scientific Computing, 21 (2000), 2352–2380.

J. S. Hesthaven and T. Warburton, High-order nodal methods on unstructured grids. I.Time-domain solution of Maxwell’s equations. Journal of Computational Physics,181 (2002), 186–221.

J. S. Hesthaven and M. Kirby, Filering in Legendre Spectral Methods, Math. Comp.2006.

J. S. Hesthaven and T. Warburton, Discontinuous Galerkin Methods for the Time-dependent Maxwell’s equations: an introduction. ACES Newsletter, 19 (2004),10–29.

J. S. Hesthaven and T. Warburton, High-order nodal discontinuous Galerkin methodsfor the Maxwell eigenvalue problem. Royal Society of London Series A, 362(2004), 493–524.

J. S. Hesthaven, P. G. Dinesen, and J. P. Lynov, Spectral collocation time-domainmodeling of diffractive optical elements. Journal of Computational Physics, 155(1999), 287–306.

I. Higueras, Representations of Runge–Kutta methods and strong stability preservingmethods. SIAM Journal on Numerical Analysis, 43 (2005), 924–948.

M. Y. Hussaini, D. A. Kopriva, M. D. Salas, and T. A. Zang, Spectral methods for theEuler equations: Part I: Fourier methods and shock-capturing. AIAA Journal, 23(1985), 64–70.

A. Ilin and R. Scott, (eds.), Proceedings of the Third International Conference onSpectral and High Order Methods, Houston, Texas, 5–9 June 1995. Special Issueof the Houston Journal of Mathematics, (1996).

K. Ito and R. Teglas, Legendre–Tau approximations for functional differential equations.SIAM Journal for Control and Optimization, 24 (1986), 737–759.

K. Ito and R. Teglas, Legendre–Tau approximations for functional differential equations:Part 2: The linear quadratic optimal control problem. SIAM Journal for Controland Optimization, 25 (1987), 1379–1408.

Page 276: Spectral Methods for Time-Dependent Problems

268 Bibliography

A. Karageorghis, A note on the Chebyshev coefficients of the general order derivativeof an infinitely differentiable function. Journal of Computational and AppliedMathematics, 21 (1988), 129–132.

A. Karageorghis, A note on the satisfaction of the boundary conditions for chebyshevcollocation methods in rectangular domains. Journal of Scientific Computing, 6(1991), 21–26.

A. Karageorghis and T. N. Phillips, On the coefficients of differentiated expansions ofultraspherical polynomials. Applied Numerical Mathematics, 9 (1992), 133–141.

G. E. Karniadakis and S. J. Sherwin, Spectral/hp Methods in Computational FluidDynamics. 2nd edn. Oxford: Oxford University Press, (2005).

D. A. Kopriva, A Practical Assessment of Spectral Accuracy for Hyperbolic Problemswith Discontinuities, J. Sci. Comput. 2(1987), pp. 249–262.

D. A. Kopriva, T. A. Zang, and M. Y. Hussaini, Spectral methods for the Eulerequations: The blunt body revisited. AIAA Journal, 29 (1991), 1458–1462.

R. Kosloff and H. Tal-Ezer, A modified Chebyshev pseudospectral method with anO(1/n) time step restriction. Journal of Computational Physics, 104 (1993),457–469.

H. O. Kreiss and J. Oliger, Comparison of accurate methods for the integration ofhyperbolic problems. Tellus, 24 (1972), 199–215.

H. O. Kreiss and J. Oliger, Stability of the Fourier method, SIAM Journal on NumericalAnalysis, 16 (1979), 421–433.

P. D. Lax, Accuracy and resolution in the computation of solutions of linear andnonlinear equations. In Proceedings of Recent Advances in Numerical Analysis.New York: Academic Press (1978), pp. 107–117.

D. Levy and E. Tadmor, From semi-discrete to fully-discrete: stability of Runge–Kuttaschemes by the energy method. SIAM Review, 40 (1998), 40–73.

I. Lomtev, C. B. Quillen and G. E. Karniadakis, Spectral/hp methods for viscouscompressible flows on unstructured 2D meshes. Journal of ComputationalPhysics, 144 (1998), 325–357.

L. Lurati, Pade-Gegenbauer Suppression of Runge Phenomenon in the Diagonal Limitof Gegenbauer Approximations, J. Comput. Phys. 2006 – to appear.

L. Lustman, The time evolution of spectral discretizations of hyperbolic systems. SIAMJournal of Numerical Analysis, 23 (1986), 1193–1198.

H.-P. Ma, Chebyshev–Legendre spectral viscosity method for nonlinear conservationlaws. SIAM Journal of Numerical Analysis, 35 (1998), 869–892.

H.-P. Ma, Chebyshev–Legendre super spectral viscosity method for nonlinearconservation laws. SIAM Journal of Numerical Analysis, 35 (1998), 893–908.

H.-P. Ma and B.-Y. Guo, The Chebyshev spectral method for Burgers-like equations.Journal of Computational Mathematics, 6 (1988), 48–53.

M. G. Macaraeg and C. L. Streett, Improvements in spectral collocation discretizationthrough a multiple domain technique. Applied Numerical Mathematics, 2 (1986),95–108.

Y. Maday and A. Quarteroni, Legendre and Chebyshev spectral approximations ofBurgers’ equation. Numerische Mathematik, 37 (1981), 321–332.

Y. Maday and E. Tadmor, Analysis of the spectral vanishing viscosity method forperiodic conservation laws. SIAM Journal on Numerical Analysis, 26 (1989), 854–870.

Page 277: Spectral Methods for Time-Dependent Problems

Bibliography 269

Y. Maday, S. M. Ould Kaber, and E. Tadmor, Legendre pseudospectral viscosity methodfor nonlinear conservation laws. SIAM Journal of Numerical Analysis, 30 (1992),321–342.

A. Majda, J. McDonough, and S. Osher, The Fourier Method for nonsmooth initialdata. Mathematics of Computation, 32 (1978), 1041–1081.

C. Mavriplis and J. M. Rosendale, Triangular spectral elements for incompressible fluidflow. ICASE Report 93–100, NASA Langley Research Center, Virginia: Hampton,(1993).

B. E. McDonald, Flux-corrected pseudospectral method for scalar hyperbolicconservation laws. Journal of Computational Physics, 82 (1989), 413–428.

M. S. Min and D. Gottlieb, On the convergence of the Fourier approximation foreigenvalues and eigenfunctions of discontinuous problems. SIAM Journal onNumerical Analysis, 40 (2002), 2254–2269.

S. A. Orszag, Galerkin approximations to flows within slabs, spheres and cylinders.Physical Review Letters, 26 (1971), 1100–1103.

S. A. Orszag, Comparison of pseudospectral and spectral approximation. Studies inApplied Mathematics, 51 (1972), 253–259.

S. A. Orszag, Spectral methods for problems in complex geometries. Journal ofComputational Physics, 37 (1980), 70–92.

R. G. M. van Os and T. N. Phillips, Efficient and stable spectral element methods forpredicting the flow of an XPP fluid past a cylinder. Journal of Non-NewtonianFluid Mechanics, 129 (2005), 143–162.

S. Osher, Smoothing for spectral methods. In Spectral Methods for Partial DifferentialEquations, eds. R. G. Voigt, David Gottlieb, and M. Y. Hussaini. Philadelphia:SIAM (1984), pp. 209–216.

S. M. Ould Kaber, Filtering non-periodic functions. In Analysis, Algorithms and Appli-cations of Spectral and High Order Methods for Partial Differential Equations,eds. Christine Bernardi and Yvon Maday. Amsterdam: North-Holland (1994),pp. 123–130.

S. M. Ould Kaber and H. Vandeven, Reconstruction of a discontinuous function fromits Legendre coefficients. Comptes Rendus Mathematiques, 317 (1993), 527–532.

J. E. Pasciak, Spectral and Pseudospectral Methods for Advection Equations.Mathematics of Computation, 35 (1980), 1081–1092.

R. Peyret and T. D. Taylor, Computational Methods for Fluid Flow. New York:Springer-Verlag, (1983).

R. Peyret, Spectral Methods for Incompressible Viscous Flow. New York: Springer-Verlag, (2002).

W. D. Pilkey, (ed.) Special issue: selection of papers presented at ICOSAHOM’92.Finite Elements in Analysis and Design archive, 16:3–4. Amsterdam: ElsevierScience, (1994).

A. Quarteroni, Blending Fourier and Chebyshev interpolation. Journal of ApproximationTheory, 51 (1987), 115–126.

S. C. Reddy and L. N. Trefethen, Lax-stability of fully discrete spectral methodsvia stability regions and pseudo-eigenvalues. Computater Methods in AppliedMechanics and Engineering, 80 (1990), 147–164.

L. G. Reyna, l2 estimates for Chebyshev collocation. Journal of Scientific Computing,3 (1988), 1–24.

Page 278: Spectral Methods for Time-Dependent Problems

270 Bibliography

S. J. Ruuth and R. J. Spiteri, Two barriers on strong-stability-preserving timediscretization methods. Journal of Scientific Computing, 17 (1990), 211–220.

L. Sakell, Pseudospectral solutions of one- and two-dimensional inviscid flows withshock waves. AIAA Journal, 22 (1984), 929–934.

S. Schochet, The rate of convergence of spectral-viscosity methods for periodic scalarconservation laws. SIAM Journal of Numerical Analysis, 27 (1990), 1142–1159.

C.-W. Shu, Total-variation-diminishing time discretizations. SIAM Journal on Scientificand Statistical Computing, 9 (1988), 1073–1084.

C.-W. Shu, A survey of strong stability preserving high order time discretizations.In Collected Lectures on the Preservation of Stability under Discretization, eds.D. Estep and S. Tavener. Philadelphia: SIAM (2002), pp. 51–65.

C.-W. Shu and S. Osher, Efficient implementation of essentially non-oscillatoryshock-capturing schemes. Journal of Computational Physics, 77 (1988), 439–471.

C.-W. Shu and P. Wong, A note on the accuracy of spectral method applied to nonlinearconservation laws. Journal of Scientific Computing, 10 (1995), 357–369.

D. Sidilkover and G. Karniadakis. Non-oscillatory spectral element Chebyshev methodsfor shock wave calculations. Journal of Computational Physics, 107 (1993), 10.

A. Solomonoff, A fast algorithm for spectral differentiation. Journal of ComputationalPhysics, 98 (1992), 174–177.

J. Strain, Spectral methods for nonlinear parabolic systems. Journal of ComputationalPhysics, 122 (1995), 1–12.

E. Suli and A. Ware, A spectral method of characteristics for hyperbolic problems.SIAM Journal of Numerical Analysis, 28 (1991), 423–445.

G. Szego, Orthogonal Polynomials. Colloquium Publications 23, American Mathemat-ical Society, Providence, RI, 1939.

E. Tadmor, The exponential accuracy of Fourier and Chebyshev differencing methods.SIAM Journal on Numerical Analysis, 23 (1986), 1–10.

E. Tadmor, Stability analysis of finite-difference, pseudospectral, and Fourier–Galerkinapproximations for time-dependent problems. SIAM Review, 29 (1987), 525–555.

E. Tadmor, Convergence of spectral methods for nonlinear conservation laws. SIAMJournal of Numerical Analysis, 26 (1989), 30–44.

E. Tadmor, Shock capturing by the spectral viscosity method. Computer Methods inApplied Mechanics and Engineering, 78 (1990), 197–208.

E. Tadmor, Super viscosity and spectral approximations of nonlinear conservationlaws. “Numerical Methods for Fluid Dynamics IV”. Proceedings of the 1992Conference on Numerical Methods for Fluid Dynamics, eds. M. J. Baines andK. W. Morton. London: Oxford University Press (1993), pp. 69–82.

E. Tadmor, Approximate solutions of nonlinear conservation laws. In AdvancedNumerical Approximation of Nonlinear Hyperbolic Equations, Lecture Notesfrom CIME Course Cetraro, Italy, 1997 (A. Quarteroni, ed.), Lecture Notes inMathematics, Springer-Verlag, 1697 (1998), pp. 1–150.

H. Tal-Ezer, Spectral methods in time for hyperbolic equations. SIAM Journal ofNumerical Analysis, 23 (1986), 11–26.

H. Tal-Ezer, Spectral methods in time for parabolic problems. SIAM Journal ofNumerical Analysis, 26 (1989), 1–11.

Page 279: Spectral Methods for Time-Dependent Problems

Bibliography 271

J. Tanner and E. Tadmor, Adaptive Mollifiers – High Resolution Recover of PiecewiseSmooth Data from its Spectral Information, Found. Comput. Math. 2(2002),pp. 155–189.

J. Trujillo and G. E. Karniadakis, A penalty method for the vorticity–velocityformulation. Journal of Computational Physics, 149 (1999), 32–58.

L. N. Trefethen, Lax-stability vs. eigenvalue stability of spectral methods. In NumericalMethods for Fluid Dynamics III, eds. K. W. Morton and M. J. Baines. Oxford:Clarendon Press (1988), pp. 237–253.

L. N. Trefethen, Spectral Methods in Matlab. Philadelphia: SIAM, (2000).L. N. Trefethen and M. R. Trummer, An instability phenomenon in spectral methods,

SIAM J. Numer. Anal. 24(1987), pp. 1008–1023.H. Vandeven, Family of spectral filters for discontinuous problems. Journal of Scientific

Computing, 8 (1991), 159–192.J. S. Hesthaven, D. Gottlieb, and E. Turkel, Proceedings of the Fourth International

Conference on Spectral and High Order Methods. Applied Numerical Mathematics,33:1–4, (2000).

Proceedings of the Fifth International Conference on Spectral and High OrderMethods (Uppsala, Sweden). Journal of Scientific Computing, 17 (2002).

T. Warburton, I. Lomtev, Y. Du, S. Sherwin, and G. E. Karniadakis Galerkin anddiscontinuous Galerkin spectral/hp methods. Computer Methods in AppliedMechanics and Engineering, 175 (1999), 343–359.

J. Andre C. Weideman and L. N. Trefethen, The eigenvalues of second-order spectral dif-ferentiation matrices. SIAM Journal on Numerical Analysis, 25 (1988), 1279–1298.

B. D. Welfert, On the eigenvalues of second-order pseudospectral differentiationoperators. Computer Methods in Applied Mechanics and Engineering, 116 (1994),281–292.

B. D. Welfert, Generation of pseudospectral differentiation matrices, I. SIAM Journalon Numerical Analysis, 34 (1997), 1640–1657.

J. H. Williamson, Low-storage Runge–Kutta schemes. Journal of ComputationalPhysics, 35 (1980), 48–56.

Page 280: Spectral Methods for Time-Dependent Problems

Index

aliasing error, 30, 39, 41, 42, 54, 114

Boundary conditions, 133–134Burger’s equation, 122, 127Chebyshev polynomials, 74, 75

bounds, 74recurrence relations, 75Rodrigues’ formula, 74weight function, 74

collocation method, 129–133, 142–145

Derivatives, 6, 15, 17, 30, 31, 80–83Differentiation matrices, 7, 9

Chebyshev, 96–98Fourier, 32, 33, 57Legendre, 93–96

Dirichlet kernel, 156discrete inner products, 54, 88discrete norms

Chebyshev, 89Legendre, 89

discrete trigonometric polynomials, 24, 25even expansion, 25odd expansion, 28approximation results, 27, 38, 39

discrete Legendre expansionapproximation results, 115

discrete Chebyshev expansionapproximation results, 115, 116

discontinuous Galerkin methods, 246–247

eigenvalue spectrum of differentiationoperators

Fourier–Galerkin approximation, 189polynomial approximation, 189–191

electrostatic, 99, 104, 106

elliptic problem, 126–127energy, 55even–odd decomposition, 207–210

fast cosine transform, 206fast Fourier transform, 32, 34, 50, 51, 205filters, 160–174

and super-spectral viscosity, 151filter family, 170filter function, 169finite difference, 5, 6, 10, 11finite precision effects see round-off errorsfully discrete stability analysis, 191–192

Galerkin method, 117, 135Gauss quadrature points, 108

computation of, 210–213Gaussian weights

computation of, 210–213Gegenbauer reprojection, 178–182

for linear equations, 182–184for nonlinear equations, 185–186

general grids, 236Gibbs complementary basis, 175–176

to Fourier basis, 178to Legendre basis, 181to Gegenbauer basis, 182

Gibbs phenomenon, 154–160removal of, 174–182

hyperbolic equations (see also wave equation),6, 55, 119, 130, 137–139, 153

interpolation, 26, 48

Jacobi polynomials, 69–72

272

Page 281: Spectral Methods for Time-Dependent Problems

Index 273

Christoffel–Darboux, 71 (Theorem 4.4)explicit formula, 70normalization, 70recurrence relations, 71 (Theorem 4.2), 72

(Theorem 4.5)recurrence relation in terms of derivatives,

71 (Theorem 4.3)Rodrigues’ formula, 69

Lagrange polynomial interpolation, 91–92,131

Lebesque constant, 100–102, 105Lebesque function, 100–102Legendre polynomials, 72

explicit formula, 73recurrence relations, 73rodrigues formula, 72sturm–Liouville equation, 72

mapping techniques, 225–234mass matrix, 118multi-step methods, 193

parabolic equation, 119, 121, 122, 132,136

penalty methods, 133–134, 238–239for complex boundary conditions,

243–246collocation methods, 241–243Galerkin methods, 239–241

stability of, 145–150phase error, 9, 10, 12, 13, 18points per wavelength, 13, 16, 18, 77, 78polynomial expansions, 79

expansion coefficients, 80Legendre, 81Chebyshev, 82

quadrature formulas, 29Gauss, 85Gauss–Lobatto, 83Gauss–Radau, 84Legendre–Gauss–Lobatto, 86Legendre–Gauss–Radau, 86Legendre–Gauss, 87Chebyshev–Gauss–Lobatto, 87Chebyshev–Gauss–Radau, 87Chebyshev–Gauss, 88

round-off errorsin Fourier methods, 214–217in polynomial methods, 217–225

Runge–Kutta methods, 193–197, 199–201low storage, 195–196linear stability regions, 195strong stability preserving, 197–202

spectral methods, 5Chebyshev, 117–123Fourier, 16

Galerkin, 43–48collocation, 48

tau, 123–129stability

Chebyshev-collocation method, 142–145Fourier–Galerkin method, 52, 53, 54Fourier-collocation

linear hyperbolic problems, 54–62linear parabolic problems, 62, 63, 64nonlinear hyperbolic problems, 64, 65

Galerkin method for semi-boundedoperators, 135–142

nonlinear equations, 150–152penalty methods, 145–150

stiffness matrix, 118, 121, 122strong stability preserving methods, 197–202

Runge–Kutta, 198–201multi-step, 202

Sturm–Liouville problem, 67, 68regular, 69singular, 68

super spectral viscosity, 60, 62, 64, 65for Chebyshev, 150for Legendre, 150

tau method, 123–129trigonometric polynomial expansions, 19, 20,

21, 36, 37truncation error, 24, 41, 45ultraspherical polynomials, 76–77

relation to Legendre and Chebyshevpolynomials, 76

Rodrigues’ formula, 76Sturm–Liouville problem, 76

wave equation, 6, 9, 17, 133weight function, 69