Chapter 12

Spectral and Pseudo-Spectral Methods for Periodic Elliptic Equations

In this chapter, we will investigate the solutions to periodic elliptic equations in one space dimension. Most everything can be generalized to two and three- dimensional problems as well.

12.1 Periodic Di↵erential Equations

Definition 12.1.1. Suppose that

173 174 CHAPTER 12. SPECTRAL METHODS holds on the whole real number line. Still, we some times say the boundary conditions are of periodic type. In any case, for the periodic problem, one must be careful about the value of c. Proposition 12.1.4. Suppose that f C (a, b) and u C2(a, b) is a classical 2 p 2 p solution to the [a, b]-periodic Helmholtz problem with c 0,then b b c u(x) dx = f (x) dx. Za Za Consequently, a necessary condition for there to be a solution to the [a, b] b periodic Poisson problem (c =0) is that a f (x) dx =0. Proof. The proof follows using integration-by-parts,R Theorem 4.2.14, and is left as an exercise.

Theorem 12.1.5. Suppose that 0, there exists a unique classical solution u C2(a, b) to the [a, b]- 2 p periodic Helmholtz problem (12.1.1).Anecessaryandsucient condition for the existence of a classical solution to the [a, b]-periodic Poisson prob- b b lem (12.1.1) (c =0) is that a f (x) dx =0.Ifc =0and a f (x) dx =0 there is a unique classical solution u to (12.1.1) in the function class R R b C˚2(a, b)= u C2(a, b) u(x) dx =0 . p 2 p ⇢ Za Proof. The proof can be gotten using the periodic Green’s function, or by using techniques. See [9, 12, 17].

12.2 Finite Di↵erence Approximation

Now, we wish to approximate the classical solutions to these problems using finite di↵erence methods. Many of the techniques that we describe here are similar to those developed in Chapter 10. We need a couple of preliminary definitions.

Definition 12.2.1. Suppose that m N. Define the index set 2 V := 1, ,m , m { ··· } 1 and set h = and pi = ih,fori Z. Define the following sets m 2 m := w : Vm C , := w : Z C . V { ! } V { ! } 12.2. FINITE DIFFERENCE APPROXIMATION 175

Elements of these sets – which are clearly linear vector spaces of functions – are called grid functions. We use the notation wi = w(i),fori Vm or i Z. 2 2 We define subspace of periodic grid functions

m,p := w wi+n m = wi , for all i,n Z . V { 2 V| · 2 } Finally, we define the discrete Laplacian operator : via h V ! V wi 1 2wi + wi+1 hwi := ,iZ. h2 2

1 Definition 12.2.2. Suppose m N, h = , pi = ih, f Cp(0, 1), c 0,and 2 m 2 u C2(0, 1) is a classical solution to the one dimensional periodic Helmholtz 2 p problem d 2u (x)+cu = f (x),xR. (12.2.1) dx2 2 We call w a finite di↵erence approximation to (12.2.1) i↵ 2 Vm,p

hwi + cwi = fi ,iZ, (12.2.2) 2 where fi := f (pi ), for all i Z. The global error e m,p is the grid function 2 2 V defined via ei = ui wi ,iZ, 2 where ui := u(pi ), for all i Z. The local truncation error ⌧[u] m,p is 2 2 V the grid function ⌧i [u]:=fi + hui cui ,iZ. 2 One of our first concerns should be to determine whether our finite di↵er- ence approximation is well-defined. To make this determination, we first state some simple facts.

Proposition 12.2.3. Let m N. There is a one-to-one correspondence be- 2 m tween the space of grid functions m and C . Furthermore, there is a one- V to-one correspondence between and the space of periodic grid functions Vm . Therefore, dim( ) = dim( )=m. Vm,p Vm Vm,p m Proof. The (canonical) correspondence between m and C has already been V established, albeit for the real case. Regarding the second correspondence, if w , then we can define its unique periodic extension w ext via 2 Vm 2 Vm,p ext wi+n m := wi , for all i Vm,n Z. · 2 2 176 CHAPTER 12. SPECTRAL METHODS

Conversely, for any w , there is a unique restriction w res defined 2 Vm,p 2 Vm via w res := w , for all i V . i i 2 m

Remark 12.2.4. As before, we will write

m w C w m w m,p. 2 $ 2 V $ 2 V If we know that the components of the vector are real, we will write bf w Rm 2 instead. We use the same convention as before, denoting a grid function by a greek or roman character and its corresponding canonical vector representative by the boldface of the same character.

