Question: write Code in MATLAB for this step by step for all parts and comment the steps Compare Gauss-Seidel & Jacobi : (a) Modify the MATLAB

 write Code in MATLAB for this step by step for all

parts and comment the steps Compare Gauss-Seidel \& Jacobi : (a) Modify

write Code in MATLAB for this step by step for all parts and comment the steps

Compare Gauss-Seidel \& Jacobi : (a) Modify the MATLAB code given in lecture to create two matlab functions named gauss_seidel and jacobi which implement the algorithms discussed in class. Your functions should take the parameters (A,b, tol,max_it), where tol, stop condition, residual measured by inf norm max_it, maximum number of iterations to attempt Your functions should return: x, the solution vector itr, the total number of iterations normVal, a vector with one value per iteration of the norm of the error Remember that if you use a MLX file, the functions must be placed at the end of the file. (b) Solve the following system of equations using both methods to an accuracy of 1.0e8, print the final x and plot the residual of both algorithms until convergence, use dashed limgs to plot the Gauss-Seidel and a solid line to plot Jacobi. A=123100000312310000131231000013123100001312310000131231000013123000001312,b=11111111 (c) What are the main differences between the Gauss-Seidel and Jacobi algorithms? (d) What is a sparse matrix and why do we use Gauss-Seidel and Jacobi on sparse matrices

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!