Documente Academic
Documente Profesional
Documente Cultură
2x Periodic boundary condition (L = 2*) REQUIRED: A computer program to approximate first derivative of function at 8, 16, 32, 64, 128, and 256 point meshes Plot 1: Approximate first derivative values versus x for three coarsest meshes (M=8, 16, 32) and exact first derivative Plot 2: Actual error of first derivative values versus x for three coarsest meshes Plot 3: Actual error of first derivative values versus x for three finest meshes (M=64, 128, 256) Description of errors for each plot Explanation of shape of errors for three coarsest meshes and three finest meshes. Table of predicted values and errors at x = /8 as a function of x. Comparison with answers from problem 2.5 Plot 4: L1 norm of grid error versus x on a log-log plot. Observations about the increased accuracy.
j
u j +1 + u j 1
SOLUTION: a) The problem is to write the 3-point central difference scheme for the given periodic function and see how the grid refinements affect the approximated derivative of the function. b) Attached c) Attached d) Attached e) Attached f) The coarse grids resolutions are not dense enough to capture the wavelength of our function. According Nyquist sampling theorem 2dx is the shortest wavelength that may be captured. So the error oscillation for coarse grids looks very random compared to the dense grids. g) Table of predicted values and errors at x=pi/8
Dx M= M= M= 16 dx = 3.92699082e-001 32 dx = 1.96349541e-001 64 dx = 9.81747704e-002 Exact du -3.4142 -3.4142 -3.4142 -3.4142 -3.4142 Approximate du Absolute error
h) Attached
4 du/dx
-2
-4 0
3 x
error vs x for M=8,16,32 10 error for M=8 error for M=16 error for M=32
error 0 -5 0
3 x
u for M=256
4 du/dx
-2
-4 0
3 x
error vs x for M=64,128,256 0.8 error for M=64 error for M=128 error for M=256
0.6
0.4
3 x
10
10
10
-1
10
-2
10
-2
10 delta X
-1
10
(3.2) GIVEN:
2 u j +1 + 3 u j 6 u j 1 + u j 2 6x
REQUIRED: Comparison of coefficients with problem 2.3 A computer program to approximate first derivative of function at 8, 16, 32, 64, 128, and 256 point meshes Plot 1: Approximate first derivative values versus x for three coarsest meshes (M=8, 16, 32) and exact first derivative Plot 2: Actual error of first derivative values versus x for three coarsest meshes Plot 3: Actual error of first derivative values versus x for three finest meshes (M=64, 128, 256) Description of errors for each plot Explanation of shape of errors for three coarsest meshes and three finest meshes. Table of predicted values and errors at x = /8 as a function of x. Comparison with answers from problem 2.5 Plot 4: L1 norm of grid error versus x on a log-log plot. Observations about the increased accuracy.
SOLUTION: a) They are the same coefficients. b) Attached c) Attached d) Attached e) Table of predicted values and errors at x=pi/8
M= M= M= M= 8 dx = 7.85398163e-001 16 dx = 3.92699082e-001 32 dx = 1.96349541e-001 64 dx = 9.81747704e-002 0 -3.4142 -3.4142 -3.4142 -3.4142 -3.4142 0 0
f) Attached
u for M=32
4 du/dx
-2
-4 0
3 x
error vs x for M=8,16,32 10 8 6 4 error 2 0 -2 -4 -6 error for M=8 error for M=16 error for M=32
3 x
4 du/dx
-2
-4 0
3 x
0.2
0.1
0 error -0.1 -0.2 error for M=64 error for M=128 error for M=256 0 1 2 3 x L-norm of error vector vs delta X 4 5 6 7 -0.3 -0.4 10
1
10
-1
10
-2
10
-3
10
-2
10 delta X
-1
10
REQUIRED: Description of Sherman-Morrison algorithm A computer program to approximate first derivative of function at 8, 16, 32, 64, 128, and 256 point meshes Plot 1: Approximate first derivative values versus x for three coarsest meshes (M=8, 16, 32) and exact first derivative Plot 2: Actual error of first derivative values versus x for three coarsest meshes Plot 3: Actual error of first derivative values versus x for three finest meshes (M=64, 128, 256) Description of errors for each plot Explanation of shape of errors for three coarsest meshes and three finest meshes. Table of predicted values and errors at x = /8 as a function of x. Comparison with answers from problem 2.5 Plot 4: L1 norm of grid error versus x on a log-log plot. Observations about the increased accuracy. SOLUTION: a) The Sherman-Morrison Algorithm is a more efficient periodic tridiagonal solution solver. It breaks the problem into two linear combinations. b) Attached c) Attached d) Attached e) Attached f) For the higher order compact scheme the convergence to the exact solution is much faster.
A p p r o x im a te firs t d e r iv a tiv e s w ith m e s h s iz e = 8 , 1 6 , 3 2 10 E M M M xa ct =8 =1 6 =3 2
4 du 2 0 -2 -4 0
3 x
E rs rro 5
0 Error -5
E ac x t M8 = M 16 = 2 4 x Er r r os 6 8
-1 0
0 1 .0 5 0 1 .0 0 0 .0 5 Error 0 -0 0 .0 5 -0 1 .0 -0 1 .0 5 -0 2 .0 0 2 4 x 6
M6 =4 M1 8 =2 M2 6 =5
1 0
1 0
1 0
-1
1 0
-2
1 0
-3
1 0
-4
1 0
-5
1 0
-6
1 0
-2
1 0 d lta X e
-1
1 0