Anda di halaman 1dari 16

Persamaan Non linier

Mencari salah satu akar persamaan non linier :


• Metoda Bisection
• Metoda Regula false (interpolasi Linier)
• Metoda Newton Raphson
• Metoda Succesive Approximation
a. Metoda Bisection
f(x) = x3 + x2 - 3 x - 3 = 0 x = 1, f(x) = -4.
x = 2, f(x) = +3.
Perubahan tanda diantara x = 1 dan x = 2  ada akar berada pada interval (1,2)

F(x)

4
3
2
1
1 2 X
-
1-
2-
3-
4
Metoda Bisection

F(x)  Untuk x1 = 1 maka f(1) = -4 dan x2 = 2 maka f(1) = 3


 Harga f(1) dan f(2) berlawanan tanda  ada akar
4  Hitung harga baru x = (x1 + x2)/2
 Harga fungsi pada x=1,5 f(1,5)= -1,875
3 (x2,f2)
 Bandingkan dengan harga f(1)=-4 dan f(2)= 3
2 (x4,f4)  Harga fungsi berubah tanda diantara x = 1,5 dan x = 2,
1  Maka satu akar terletak diantara x = 1,5 dan x = 2,
 Operasi membagi dua interval ini diulang untuk
X1 X3 X4 X2 X menentukan posisi akar sebenarnya.
-
(x5,f5)  Akhirnya diperoleh harga x = 1,73205081
1-
2- (x3,f3)
3-
(x1,f1)
4
Algoritma Metoda Bisection
1. Pilih harga x1 dan x2 sehingga f(x1) dan f(x2) berlawanan tanda.
2. Tentukan harga x3 dengan rumus : x3 = (x1 + x2)/2
3. Bila Err  Toleransi, harga x3 adalah harga x yang dicari.
Bila tidak, lanjutkan ke tahap 4.
4. Bila f(x3 ) berlawanan tanda dengan f(x1 ), tetapkan x2 = x3
Bila f(x3 ) berlawanan tanda dengan f(x2 ), tetapkan x1 = x3
Kembali ke tahap 2.

Err = abs(x2-x1)/2 atau abs(f(x3))


Start
Flowchart
Read x1,x2, Tol Metoda Bisection
f1 = f ( x1 )
f2 = f ( x2 )

Y
f1. f2 > 0

x3 = 1/2 ( x1 + x2 )

E = 1/2 .abs( x1 – x2 )

Y
E< Tol Cetak x3

f3 = f ( x3 ) End

Y
f1. f2 < 0 x2 = x3
f2 = f3
N

x1 = x3
f1 = f3
Contoh Metoda Bisection :
f(x) = x3 + x2 - 3 x - 3 = 0
Ite x1 x2 x3 f(x1) f(x2) f(x3) Err= ‌x1- x2 ‌/2

1 1 2 1.5 -4 3 -1.875 0.5


2 1.5 2 1.75 -1.875 3 0.171875 0.25
3 1.5 1.75 1.625 -1.875 0.171875 -0.94336 0.125
4 1.625 1.75 1.6875 -0.94336 0.171875 -0.40942 0.0625
5 1.6875 1.75 1.71875 -0.40942 0.171875 -0.12479 0.03125
6 1.71875 1.75 1.734375 -0.12479 0.171875 0.02203 0.015625
. .
. .
. .
17 1.73204 1.732056 1.732048 -9.8E-05 4.6E-05 -2.6E-05 7.62939E-06
Metoda Regula false
f ( x2 )
x3  x 2  ( x 2  x1 )
f ( x 2 )  f ( x1 )

F(x)

4
3 (x2,f2)
2
1

X1 X3 X2 X
-
.f(x2)-f(x1)
1-
2-
(x3,f3)
3-
(x1,f1)
4
Algoritma Metoda Regula False
1. Pilih harga x1 dan x2 sehingga f(x1) dan f(x2) berlawanan tanda.
2. Tentukan harga x3 dengan rumus :
f ( x2 )
x3  x 2  ( x 2  x1 )
f ( x 2 )  f ( x1 )
3. Bila Err  Toleransi, harga x3 adalah harga x yang dicari.
Bila tidak, lanjutkan ke tahap 4.
4. Bila f(x3 ) berlawanan tanda dengan f(x1 ), tetapkan x2 = x3
Bila f(x3 ) berlawanan tanda dengan f(x2 ), tetapkan x1 = x3
Kembali ke tahap 2.
Contoh Metoda Regula False :
f(x) = x3 + x2 - 3 x - 3 = 0

Ite x1 x2 x3 f(x1) f(x2) f(x3) Err= ‌f(x2)‌


