analisaanalisaterapan terapan:: metodemetode numerik · pdf filegambar2 ilustrasi geometri...
TRANSCRIPT
AnalisaAnalisa TerapanTerapan: : MetodeMetodeNumerikNumerikPertemuan ke-4
Persamaan Non-Linier: Metode Secant
4 Oktober 20124 Oktober 2012
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 1
MetodeMetode Secant Secant –– DasarDasar
)(xf
)f(x - = xx
i
iii
′+1
Dalam Metode Newton
Turunan f’(xi) didekati dengan
(1)
f(x)
f(xi) [xi, f(xi)]
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 2
1
1 )()()(
−
−
−
−=′
ii
ii
ixx
xfxfxf
)()(
))((
1
11
−
−+
−
−−=
ii
iii
iixfxf
xxxfxx
Substitusi Persamaan (2) kedalam Persamaan (1) menghasilkan metodeSecant:
(2)
Gambar 1 Ilustrasi geomentri metodeNewton-Raphson.
f(xi -1)
xixi-1 x
α
MetodeMetode Secant Secant –– DasarDasar
Segitiga sebangun pada Gambar 2
DE
DC
AE
AB=
Metode secant juga dapat diturunkan secara geometrik:
f(x)
f(xi)
[xi, f(xi)]B
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 3
)()(
))((
1
1
1
−
−
+−
−−=
ii
iii
iixfxf
xxxfxx
11
1
1
)()(
+−
−
+ −=
− ii
i
ii
i
xx
xf
xx
xf
Gambar 2 Ilustrasi geometri metodeSecant
Dapat dituliskan menjadi:
Atau dapat dituliskan kembalimenjadi :
f(xi -1)
xixi-1xi+1 x
C
DE A
ALGORITMAALGORITMA METODEMETODESECANTSECANT
Persamaan Non-Linier: Metode Secant
SECANTSECANT
Dr.Eng. Agus S. Muntohar -Department of Civil
Engineering4
LangkahLangkah 11
� Pilih dua nilai perkiraan awal untukmenghitung nilai perkiraan xi+1:
)()(
))((
1
1
1
−
−
+−
−−=
ii
iii
iixfxf
xxxfxx
� Hitung nilai absolut dari kesalahanperkiraan relatif:
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 5
0101
1 x
- xx =
i
iia ×∈
+
+
)()( 1−− ii xfxf
Langkah 2Langkah 2
� Cek jika nilai |εa| lebih besar dari nilaitoleransi εs.
◦ Jika benar, maka kembali ke Langkah 1
◦ Jika tidak, maka hentikan hitungan. ◦ Jika tidak, maka hentikan hitungan.
� Cek pula jika jumlah iterasi melebihi batasmaksimum iterasi yang ditetapkan.
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 6
ContohContoh 11 Suatu papan kayu sepanjang 29 in menerima beban berupa susunanbuku-buku yang memiliki tinggibervariasi dari 8 ½ hingga 11 in. Ukuran papan adalah 3/8 in tebal danlebar 12 in. Modulus Elastisitas papankayu terebut adalah 3.667 Msi (mega square inch). Tentukan defleksivertikal maksimum papan kayutersebut, bila defleksi vertikalmengikuti persamaan berikut:
Buku
Papan
Gambar 2 Papan yang dibebani buku.
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 7
ν(x) = -0.13533x10-8 x5 – 0.66722x10-6 x4 + 0.42493x10-4 x3 –0.018507x
x adalah jarak dimana terjadi defleksi maksimum. Defleksimaksimum diperoleh dari
0)( ==dx
dvxf
Gambar 2 Papan yang dibebani buku.
ContohContoh 1 (Cont.)1 (Cont.)
Letak x yang memberikan defleksi maksimum diberikandengan persamaan
f’(x) = -0.67665x10-8 x4 – 0.26689x10-5 x3 + 0.12748x10-3 x2 –0.018509 = 0
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 8
Catatan:Akar-akar persamaan dicari dengan 3 kali iterasi. Diperlukan turunan kedua dari v(x) untuk menghitung akarpersamaan menggunakan metode Newton - RaphsonNilai absolut dari kesalahan perkiraan relatif dihitung padasetiap akhir iterasi.Jumlah digit penting ditentukan pada iterasi terakhir.
Contoh1 (Cont.) Contoh1 (Cont.)
0
0.005
0.01
0.015
0.02
0 5 10 15 20 25 30
Fu
ng
si f
(x)
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 9
0018507.010x 12748.010 x 26689.010x 67665.0)f( 2-33-54-8 =−+−−= x xx x
Gambar 3 Grafik fungsi f(x).
-0.02
-0.015
-0.01
-0.005
Fu
ng
si f
(x)
x (m)
f(x)
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
� Diambil nilai perkiraan awal untuk fungsif(x) = 0, x-1 = 10 dan x0 = 15.
� Iterasi 1: ( )( )( ) ( )10
10001
−
−
−
−−=
xfxf
xxxfxx
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 10
( )
( ) ( ) ( )4
233548
2
0
33
0
54
0
8
0
102591.8
018507.0151012748.015106689.2151067665.0
018507.01012748.0106689.21067665.0
−
−−−
−−−
×=
−×+×−×−=
−×+×−×−= xxxxf
( )
( ) ( ) ( )3
233548
2
1
33
1
54
1
8
1
104956.8
018507.0101012748.010106689.2101067665.0
018507.01012748.0106689.21067665.0
−
−−−
−
−
−
−
−
−
−
×−=
−×+×−×−=
−×+×−×−= xxxxf
0
0.005
0.01
0.015
0.02
Fu
ng
si f
(x)
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
-0.02
-0.015
-0.01
-0.005
0
0 5 10 15 20 25 30
Fu
ng
si f
(x)
x (m)
f(x) X-1 x0 x1 Slope
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 11
Gambar 4 Grafik hasil iterasi 1
( )( )( ) ( )
557.14
104956.8102591.8
1015102591.815
34
4
1
=
×−−×
−×−=
−−
−
x
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
� Nilai absolut dari kesalahan perkiraanrelatif |εa| dari hasil Iterasi 1 adalah :
1001
01 ×−
=∈x
xxa
� Jumlah digit penring adalah 1, karena |εa| < 5%
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 12
% 0433.3
100557.14
15557.14
=
×−
=
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
� Iterasi 2: Perkiraan akar persamaanberikutnya menggunakan nilai x0 = 15 danx1 = 14.557( )( )
( ) ( )01
01112
xfxf
xxxfxx
−
−−=
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 13
( )
( ) ( ) ( )5
233548
2
1
33
1
54
1
8
1
109870.2
018507.0557.141012748.0557.14106689.2557.141067665.0
018507.01012748.0106689.21067665.0
−
−−−
−−−
×−=
−×+×−×−=
−×+×−×−= xxxxf
( )( )( ) ( )
572.14
102591.8109870.2
15557.14109870.215
45
5
2
=
×−×−
−×−−=
−−
−
x
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
0
0.005
0.01
0.015
0.02
Fu
ng
si f
(x)
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 14
Gambar 5 Grafik hasil iterasi 2
-0.02
-0.015
-0.01
-0.005
0
0 5 10 15 20 25 30
Fu
ng
si f
(x)
x (m)
f(x) x0 x1 X2 Slope
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
� Nilai absolut dari kesalahan perkiraan relatif |εa| dari hasil Iterasi 2 adalah :
100572.14
557.14572.14
1002
12
×−
=
×−
=∈x
xxa
� Jumlah digit penring adalah 2, karena |εa| < 0.5%
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 15
% 10611.0
100572.14
=
×=
Contoh1 (Cont.) Contoh1 (Cont.) -- SolusiSolusi
� Iterasi 3: Perkiraan akar persamaanberikutnya menggunakan nilai x1 = 14.557 dan x2 = 14.572 ( )( )
( ) ( )12
12223
xfxf
xxxfxx
−
−−=
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 16
( )
( ) ( ) ( )9
233548
2
2
33
2
54
2
8
2
100676.6
018507.0572.141012748.0572.14106689.2572.141067665.0
018507.01012748.0106689.21067665.0
−
−−−
−−−
×−=
−×+×−×−=
−×+×−×−= xxxxf
( )( )
( ) ( )
9
3 9 5
6.0676 10 14.572 14.55714.572
6.0676 10 2.9870 10
14.572
x
−
− −
− × −= −
− × − − ×
=
Example 1 Cont.Example 1 Cont.
0
0.005
0.01
0.015
0.02
Fu
ng
si f
(x)
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 17
Gambar 6 Grafik hasil iterasi 3
-0.02
-0.015
-0.01
-0.005
0
0 5 10 15 20 25 30
Fu
ng
si f
(x)
x (m)
f(x) x1 X2 x3 Slope
Example 1 Cont.Example 1 Cont.
The absolute relative approximate error at the end of Iteration 3 isa∈
10012 ×−
=∈x
xxa
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 18
%102.1559
100572.14
572.14572.14
5
2
−×=
×−
=
x
The number of significant digits at least correct is 6, because the absolute relative approximate error is less than 0.00005%.
Resume Resume IterasiIterasi ContohContoh 11
Ite-rasi
xi-1 xi xi+1 f(xi-1) f(xi) f(xi+1) |εεεεa| %
1 10 15 14.557 -8.4956x10-3 8.2591x10-4 -2.987x10-5 3.0433
2 15 14.557 14.572 8.2591x10-4 -2.987x10-5 -6.0676x10-9 0.10611
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 19
2 15 14.557 14.572 8.2591x10 -2.987x10 -6.0676x10 0.10611
3 14.557 14.572 14.572 -2.987x10-5 -6.0676x10-9 -6.0676x10-9 2.1559x10-5
KelebihanKelebihan
� Konvergensi yang diraih lebih cepat, jika diperoleh nilaiyang konvergenyang konvergen
� Memakai dua nilai perkiraan yang tidak memerlukan akaryang disimpan
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 20
KekuranganKekurangan: : PembagianPembagian nolnol
1
22
0
f x( )
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 21
10 5 0 5 102
1
0
f(x)
prev. guess
new guess
2−
0f x( )
f x( )
1010− x x guess1, x guess2,
( ) ( ) 0== xSinxf
KekuranganKekurangan: : LompatanLompatan AkarAkar
Root Jumping
0
1
22
0
f x( )
f x( )
f x( )
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 22
10 5 0 5 102
1
0
f(x)
x'1, (first guess)
x0, (previous guess)
Secant line
x1, (new guess)
2−
f x( )
secant x( )
f x( )
1010− x x 0, x 1', x, x 1,
( ) 0== Sinxxf
Contoh 2Contoh 2
� Suatu bola terapung seperti Gambar 6 memiliki berat jenis 0.6 dan jari-jari 5.5 cm. Tentukan kedalaman bola yang terendam dalam air!terendam dalam air!
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 23
Gambar 7 Diagram bola terapung
ContohContoh 2 (Cont.)2 (Cont.)
� Kedalaman bola yang terendam air x dinyatakan dengan persamaan berikut
�
a) Gunakan metode Secant untuk menentukan010993.3165.0 423 =×+− −
xx
a) Gunakan metode Secant untuk menentukanakar-akar persamaan kedalaman bola yang terendam air x. Lakukan tiga kali iterasiuntuk memperkirakan akar-akar persamaanterebut.
b) Tentukan nilai absolut dari kesalahanperkiraan relatif pada masing-masing iterasi, dan jumlah digit pentingnya.
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 24
ContohContoh 2 (Cont.)2 (Cont.)
Secara fisik, bagian bola yang terendam air memiliki kedalamanantara x = 0 dan x = 2R,
dengan R = jari-jari bola,
yaituyaitu
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 25
( )
11.00
055.020
20
≤≤
≤≤
≤≤
x
x
Rx
Gambar 7 Diagram bola terapung
0.0001
0.0002
0.0003
0.0004
0.0005
Fun
gsi
f(x
)
Untuk membantupemahaman tentangbagaimana metode ini
ContohContoh 2 (Cont. ) 2 (Cont. ) –– SolusiSolusi
Penyelesaian:
-0.0003
-0.0002
-0.0001
0
0.0001
-0.02 0 0.02 0.04 0.06 0.08 0.1 0.12
Fun
gsi
f(x
)
x (m)
f(x)
bagaimana metode inidigunakan untuk mencariakar-akar persamaan, ditampilkan grafik fungsif(x), dimana
Dr.Eng. Agus S. Muntohar -Department of Civil Engineering 26
( ) 423 1099331650 -.x.xxf ×+−= Gambar 8 Grafik dari fungsi f(x)
ContohContoh 2 (Cont. ) 2 (Cont. ) –– SolusiSolusi
� Asumsikan nilai perkiraan awal dari f(x) = 0 pada x-1 = 0.02 dan x0 = 0.05
� Iterasi 1: Akar persamaan dihitung dengan
( )( )
http://numericalmethods.eng.usf.edu 27
( )( )
( ) ( )
( )( )( )
( )( ) ( )( )
0 0 1
1 0
0 1
23 4
2 23 4 3 4
0.05 0.165 0.05 3.993 10 0.05 0.020.05
0.05 0.165 0.05 3.993 10 0.02 0.165 0.02 3.993 10
0.06461
f x x xx x
f x f x
−
−
−
− −
−= −
−
− + × −= −
− + × − − + ×
=
ContohContoh 2 (Cont. ) 2 (Cont. ) –– SolusiSolusi
The absolute relative approximate error at the end of Iteration 1 is
10001 ×−
=∈x
xxa
a∈
http://numericalmethods.eng.usf.edu 28
%62.22
10006461.0
05.006461.0
1
=
×−
=
xa
The number of significant digits at least correct is 0, as you need an absolute relative approximate error of 5% or less for one significant digits to be correct in your result.
ContohContoh 2 (Cont. ) 2 (Cont. ) –– SolusiSolusi
http://numericalmethods.eng.usf.edu 29
Gambar 9 Graph of results of Iteration 1.
Example 1 Cont.Example 1 Cont.
Iteration 2The estimate of the root is
( )( )− xxxf
http://numericalmethods.eng.usf.edu 30
( )( )( ) ( )
( )( )( )( )( ) ( )( )
06241.0
10993.305.0165.005.010993.306461.0165.006461.0
05.006461.010993.306461.0165.006461.006461.0
423423
423
01
01112
=
×+−−×+−
−×+−−=
−
−−=
−−
−
xfxf
xxxfxx
Example 1 Cont.Example 1 Cont.
The absolute relative approximate error at the end of Iteration 2 is
10012 ×−
=∈x
xxa
a∈
http://numericalmethods.eng.usf.edu 31
%525.3
10006241.0
06461.006241.0
2
=
×−
=
xa
The number of significant digits at least correct is 1, as you need an absolute relative approximate error of 5% or less.
Example 1 Cont.Example 1 Cont.
http://numericalmethods.eng.usf.edu 32
Figure 6 Graph of results of Iteration 2.
Example 1 Cont.Example 1 Cont.
Iteration 3The estimate of the root is
( )( )− xxxf
http://numericalmethods.eng.usf.edu 33
( )( )( ) ( )
( )( )( )( )( ) ( )( )
06238.0
10993.306461.0165.005.010993.306241.0165.006241.0
06461.006241.010993.306241.0165.006241.006241.0
423423
423
12
12223
=
×+−−×+−
−×+−−=
−
−−=
−−
−
xfxf
xxxfxx
Example 1 Cont.Example 1 Cont.
The absolute relative approximate error at the end of Iteration 3 is
10023 ×−
=∈x
xxa
a∈
http://numericalmethods.eng.usf.edu 34
%0595.0
10006238.0
06241.006238.0
3
=
×−
=
xa
The number of significant digits at least correct is 5, as you need an absolute relative approximate error of 0.5% or less.
Iteration #3Iteration #3
http://numericalmethods.eng.usf.edu 35
Figure 7 Graph of results of Iteration 3.