Question: MATLAB CODE Problem 3 (40 pts) Solve Ax = b for AeRnxn when n = 10, 100, 1000, with the help of the Jacobi and

MATLAB CODE Problem 3 (40 pts) Solve Ax = b for AeRnxn when n = 10, 100, 1000, with the help of the Jacobi and Gauss-Seidel algorithms in Matlab or Python for each of the two cases: A and b generated randomly such that A is (a) diagonally-dominant and (b) A is symmetric positive-definite. For each of the 12 cases above: (i) Plot the eigenvalues of the corresponding system matrices and comment on stability. (ii) Plot the state vector for randomly generated initial conditions. (iii) Plot the residual error. (iv) For the Jacobi algorithm with a diagonally-dominant matrix of size n = 103, implement a relaxation with a = 0.1,0.5, 0.9 and compare the convergence rates (on the same figure). A relaxation of a discrete time dynamics is given by Xk+1 (1 a)xk + a(Axk + Bu), for some a (0,1). Comment on the effect of a on the convergence speed of the algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
