Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB SOR itteration Exercise 2: Successive Over-Relaxation The successive over

ID: 3600715 • Letter: M

Question

MATLAB SOR itteration

Exercise 2: Successive Over-Relaxation The successive over-relaxation method (SOR method) is another iterative method related to Jacobi and Gau Seidel iteration. Suppose we wish to solve the system Ax -b, and the matrix A is decomposed into diagona, upper, and lower parts: a12 aln .an-1,n a21 0"-. A-D+U+L The SOR method for a relaxation factor w is defined as Note that for = 1, this is equivalent to the Gaus-Seidel method. Consider the system A50·frorn Exercise 1 (a) For = 1.5, find the matrix form of#x+1 = Mk +c. Concatenate the matrix M and the vector c and save the resulting 50×51 rnatrix as A7.dat (b) If we define the error of iteration as ek = - , we can show that the error evolves like e Bek The error will decay if the eigenvalues of B are all less than one in absolute value. For -1 to -1.99 (in increments of 0.01), compute the eigenvalues of the matrix B. Find the largest eigenvalue (in absolute value) in each case, and save these absolute values in a 100 x 1 matrix in A8.dat. Find the choice of that yields the smallest maximal eigenvalue (in absolute value). Save this w and the absolute value of its rnaximal eigenvalue as a column vector (with as the first entry) in A9.dat (c) For the same set of w choices, compute 200 SOR iterations from an initial guess of a column of ones. Compute the residual A50P200- of the final iteration 200 for each case. Save the 2-norm of each residual as a 100 x 1 column vectori A10.dat. Does the smallest residual correspond to the same optimal was you found in part (b)? (d) Use SOR iteration with the optimal frorn part (b) to solve for given an initial guess of a column of ones. Continue to iterate the SOR method until every term in the vector is within 10 4 of the previous iteration (as in Exercise 1, part ) Save the final iteration as a column vector in A11.dat and save the total number of iterations as A12.dat. Which

Explanation / Answer

SOR Method: