100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada
logo-home
APM1513 ASSIGNMENT 2 SOLUTIONS 2023 UNISA APPLIED LINEAR ALGEBRA LINEAR ALGEBRA 10,60 €   Añadir al carrito

Otro

APM1513 ASSIGNMENT 2 SOLUTIONS 2023 UNISA APPLIED LINEAR ALGEBRA LINEAR ALGEBRA

 10 vistas  0 compra
  • Grado
  • Institución

APM1513 ASSIGNMENT 2 SOLUTIONS 2023 UNISA APPLIED LINEAR ALGEBRA LINEAR ALGEBRA

Última actualización de este documento: 1 año hace

Vista previa 3 fuera de 17  páginas

  • 22 de agosto de 2023
  • 22 de agosto de 2023
  • 17
  • 2023/2024
  • Otro
  • Desconocido
avatar-seller
APM1513
ASSIGNMENT 2
SOLUTIONS 2023
Unique number: *******

DUE DATE: 22 AUGUST 2023


APPLIED LINEAR
ALGEBRA



Page 1 of 17

,SOLUTION

octave:1> rand("state",429373610915)

octave:2> rand(1)

ans = 0.63536




SOLUTION

% (a)
A = [2 -1 3; 4 2 -5; 6 3 1];
B =[8; -9; 12];
X = A\B;
printf("\nSolution using A\\B Construct is : \n")
printf("X1=%f, \tX2=%f, \tX3=%f\n\n", X(1,1), X(2,1), X(3,1));


% (b)
A = [10 1 2; 1 10 -3; 2 1 10];
B =[3; 1.5; -9];
X = A\B;
Page 2 of 17

, printf("\nSolution using A\\B Construct is : \n")
printf("X1=%f, \tX2=%f, \tX3=%f\n\n", X(1,1), X(2,1), X(3,1));

%--------------------------------------------------------------------------------------------------------------
--

function GuassSeidel(A,B, convergeVal, maxIteration)
N = length(B);
X = zeros(N,1);
err = ones(N,1);

for i = 1:N
j = 1:N;
j(i) = [];
C = abs(A(i,j));
Check(i,1) = abs(A(i,i)) - sum(B);
if Check(i) < 0
fprintf('The matrix is not strictly diagonally dominant at row %2i\n\n',i)
end
end

iter = 0;
while max(err) > convergeVal
iter = iter + 1;
Z = X;
for i = 1:N
j = 1:N;
j(i) = [];
Xtemp = X;
Xtemp(i) = [];
X(i,1) = (B(i,1) - sum(A(i,j) * Xtemp)) / A(i,i);
end

Xs = X;
err = sqrt((X - Z).^2);

if iter >= maxIteration
break;
end
end

% Printing the ouput
printf("\nSolution using Guass Seidel Model : \n");
printf("X1=%f, \tX2=%f, \tX3=%f, ", Xs(1), Xs(2), Xs(3));
printf("Number of iterations %d\n\n", iter);
end


% part(a) using Guass Seidel
A = [10 1 2; 1 10 -3; 2 1 10];

Page 3 of 17

Los beneficios de comprar resúmenes en Stuvia estan en línea:

Garantiza la calidad de los comentarios

Garantiza la calidad de los comentarios

Compradores de Stuvia evaluaron más de 700.000 resúmenes. Así estas seguro que compras los mejores documentos!

Compra fácil y rápido

Compra fácil y rápido

Puedes pagar rápidamente y en una vez con iDeal, tarjeta de crédito o con tu crédito de Stuvia. Sin tener que hacerte miembro.

Enfócate en lo más importante

Enfócate en lo más importante

Tus compañeros escriben los resúmenes. Por eso tienes la seguridad que tienes un resumen actual y confiable. Así llegas a la conclusión rapidamente!

Preguntas frecuentes

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

100% de satisfacción garantizada: ¿Cómo funciona?

Nuestra garantía de satisfacción le asegura que siempre encontrará un documento de estudio a tu medida. Tu rellenas un formulario y nuestro equipo de atención al cliente se encarga del resto.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller TutorMaster0820448712. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for 10,60 €. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

45,681 summaries were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Empieza a vender
10,60 €
  • (0)
  Añadir