Tugas Metode Numerik

362 views

Published on

Metode Numerik

Published in: Science
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
362
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Tugas Metode Numerik

  1. 1. UTS Metode Numerik Tekmnik Informatika Hari Santoso 06550023 1). f(x)=cos2px+(2x+q), maka jika p dan q disesuaikan NIM menjadi cos(2*2*x)+(2*x+3) atau cos(4x)+(2x+3) Catatan khusus pekerjaan saya : Toleransi Lebar Selang = 0.0000001 (epsilon 1) Nilai Hampiran Akar = 0.00000000001 (epsilon 2); f(x) mendekati 0 A. Hampiran akar – Menggunakan metode Biseksi (Bagi Dua) hasilnya : -1.8016114476295115 dengan dua titik awal -3 dan 2 – Menggunakan metode Regula Falsi : -1.8016114476286291 dengan dua titik awal -3 dan 2 – Menggunakan metode Newton Raphson : -1.801611447628629 dengan titik awal -2 – Menggunakan metode Secant : -1.8016114476267557 dengan dua titik awal -3 dan 2 B. Galat Relatif (εRA) dari Xn (hampiran akar ke n) – Metode Biseksi n Xn X(n+1) (εRA) = ((X(n+1))-X)/X(n+1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 0.0 -0.5 -1.75 -2.375 -2.0625 -1.90625 -1.828125 -1.7890625 -1.80859375 -1.798828125 -1.8037109375 -1.80126953125 -1.802490234375 -1.8018798828125 -1.80157470703125 -1.801727294921875 -1.8016510009765625 -1.8016128540039062 -1.8015937805175781 -1.8016033172607422 -1.8016080856323242 -1.8016104698181152 -1.8016116619110107 -1.801611065864563 -1.8016113638877869 -1.8016115128993988 -1.8016114383935928 -1.8016114756464958 -1.8016114570200443 -1.8016114477068186 -1.8016114430502057 -1.8016114453785121 -1.8016114465426654 -1.801611447124742 -1.8016114474157803 -1.8016114475612994 -1.801611447634059 -1.8016114475976792 -0.5 -1.75 -2.375 -2.0625 -1.90625 -1.828125 -1.7890625 -1.80859375 -1.798828125 -1.8037109375 -1.80126953125 -1.802490234375 -1.8018798828125 -1.80157470703125 -1.801727294921875 -1.8016510009765625 -1.8016128540039062 -1.8015937805175781 -1.8016033172607422 -1.8016080856323242 -1.8016104698181152 -1.8016116619110107 -1.801611065864563 -1.8016113638877869 -1.8016115128993988 -1.8016114383935928 -1.8016114756464958 -1.8016114570200443 -1.8016114477068186 -1.8016114430502057 -1.8016114453785121 -1.8016114465426654 -1.801611447124742 -1.8016114474157803 -1.8016114475612994 -1.801611447634059 -1.8016114475976792 -1.801611447615869 1.0 0.7142857142857143 0.2631578947368421 0.15151515151515152 0.08196721311475409 0.042735042735042736 0.021834061135371178 0.01079913606911447 0.0054288816503800215 0.0027070925825663237 0.0013553808620222283 6.772314777190844E-4 3.3873043831718716E-4 1.6939390859504693E-4 8.46897813309846E-5 4.234668383118918E-5 2.1173790235494895E-5 1.0587007201282299E-5 5.293475579609109E-6 2.6467307846021674E-6 1.3233636410074397E-6 6.616813826811779E-7 3.308408007961882E-7 1.6542037303418978E-7 8.27101796761205E-8 4.135509154830378E-8 2.0677545346590998E-8 1.033877278018572E-8 5.169386416815416E-9 2.584693215088347E-9 1.2923466058740138E-9 6.461733025194669E-10 3.230866511553485E-10 1.61543325551578E-10 8.077166276926494E-11 4.038583138300145E-11 2.019291569190848E-11 1.0096457845852301E-11
  2. 2. 39 40 -1.801611447615869 -1.801611447624964 -1.801611447624964 -1.8016114476295115 5.0482289229006665E-12 2.524114461443962E-12 – Metode Regula Falsi n Xn X(n+1) (εRA) = ((X(n+1))-X)/X(n+1) 1 2 3 4 5 6 7 8 0.0 -1.8035563490771485 -1.797953034224506 -1.801604801477325 -1.8016114356729023 -1.8016114476071223 -1.8016114476285903 -1.801611447628629 -1.8035563490771485 -1.797953034224506 -1.801604801477325 -1.8016114356729023 -1.8016114476071223 -1.8016114476285903 -1.801611447628629 -1.8016114476286291 1.0 0.0031164967860571793 0.0020269524425248187 3.6823675993484088E-6 6.624191954642433E-9 1.191596476933161E-11 2.144511310016917E-14 1.2324777643775381E-16 – Metode Newton Raphson n Xn X(n+1) (εRA) = ((X(n+1))-X)/X(n+1) 1 2 3 4 -2.0 -1.807719189790674 -1.8016450051978534 -1.8016114486748949 -1.807719189790674 -1.8016450051978534 -1.8016114486748949 -1.801611447628629 0.10636652600429128 0.0033714658411041643 1.8625837987006956E-5 5.807389624069679E-10 – Metode Secant n Xn X(n+1) (εRA) = ((X(n+1))-X)/X(n+1) 1 2 3 4 5 6 7 8 9 10 11 12 2.0 -3.8035563490771485 -1.2231320622744302 -1.527154917782535 -0.09544665943497099 -2.0018169103475882 -1.5513403115519542 -1.7477976253246201 -1.8301133003465275 -1.8000848729605656 -1.801573851656067 -1.801611501216167 -3.8035563490771485 -1.2231320622744302 -1.527154917782535 -0.09544665943497099 -2.0018169103475882 -1.5513403115519542 -1.7477976253246201 -1.8301133003465275 -1.8000848729605656 -1.801573851656067 -1.801611501216167 -1.8016114476267557 1.5258236809046504 2.109685753805182 0.19907794027180503 15.000087659673461 0.9523199854384296 0.2903789680711508 0.11240278103489112 0.04497845844097255 0.016681673090544174 8.264877368933529E-4 2.0897713005595138E-5 2.9745265786088064E-8
  3. 3. C. Grafik Konvergensi Akar Bentuk Grafik dalam Aplikasi Grafik Konvergensi Akar Dari grafik, bisa diperhatikan konvergensinya terjadi di sekita -1,8. Pada daerah itu, nilainya sudah mengalami kekontinuan yang digambarkan dengan garis lurus. Pada grafik konvergensi di atas, metode yang digunakan yaitu Biseksi. Jadi untuk metode yang lain, tentu akan sedikit berbeda, tapi konvergensinya tetap pada sekitar titik -1,8 seperti yang telah dicari sebelumnya. Nah biar lebih jelas, silakan perhatikan tabel pada bagian D.
  4. 4. D. Analisa Kecepatan Iterasi mencari akar dengan Java – Metode Biseksi (Bagi Dua) r a c b f(a) f(c) f(b) Lebar 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 -3.0 -3.0 -3.0 -2.375 -2.0625 -1.90625 -1.828125 -1.828125 -1.80859375 -1.80859375 -1.8037109375 -1.8037109375 -1.802490234375 -1.8018798828125 -1.8018798828125 -1.801727294921875 -1.8016510009765625 -1.8016128540039062 -1.8016128540039062 -1.8016128540039062 -1.8016128540039062 -1.8016128540039062 -1.8016116619110107 -1.8016116619110107 -1.8016116619110107 -1.8016115128993988 -1.8016115128993988 -1.8016114756464958 -1.8016114570200443 -1.8016114477068186 -1.8016114477068186 -1.8016114477068186 -1.8016114477068186 -1.8016114477068186 -1.8016114477068186 -1.8016114477068186 -1.801611447634059 -1.801611447634059 -1.801611447634059 -1.801611447634059 -0.5 -1.75 -2.375 -2.0625 -1.90625 -1.828125 -1.7890625 -1.80859375 -1.798828125 -1.8037109375 -1.80126953125 -1.802490234375 -1.8018798828125 -1.80157470703125 -1.801727294921875 -1.8016510009765625 -1.8016128540039062 -1.8015937805175781 -1.8016033172607422 -1.8016080856323242 -1.8016104698181152 -1.8016116619110107 -1.801611065864563 -1.8016113638877869 -1.8016115128993988 -1.8016114383935928 -1.8016114756464958 -1.8016114570200443 -1.8016114477068186 -1.8016114430502057 -1.8016114453785121 -1.8016114465426654 -1.801611447124742 -1.8016114474157803 -1.8016114475612994 -1.801611447634059 -1.8016114475976792 -1.801611447615869 -1.801611447624964 -1.8016114476295115 2.0 -0.5 -1.75 -1.75 -1.75 -1.75 -1.75 -1.7890625 -1.7890625 -1.798828125 -1.798828125 -1.80126953125 -1.80126953125 -1.80126953125 -1.80157470703125 -1.80157470703125 -1.80157470703125 -1.80157470703125 -1.8015937805175781 -1.8016033172607422 -1.8016080856323242 -1.8016104698181152 -1.8016104698181152 -1.801611065864563 -1.8016113638877869 -1.8016113638877869 -1.8016114383935928 -1.8016114383935928 -1.8016114383935928 -1.8016114383935928 -1.8016114430502057 -1.8016114453785121 -1.8016114465426654 -1.801611447124742 -1.8016114474157803 -1.8016114475612994 -1.8016114475612994 -1.8016114475976792 -1.801611447615869 -1.801611447624964 -2.1561460412675078 -2.1561460412675078 -2.1561460412675078 -2.7471721561963784 -1.510747937452222 -0.5855141432845307 -0.14084376281497168 -0.14084376281497168 -0.03647253654195837 -0.03647253654195837 -0.010918155089783221 -0.010918155089783221 -0.004564879615149953 -0.0013936041850319825 -0.0013936041850319825 -6.01345870745118E-4 -2.0530091988679722E-4 -7.299505949576179E-6 -7.299505949576179E-6 -7.299505949576179E-6 -7.299505949576179E-6 -7.299505949576179E-6 -1.1121880566511422E-6 -1.1121880566511422E-6 -1.1121880566511422E-6 -3.387742844029873E-7 -3.387742844029873E-7 -1.454208748974395E-7 -4.87441751406692E-8 -4.058264835293812E-10 -4.058264835293812E-10 -4.058264835293812E-10 -4.058264835293812E-10 -4.058264835293812E-10 -4.058264835293812E-10 -4.058264835293812E-10 -2.818312250241206E-11 -2.818312250241206E-11 -2.818312250241206E-11 -2.818312250241206E-11 1.5838531634528576 0.2539022543433046 -2.7471721561963784 -1.510747937452222 -0.5855141432845307 -0.14084376281497168 0.06435608928769787 -0.03647253654195837 0.014408685484931905 -0.010918155089783221 0.0017740808647616069 -0.004564879615149953 -0.0013936041850319825 1.906878632146336E-4 -6.01345870745118E-4 -2.0530091988679722E-4 -7.299505949576179E-6 9.169593440627732E-5 4.2198653149583265E-5 1.7449683327619425E-5 5.075116120578649E-6 -1.1121880566511422E-6 1.981465746370148E-6 4.3463927346110154E-7 -3.387742844029873E-7 4.793252128543202E-8 -1.454208748974395E-7 -4.87441751406692E-8 -4.058264835293812E-10 2.376334751197362E-8 1.167876051422212E-8 5.63646707085752E-9 2.6153202936640696E-9 1.104746849556193E-9 3.494602385245571E-10 -2.818312250241206E-11 1.606385024999213E-10 6.622768999875461E-11 1.9022339259322507E-11 -4.580447132696008E-12 6.854499966191386 1.5838531634528576 0.2539022543433046 0.2539022543433046 0.2539022543433046 0.2539022543433046 0.2539022543433046 0.06435608928769787 0.06435608928769787 0.014408685484931905 0.014408685484931905 0.0017740808647616069 0.0017740808647616069 0.0017740808647616069 1.906878632146336E-4 1.906878632146336E-4 1.906878632146336E-4 1.906878632146336E-4 9.169593440627732E-5 4.2198653149583265E-5 1.7449683327619425E-5 5.075116120578649E-6 5.075116120578649E-6 1.981465746370148E-6 4.3463927346110154E-7 4.3463927346110154E-7 4.793252128543202E-8 4.793252128543202E-8 4.793252128543202E-8 4.793252128543202E-8 2.376334751197362E-8 1.167876051422212E-8 5.63646707085752E-9 2.6153202936640696E-9 1.104746849556193E-9 3.494602385245571E-10 3.494602385245571E-10 1.606385024999213E-10 6.622768999875461E-11 1.9022339259322507E-11 5.0 2.5 1.25 0.625 0.3125 0.15625 0.078125 0.0390625 0.01953125 0.009765625 0.0048828125 0.00244140625 0.001220703125 6.103515625E-4 3.0517578125E-4 1.52587890625E-4 7.62939453125E-5 3.814697265625E-5 1.9073486328125E-5 9.5367431640625E-6 4.76837158203125E-6 2.384185791015625E-6 1.1920928955078125E-6 5.960464477539062E-7 2.980232238769531E-7 1.4901161193847656E-7 7.450580596923828E-8 3.725290298461914E-8 1.862645149230957E-8 9.313225746154785E-9 4.6566128730773926E-9 2.3283064365386963E-9 1.1641532182693481E-9 5.820766091346741E-10 2.9103830456733704E-10 1.4551915228366852E-10 7.275957614183426E-11 3.637978807091713E-11 1.8189894035458565E-11 9.094947017729282E-12 – Metode Regula Falsi r a c b f(a) f(c) f(b) Lebar 1 2 3 4 5 6 7 8 -3.0 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.8035563490771485 -1.797953034224506 -1.801604801477325 -1.8016114356729023 -1.8016114476071223 -1.8016114476285903 -1.801611447628629 -1.8016114476286291 2.0 2.0 -1.797953034224506 -1.801604801477325 -1.8016114356729023 -1.8016114476071223 -1.8016114476285903 -1.801611447628629 -2.1561460412675078 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 -0.010112795266789765 0.01892322513325584 3.449524358623002E-5 6.205369573741848E-8 1.1162604174330681E-10 2.0117241206207837E-13 6.661338147750939E-16 -4.440892098500626E-16 6.854499966191386 6.854499966191386 0.01892322513325584 3.449524358623002E-5 6.205369573741848E-8 1.1162604174330681E-10 2.0117241206207837E-13 6.661338147750939E-16 5.0 3.8035563490771485 0.005603314852642427 0.001951547599823522 0.0019449134042461846 0.001944901470026128 0.0019449014485581895 0.0019449014485195537 – Metode Newton Raphson r Xr Xr+1 Xr+1 - Xr 1 2 3 4 -2.0 -1.807719189790674 -1.8016450051978534 -1.8016114486748949 0.0 -2.0 -1.807719189790674 -1.8016450051978534 2.0 0.19228081020932608 0.006074184592820497 3.355652295855549E-5 – Metode Secant r Xr Xr+1 Xr+1 - Xr 1 2 3 4 5 6 7 8 9 10 11 12 2.0 -3.8035563490771485 -1.2231320622744302 -1.527154917782535 -0.09544665943497099 -2.0018169103475882 -1.5513403115519542 -1.7477976253246201 -1.8301133003465275 -1.8000848729605656 -1.801573851656067 -1.801611501216167 -3.8035563490771485 -1.2231320622744302 -1.527154917782535 -0.09544665943497099 -2.0018169103475882 -1.5513403115519542 -1.7477976253246201 -1.8301133003465275 -1.8000848729605656 -1.801573851656067 -1.801611501216167 -1.8016114476267557 5.803556349077148 2.5804242868027183 0.3040228555081048 1.431708258347564 1.9063702509126172 0.45047659879563406 0.19645731377266595 0.0823156750219074 0.030028427385961898 0.0014889786955014639 3.764956009999487E-5 5.358941135291673E-8 Jadi dalam kasus ini, metode Newton Raphson memiliki kecepatan menghapiri akar yang paling cepat dibanding metode yang lain. Tapi dalam kasus lain, bisa saja metode Newton Raphson memiliki kelemahan yang tidak bisa dipecahkan terutama rumus-rumus yang rumit. Dan hal ini kemudian ada metode Secant sebagai modifikasi dari Newton Raphson yang bisa memperbaiki Newton Raphson.
  5. 5. 2). Lagrange x 1,0 1,3 1,6 1,9 2,2 y 0,7652 0,6201 0,4554 0,2818 0,1104 Hitung f(1.5p) → p= angka nim trakhir, maka f(1.53) code here 8<--------------------------------------------------------------- class lagrange{ public static void main (String haripinter[]){ int i,j; double a=1, b=0, z=1.53, c=0; double[] x={1,1.3,1.6,1.9,2.2}; double[] y={0.7652,0.6201,0.4554,0.2818,0.1104}; for (i=0;i<x.length ;i++ ){ a=1; for (j=0;j<y.length ;j++ ){ if(i!=j){ a=a*(z-x[j])/(x[i]-x[j]); } } b=a*y[i]; c=c+b; } System.out.println("+--------------------+"); System.out.println("| "+c+" |"); System.out.println("+--------------------+"); } } 8<---------------------------------------------------------------- Output : +--------------------+ | 0.4950260080452676 | +--------------------+

×