Assignment ID is p4 NOTE: Algebraic expressions follow FORTRAN conventions. Use
ID: 2263332 • Letter: A
Question
Assignment ID is p4 NOTE: Algebraic expressions follow FORTRAN conventions. Use full calculator precision for intermediate values. DO NOT DO ANY ROW INTERCHANGES Matrix L is 18.28 211.64 198.81 e e -29.75-3-13.39-4- Matrix U is 26.12 Matrix product L times U is 221.55 10.28 5786,89 480.154 36,89 6388.99 909.681 29.75 -3849.66 786.287 13.39 9423.26I 399.468 I For the system Ax-b with A defined as 163 -27 36 214 -22 240 -16 198 41 17 I 219 I and b transpose given by: 1258 1478 1895 1937 one iteration of Gauss-Seidel starting at x equal to the transpose of: 1892 1683 1991 1767 1958 produces the new approximation to x given by the transpose of: 1e The process is stopped by using the convergence criterion |Ix(k+2)-x()1l0.000e1, then x(k+1) isExplanation / Answer
By implementing the following code, we can obtain the L and U matrices rounded off:
clc;clear all;close all;
A=[221.55 5786.89 0 0 0;10.28 480.154 6308.99 0 0;0 -36.89 -909.681 -3049.66 0;0 0 -29.75 206.207 9423.26;0 0 0 -13.39 -399.468];
[L U]=lu(A);
Results:
BLANK1: (b)221.55
BLANK2: (e)-36.89
BLANK3: (e)228.72
BLANK4: (c)152.2
BLANK5: (e)29.81
BLANK6: (b)-16.05
BLANK7: (e)41.2
By implementing the following code,we can obtain the first iteration (directly implemented the formula):
clc;clear all;close all;
A=[163 36 0 0 0;-27 214 -1 0 0;0 -22 240 -16 0;0 0 33 198 -17;0 0 0 41 219];
L=[163 0 0 0 0;-27 214 0 0 0;0 -22 240 0 0;0 0 33 198 0;0 0 0 41 219];
U=[0 36 0 0 0;0 0 -1 0 0;0 0 0 -16 0;0 0 0 0 -17;0 0 0 0 0];
b=[1258 1177 1470 1895 1937]';
x=[1892 1603 1991 1767 1958]';
x1=(inv(L))*(b-U*x);
Result:
x1=[-346.319018404908 -28.890717275385590 121.2766842497563 157.4690374735255 -20.635755874039017]T ;
which can be approximated as, x1=[-346.319 -28.8907 121.277 157.469 -20.6358]T ;
Thus, answers:
BLANK8: (a)-346.319
BLANK9: (e)-28.8907
BLANK10: (d)121.277
BLANK11: (e)157.469
BLANK12: (a)-20.6358
And for the process, I've used the basic Gauss-Seidel Algorithm from MATLAB works:
clc;clear all;close all;
A=[163 36 0 0 0;-27 214 -1 0 0;0 -22 240 -16 0;0 0 33 198 -17;0 0 0 41 219];
b=[1258 1177 1470 1895 1937]';
x=[1892 1603 1991 1767 1958]';
n=size(x,1);
normVal=Inf;tol=1e-05;GaussItr=0;
plotGauss=[];
while normVal>tol
x_old=x;
for i=1:n
sigma=0;
for j=1:i-1
sigma=sigma+A(i,j)*x(j);
end
for j=i+1:n
sigma=sigma+A(i,j)*x_old(j);
end
x(i)=(1./A(i,i))*(b(i)-sigma);
end
GaussItr=GaussItr+1;
normVal=norm(x_old-x);
plotGauss=[plotGauss;normVal];
end
fprintf('Solution of the system if : %f %f %f %f %f in %d iterations',x,GaussItr);
Result:
Solution of the system if :
6.319437
6.331440
7.303297
8.968725
7.165672 in 8 iterations
Thus, the answer can be approximated as x(k+1) = [6.31944 6.33144 7.3033 8.96873 7.165672]T ;
Thus,
BLANK13: (e)6.31944
BLANK14: (b)6.33144
BLANK15: (d)7.3033
BLANK16: (b)8.96873
BLANK17: (c)7.16567
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.