Páginas

METODOS DE JACOBI

%METODO JACOBI
clc
clear
tol=0.0001;
x(1)=0;
y(1)=0;
z(1)=0;
w(1)=0;
for i=2:50
x(i)=(8+2*y(i-1)-4*z(i-1)+3*w(i-1))/17;
y(i)=(10-x(i-1)+z(i-1)-2*w(i-1))/9;
z(i)=(14-2*x(i-1)+y(i-1)+w(i-1))/6;
w(i)=(24-x(i-1)-y(i-1)-z(i-1))/8;
error=sqrt((x(i)-x(i-1))^2+(y(i)-y(i-1))^2+(z(i)-z(i-1))^2+(w(i)-w(i-1))^2);
if(error<=0.0001)
break
end
end
x(i)
y(i)
z(i)
w(i)
error

No hay comentarios.:

Publicar un comentario