Answered step by step
Verified Expert Solution
Question
1 Approved Answer
questions about this progr wer the foll function problem2_79 2 clo 3 n = 3; 4 x zeros (n, 1); 3A[3 10 -5; -4
questions about this progr wer the foll function problem2_79 2 clo 3 n = 3; 4 x zeros (n, 1); 3A[3 10 -5; -4 1 2; 1 1 -4]; 6 b[-2; 1; 0]; 7 Rnorm (A+x-b); sk=0; 9 fprintf('k \t err ') 10 fprintf( 2d \t while R > le-7 for i = 1:n end s = 0; 6.4e ',k,R). for 1:n end ss+A(i,j) *x(5); x(i)x(i) +0.8 (b(i)-s)/A(i, 1); R = norm (A+x-b); 12 13 14 15 16 17 18 19 20 21 22 23 24 25 and 26 end 27 if R-1 k = k + 1; fprintf('82d \t 86.4e ',k,R) if k > 50 fprintf( 'Did not converge. ') R = -1; fprintf( 'The converged result is: ') for i 1:n fprintf(8.6f ',x(i)) 28 29 30 31 end R 12 end (a) What mathematical problem does this program solve? (b) What numerical method does this program use? (c) What is the initial condition used to start the numerical method? (d) What is the criteria for convergence? (e) What is the reason you might choose the value 0.8 in line 17? (f) What is the significance of changing line 17 to: x(i)= x(i)+ (b(i)-s)/A(i,i); (g) What happens if you change line 17 to: x(i)= x(i)+ 2.5*(b(i)-s)/A(i.i); (h) If we forget to include line 13, the program does not work. Explain the problem with this bug. (i) How would you modify the mathematical problem from part (a) (with the same initial guess) to ensure that this numerical method will converge? Explain the reason behind your answer. Your answer can be in words, and you do not need to rewrite the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a This program solves a system of linear equations using the GaussSeidel iterative method b The prog...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