Question: (40 points) Extra credit: Consider the n n pentadiagonal matrix 1 1/2 1/2 A=11/2 1/2 1/2 1/2 n Such a matrix can be constructed in

 (40 points) Extra credit: Consider the n n pentadiagonal matrix 1

(40 points) Extra credit: Consider the n n pentadiagonal matrix 1 1/2 1/2 A=11/2 1/2 1/2 1/2 n Such a matrix can be constructed in MATLAB by typing: % Construct the pentadiagonal matrix: one ones (n, 1); A 0.5 spdags([ 2*(1: n), one],-2:2,n,n); * one one one Let Xe be the vector of n ones and consider n 500. Set b = Axe, i.e., in order to find the rhs vector, fix tol 10-13, and consider an initial vector with n zeros. Then: Use your code developed in Question 6 (employing the Conjugate Gradient (CG) method without preconditioning) to solve the linear system Ax b Use the Preconditioned Conjugate Gradient (PCG) method implemented in my_pcg.m MATLAB file with the Jacobi and Gauss-Seidel precondition- ers in order to solve the same linear system (see, Remarks for details about the preconditioners in the respective cases) Compare/plot (in a semilog scale) the errors of these three runs against step number k. Attach your plot Remarks: As far as the preconditioners P are concerned, use the following: Jacobi preconditioner: P- D (D is the diagonal matrix extracted from A) . Gauss-Seidel preconditioner: P = (1+LD-1)(D+U) with L and U being the strictly lower and upper triangular matrices, again, extracted from A Also, the MATLAB function my pcg.m is provided! (40 points) Extra credit: Consider the n n pentadiagonal matrix 1 1/2 1/2 A=11/2 1/2 1/2 1/2 n Such a matrix can be constructed in MATLAB by typing: % Construct the pentadiagonal matrix: one ones (n, 1); A 0.5 spdags([ 2*(1: n), one],-2:2,n,n); * one one one Let Xe be the vector of n ones and consider n 500. Set b = Axe, i.e., in order to find the rhs vector, fix tol 10-13, and consider an initial vector with n zeros. Then: Use your code developed in Question 6 (employing the Conjugate Gradient (CG) method without preconditioning) to solve the linear system Ax b Use the Preconditioned Conjugate Gradient (PCG) method implemented in my_pcg.m MATLAB file with the Jacobi and Gauss-Seidel precondition- ers in order to solve the same linear system (see, Remarks for details about the preconditioners in the respective cases) Compare/plot (in a semilog scale) the errors of these three runs against step number k. Attach your plot Remarks: As far as the preconditioners P are concerned, use the following: Jacobi preconditioner: P- D (D is the diagonal matrix extracted from A) . Gauss-Seidel preconditioner: P = (1+LD-1)(D+U) with L and U being the strictly lower and upper triangular matrices, again, extracted from A Also, the MATLAB function my pcg.m is provided

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!