1 1 2 1.57143 -4 3 -1.3644 1.364431487
2 1.57143 2 1.70541 -1.3644 3 -0.2477 0.2477451
3 1.70541 2 1.72788 -0.2477 3 -0.0393 0.039339551
4 1.72788 2 1.7314 -0.0393 3 -0.0061 0.006110673
5 1.7314 2 1.73195 -0.0061 3 -0.0009 0.000945921
6 1.73195 2 1.73204 -0.0009 3 -0.0001 0.000146349
7 1.73204 2 1.73205 -0.0001 3 -2E-05 2.26406E-05
8 1.73205 2 1.73205 -2E-05 3 -4E-06 3.50252E-06
Algoritma
Metoda Regula False Modifikasi
1. Pilih harga x1 dan x2 sehingga f(x1) dan f(x2) berlawanan tanda.
2. Tetapkan SAVE = f(x1). Nyatakan f1 = f(x1) dan f2 = f(x2).
3. Tentukan harga x3 dengan rumus :

f ( x2 )
x3  x 2  ( x 2  x1 )
f ( x 2 )  f ( x1 )
4. Bila Err  Toleransi, harga x3 adalah harga x yang dicari.
Bila tidak, lanjutkan ke tahap 5.
5. Bila f(x3 ) berlawanan tanda dengan f(x1), tetapkan x2 = x3 dan
f2=f3 ;Bila f(x3) berlawanan tanda dengan SAVE tetapkan f1=f1/2
6. Bila f(x3 ) berlawanan tanda dengan f(x2), tetapkan x1 = x3 dan f1=f3 ;
Bila f(x3 ) berlawanan tanda dengan SAVE tetapkan f1=f1/2.
7. Tetapkan SAVE = f(x3 ). Kembali ke tahap 3.
Start
Flowchart
Read x1,x2, Tol
Metode Regula False
f1 = f ( x1 )
f2 = f ( x2 )

Y
f1. f2 > 0

Save =
f1

xs = x2 – ( f2 (x2-x1)) / (f2-
f1 )

E =abs( f3)

Y
Save = f3 E< Tol Cetak x3

f3 = f ( x3 ) End

N
f1 = f1/2 f1. f3 < 0 x1 = x3
f1 = f3
Y
Y
N
x2 = x3 N
f3.fs> 0 F2 = f3
f3. fs > 0

f2 = f2/2
Contoh
Metoda Regula false modifikasi :
f(x) = x3 + x2 - 3 x - 3 = 0

Ite x1 x2 x3 f(x1) f(x2) f(x3) Save


1 1 2 1.57143 -4 3 -1.3644 -4
2 1.57143 2 1.77557 -1.3644 1.5 * 0.42371 -1.36443149
3 1.57143 1.77557 1.7272 -1.3644 0.42371 -0.0458 -1.36443149
4 1.7272 1.77557 1.73579 -0.0458 0.21186 0.03551 -0.04576993
5 1.7272 1.73579 1.73204 -0.0458 0.03551 -0.0001** -0.04576993
6 1.73204 1.73579 1.73206 -0.0001 0.01775 0.00011 -0.00011256
7 1.73204 1.73206 1.73205 -0.0001 0.00011 -9E-10 -0.00011256
Metoda Newton Raphson
f x n 
X n 1  X n 
f ' x n 

F(x)

4
3 (xn,fn)
2
1
X
- Xn+2 Xn+1 Xn
1-
2-
3-
4
Algoritma Metoda Newton Raphson
1. Pilih harga xn
2. Tentukan harga xn+1 dengan rumus :
f x n 
X n 1  Xn 
f ' x n 

3. Bila Err  Toleransi, harga xn+1 adalah harga x


yang dicari.
Kembali ke tahap 2.
Contoh Metoda Newton Raphson :
f(x) = sin x -(x/2)2 =0
Ite xn f(xn) f'(xn) hn xn+1 (xn+1 - xn)/xn
1 1 2 1.57143 -4 3 -1.3644
2 1.57143 2 1.70541 -1.3644 3 -0.2477
3 1.70541 2 1.72788 -0.2477 3 -0.0393
4 1.72788 2 1.7314 -0.0393 3 -0.0061
5 1.7314 2 1.73195 -0.0061 3 -0.0009
6 1.73195 2 1.73204 -0.0009 3 -0.0001
7 1.73204 2 1.73205 -0.0001 3 -2E-05
8 1.73205 2 1.73205 -2E-05 3 -4E-06
Flowchart
Metode Newton Raphson
start

xo; tol

f(x) ; f’(x)

X1= x0 - f(x0) / f’(x0)

Abs (f(x1)) Y
Cetak
< tol Xk+1

end
X0=X1

Anda mungkin juga menyukai