Anda di halaman 1dari 3

Nama : Dani Indra Kusworo

Nim

: 10/307635/DPA/03760

1. Soal 4x10y 6z=30


3x 5y7z=15
6x8y 6z=8
A. = 4 -10 6

3 5 -7
6 -8 6
b. =

30
15
-8

Langkah pertama tuliska matriknya di scilab console


-->A=[4 -10 6;3 5 -7; 6 -8 6]
A =
4. - 10. 6.
3. 5. - 7.
6. - 8. 6.
-->b=[30;15;8]
b =
30.
15.
8.
Kemudian buat Jacobi.sci
function akar=jacobi(A, b)

epsilon =0.0000000000000001; //dalam program ini mengunakan ketelitian 0.000000000000001


counter=0;
[baris kolom]=size(A);
x0=zeros(baris,1);
while%T
counter=counter+1;
for i=1:baris
sigma=0;
for j=1:kolom
if i~=j
sigma=sigma+(A(i,j)*x0(j));
end
end
x1(i)=1/A(i,i)*(b(i)-sigma);
end
if abs (norm(x0-x1))>epsilon
x0=x1;
else
break;
end;
end
akar=x0;
disp(counter);
endfunction

lakukan execute exec(jacobi.sci)


akar=jacobi (A,b)

1236.
akar =

10^306 *

- 26.087886
6.7216664
- 19.715886