Spectral Methods, Lecture Notes - Advanced Calculus, Study notes of Calculus

Spectral Method, Discussion, Matlab Code, Results

Typology: Study notes

2010/2011

Uploaded on 10/05/2011

deville
deville 🇺🇸

4.7

(23)

390 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Math 128A Lab 6: Spectral Method
Adrian Down
March 16, 2006
Part 1
0 0.5 1 1.5 2 2.5 3
0
0.5
1
1.5 Solution to d2y − (cos x)y = −1, n = 127
1
pf3
pf4
pf5

Partial preview of the text

Download Spectral Methods, Lecture Notes - Advanced Calculus and more Study notes Calculus in PDF only on Docsity!

Math 128A Lab 6: Spectral Method

Adrian Down

March 16, 2006

Part 1

0 0.5 1 1.5 2 2.5 3

0

1

Solution to d^2 y − (cos x)y = −1, n = 127

Part 2

Discussion

This problem was examined in problem set 7, problem 4, part b. There, I

assumed a solution as a sum of sin junctions,

N ∑

k=

uk sin kx

I found that the equations for the coefficients in the optimal expansion could

be written as a tri-diagonal matrix. The elements of the matrix on the right

are,

π

k

δk odd =

8 π

1 k

k odd

0 k even

Assuming for the sake of representation that N is even,

         − 2 · 1

2

2 1

1 − 2 · (N − 1)

2 1

1 − 2 · N

2

u 1

u 2

. . .

. . .

uN − 1

uN

8 π 0 8 π

1 3 . . . 8 π

1 N − 1

0

Results

The resulting spectral approximations for several values of N are shown in

figure 1.

Part 3

Discussion

I find that the spectral solution is much more accurate than the numerical

approximation taking N = 8 terms in the spectral summation compared to

n = 8 interior mesh points. Because both methods rely on solving a tri-

diagonal system, the spectral method provides much greater accuracy with

similar computation time for small values of N.

0 0.5 1 1.5 2 2.5 3

0

1

Comparison of numerical approximation and spectral methods for solving d

2 y − y*cos(x)=−

Node approx. n= Node approx. n= N = 1 N = 2 N = 4 N = 8

Figure 2:

0 0.5 1 1.5 2 2.5 3

0

1

Comparison of n=8 node approximation with n=8 spectral approximation

Node Spectral

Figure 3: