Last active
September 18, 2016 08:19
-
-
Save ChristopherAT/6d497041d52220e87798ebe0cba66226 to your computer and use it in GitHub Desktop.
(12/330958/PA/14416 : modul 2, soal 1, soal 2, soal 3, soal 4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Soal nomor 1: | |
% Tentukan solusi persamaan | |
% sin(x)+3cos(x)- 2 = 0 | |
% cos(x)-sin(y) + 0.2 = 0 | |
% dengan tebakan awal (1,1). | |
% | |
% | |
% Pembahasan: | |
% Persamaan tersebut akan diubah kedalam bentuk | |
% x=f(x,y) dan y=g(x,y) | |
% Didapat | |
% x=arccos((1/3)*(2-sin(x))) | |
% y=arcsin(cos(x)+0.2) | |
% Selanjutnya dalam program, variabel x=t(1) dan y=t(2) | |
function y=soal_1(t) | |
y=[acos((1/3)*(2-sin(t(1))));... | |
asin(cos(t(1)+0.2))]; | |
% | |
% Hasil dari Command Window: | |
%------------------------------------------ | |
% Iterasi_N_Variabel(@soal_1,[1;1]) | |
% Iterasi: 7 | |
% | |
% ans = | |
% | |
% 1.2078 | |
% 0.1630 | |
%------------------------------------------ | |
% Jadi x=1.2078 dan | |
% y=0.1630 | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Soal nomor 2: | |
% Tentukan titik potong dari dua lingkaran | |
% (x-2)^2+y^2=4 dan x^2+(y-3)^2=4 | |
% | |
% Pembahasan: | |
% Persamaan tersebut akan diubah kedalam bentuk | |
% x=f(x,y) dan y=g(x,y) | |
% Didapat | |
% x=(-y^2)/(x-4) | |
% y=(-x^2-5)/(y-6) | |
% Selanjutnya dalam program, variabel x=t(1) dan y=t(2) | |
function y=soal_2(t) | |
y=[(-t(2)^2)/(t(1)-4);... | |
(-t(1)^2-5)/(t(2)-6)]; | |
% | |
% Hasil dari Command Window: | |
%------------------------------------------ | |
% Iterasi_N_Variabel(@soal_2,[1;1]) | |
% Iterasi: 13 | |
% | |
% ans = | |
% | |
% 0.2794 | |
% 1.0196 | |
%------------------------------------------ | |
% Jadi x=0.2794 dan | |
% y=1.0196 | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Soal nomor 3: | |
% Tentukan solusi sistem persamaan berikut untuk 0<x<1.5: | |
% tan(x)-y=1 | |
% cos(x)-3sin(y)=0 | |
% | |
% | |
% Pembahasan: | |
% Persamaan tersebut akan diubah kedalam bentuk | |
% x=f(x,y) dan y=g(x,y) | |
% Didapat | |
% x=arctan(1+y) | |
% y=arcsin(cos(x)/3) | |
% Selanjutnya dalam program, variabel x=t(1) dan y=t(2) | |
function y=soal_3(t) | |
y=[atan(1+t(2));asin(cos(t(1))/3)]; | |
% | |
% Hasil dari Command Window: | |
%------------------------------------------ | |
% Iterasi_N_Variabel(@soal_3,[1;1]) | |
% Iterasi: 11 | |
% | |
% ans = | |
% | |
% 0.8816 | |
% 0.2136 | |
%------------------------------------------ | |
% Jadi x=0.8816 dan | |
% y=0.2136 | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Soal nomor 4: | |
% Pada persamaan lingkaran berikut | |
% (x-a)^2+(y-b)^2=R^2 | |
% Tentukan koordinat titik pusat dan jari - jari | |
% lingkaran tersebut jika diketahui | |
% x 8.21 0.34 5.96 | |
% y 0.00 6.26 -1.12 | |
% | |
% Pembahasan: | |
% Substitusi nilai x dan y kedalam persamaan, diperoleh | |
% sistem persamaan sebagai berikut: | |
% (8.21-a)^2+(0.00-b)^2=R^2 | |
% (0.34-a)^2+(6.26-b)^2=R^2 | |
% (5.96-a)^2+(-1.12-b)^2=R^2 | |
% Sistem persamaan itu dapat ditulis kedalam bentuk | |
% a^2+b^2-R^2-16.42a+67.4041=0 | |
% a^2+b^2-R^2-0.68a-12.52b+39.3032=0 | |
% a^2+b^2-R^2-11.92a+2.24b+36.7760=0 | |
% Persamaan tersebut akan diubah kedalam bentuk | |
% a=f(a,b,R), b=g(a,b,R) dan R=h(a,b,R) | |
% Diperoleh | |
% a=(R^2-b^2-67.4041)/(a-16.42) | |
% b=(R^2-a^2+0.68a-39.3032)/(b+12.52) | |
% R=(a^2+b^2-11.92a+2.24b+36.7760)/R | |
% Selanjutnya dalam program, variabel a=t(1), b=t(2) dan R=t(3) | |
function y=soal_4(t) | |
y=[(t(3)^2-t(2)^2-67.4041)/(t(1)-16.42);... | |
(t(3)^2-t(1)^2+0.68*t(1)-39.3032)/(t(2)+12.52);... | |
(t(1)^2+t(2)^2-11.92*t(1)+2.24*t(2)+36.7760)/t(3)]; | |
% | |
% Hasil dari Command Window: | |
%------------------------------------------ | |
% Iterasi_N_Variabel(@soal_4,[1;1;1]) | |
% Iterasi: 11 | |
% | |
% ans = | |
% | |
% NaN | |
% NaN | |
% Inf | |
%------------------------------------------ | |
% Kesimpulan: | |
% Metode iteratif tidak dapat dijalankan | |
% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment