ES 105 Homework: January 16, 2009

Below you will find the discussion and relevant materials for the ES 105 homework assignment due on January 16, 2009.

Discussion

 

Questions

a) Verify that the analytic solution is:

a1) Sketch the solution map of U.

b) Create a centered, second order correct FD molecule for an interior node, each of the four boundaries, and each corner. Make and use a clear, concise map of node locations in the process.

c) Will the algebraic system be diagonally dominant?

This system will be diagonally dominant. Since there is at least one inequality in which the main diagonal is greater than the off diagonals, this system will be irreducibly diagonally dominant. See the attached documents for how this was calculated from the FD molecules.

d) With N interior nodes in the q-direction and N in the r-direction, solve using direct LU decomposition. Compute and plot U and the current vector i/s = -invD. Use N=5 and N=10 here (i.e., coarse reslution). (Use subroutine SOLVE; write your FD answers to an ASCII file; use MATLAB graphics to be distributed to do the plotting.) Do your coarse solutions agree with your sketch?

Yes, my coarse solutions agree with my sketch.

d1) The matrices generated in (d): are they in fact diagonally dominant, and does that agree with your answer to (c)?

Yes, my matrices are diagonally dominant in my numerical results.

CALCULATION FOR N = 5 TO DETERMINE DIAGONAL DOMINANCE

RESULTS = |MAIN DIAGONAL| - SUM( |OFFDIAGONALS| )


0.370860839843750E+03
0.102731567382812E+03
0.473036804199219E+02
0.270899200439453E+02
0.585255584716797E+02
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.409990692138672E+02
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.409990692138672E+02
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.409990692138672E+02
-0.610351562500000E-04
0.000000000000000E+00
0.000000000000000E+00
0.000000000000000E+00
0.409990539550781E+02

 

e) Compare with the analytic solution by plotting an error map vs (r,q).

Please see the plots below.

f) Compute the RMS error for a range of N, coarse to fine. Do not be skimpy on N here. Plot error versus h. Do the results agree with theory? Explain.

NODES
H
RMS
10
0.0857142806
0.0037245993
25
0.0352941155
0.0012180065
50
0.0178217813
0.0002268898
75
0.0119205294
0.0000276098
100
0.0089552235
0.0001941619
125
0.0071713147
0.0005180390

 

We see a slope of 2 for our errors as the number of nodes increases. This results agree with theory, since we expect order two accurcy with a centered difference approximation.

g) Plot the converged (high N) numerical solution (current and potential). Does it make sense? Does it agree with your sketch? Our converged plot is at N=100 nodes. We see that it does agree with our theoretical sketch.

 

 

Materials

Source Code

 

 

Plots

Analytic Solution @ N = 100

 

 

U Plot @ N = 5

Error Plot @ N = 5

U Plot @ N = 10

Error Plot @ N = 10

U Plot @ N = 50

 

Error Plot @ N = 50

 

CONVERGED SOLUTION

U Plot @ N = 100

 

Error Plot @ N = 100

 

RMSE vs Number of Nodes

 

U Plot with 3*theta @ N = 10

 

 

U Plot with 3*theta @ N = 50

Discussions: Thanks to Neil E., Matt M., Grace, and Amir in working out some details of this assignment.

Error Plot with 3*theta @ N = 50