You are on page 1of 18

KOMPUTASI NUMERIK TEKNIK KIMIA

TK184604 – 3 SKS

Prof. Dr. Ir. KUSWANDI, DEA

DEPARTEMEN TEKNIK KIMIA


FAKULTAS TEKNOLOGI INDUSTRI DAN REKAYASA SISTEM
INSTITUT TEKNOLOGI SEPULUH NOPEMBER
Penyelesaian Persamaan Non Linier

Metode Penyelesaian
• Bisection
• Interpolasi Linier
• Modifikasi Interpolasi Linier
• Secant
➢ Newton-Raphson
➢ Pendekatan Berturutan

Kuswandi - Chem. Eng. Dept. ITS 1


Metode Bisection
f(x) = 0

1
x 3 = ( x1 + x 2 )
2
1
( x1 − x 2 )  Tol
2

Kuswandi - Chem. Eng. Dept. ITS 2


Start Bisection
Interpolasi Linier
Read x1, x2

F1 = F(x1)
F2 = F(x2)

Y
F1F2 > 0
N
1 F2
x 3 = ( x1 + x 2 ) x3 = x2 − ( x 2 − x1 )
2 F2 − F1
1
E= ( x1 − x 2 )
2
x2 = x3
F2 = F 3 Y
E < Tol Write x3 End
Y
N
x1 = x3 N
F1F3 < 0 F3 = F(x3)
F1 = F3
Kuswandi - Chem. Eng. Dept. ITS 3
Contoh : f(x) = x3 + x2 – 3x – 3

x1 x2 x3 f(x1) f(x2) f(x3)


1 2 1.5 -4 3 -1.875
1.5 2 1.75 -1.875 3 0.1719
1.5 1.75 1.625 -1.875 0.1719 -0.9434
1.625 1.75 1.6875 -0.9434 0.1719 -0.4094
1.6875 1.75 1.71875 -0.4094 0.1719 -0.1248
* * *
* * *
* * *
1.73205

Kuswandi - Chem. Eng. Dept. ITS 4


Metode Interpolasi Linier
(Regula Falsi)

x2 − x3 f (x 2 )
=
x 2 − x1 f ( x 2 ) − f ( x1 )

f2
x3 = x2 − ( x 2 − x1 )
f 2 − f1

Kuswandi - Chem. Eng. Dept. ITS 5


Contoh : f(x) = x3 + x2 – 3x – 3

x1 x2 x3 f(x1) f(x2) f(x3)


1 2 1.57143 -4 3 -1.36443
1.57143 2 1.70541 -1.36443 3 -0.24775
1.70541 2 1.72788 -0.24775 3 -0.03934
1.72788 2 1.73140 -0.0393 3 -0.00611
1.73140 2 1.73195 -0.0061 3 -0.00095
Error 0.00010
* * *
* * *
1.73205

Kuswandi - Chem. Eng. Dept. ITS 6


Modifikasi Interpolasi Linier

Kuswandi - Chem. Eng. Dept. ITS 7


Start

Read x1, x2, Tol

F1 = F(x1)
F2 = F(x2)

Y
F1F2 > 0
N
F2
Save = F3 x3 = x2 − ( x 2 − x1 ) Save = F3
F2 − F1

E = abs(f 3)
Write x3 End
Y
N E < Tol
N
Y N Y
F1 = F1/2 F3FS > 0 F3FS > 0 F2 = F2/2
F3 = F(x3)

x2 = x3 Y x1 = x3
F1F3 < 0
F2 = F3 F1 = F3
Kuswandi - Chem. Eng. Dept. ITS 8
Contoh : f(x) = x3 + x2 – 3x – 3

x1 x2 x3 f(x1) f(x2) f(x3) save


1 2 1.57143 -4 3 -1.36443 -4
1.57143 2 1.77557 -1.36443 1.5 0.42371 -1.3644
1.57143 1.77557 1.72720 -1.36443 0.4237 -0.04577 0.4237
1.72720 1.77557 1.73192 -0.0458 0.4237 -0.00128 -0.0458
1.73192 1.77557 1.73218 -0.0013 0.2119 0.00120
Error -0.00013
* * *
* * *
1.73205

Kuswandi - Chem. Eng. Dept. ITS 9


