Question: Consider the following linear system 4 x 1 + x 2 - x 3 + x 4 = - 2 x 1 + 4 x

Consider the following linear system
4x1+x2-x3+x4=-2
x1+4x2-x3-x4=-1
-x1-x2+5x3+x4=0
x1-x2+x3+3x4=1
a) Solve the system using Matlab/Octave rref, backslash, and the inverse commands. Call the
solution x.
b) Use Matlab/Octave code to solve the system using the Jacobi method, starting with the initial
value x(0)=(0,0,0,0). Call the solution xJ. Print 5 iterations.
c) Use Matlab/Octave code to solve the system using the Gauss-Seidel method, starting with the
initial value {:x(0)=(0,0,0,0)). Call the solution xGS. Print 5 iterations.
d) Use Matlab/Octave code to compute the ||x-xJ||2 and ||x-xGS||2 for the errors in the
approximation.
e) Are the two numerical methods converging to the solution? Which method is better to use?
Justify your answer.
solve the questions using octave or matlab program

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!