Question: This problem is asked to be calculated with a MatLab code Prob 1 (4 points) A system of linear equations is given: 4 1 14.5

 This problem is asked to be calculated with a MatLab codeProb 1 (4 points) A system of linear equations is given: 4

This problem is asked to be calculated with a MatLab code

Prob 1 (4 points) A system of linear equations is given: 4 1 14.5 / 8 1 0.5 2 3 3 2 0.5 0.5 X1 0.5 x2 1.5 / X3 4 / Eq. (1) 5 7.5 1 Symbolically, we write Eq. (1) as AT=, Eq.(2) which also gives the definitions of the matrix A and vectors and b. For this system, the exact solution is known to be Let us also recall a few relevant definitions. Given in as a numerical solution, the relative true error (RTE) is defined as llell RTE - Eq.(3) where e = xn-is is the vector of absolute error. The relative residual (RRS) is defined as Fill RRS = Eq.(4) 115 where r = AXn-b is the residual vector. The key conclusion of the discussion (in Lecture 11) on condition number, C, is summarized by the inequality, **(RRS) S (RTE) SC * (RRS). Eq. (5) C Conceptually, Eq. (5) provides the upper and lower bounds of RTE by computing RRS and C. Lastly, the condition number itself is defined by C = ||A||||A-1|| Eq.(6) In Eqs. (3)-(6), Euclidean norm is used for a vector and Euclidean 2-norm (or Frobenius norm) is used for a matrix. Let x; be the j-th element of a vector x with N elements, then Let Aij be the element of an NxN matrix A at the i-th row and j-th column, then 141 = (4) || A|| = >(Aij)2 . (a) Solve the system in Eq. (1) with two methods: (i) Jacobi iterative method, using (x1, x2, x3, x4) = (0,0,0,0) as the initial guess to perform 20 iterations. (ii) Gauss-Seidel iterative method, using (x2, X3, x4) =(0,0,0) as the initial guess to perform 20 iterations. (Note that the G-S method does not require an initial guess for x1.) Here, one iteration means completing the update of all X1, X2, X3, and x4 once. From the results, make a plot of the relative true error (RTE) vs. the number of iterations for both methods. Please collect the two curves of RTE in the same plot for a clear comparison. Since RTE decreases dramatically with the number of iterations, for clarity we require that the actual plot be made by taking the 10-based logarithm of RTE. In other words, the deliverable is the line plot of log10(RTE) vs. the number of iterations. (In Matlab, the built-in function for 10-based log is log10.) (b) Compute the condition number, C, for the system in Eq. (1). Using the result from the case in Part (a) with Gauss-Seidel method, make a plot with 3 curves (must be collected in the same plot): The first is the curve of log10(RTE) vs. the number of iterations, as recycled from Part (a). (Despite the redundancy, for clarity we ask that a new plot be made for Part (b). Do not merge the deliverables in Part (a) and (b) into a single plot.) The other two are the curves for log10(RRS*C) and log10(RRS*C-), vs. the number of iterations. This plot serves the purpose of demonstrating the relations in Eq. (5). Namely, RRS*C and RRS*C provide the upper bound and lower bound of RTE. (If C is close to 1, these bounds are tight" and RRS is a useful proxy of RTE. If C is very large, RTE is detached from RRS.) Prob 1 (4 points) A system of linear equations is given: 4 1 14.5 / 8 1 0.5 2 3 3 2 0.5 0.5 X1 0.5 x2 1.5 / X3 4 / Eq. (1) 5 7.5 1 Symbolically, we write Eq. (1) as AT=, Eq.(2) which also gives the definitions of the matrix A and vectors and b. For this system, the exact solution is known to be Let us also recall a few relevant definitions. Given in as a numerical solution, the relative true error (RTE) is defined as llell RTE - Eq.(3) where e = xn-is is the vector of absolute error. The relative residual (RRS) is defined as Fill RRS = Eq.(4) 115 where r = AXn-b is the residual vector. The key conclusion of the discussion (in Lecture 11) on condition number, C, is summarized by the inequality, **(RRS) S (RTE) SC * (RRS). Eq. (5) C Conceptually, Eq. (5) provides the upper and lower bounds of RTE by computing RRS and C. Lastly, the condition number itself is defined by C = ||A||||A-1|| Eq.(6) In Eqs. (3)-(6), Euclidean norm is used for a vector and Euclidean 2-norm (or Frobenius norm) is used for a matrix. Let x; be the j-th element of a vector x with N elements, then Let Aij be the element of an NxN matrix A at the i-th row and j-th column, then 141 = (4) || A|| = >(Aij)2 . (a) Solve the system in Eq. (1) with two methods: (i) Jacobi iterative method, using (x1, x2, x3, x4) = (0,0,0,0) as the initial guess to perform 20 iterations. (ii) Gauss-Seidel iterative method, using (x2, X3, x4) =(0,0,0) as the initial guess to perform 20 iterations. (Note that the G-S method does not require an initial guess for x1.) Here, one iteration means completing the update of all X1, X2, X3, and x4 once. From the results, make a plot of the relative true error (RTE) vs. the number of iterations for both methods. Please collect the two curves of RTE in the same plot for a clear comparison. Since RTE decreases dramatically with the number of iterations, for clarity we require that the actual plot be made by taking the 10-based logarithm of RTE. In other words, the deliverable is the line plot of log10(RTE) vs. the number of iterations. (In Matlab, the built-in function for 10-based log is log10.) (b) Compute the condition number, C, for the system in Eq. (1). Using the result from the case in Part (a) with Gauss-Seidel method, make a plot with 3 curves (must be collected in the same plot): The first is the curve of log10(RTE) vs. the number of iterations, as recycled from Part (a). (Despite the redundancy, for clarity we ask that a new plot be made for Part (b). Do not merge the deliverables in Part (a) and (b) into a single plot.) The other two are the curves for log10(RRS*C) and log10(RRS*C-), vs. the number of iterations. This plot serves the purpose of demonstrating the relations in Eq. (5). Namely, RRS*C and RRS*C provide the upper bound and lower bound of RTE. (If C is close to 1, these bounds are tight" and RRS is a useful proxy of RTE. If C is very large, RTE is detached from RRS.)

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!