Metode Secant
• Dipilih 2 harga fungsi yang dekat dengan
akar sebenarnya
• Dilakukan interpolasi / ekstrapolasi
Contoh : f(x) = x3 + x2 – 3x – 3
x1 x2 x3 f(x1) f(x2) f(x3)
1 2 1.57143 -4 3 -1.36443
2 1.57143 1.70541 3 -1.36443 -0.24775
1.57143 1.70541 1.73514 -1.36443 -0.2477 0.02926
1.70541 1.73514 1.73200 -0.2477 0.0293 -0.00052
1.73514 1.73200 1.73205 0.0293 -0.0005 -1.04E-06
Error 0.00000
* * *
* * *
1.73205
Kuswandi - Chem. Eng. Dept. ITS 10
Metode Newton-Raphson
f(x) = 0

f (x n )
tan  =
x n − x n +1
f (x n )
f ' (x n ) =
x n − x n +1

f (x n )
x n +1 = x n −
f ' (x n )

x n +1 = x n − h n
f ' (x n )  0

Kuswandi - Chem. Eng. Dept. ITS 11


Contoh : f(x) = x3 + x2 – 3x – 3
f’(x) = 3x2 + 2x – 3

xn f(xn) f'(xn) hn Error


1 2 3 13 0.230769 0.26795
2 1.76923 0.360492 9.928994 0.036307 0.03718
3 1.73292 0.008267 9.474922 0.000873 0.00087
4 1.73205 4.72E-06 9.464108 4.99E-07 0.00000
5 1.73205 1.54E-12 9.46410 1.63E-13
1.73205
1 1 -4 2 -2
2 3.00000 24 30 0.8
3 2.20000 5.888 15.92 0.369849
4 1.83015 0.989001 10.70866 0.092355
5

Kuswandi - Chem. Eng. Dept. ITS 12


Metode Pendekatan Berturutan
Bentuk x = g(x)

f(x) = 0 x = g(x)
Contoh : f(x) = x2 – 2x – 3 = 0 x = 3, x = -1
g(xn) 1 2 3

1. x = 2x + 3 x1 4 4 4
x2 3.317 1.5 6.5
2. x = 3 /(x − 2) x3 3.104 -6 19.625
3. x = (x 2 − 3) / 2 x4 3.034 -0.375 191.0703
x5 3.011 -1.263
x6 3.004 -0.919
xn+1 = g(xn) x7 -1.028 divergen
x8 -0.991
x9 conv -1.003
monoton (osilasi)
Kuswandi - Chem. Eng. Dept. ITS 13
Konvergen monotonik
0 < g’(x) < 1

Konvergen osilasi
| g’(x) | < 1

Kuswandi - Chem. Eng. Dept. ITS 14


Divergen : | g’(x) | > 1

Iterasi konvergen bila :


| g’(x) | < 1

Kuswandi - Chem. Eng. Dept. ITS 15


Konvergensi Metode Newton
f (x n )
Algorithma : x n +1 = x n − n = 1, 2, 3, .....
f ' (x n )
x n +1 = g( x n )

Konvergen bila g’(xn) < 1

f (x)
g( x ) = x −
f ' (x)
f ' ( x )f ' ( x ) − f ( x )f ' ' ( x ) f ( x )f ' ' ( x )
g' ( x ) = 1 − 2
=
[f ' ( x )] [f ' ( x )]2

f ( x )f ' ' ( x ) f(x) dan turunannya kontinyu


2
1 f(x) <> 0
[f ' ( x )]
Kuswandi - Chem. Eng. Dept. ITS 16
Bila r : akar pers. f(x) = 0 r = g (r)
Karena xn+1 = g(xn), maka dapat ditulis
x n +1 − r = g( x n ) − g(r )
Ekspansi deret Taylor dari g(xn) di sekitar r
g ' ' ( )
g( x n ) = g(r ) + g' (r )( x n − r ) + (x n − r)2
2!
dimana :  dalam interval xn dan r
f ( r )f ' ' ( r )
g' (r ) = 2
=0 bila f(r) = 0
[f ' (r )]
g ' ' ( )
g( x n ) = g(r ) + (x n − r)2
2
Bila xn - r = en
e n +1 = x n +1 − r = g( x n ) − g(r )
g" () 2
e n +1 = en Konvergen Kuadratis
2
Kuswandi - Chem. Eng. Dept. ITS 17

You might also like