Docsity

8 Problems on Advanced Scientific Computing I - Assignment 3 | CS 6210, Assignments of Computer Science

Toggle sidebar
bg1
School of Computing
CS 6210
Homework Assignment Three
Fall 2008
Implement in double precision the Gauss-Seidel, SOR, Chebyshev and CG methods for coding the two
dimensional Poisson’s Problem with known solution to uxx(x, y) + uyy(x, y ) = f(x, y) on the unit square
[0,1]2equal to
u(x, y) = 128 ·x(1 −x)y(1 −y).
First, determine function f(x, y) that corresponds to the above solution. Next, test your code for
n= 10,100,1000 (or possibly higher if you dare!). Then compare computed solution euto the exact
solution u. You should terminate when uand eusatisfy ||eu−u||∞≤ǫfor small ǫ > 0 appropriately
chosen, as discussed in class.
We recall that optimal ωfor SOR equals 2
1 + sin π
n+1
.
Successful submissions will
1. (15 pts) Provide careful derivation of forcing function f.
2. (10 pts) Schematically display matrix Aand column vectors uand ffrom Au =−h2f. This may be
hand-written, hand-typed, or program-generated. We are seeking a creative, effective communication to
the reader what linear system is being solved!
3. (20 pts) Convince the reader that 2. has been correctly implemented as code.
4. (10 pts) Based on Professor Sikorski’s lecture presentations, state all programming strategies and
storage imperatives relevant to this problem, and make clear to the reader that they have been correctly
implemented.
5. (10 pts) Make known the epsilon value(s) used and why chosen.
6. (15 pts) Display in a single table for each of the above algorithms values of:
max
i,j=1,...,n |eu(xi, yj)−u(xi, yj)|
where xi=i·h,yi=j·h,h= 1/(n+ 1).
7. (15 pts) Fill in as many as positions as possible in the following table including in each case the
associated value of ǫ. CPU times (CPU-T) should be in seconds. Numbers in parentheses refer to values
for n.
Method #-Iter (10) CPU-T (10) #-Iter (100) CPU-T (100) #-Iter (1000) CPU-T (1000)
G-S
SOR
Chebyshev
CG
8. (15 pts) Based on formulas presented in class involving eigenvalues and condition numbers, compare
and justify expected and actual differences in CPU times and #-iterations among the various algorithms.

Partial preview of the text

Download 8 Problems on Advanced Scientific Computing I - Assignment 3 | CS 6210 and more Assignments Computer Science in PDF only on Docsity!

School of Computing

CS 6210

Homework Assignment Three

Fall 2008

Implement in double precision the Gauss-Seidel, SOR, Chebyshev and CG methods for coding the two dimensional Poisson’s Problem with known solution to uxx(x, y) + uyy(x, y) = f (x, y) on the unit square [0, 1]^2 equal to u(x, y) = 128 · x(1 − x)y(1 − y).

First, determine function f (x, y) that corresponds to the above solution. Next, test your code for n = 10, 100 , 1000 (or possibly higher if you dare!). Then compare computed solution ˜u to the exact solution u. You should terminate when u and ˜u satisfy ||u˜ − u||∞ ≤ ǫ for small ǫ > 0 appropriately chosen, as discussed in class.

We recall that optimal ω for SOR equals

1 + sin (^) n+1π

Successful submissions will

  1. (15 pts) Provide careful derivation of forcing function f.
  2. (10 pts) Schematically display matrix A and column vectors u and f from Au = −h^2 f. This may be hand-written, hand-typed, or program-generated. We are seeking a creative, effective communication to the reader what linear system is being solved!
  3. (20 pts) Convince the reader that 2. has been correctly implemented as code.
  4. (10 pts) Based on Professor Sikorski’s lecture presentations, state all programming strategies and storage imperatives relevant to this problem, and make clear to the reader that they have been correctly implemented.
  5. (10 pts) Make known the epsilon value(s) used and why chosen.
  6. (15 pts) Display in a single table for each of the above algorithms values of:

max i,j=1,...,n |˜u(xi, yj ) − u(xi, yj )|

where xi = i · h, yi = j · h, h = 1/(n + 1).

  1. (15 pts) Fill in as many as positions as possible in the following table including in each case the associated value of ǫ. CPU times (CPU-T) should be in seconds. Numbers in parentheses refer to values for n.

Method #-Iter (10) CPU-T (10) #-Iter (100) CPU-T (100) #-Iter (1000) CPU-T (1000) G-S SOR Chebyshev CG

  1. (15 pts) Based on formulas presented in class involving eigenvalues and condition numbers, compare and justify expected and actual differences in CPU times and #-iterations among the various algorithms.