# AMATH 301 - w4(i 1)=(131-3*x4(i 1/4 z4(i 1)=(282-2*x4(i...

This preview shows pages 1–4. Sign up to view the full content.

x1=0; w1=0; z1=0; for i=1:1000 x1(i+1)=(391-3*w1(i)-6*z1(i))/11; w1(i+1)=(131-3*x1(i))/4; z1(i+1)=(282-2*x1(i)-4*w1(i))/7; if ((x1(i+1)-x1(i))^2+(w1(i+1)-w1(i))^2+(z1(i+1)- z1(i))^2)< 10^-6 break end end countJ1=i X(1,1)=x1(end); X(2,1)=w1(end); X(3,1)=z1(end); x2=0; w2=0; z2=0; for i=1:1000 x2(i+1)=(284-3*w2(i)-6*z2(i))/11; w2(i+1)=(142-3*x2(i))/4; z2(i+1)=(237-2*x2(i)-4*w2(i))/7; if ((x2(i+1)-x2(i))^2+(w2(i+1)-w2(i))^2+(z2(i+1)- z2(i))^2)< 10^-6 break end end countJ2=i X(1,2)=x2(end); X(2,2)=w2(end); X(3,2)=z2(end) ; x3=0; w3=0; z3=0;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
for i=1:1000 x3(i+1)=(383-3*w3(i)-6*z3(i))/11; w3(i+1)=(102-3*x3(i))/4; z3(i+1)=(213-2*x3(i)-4*w3(i))/7; if ((x3(i+1)-x3(i))^2+(w3(i+1)-w3(i))^2+(z3(i+1)- z3(i))^2)< 10^-6 break end end countJ3=i X(1,3)=x3(end); X(2,3)=w3(end); X(3,3)=z3(end) save A3.dat X -ASCII % Gauss-Seidel x4=0; w4=0; z4=0; for i=1:1000 x4(i+1)=(391-3*w4(i)-6*z4(i))/11;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: w4(i+1)=(131-3*x4(i+1))/4; z4(i+1)=(282-2*x4(i+1)-4*w4(i+1))/7; if ((x4(i+1)-x4(i))^2+(w4(i+1)-w4(i))^2+(z4(i+1)-z4(i))^2)< 10^-6 break end end countJ4=i X(1,1)=x4(end); X(2,1)=w4(end); X(3,1)=z4(end); x5=0; w5=0; z5=0; for i=1:1000 x5(i+1)=(284-3*w5(i)-6*z5(i))/11; w5(i+1)=(142-3*x5(i+1))/4; z5(i+1)=(237-2*x5(i+1)-4*w2(i+1))/7; if ((x5(i+1)-x5(i))^2+(w5(i+1)-w5(i))^2+(z5(i+1)-z5(i))^2)< 10^-6 break end end countJ5=i X(1,2)=x5(end); X(2,2)=w5(end); X(3,2)=z5(end) ; x6=0; w6=0; z6=0; for i=1:1000 x6(i+1)=(383-3*w6(i)-6*z6(i))/11; w6(i+1)=(102-3*x6(i+1))/4; z6(i+1)=(213-2*x6(i+1)-4*w6(i+1))/7; if ((x6(i+1)-x6(i))^2+(w6(i+1)-w6(i))^2+(z6(i+1)-z6(i))^2)< 10^-6 break end end countJ6=i X(1,3)=x6(end); X(2,3)=w6(end); X(3,3)=z6(end) save A4.dat X-ASCII...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

AMATH 301 - w4(i 1)=(131-3*x4(i 1/4 z4(i 1)=(282-2*x4(i...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online