Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE python to solve the Problem In this problem, we will continue to explore the successive over-relaxation (SOR) method from the coding homework. First, here
USE python to solve the Problem
In this problem, we will continue to explore the successive over-relaxation (SOR) method from the coding homework. First, here is a reminder of the definition of P and T for the SOR method: Any n x n matrix A can be composed into a diagonal, upper and lower part: 0 0 au 0 022 0 D : : 0 : 0 ann 70 212 ain 0 0 0 0 0 aan 0 0 021 0 0 U = and L= an-1, 0 0 0 0 anlan2.. an.n-10 0 so that A=D+U+L. You can easily find these matrices in MATLAB/python with the commands diag, triu and tril. (These functions are in the numpy package in python.) These matrices are useful for devising different matrix splitting methods. For instance, in the Jacobi method we let A= P+T, where P=D and T = U+L. In the Gauss-Seidel method we let P=D+L and T = U. In the SOR method, we choose w-1 P= D+L and T = D+U, (1) where w is a constant between 1 and 2. (Notice that if w= 1 then this is exactly the same as Gauss-Seidel.) 2 The coding homework asked you to use w = 1.5 to solve the system A1140 = p. You should have found that SOR (with w = 1.5) was slightly faster than Gauss- Seidel. In this problem, we will try to find an optimal value of w and see how that impacts the speed of our splitting method. (a) For every value of w between w = 1 and w = 1.999 in increments of 0.001, calculate M = -P-IT using the corresponding P and T from equation (1) and then find the absolute value of the largest eigenvalue 11 of this matrix M. Make a plot of the absolute value of A1 versus w. (That is, w should be on the 2-axis and the absolute value of the largest eigenvalue of M should be on the y-axis.) In this problem, we will continue to explore the successive over-relaxation (SOR) method from the coding homework. First, here is a reminder of the definition of P and T for the SOR method: Any n x n matrix A can be composed into a diagonal, upper and lower part: 0 0 au 0 022 0 D : : 0 : 0 ann 70 212 ain 0 0 0 0 0 aan 0 0 021 0 0 U = and L= an-1, 0 0 0 0 anlan2.. an.n-10 0 so that A=D+U+L. You can easily find these matrices in MATLAB/python with the commands diag, triu and tril. (These functions are in the numpy package in python.) These matrices are useful for devising different matrix splitting methods. For instance, in the Jacobi method we let A= P+T, where P=D and T = U+L. In the Gauss-Seidel method we let P=D+L and T = U. In the SOR method, we choose w-1 P= D+L and T = D+U, (1) where w is a constant between 1 and 2. (Notice that if w= 1 then this is exactly the same as Gauss-Seidel.) 2 The coding homework asked you to use w = 1.5 to solve the system A1140 = p. You should have found that SOR (with w = 1.5) was slightly faster than Gauss- Seidel. In this problem, we will try to find an optimal value of w and see how that impacts the speed of our splitting method. (a) For every value of w between w = 1 and w = 1.999 in increments of 0.001, calculate M = -P-IT using the corresponding P and T from equation (1) and then find the absolute value of the largest eigenvalue 11 of this matrix M. Make a plot of the absolute value of A1 versus w. (That is, w should be on the 2-axis and the absolute value of the largest eigenvalue of M should be on the y-axis.)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started