Analisa
Analisa Terapan
Terapan: : Metode
Metode
Numerik
Numerik
Pertemuan ke-4
Persamaan Non-Linier: Metode Secant
4 Oktober 2012
4 Oktober 2012
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 1
Metode
Metode Secant
Secant –
– Dasar
Dasar
)
(x
f
)
f(x
-
= x
x
i
i
i
i
′
+1
Dalam Metode Newton
Turunan f’(x
i
) didekati dengan
(1)
f(x)
f(x
i
)
[x
i
, f(x
i
)]
1 1)
(
)
(
)
(
− −−
−
=
′
i i i i ix
x
x
f
x
f
x
f
)
(
)
(
)
)(
(
1 1 1 − − +−
−
−
=
i i i i i i ix
f
x
f
x
x
x
f
x
x
Substitusi Persamaan (2) ke
dalam Persamaan (1)
menghasilkan metode
Secant:
(2)
Gambar 1 Ilustrasi geomentri metode
Newton-Raphson.
f(x
i -1
)
x
i
x
i-1
x
Metode
Metode Secant
Secant –
– Dasar
Dasar
Segitiga sebangun pada Gambar 2
DE
DC
AE
AB
=
Metode secant juga dapat diturunkan secara geometrik:
f(x)
f(x
i
)
[x
i
, f(x
i
)]
B
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 3
)
(
)
(
)
)(
(
1 1 1 − − +−
−
−
=
i i i i i i ix
f
x
f
x
x
x
f
x
x
1 1 1 1)
(
)
(
+ − − +−
=
−
i i i i i ix
x
x
f
x
x
x
f
Gambar 2 Ilustrasi geometri metode
Secant
Dapat dituliskan menjadi:
Atau dapat dituliskan kembali
menjadi :
f(x
i -1
)
x
i
x
i-1
x
i+1
x
C
D
E
A
ALGORITMA
ALGORITMA METODE
METODE
SECANT
SECANT
Persamaan Non-Linier: Metode Secant
SECANT
SECANT
-Langkah
Langkah 1
1
Pilih dua nilai perkiraan awal untuk
menghitung nilai perkiraan x
i+1
:
)
(
)
(
)
)(
(
1
1
1
−
−
+
−
−
−
=
i
i
i
i
i
i
i
x
f
x
f
x
x
x
f
x
x
Hitung nilai absolut dari kesalahan
perkiraan relatif:
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 5
0
10
1
1
x
- x
x
=
i
i
i
a
×
∈
+
+
)
(
)
(
x
i
−
f
x
i
−
1
f
Langkah 2
Langkah 2
Cek jika nilai |ε
a
| lebih besar dari nilai
toleransi ε
s
.
◦
Jika benar, maka kembali ke Langkah 1
◦
Jika tidak, maka hentikan hitungan.
◦
Jika tidak, maka hentikan hitungan.
Cek pula jika jumlah iterasi melebihi batas
Contoh
Contoh 1
1
Suatu papan kayu sepanjang 29 in
menerima beban berupa susunan
buku-buku yang memiliki tinggi
bervariasi dari 8 ½ hingga 11 in.
Ukuran papan adalah 3/8 in tebal dan
lebar 12 in. Modulus Elastisitas papan
kayu terebut adalah 3.667 Msi (mega
square inch). Tentukan defleksi
vertikal maksimum papan kayu
tersebut, bila defleksi vertikal
mengikuti persamaan berikut:
Buku
Papan
Gambar 2 Papan yang dibebani buku.
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 7
ν
(x) = -0.13533x10
-8
x
5
– 0.66722x10
-6
x
4
+ 0.42493x10
-4
x
3
–
0.018507x
x
adalah jarak dimana terjadi defleksi maksimum. Defleksi
maksimum diperoleh dari
0
)
(
=
=
dx
dv
x
f
Gambar 2 Papan yang dibebani buku.
Contoh
Contoh 1 (Cont.)
1 (Cont.)
Letak x yang memberikan defleksi maksimum diberikan
dengan persamaan
f’(x) = -0.67665x10
-8
x
4
– 0.26689x10
-5
x
3
+ 0.12748x10
-3
x
2
–
0.018509 = 0
Catatan:
Akar-akar persamaan dicari dengan 3 kali iterasi.
Diperlukan turunan kedua dari v(x) untuk menghitung akar
persamaan menggunakan metode Newton - Raphson
Nilai absolut dari kesalahan perkiraan relatif dihitung pada
setiap akhir iterasi.
Contoh1 (Cont.)
Contoh1 (Cont.)
0 0.005 0.01 0.015 0.02 0 5 10 15 20 25 30F
u
n
g
si
f
(x
)
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 9
0
018507
.
0
10
x
12748
.
0
10
x
26689
.
0
10
x
67665
.
0
)
f(
x
=
−
-8x
4−
-5x
3+
-3x
2−
=
Gambar 3 Grafik fungsi f(x).
-0.02 -0.015 -0.01 -0.005F
u
n
g
si
f
(x
)
x (m)
f(x)Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
Diambil nilai perkiraan awal untuk fungsi
f(x) = 0, x
-1
= 10 dan x
0
= 15.
Iterasi 1:
( )(
)
( )
0( )
1 1 0 0 0 1 − −−
−
−
=
x
f
x
f
x
x
x
f
x
x
( )
( )
( )
( )
4 2 3 3 5 4 8 2 0 3 3 0 5 4 0 8 010
2591
.
8
018507
.
0
15
10
12748
.
0
15
10
6689
.
2
15
10
67665
.
0
018507
.
0
10
12748
.
0
10
6689
.
2
10
67665
.
0
− − − − − − −×
=
−
×
+
×
−
×
−
=
−
×
+
×
−
×
−
=
x
x
x
x
f
( )
( )
( )
( )
3 2 3 3 5 4 8 2 1 3 3 1 5 4 1 8 110
4956
.
8
018507
.
0
10
10
12748
.
0
10
10
6689
.
2
10
10
67665
.
0
018507
.
0
10
12748
.
0
10
6689
.
2
10
67665
.
0
− − − − − − − − − − −×
−
=
−
×
+
×
−
×
−
=
−
×
+
×
−
×
−
=
x
x
x
x
f
0 0.005 0.01 0.015 0.02 F u n g si f (x )
Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
-0.02 -0.015 -0.01 -0.005 0 0 5 10 15 20 25 30 F u n g 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
10
4956
.
8
10
2591
.
8
10
15
10
2591
.
8
15
4 3 4 1=
×
−
−
×
−
×
−
=
− − −x
Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
Nilai absolut dari kesalahan perkiraan
relatif |ε
a
| dari hasil Iterasi 1 adalah :
100
1 0 1−
×
=
∈
x
x
x
aJumlah digit penring adalah 1, karena |ε
a
| <
5%
%
0433
.
3
100
557
.
14
15
557
.
14
=
×
−
=
Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
Iterasi 2: Perkiraan akar persamaan
berikutnya menggunakan nilai x
0
= 15 dan
x
1
= 14.557
( )(
)
( )
1( )
0 0 1 1 1 2x
f
x
f
x
x
x
f
x
x
−
−
−
=
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 13
( )
(
)
(
)
(
)
5 2 3 3 5 4 8 2 1 3 3 1 5 4 1 8 110
9870
.
2
018507
.
0
557
.
14
10
12748
.
0
557
.
14
10
6689
.
2
557
.
14
10
67665
.
0
018507
.
0
10
12748
.
0
10
6689
.
2
10
67665
.
0
− − − − − − −×
−
=
−
×
+
×
−
×
−
=
−
×
+
×
−
×
−
=
x
x
x
x
f
(
)
(
)
(
) (
)
572
.
14
10
2591
.
8
10
9870
.
2
15
557
.
14
10
9870
.
2
15
5 4 5 2=
×
−
×
−
−
×
−
−
=
− − −x
Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
0
0.005
0.01
0.015
0.02
F
u
n
g
si
f
(x
)
Gambar 5 Grafik hasil iterasi 2
-0.02
-0.015
-0.01
-0.005
0
0
5
10
15
20
25
30
F
u
n
g
si
f
(x
)
x (m)
f(x) x0 x1 X2 SlopeContoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
Nilai absolut dari kesalahan perkiraan relatif |ε
a| dari hasil Iterasi 2
adalah :
100
572
.
14
557
.
14
572
.
14
100
2 1 2×
−
=
×
−
=
∈
x
x
x
aJumlah digit penring adalah 2, karena |ε
a| < 0.5%
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 15
%
10611
.
0
100
572
.
14
=
×
=
Contoh1 (Cont.)
Contoh1 (Cont.) -- Solusi
Solusi
Iterasi 3: Perkiraan akar persamaan
berikutnya menggunakan nilai x
1
= 14.557
dan x
2
= 14.572
( )(
)
( )
2( )
1 1 2 2 2 3x
f
x
f
x
x
x
f
x
x
−
−
−
=
( )
(
)
(
)
(
)
9 2 3 3 5 4 8 2 2 3 3 2 5 4 2 8 210
0676
.
6
018507
.
0
572
.
14
10
12748
.
0
572
.
14
10
6689
.
2
572
.
14
10
67665
.
0
018507
.
0
10
12748
.
0
10
6689
.
2
10
67665
.
0
− − − − − − −×
−
=
−
×
+
×
−
×
−
=
−
×
+
×
−
×
−
=
x
x
x
x
f
(
)
(
)
(
) (
)
9 3 9 56.0676 10
14.572 14.557
14.572
6.0676 10
2.9870 10
14.572
x
− − −−
×
−
=
−
−
×
− −
×
=
Example 1 Cont.
Example 1 Cont.
0 0.005 0.01 0.015 0.02F
u
n
g
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
F
u
n
g
si
f
(x
)
x (m)
f(x) x1 X2 x3 SlopeExample 1 Cont.
Example 1 Cont.
The absolute relative approximate error at the end of Iteration 3 is
∈
a100
1 2−
×
=
∈
x
x
x
a%
10
2.1559
100
572
.
14
572
.
14
572
.
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 Iterasi
Iterasi Contoh
Contoh 1
1
Ite-rasi
x
i-1x
ix
i+1f(x
i-1)
f(x
i)
f(x
i+1)
|εεεε
a| %
1
10
15
14.557
-8.4956x10
-38.2591x10
-4-2.987x10
-53.0433
2
15
14.557
14.572
8.2591x10
-4-2.987x10
-5-6.0676x10
-90.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
-92.1559x10
-5Kelebihan
Kelebihan
Konvergensi yang diraih lebih cepat, jika diperoleh nilai
yang konvergen
yang konvergen
Memakai dua nilai perkiraan yang tidak memerlukan akar
Kekurangan
Kekurangan: : Pembagian
Pembagian nol
nol
1 2 2
0 f x( )
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 21
10 5 0 5 10 2 1 0 f(x) prev. guess new guess 2 − 0 f x( ) f x( ) 10 10 − x x, guess1,xguess2
( )
x =Sin( )
x =0 fKekurangan
Kekurangan: : Lompatan
Lompatan Akar
Akar
Root Jumping
0 1 2 2 0 f x( ) f x( ) f x( ) 10 5 0 5 10 2 1 0 f(x) x'1, (first guess) x0, (previous guess) Secant line x1, (new guess) 2 − f x( ) secant x( ) f x( ) 10 10 − x x, 0,x1',x,x1( )
x = Sinx=0 fContoh 2
Contoh 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
Contoh
Contoh 2 (Cont.)
2 (Cont.)
Kedalaman bola yang terendam air x
dinyatakan dengan persamaan berikut
a) Gunakan metode Secant untuk menentukan
0
10
993
.
3
165
.
0
2 4 3=
×
+
−
x
−x
a) Gunakan metode Secant untuk menentukan
akar-akar persamaan kedalaman bola yang
terendam air x. Lakukan tiga kali iterasi
untuk memperkirakan akar-akar persamaan
terebut.
b) Tentukan nilai absolut dari kesalahan
perkiraan relatif pada masing-masing iterasi,
dan jumlah digit pentingnya.
Contoh
Contoh 2 (Cont.)
2 (Cont.)
Secara fisik, bagian bola yang terendam air memiliki kedalaman
antara x = 0 dan x = 2R,
dengan R = jari-jari bola,
yaitu
yaitu
Dr.Eng. Agus S. Muntohar
-Department of Civil Engineering 25
(
)
11
.
0
0
055
.
0
2
0
2
0
≤
≤
≤
≤
≤
≤
x
x
R
x
Gambar 7 Diagram bola terapung
0.0001 0.0002 0.0003 0.0004 0.0005 Fu n g si f (x )
Untuk membantu
pemahaman tentang
bagaimana metode ini
Contoh
Contoh 2 (Cont. )
2 (Cont. ) –
– Solusi
Solusi
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 Fu n g si f (x ) x (m) f(x)bagaimana metode ini
digunakan untuk mencari
akar-akar persamaan,
ditampilkan grafik fungsi
f(x), dimana
( )
3
2
4
10
993
3
165
0
.
x
.
-x
x
Contoh
Contoh 2 (Cont. )
2 (Cont. ) –
– Solusi
Solusi
Asumsikan nilai perkiraan awal dari f(x) =
0 pada x
-1
= 0.02 dan x
0
= 0.05
Iterasi 1: Akar persamaan dihitung dengan
( )(
)
http://numericalmethods.eng.usf.edu 27( )(
)
( )
( )
(
)
(
)
(
)
(
)
(
)
(
(
)
)
0 0 1 1 0 0 1 2 3 4 2 2 3 4 3 40.05
0.165 0.05
3.993 10
0.05 0.02
0.05
0.05
0.165 0.05
3.993 10
0.02
0.165 0.02
3.993 10
0.06461
f x
x
x
x
x
f x
f x
− − − − −−
=
−
−
−
+
×
−
=
−
−
+
×
−
−
+
×
=
Contoh
Contoh 2 (Cont. )
2 (Cont. ) –
– Solusi
Solusi
The absolute relative approximate error at the end of
Iteration 1 is
100
0 1−
×
=
∈
x
x
x
a a∈
%
62
.
22
100
06461
.
0
05
.
0
06461
.
0
1=
×
−
=
x
aThe 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.
Contoh
Contoh 2 (Cont. )
2 (Cont. ) –
– Solusi
Solusi
http://numericalmethods.eng.usf.edu 29
Gambar 9 Graph of results of Iteration 1.
Example 1 Cont.
Example 1 Cont.
Iteration 2
The estimate of the root is
( )(
x
x
− x
)
f
( )(
)
( )
( )
(
)
(
)
(
)
(
)
(
)
(
(
)
)
06241
.
0
10
993
.
3
05
.
0
165
.
0
05
.
0
10
993
.
3
06461
.
0
165
.
0
06461
.
0
05
.
0
06461
.
0
10
993
.
3
06461
.
0
165
.
0
06461
.
0
06461
.
0
3 2 4 3 2 4 4 2 3 0 1 0 1 1 1 2=
×
+
−
−
×
+
−
−
×
+
−
−
=
−
−
−
=
− − −x
f
x
f
x
x
x
f
x
x
Example 1 Cont.
Example 1 Cont.
The absolute relative approximate error at the end of
Iteration 2 is
100
1 2−
×
=
∈
x
x
x
a a∈
http://numericalmethods.eng.usf.edu 31%
525
.
3
100
06241
.
0
06461
.
0
06241
.
0
2=
×
−
=
x
aThe 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.
Example 1 Cont.
Example 1 Cont.
Iteration 3
The estimate of the root is
( )(
x
x
− x
)
f
http://numericalmethods.eng.usf.edu 33( )(
)
( )
( )
(
)
(
)
(
)
(
)
(
)
(
(
)
)
06238
.
0
10
993
.
3
06461
.
0
165
.
0
05
.
0
10
993
.
3
06241
.
0
165
.
0
06241
.
0
06461
.
0
06241
.
0
10
993
.
3
06241
.
0
165
.
0
06241
.
0
06241
.
0
3 2 4 3 2 4 4 2 3 1 2 1 2 2 2 3=
×
+
−
−
×
+
−
−
×
+
−
−
=
−
−
−
=
− − −x
f
x
f
x
x
x
f
x
x
Example 1 Cont.
Example 1 Cont.
The absolute relative approximate error at the end of
Iteration 3 is
100
2 3−
×
=
∈
x
x
x
a a∈
%
0595
.
0
100
06238
.
0
06241
.
0
06238
.
0
3=
×
−
=
x
aThe number of significant digits at least correct is 5, as you
need an absolute relative approximate error of 0.5% or
less.
Iteration #3
Iteration #3
http://numericalmethods.eng.usf.edu 35