In this problem, you are going to investigate the work required to solve a matrix system using

Question:

In this problem, you are going to investigate the work required to solve a matrix system using Gauss–Seidel. The matrix system is defined by the entriesi+j (i #j), ij aij = 8+ 0.2i, (i=j), aij ||

and the forcing vector entries areb = in. bi

Your program should first check to see if the matrix is diagonally dominant and output a value of 1 (if dominant) or 0 (if not dominant). Your program should then implement the Gauss–Seidel scheme with an initial guess x(0) = 0. The criterion for convergence for iteration k is ||Ax(k) − b|| −8. You can use the norm command in MATLAB for this calculation. Add a conditional statement into your iterative scheme that will terminate the loop if you reach 100 iterations. The output of the loop should be the number of iterations and the value of the norm.

Your program should perform this calculation for matrix sizes n = 5, 10, . . . , 150. It should make a plot of the number of iterations k versus the size of the matrix n.

On the plot, also include a line k = n to indicate the scaling for the work required by Gauss elimination. Set the x-scale to be [0,150] and the y-scale to be [0,100]. If all of your values of k

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: