Answered step by step
Verified Expert Solution
Question
1 Approved Answer
do i switch the first row with the second row. and then switch row 2 with row 3? to become [ 10 2 -1 [-1
do i switch the first row with the second row. and then switch row 2 with row 3?
Problem 1) Consider the following linear system of equations AX=B : 0101422216x1x2x3=212 (a) Solve the system using Gauss Seidel method (solve by hand). At each step, calculate the relative norm of the residuals (Br(k)) and stop when it reaches a tolerance of 0.1. (b) Modify the Gauss-Seidel function you completed in Lab 6 Assignment, such that the function first checks if the diagonal entries are zero. If needed, the function will swap the row that has a zero diagonal element with the next suitable row in A such that a matrix with non-zero diagonal elements is obtained. The function needs to record the swapping process by creating a permutation matrix, P. Subsequently, your function will start to solve the system using Gauss-Seidel. - Inputs of your function: A,B, initial guess for X, tolerance, maximum number of iterations - Output of your function: numerical solution for X (c) Use your function from Part (a) to solve the above system. Set the tolerance for relative norm of residuals to 0.0001. Report the following: - In a PDF file report the number of iterations needed to reach this accuracy, and output of your code for solution X. - Your MATLAB code in .m or .mlx format to become
[ 10 2 -1 [-1
1 2 6 -2
0 4 2] 2 ]
?
if so please answer the question approporatly.
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