1 Theorem 12.2.5. Suppose m N, h = m , pi = ih, c 0, f Cp(0, 1),and 2 2 2 u Cp (0, 1) is a classical solution to the one dimensional periodic Helmholtz 2 m m problem (12.2.1). Define A R ⇥ , called the sti↵ness matrix, via 2 2 10 1 . ··· . 2 12.. . 3 .. .. A = 6 0 . . 107 . (12.2.3) 6 7 6 . 7 6 . 121 7 6 7 6 1 0 127 6 ··· 7 4 5 m Define u m,p u R component-wise via ui = u(pi ), for all i Z, 2 V $ 2 m 2 and likewise, f m,p f R , via fi = f (pi ), for all i Z. Then 2 Vm $ 2 2 w m,p w R is a solution to the finite di↵erence problem (12.2.2) i↵ 2 V $ 2 it is a solution to the problem

(A + ch2I)w = h2f . (12.2.4)

m Likewise, the global and local truncation errors, e m,p e R and m 2 V $ 2 ⌧[u] m,p ⌧[u] R , respectively, satisfy 2 V $ 2 (A + ch2I)e = h2⌧[u]. (12.2.5) Proof. The proof is an exercise.

We have proven that (12.2.2) is equivalent to (12.2.4). As before, this equivalence is useful, because it is easy analyze the coecient matrix and give sucient and necessary conditions for the solvability of (12.2.4). 12.3. CONVERGENCE OF FINITE DIFFERENCE APPROX. 177

5

4

3

2

1

0

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

Figure 12.1: The eigenvalues of the sti↵ness matrix A are show (open circles) for m = 10. Observe that 0 4.  ` 

12.3 Well-Definedness and Convergence of the Finite Di↵erence Approximation

As in Chapter 10, we will analyze the sti↵ness matrix A, define an appropriate `2-norm and prove the convergence of our method in that norm. m m Theorem 12.3.1. Let m N and suppose A R ⇥ is the sti↵ness matrix 2 2 m defined in (12.2.3). Consider the set of vectors S = v ` C ` Vm , { 2 | 2 } where the components of v ` are [v ] =: v = e`(2⇡i)kh,kV , ` k `,k 2 m with i = p 1. Then 1. S is an orthonormal set of vectors in the sense that

H (v k , v j )2 = v ` v j = k,j .

2. S is a set of eigenvectors of A, and the eigenvalue ` corresponding to the eigenvector v ` is given by 2 ` = 4 sin (`⇡h) . Since 0 4 (see Figure 12.2), for all ` V , A is a symmetric  `  2 m positive semi-definite matrix. 178 CHAPTER 12. SPECTRAL METHODS

3. A is not invertible, and, in particular, ker(A)=span( 1 ). { } 1 4. There is a constant, C1 > 0, independent of h, such that, if 0

1 1 1 2 = = 2 C1h . 1 m 1 4 sin (h⇡) 

Proof. The proofs are left for exercises. The details are similar those from Chapter 10.

Corollary 12.3.2. Suppose that c>0.Foreverym N, there is a unique m 2 solution w m,p w R to the finite di↵erence problem (12.2.2). 2 V $ 2 Proof. This follows because, when c>0, the coecient matrix A + ch2I for problem (12.2.4) is symmetric positive definite.

We need a norm for grid functions. There are lots of possibilities to choose from. Our picks will be based on some properties that we describe later.

Definition 12.3.3. Define the function ( , ) 2 : m,p m,p C via · · ` V ⇥ V ! m

(w,v) 2 := h w v , for all w,v . ` i i 2 Vm,p Xi=1

Define 2 : m,p R via k · k` V !

m 2 w 2 := (w,w) 2 = h w , for all w . k k` ` v | i | 2 Vm u i=1 q u X t Proposition 12.3.4. ( , ) 2 : m,p m,p C defines a complex inner · · ` V ⇥ V ! product and, therefore, 2 : m,p R defines a norm. Consequently, for k · k` V ! any w,v , 2 Vm,p (w,v) 2 w 2 v 2 , | ` | k k` k k` with equality i↵ w = ↵v, for some constant ↵ C.Foranyw m,p w 2 2 V $ 2 Cm

ph w = w 2 . k k2 k k` Proof. The proof is similar to one given in Chapter 10. 12.3. CONVERGENCE OF FINITE DIFFERENCE APPROX. 179

1 m Theorem 12.3.5. Suppose m N, h = m , pi = ih,andf m,p f R . 2 m 2 V $ 2 Then, there is a unique solution w m,p w R with (w,1) 2 =0to 2 V $ 2 ` the finite di↵erence Poisson problem

hwi = fi ,iZ, 2 i↵ (f,1)`2 =0. m Proof. Because of Theorem 12.2.5, w m,p w R solves the finite 2 V $ 2 di↵erence problem i↵ Aw = h2f .

( ): Suppose that (f,1) 2 = 0. The matrix A is, of course, singular. In fact, ( ` ker(A)=span(1 ). We can write a nonsingular version of this problem by { } m introducing a Lagrange multiplier: find R,andv m,p v R ,such 2 2 V $ 2 that hvi + = fi ,iZ (12.3.1) h2 2 (v,1)`2 =0. (12.3.2) The corresponding matrix problem is A˜v˜ = h2f˜,where A 1 v f A˜ = , v˜ = , f˜ = . (12.3.3) 1T 0 0    For example, when m = 8, 2 10000011 121000001 2 3 0 12100001 6 7 6 0012100017 ˜ 6 7 A = 6 0001210017 . (12.3.4) 6 7 6 0000121017 6 7 6 0000012117 6 7 6 1000001217 6 7 6 1111111107 6 7 4 5 We leave it for an exercise to prove that A˜ is non-singular. If this is true, 2 then problem (12.3.3) is well-posed. The solution must satisfy = h (f,1)`2 . m Hence = 0. It follows that v m,p v R solves the finite di↵erence 2 V $ 2 problem

hvi = fi ,iZ (12.3.5) 2 (v,1)`2 =0. (12.3.6) 180 CHAPTER 12. SPECTRAL METHODS

This direction is complete upon taking w = v.

( ): This direction is easier and is left as an exercise. ) Now, we prove a convergence result in the `2 norm. For simplicity we focus on the Helmholtz problem, that is, c>0.

1 Theorem 12.3.6. Suppose m N, h = m , pi = ih, f Cp(0, 1),and 4 2 2 u Cp (0, 1) is a classical solution to the one dimensional Helmholtz prob- 2 m lem (12.2.1) with c>0. Suppose that w m,p w R is a solution 2 V $ 2 m to the finite di↵erence problem (12.2.2), and let e m,p e R be its 2 V $ 2 global error. Then there is a constant C2 > 0 that is independent of h,such that ⌧ [u] C h2, for all i V . | i |  2 2 m 1 Furthermore, if 0

2 e 2 C C h , k k`  2 3 where C3 > 0 is independent of h.

Proof. As usual, the first part is a consequence of Taylor’s theorem. The details are left for the reader. For the second part, observe that the global and local truncation errors, m m e m,p e R and ⌧[u] m,p ⌧[u] R , respectively, satisfy 2 V $ 2 2 V $1 2 (12.2.5). Therefore, e = h2 A + ch2I ⌧. We leave it as an exercise for the reader to prove that, if 0

1 1 2 2 A + ch I = 2 C3h , 2 1 + ch  where 1 is the first eigenvalue ofA and C3 > 0 is independent of h. If this is the case,

2 2 1 e 2 h A + ch I ⌧ 2 C3 ⌧ 2 k k  2 k k  k k m 2 3 = C ⌧ 2 pmC C h = C C h 2 . 3v | i |  2 3 2 3 u i=1 uX t

Using the fact that e 2 = ph e , the result follows. k k` k k2 12.4. THE SPECTRAL 181

12.4 The Spectral Galerkin Method

In this section, we briefly describe the spectral Galerkin method for solving the periodic Poisson problem. Let us first make some definitions.

Definition 12.4.1. Define for m N0, 2 m m H (a, b):= f H (R) f is [a, b]-periodic , p { 2 loc | } where

m m H (R):= f : R R f H (c,d), for all c,d R,c

Theorem 12.4.3. There is a constant CP > 0 such that du u L2(0,1) CP = CP u H1(0,1) , k k  dx 2 | | L (0,1) 1 for all u H˚ (0, 1). 2 p 182 CHAPTER 12. SPECTRAL METHODS

˚1 Proof. We prove this result for Cp (0, 1). The more general version can be established using a density argument. Suppose that u C˚1(0, 1). Since u 2 p is continuous, periodic and has zero mean, there is a point a [0, 1) where 2 u(a) = 0. Since the function is periodic, without loss of generality, we may assume that a = 0. Then, by the Fundamental Theorem of , for any z [0, 1], since u(0) = 0, 2 z u(z)=u(z) u(0) = u0(x) dx. Z0 By the Cauchy-Schwartz inequality,

2 z 2 z z 2 2 2 u(z) = 1 u0(x) dx 1 dx u (x) dx | | ·  | 0 | ✓Z0 ◆ sZ0 sZ0 ! z 1 2 2 = z u0(x) dx u0(x) dx.  Z0 Z0 Integrating, we have

1 1 1 1 2 2 2 u(z) dz u0(x) dx dz = u0(x) dx. | |  Z0 Z0 Z0 Z0 Thus, the result holds with CP = 1, in this case:

u 2 u0 . k kL (0,1)  L2(0,1) Theorem 12.4.4. Suppose that f L2(0, 1) is given. Then, there is a unique 2 0 solution u H˚1(0, 1) H˚2(0, 1) to the following weak periodic Poisson prob- 2 p \ p lem: find u H˚1(0, 1) such that 2 p 1 a(u,v)=(f,v) 2 , for all,vH˚ (0, 1), (12.4.1) L (0,1) 2 p where du dv a(u,v):= , . dx dx ✓ ◆L2(0,1) Furthermore, if f H˚r (0, 1) for r N,thenu H˚r+2(0, 1), and if f 2 p 2 2 p 2 C˚ (0, 1),thenu C˚ (0, 1),where p1 2 p1

˚ 1 ˚m Cp1(0, 1) := Cp (0, 1). m=0 \ 12.4. THE SPECTRAL GALERKIN METHOD 183

Proof. Existence and uniqueness part follows from an argument similar to that used in the proof of Theorem 11.2.4. The primary tool is the Riesz Represen- tation Theorem 11.2.5, and one shows symmetry, bilinearity, continuity, and coercivity of a( , ). As before, there is some > 0 such that · · 1 a(u,v) u 1 v 1 , for all u,v H˚ (0, 1), | |  k kH (0,1) k kH (0,1) 2 p and, there is some ↵ > 0 such that

2 1 ↵ u 1 a(u,u), for all u H˚ (0, 1), k kH (0,1)  2 p which follows from the Poincar´einequality. The details are left as an exercise. It follows then that a( , ):H˚1(0, 1) H˚1(0, 1) R is an inner product · · p ⇥ p ! and, therefore, that

u := a(u,u)= (u ,u ) 2 k kE 0 0 L (0,1) q ˚1 p defines a norm on Hp(0, 1), called the energy norm, that is equivalent to the 1 norm u 1 . In particular, we have, for all u H˚ (0, 1), k kH (0,1) 2 p

2 u u 1 C +1 u . k kE k kH (0,1)  P k kE q

2 Example 12.4.5. Here we examine the eigenfunctions of the operator d u dx2 on the interval (0, 1) subject to periodic boundary conditions. Define for x R 2 and k N, 2 k (x) = sin(2⇡kx), k (x) = cos(2⇡kx).

Define, 0(x)=1, for all x R. Then, clearly, 2 d 2 d 2 k =(2⇡)2k2 = , k =(2⇡)2k2 = ⌘ , dx2 k k k dx2 k k k and , C˚ (0, 1). Observe that the eigenvalues grow unboundedly: k k 2 p1 = ⌘ =(2⇡)2k2 , as k . k k !1 !1 The eigenfunctions are orthogonal, that is, for any k,` N, k = `, 2 6

( k , `)L2(0,1) =0=(k , `)L2(0,1); for any k,` N 2 ( k , `)L2(0,1) = 0; 184 CHAPTER 12. SPECTRAL METHODS and finally, for k N, 2

( k , 0)L2(0,1) =0=(k , 0)L2(0,1).

The last is a restatement of the mean-zero property. The nor- malizations are 1 ( k , k )L2(0,1) = =(k , k )L2(0,1),kN, 2 2 and (0, 0)L2(0,1) =1. To simplify the calculations, one can use complex trigonometric functions instead of real. Define for all x R, k Z, 2 2 2⇡ikx k (x)=e , where i := p 1. Then, d 2 k =(2⇡)2k2 = , dx2 k k k and we observe that 2 2 k = k =(2⇡) k . In the complex case, the orthogonality property is expressed using the complex L2 inner-product. For the present example,

1 2⇡ikx 2⇡i`x 1 if k = ` (k , `)L2(0,1) = e e dx = . 0 0 if k = ` Z ( 6

Theorem 12.4.6. The set B := k k Z is an orthonormal basis for 2 { | 2 } L2((0, 1); C), and if f L ((0, 1); C), 2 1 ˆ 2⇡ikx fk := (f,k )L2(0,1) = f (x)e dx, k Z, 2 Z0 and N PNf := fˆk k , k= N X then

f P f 2 0 k N kL (0,1) ! 12.4. THE SPECTRAL GALERKIN METHOD 185 as N . In particular, if f Hr ((0, 1); C), then, for some constant C>0, !1 2 p 1 f PNf Hs C r s f Hr , k k  N | | for any s,r N0, s r.Iff C1((0, 1); C),then,foranys N0, 2  2 p 2 1 f P f s C , (12.4.2) k N kH  Nm for any m N. 2 Proof. For an in-depth discussion, see for example the book by Canuto, et al. [7]. The first part is a bedrock result of Fourier Analysis. Specifically, for any f L2((0, 1); C), 2 N f = lim fˆk k , N !1 k= N X with convergence in the (complex) L2 norm: for any g L2((0, 1); C), 2 1 1 2 g L2(0,1) := (g,g)L2(0,1) = g(x) g(x)dx = g(x) dx. k k s 0 s 0 | | q Z Z To give some idea of the second part, we prove it for a special case. For any r N, since the eigenvalues are strictly positive, 2 1 f PNf = fˆ k k + fˆk k k=N+1 X 1 r/2 r/2 ˆ r/2 r/2 ˆ = k k f k k + k k fk k . k=XN+1 ⇣ ⇣ ⌘ ⇣ ⌘ ⌘ Now, we use Parseval’s identity: for any g L2((0, 1); C) 2 N N 2 2 g L2(0,1) = lim gˆk gˆk = lim gˆk . k k N N | | !1 k= N !1 k= N X X r/2 r/2 In this case, since k = k is decreasing as k increases, we have 1 2 1 2 2 r/2 r/2 ˆ r/2 r/2 ˆ f PNf L2(0,1) = k k f k + k k fk k k k=N+1 ⇣ ⌘ k=N+1 ⇣ ⌘ X X 1 1 (N+1) r ˆ 2 r ˆ 2 k k f k + k fk  k=N+1 k=N+1 ! X X (N+1) 2 f r ,  k | |H (0,1) 186 CHAPTER 12. SPECTRAL METHODS where, in the last step, we have used the fact that

N 2 r ˆ 2 f Hr (0,1) = lim k fk , | | N !1 k= N X which follows from integration-by-parts and Parseval’s identity. We have proven,

(N+1)/2 1 f P f 2 f r = f r . k N kL (0,1)  k | |H (0,1) 2⇡(N + 1)| |H (0,1)

The more general cases can be proven in a similar fashion.

Remark 12.4.7. The convergence property expressed in estimate (12.4.2) of Theorem 12.4.6 is known as spectral convergence.

Definition 12.4.8. Suppose that f L2((0, 1); C) is given and N N. Define 2 0 2

N S˚N = v = ↵k k ↵k C, ↵0 =0 . ( 2 ) k= N X The spectral Galerkin approximation of the periodic Poisson problem is a function u S˚ that satisfies N 2 N

a(u ,v)=(f,v) 2 , for all v S˚ . N L (0,1) 2 N

Theorem 12.4.9. Suppose that f L2((0, 1); C) is given and N N. There 2 0 2 is a unique spectral Galerkin approximation u S˚ . In particular, N 2 N

N fˆ u = uˆ , uˆ = k ,k= 1, 2, , N. (12.4.3) N k k k (2⇡)2k2 ± ± ··· ± k= N kX=0 6

Furthermore, if f is real-valued, then uN is real-valued. 12.4. THE SPECTRAL GALERKIN METHOD 187

Proof. For all ` = 1, 2, ,N, ± ± ···

1 N d d` fˆ` =(f,`) 2 = a(uN, `)= 0 uˆk k 1 dx L dx dx Z0 k= N B kX=0 C B 6 C N @ A 1 d d = uˆ k ` dx k dx dx k= N Z0 kX=0 6 N 1 2 2⇡ikx 2⇡i`x = uˆk (2⇡) k` e e dx k= N Z0 kX=0 6 2 2 =ˆu`(2⇡) ` , using orthonormality in the last step. The uniqueness of the solution is left as an easy exercise. Finally, f is real-valued i↵ its Fourier coecients satisfy fˆk = fˆ k , for all k Z. Clearly, uN inherits this property. 2

r 1 r+1 Theorem 12.4.10. Suppose that r,N N, f H (0, 1), u H (0, 1) 2 2 p 2 p is the weak solution to the periodic Poisson problem (12.4.1),anduN is its spectral Galerkin approximation (12.4.3). Then

C u u 1 u r+1 , (12.4.4) k NkH  ↵ Nr | |H for some C>0.

Proof. One can easily establish a version of Cea’s Lemma for the present peri- odic Poisson problem: in the energy norm, we have the optimal

u uN E = min u v E , k k v S˚ k k 2 N and, in the H1 norm, we have the quasi-optimal approximation property u uN H1 min u v H1 . k k  ↵ v S˚ k k 2 N The combination of the last estimate with the approximation result in Theo- rem 12.4.6 gives the desired estimate. 188 CHAPTER 12. SPECTRAL METHODS

12.5 The Pseudo-Spectral Method

Definition 12.5.1. Suppose m N. For all u m,p and all k Z, define 2 2 V 2 m 1 2⇡ikp` uˆk := h u`e , X`=0 where h = 1 , p = j h. The grid function uˆ is called the Discrete Fourier n j · 2 V Transform (DFT) of u, and we write uˆ = [u]. F Proposition 12.5.2. For all u , uˆ , that is, the DFT is a periodic 2 Vm,p 2 Vm,p grid function.

Proof. This is a simple exercise.

1 Proposition 12.5.3. Suppose that m N, h = , pj = jh. The following 2 m identity holds: m 1 2⇡ikp` h e = k,nm, (12.5.1) X`=0 for any n Z. 2 Proof. Suppose that k = nm. Then 6 m 1 m 1 e2⇡ikhh e2⇡ikp` = h e2⇡ik(p`+h) X`=0 X`=0 m 1 = h e2⇡ik(`+1)h `=0 Xm = h e2⇡ikp` X`=1 m 1 = h e2⇡ikp` =: S, X`=0 where the last equality follows from the periodicity of e2⇡ikp` with respect to `. Thus, e2⇡ikhS = S e2⇡ikh 1 S =0. , This implies that S = 0, since, provided k = nm, 6 e2⇡ikh =1. 6 12.5. THE PSEUDO-SPECTRAL METHOD 189

On the other hand, when k = nm, n Z, 2 2⇡ikp 2⇡im np 2⇡n` e ` = e · ` = e =1.

Thus, m 1 m 1 h e2⇡ikp` = h 1=h m =1. · X`=0 X`=0

Proposition 12.5.4. Let m N. The DFT mapping [u]=ˆu is a linear, 2 F one-to-one, onto mapping from to . Therefore, it has an inverse. Vm,p Vm,p Proof. Clearly, is linear and maps into . To show that the mapping is F Vm,p one-to-one, suppose that u,w have the same DFT, that is, for every 2 Vm,p k Z, 2 m m 2⇡ikp` 2⇡ikp` h u`e = h w`e . X`=0 X`=0 Thus, for all k Z, 2 m 2⇡ikp h (u w )e ` =0. ` ` X`=0 Then, for any j Z, 2 m 1 m 2⇡ijp 2⇡ikp 0= e k h (u w )e ` ` ` kX=0 X`=0 m 1 m 1 2⇡ih(jk `k) = (u w )h e ` ` X`=0 kX=0 m 1 m 1 2⇡i(j `)p = (u w )h e k ` ` X`=0 kX=0 m 1 = (u` w`)j `,nm X`=0 m 1 = (u` w`)j nm,` X`=0 = uj nm wj nm = u w , j j 190 CHAPTER 12. SPECTRAL METHODS where we have used (12.5.1). Since j Z is arbitrary, u = w, which proves 2 that is one-to-one. F To show that is onto, suppose that v is arbitrary. We want to F 2 Vm,p find some w such thatw ˆ = [w]=v. Define 2 Vm,p F m 1 2⇡ikp` wk = v`e . X`=0 Then, m 1 2⇡ijp wˆ = [w] = h w e k j F j k kX=0 m 1 m 1 2⇡ikp` 2⇡ijpk = h v`e e ! kX=0 X`=0 m 1 m 1 2⇡ih(k` jk) = h v`e kX=0 X`=0 m 1 m 1 2⇡i(` j)pk = v`h e X`=0 kX=0 m 1 = v`` j,nm X`=0 m 1 = v``,j+nm X`=0 = vj+nm

= vj . We have again used the identity (12.5.1). The proof is complete.

Definition 12.5.5. The Inverse Discrete Fourier Transform (IDFT) is de- fined via m 1 1 2⇡ikp [w] := w e ` , F k ` `=0 ⇥ ⇤ X for all w . 2 Vm,p 1 Corollary 12.5.6. Let m N. The IDFT mapping is a linear, one-to-one, 2 F onto mapping from to , and it is the inverse of the DFT mapping Vm,p Vm,p : F 1 1 w = [w] = [ [w]] , F F F F ⇥ ⇤ 12.5. THE PSEUDO-SPECTRAL METHOD 191 for all w . 2 Vm,p Theorem 12.5.7 (Discrete Plancherel Identity). Suppose that w and 2 Vm,p wˆ is its DFT. Then 2 Vm,p m 1 m 1 h wk wk = wˆk wˆk . (12.5.2) kX=0 kX=0 Proof. The proof is an exercise.

Example 12.5.8. Suppose that Z is an index set of finite cardinality and I ⇢ 2⇡ikx u = ↵k e . k X2I Then du = ↵ (2⇡ik)e2⇡ikx, dx k k X2I and d 2u = ↵ (2⇡k)2e2⇡ikx. dx2 k k X2I In other words, derivatives modify the Fourier coecients of the series repre- sentation in simple ways.

Definition 12.5.9. Suppose that m N, u m,p,anduˆ m,p is its DFT. 2 2 V 2 V If m =2K +1, K N, we define the first and second order pseudo-spectral 2 derivatives, respectively, of u via

K u = uˆ (2⇡ik)e2⇡ijpk , (12.5.3) Dh j k k= K X and K 2u = uˆ (2⇡k)2e2⇡ijpk . (12.5.4) Dh j k k= K X If m =2K, K N, the pseudo spectral derivatives are defined via 2 K u = uˆ ! (2⇡ik)e2⇡ijpk , (12.5.5) Dh j k k k= K X 192 CHAPTER 12. SPECTRAL METHODS and K 2u = ! uˆ (2⇡k)2e2⇡ijpk , (12.5.6) Dh j k k k= K X where the weight grid function is defined as

1 2 if k = K !k = ± . 1 if k = K ( 6 ± Remark 12.5.10. Suppose u ,anduˆ is its DFT. Regarding the 2 Vm,p 2 Vm,p definitions above, observe that if m is odd, m =2K +1, K N,then 2 m 1 K 2⇡ijpk 2⇡ijpk uj = uˆk e = uˆk e , k=0 k= K X X and if m is even, m =2K, K N,then 2 m 1 K 2⇡ijpk 2⇡ijpk uj = uˆk e = !k uˆk e . k=0 k= K X X In other words, we do not change anything by rewriting our summations. How- ever, note that, when m =2K +1, K N, 2 m 1 K uˆ (2⇡ik)e2⇡ijpk = uˆ (2⇡ik)e2⇡ijpk , k 6 k k=0 k= K X X and when m =2K, K N, 2 m 1 K uˆ (2⇡ik)e2⇡ijpk = ! uˆ (2⇡ik)e2⇡ijpk . k 6 k k k=0 k= K X X The problem is that the grid functions ↵ := 2⇡ik,and := (2⇡k)2 k k are not periodic grid functions, though they are odd and even grid functions, respectively. The pseudo spectral derivatives that we introduced in Definition 12.5.9 are chosen to be symmetric sums about k =0.

Proposition 12.5.11. Suppose that m N, u m,p,anduˆ m,p is its 2 2 V 2 V DFT. Then the pseudo spectral derivatives are periodic grid functions, that is u, 2u . Dh Dh 2 Vm,p Proof. The proof is an exercise. 12.5. THE PSEUDO-SPECTRAL METHOD 193

Definition 12.5.12. Let m N, and suppose that f ˚m,p is given, where 2 2 V ˚ := v (v,1) 2 =0 . Vm,p { 2 Vm,p | ` } Consider the following problem: find w ˚ such that 2 Vm,p 2w = f. (12.5.7) Dh The solution w, if it exists, is called the pseudo-spectral approximation for the periodic Poisson problem.

Theorem 12.5.13. Let m N, and suppose that f ˚m,p is given. There 2 2 V exists a unique pseudo-spectral approximation for the periodic Poisson problem w ˚ satisfying (12.5.7). In particular, if m is odd, that is, m =2K +1, 2 Vm,p then K fˆk w = wˆ e2⇡ijpk , wˆ = ,k= 1, , K, j k k (2⇡k)2 ± ··· ± k= K X with a similar result for m even. ˆ Proof. Suppose thatw ˆ and f are the DFTs of w and f . Since (f,1)`2 = 0, fˆ = 0. Suppose that m is odd. We then have 2w = f i↵ 0 Dh K K wˆ (2⇡k)2e2⇡ijpk = fˆ e2⇡ijpk , k k k= K k= K X X i↵ fˆ wˆ = k ,k= 1, , K. k (2⇡k)2 ± ··· ± The case for which m is even is similar.

Example 12.5.14. Here we describe a practical implementation of the pseudo- spectral approximation method. Suppose that f C˚0(0, 1) is given. Define 2 p f˜k := f (pk ),kZ. 2 Then, set ˜ Phfk := fk (f,1)`2 ,kZ. 2 Observe that P f ˚ ,butf˜ ˚ , in general. The operator P is called h 2 Vm,p 62 Vm,p h the mean-zero projection.Setfˆ = [P f ], and observe fˆ =0, as desired. F h 0 Assuming m is odd, the DFT of the solution is given by fˆ wˆ = k ,k= 1, , K. k (2⇡k)2 ± ··· ± 194 CHAPTER 12. SPECTRAL METHODS

Set wˆ0 =0. Finally, we construct the solution via the IDFT,

K 2⇡ijpk w = wˆk e . k= K X As for the spectral Galerkin method, we can prove spectral convergence properties for this approximation. We omit a discussion of this topic for the sake of brevity. The interested reader can consult [7]. Bibliography

[1] R.A. Adams and J.J.F. Fournier. Sobolev Spaces. Academic Press, New York, NY, second edition, 2003.

[2] K. Atkinson and W. Han. Theoretical Numerical Analysis. Texts in 39. Springer-Verlag, New York, NY, third edition, 2009.

[3] R.G. Bartle and D.R. Sherbert. Introduction to Real Analysis. Wiley, Hoboken, NJ, fourth edition, 2011.

[4] D. Braess. Finite Elements: Theory, Fast Solvers, and Applications in Solid Mechanics. Cambridge University Press, Cambridge, United King- dom, third edition, 2007.

[5] S.C. Brenner and L.R. Scott. The Mathematical Theory of Finite Element Methods. Texts in Applied Mathematics 15. Springer-Verlag, New York, NY, third edition, 2007.

[6] J.C. Butcher. Numerical Methods for Ordinary Di↵erential Equations. Wiley, Chichester, UK, second edition, 2008.

[7] Claudio Canuto, M Yousu↵ Hussaini, Alfio Quarteroni, and Thomas A Zang. Spectral Methods: Fundamentals in Single Domains. Springer, Berlin, Germany, 2007.

[8] E.A. Coddington and N. Levinson. Theory of Ordinary Di↵erential Equa- tions. McGraw-Hill, New York, NY, 1955.

[9] L.C. Evans. Partial Di↵erential Equations. American Mathematical So- ciety, Providence, RI, 2010.

[10] W. Gautschi. Numerical Analysis. Birkhauser, New York, NY, second edition, 2012.

219 220 BIBLIOGRAPHY

[11] A. Iserles. A First Course in the Numerical Analysis of Di↵erential Equa- tions. Cambridge, New York, NY, second edition, 2009.

[12] F. John. Partial Di↵erential Equations. Applied Mathematical Sciences. Springer-Verlag, New York, NY, fourth edition, 1981.

[13] Rainer Kress. Numerical Analysis. Springer Verlag, New York, NY, 1998.

[14] W. Rudin. Principals of Mathematical Analysis. McGraw-Hill, New York, NY, third edition, 1976.

[15] L. Ridgway Scott. Numerical Analysis. Princeton University Press, Prince- ton, NJ, 2011.

[16] J. Stoer and R. Bulirsch. Introduction to Numerical Analysis. Springer Verlag, New York, NY, third edition, 2002.

[17] H. Weinberger. A First Course in Partial Di↵erential Equations. Xerox, Lexington, MA, 1965.