• Tidak ada hasil yang ditemukan

ROOTS OF Non Linier Equations

N/A
N/A
Protected

Academic year: 2021

Membagikan "ROOTS OF Non Linier Equations"

Copied!
47
0
0

Teks penuh

(1)

ROOTS OF Non Linier Equations

• Metode Bagi dua (Bisection Method) • Metode Regula Falsi (False Position

Method)

• Metode Grafik • Metode Grafik

• Iterasi Titik-Tetap (Fix Point Iteration) • Metode Newton-Raphson

(2)

Solusi Persamaan Kuadrat Tingkat 2

a ac b b x c bx ax x f 2 4 0 ) ( 2 2 − ± − = = + + =

Persamaan di atas memberi akar-akar penyelesaian untuk fungsi aljabarf(x)

Yaitu nilai-nilai x yang memberikan f(x) = 0

(3)

Overview of Methods

• Bracketing methods Graphing method Bisection method Bisection method False position • Open methods

One point iteration Newton-Raphson Secant method

(4)

• Memahami konsep konvergensi dan divergensi. • Memahami bahwa metode tertutup selalu

konvergen, sedangkan metode terbuka kadang-kadang divergen.

Specific Study Objectives

kadang divergen.

• Konvergensi pada metode terbuka biasanya didapat jika initial guess –nya dekat dengan akar

(5)

Metode Tertutup

• Graphical

• Bisection method

• False position method • False position method

(6)

Cara Grafik

• Plotkan fungsinya dan tentukan dimana memotong sumbu x.

• Lacks precision f(x)=e-x-x • Lacks precision

• Trial and error

f(x)=e -x -2 0 2 4 6 8 1 0 -2 -1 0 1 2 x f( x )

(7)

Cara Grafik

(limited practical value)

x f(x)

x f(x)

Pembatas atas dan Bawah memiliki tanda sama.

Akar tidak ada atau banyak akar x x x f(x) x f(x) banyak akar Tanda berbeda,

(8)

Bisection Method

• Memanfaatkan beda tanda dua nilai batas

• f(xl)f(xu) < 0 dimana l=lower (batas bawah) dan u=upper (batas atas)

u=upper (batas atas) • Minimal ada satu akar

x f(x) x f(x) x f(x)

(9)

Algorithm

• Pilih xu dan xl. Cek beda tanda nilai fungsi keduanya f(xl)f(xu) < 0

• Perkirakan akar xr = (xl + xu) / 2

• Tentukan interval berikut ada di subinterval atas atau subinterval • Tentukan interval berikut ada di subinterval atas atau subinterval

bawah

f(xl)f(xr) < 0 then xu = xr RETURN f(xl)f(xr) >0 then xl = xr RETURN

(10)

Metode Bagi Dua

Asumsi: Fungsi f(x) kontinu dalam interval

[

a0, b0

]

0 ) ( ) (a0 f b0 < f do n = 0,1,… 2 / ) (a b m = (an + bn ) / 2 m = + if f (an ) f (m) < 0, then an+1 = an , bn+1 = m else a n +1 = m , bn+1 = bn if bn+1 − an+1 ≤ ε exit end do or f (m) = 0

(11)
(12)

Error

100 × − = awal awal akhir a perkiraan perkiraan perkiraan ε

(13)

•f(x) = e-x - x

CONTOH

Gunakan bisection method untuk mencari

akar-akar persamaan

8 1 0 •f(x) = e - x •xl = -1 xu = 1 3.7 1 8282 -0.6321 2 -2 0 2 4 6 8 -2 -1 0 1 2 x f( x )

(14)

SOLUTION

6 8 1 0 f( x ) 3.7 1 8282 -0.6321 2 1 -2 0 2 4 -2 -1 0 1 2 x f( x )

(15)

1 2

SOLUTION

-0.6321 2 0.1 065 31 -2 0 -1 0 1 2 x f( x )

(16)

False Position Method

• “Brute Force” dari metode bagi dua kurang efisien

• Menghubungkan dua nilai batas dengan garis • Menghubungkan dua nilai batas dengan garis

lurus

• Mengganti kurva menjadi garis lurus memberikan “false position”

(17)

xl xu f(xu) next estimate, xr

( )

( )

f x x x f x x x l u − = − Based on similar triangles xu f(xl)

( )(

)

( )

( )

x x x x x x f x x x f x f x r l r u r u u l u l u − = − = − − −

(18)

Regula Falsi

Asumsi: Fungsi f(x) kontinu dalam interval

[

a0, b0

]

0 ) ( ) (a0 f b0 < f do n = 0,1,… )] ( ) ( /[ ] ) ( ) ( [ f b a f a b f b f a w = [ f (bn )an − f (an )bn ] /[ f (bn ) − f (an )] w = − − if f (an ) f (w) < 0, then an+1 = an , bn+1 = w else a n +1 = w , bn+1 = bn if bn+1 − an+1 ≤ ε exit end do or f (w) = 0

(19)
(20)

CONTOH

Tentukan akar persamaan dari persamaan berikut menggunakan false position method, mulai

dengan initial estimate xl=4.55 and xu=4.65

f(x) = x

3

- 98

-40 -30 -20 -1 0 0 1 0 20 30 4 4.5 5 x f( x )

(21)

Open Methods

• Simple one point iteration • Newton-Raphson method • Secant method

• Secant method

• Pada metode tertutup, akar terdapat di antara kedua interval yang dibatasi batas atas dan bawah

(22)

Open Methods

• Metode terbuka diharapkan konvergen

solution moves closer to the root as the computation progresses

• Metode terbuka;

– single starting value, atau

– two starting values that do not necessarily bracket the root

• Ada kemungkinan metode ini divergen

solution moves farther from the root as the computation progresses

(23)

The tangent f(x) f(x ) The tangent gives next estimate. xi x f(xi) xi+1 f(xi+1 )

(24)

Solution can “overshoot” the root and potentially diverge f(x) x x0 x x1 x2

(25)

Simple one point iteration /

Metode Titik Tetap

• Merubah formula untuk memperkirakan akar

• Re-arrange fungsi f(x) sehingga ada satu nilai x pada sebelah kiri dari persamaan

pada sebelah kiri dari persamaan

Contoh, untuk f(x) = x2 - 2x + 3 = 0 Ubah menjadi

(26)

Simple one point iteration

• Contoh lain, untuk

f(x) = sin x = 0, menjadi

x = sin x + x x = sin x + x

• Hitung nilai x = g(x)

• Perkiraan nilai berikut berdasar pada

(27)
(28)

CONTOH

• Untuk f(x) = e-x -3x • Ubah menjadi g(x) = e-x / 3 • Initial guess x = 0 • Initial guess x = 0 -6 -4 -2 0 2 4 6 8 1 0 1 2 1 4 1 6 -2 -1 0 1 2 x f( x )

(29)

Initial guess 0.000 g(x) f(x) εεεε a 0.333 -0.283 0.239 0.071 39.561 0.263 -0.018 9.016 -6 -4 -2 0 2 4 6 8 1 0 1 2 1 4 1 6 f( x ) 0.263 -0.018 9.016 0.256 0.005 2.395 0.258 -0.001 0.612 0.258 0.000 0.158 0.258 0.000 0.041 -2 -1 0 1 2 x

(30)

Metode Newton Raphson

( )

( )

tangent = = = − dy dx f f x f xi ' ' 0 f(xi) tangent

( )

( )

( )

( )

= − − = − + + f x f x x x rearrange x x f x f x i i i i i i i i ' ' 0 1 1 xi xi+1

(31)
(32)

Newton Raphson

Pitfalls

(33)

CONTOH

Gunakan metode

Newton Raphson untuk mencari akar-akar dari

60 80 1 00

mencari akar-akar dari f(x) = x2 - 11 memakai initial guess xi = 3 -20 0 20 40 60 0 2 4 6 8 1 0 x f( x )

(34)

Newton Rhapson

 Secant

• Include an upper limit on the number of iterations

• Establish a tolerance, ε • Establish a tolerance, εs

• Check to see if εa is increasing

Bagaimana jika turunan fungsinya sulit dipecahkan? SECANT METHOD

(35)

Secant method

( ) ( ) ( ) f x f x f x x x i i i i ' = − − − − 1 1

Memperkirakan turunan menggunakan finite divided difference

i− 1 i

APAKAH finite divided difference? HINT: dy / dx = ∆y / ∆x

(36)

( ) ( )i i i i x f x f x x +1 = − ' Masukkan perkiraan dengan finite difference pada rumus untuk

Newton Raphson

Secant method

( )( ) ( i ) ( )i i i i i i x f x f x x x f x x − − − = − − + 1 1 1

(37)
(38)

Secant method

( )(

)

(

i

)

( )

i i i i i i x f x f x x x f x x − − − = − − + 1 1 1

• Membutuhkan dua nilai perkiraan awal

• f(x) tidak harus berbeda tanda, membedakan dengan metode tertutup, false position method.

(39)

f(x) 1 2 f(x) 2 FALSE POSITION SECANT METHOD x 1 new est. x 1 new est. Perkiraan baru

dipilih dari potongan garis dengan sumbu x

Perkiraan baru bisa diluar batas kurva

(40)

Systems of Non-Linear Equations

• Kita telah mengenal sistem persamaan linier

f(x) = a1x1 + a2x2+... anxn - C = 0

dimana a11 , a22 .... ann dan C adalah konstanta

• Maka, perhatikan sistem persamaan non-linier

y = -x2 + x + 0.5 y + 5xy = x3

(41)

Systems of Non-Linear Equations

• Buat persamaan sama dengan nol

u = x2 + xy – 10 v = y + 3xy2 – 57

• u(x,y) = x2 + xy – 10 = 0 • u(x,y) = x2 + xy – 10 = 0 • v(x,y) = y + 3xy2 – 57 = 0

• Solusi adalah nilai-nilai x dan y yang akan

memberikan nilai fungsi u dan v sama dengan nol.

(42)

Metode Titik Tetap

• Mulai dengan nilai awal x0 = 1.5 dan y0 = 3.5

0 0 1

10

x

y

x

=

1 0 1 0 0 1

3

57

10

x

y

y

y

x

x

=

=

(43)

Metode Newton Rhapson

x x u v y v u y u x v y u y v x i i i i i i i i i + = − − − 1 ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂

u(x,y) dan

v(x,y)

x y y x y y u v y v u y u x v y u y v x i i i i i i i i i + = − − − 1 ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂

Versi dua persamaan untuk Newton-Raphson

(44)

Determinan Jacobian

(tambahan saja)

x x u v y v u y u x v y u y v x i i i i i i i i i + = − − − 1 ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ THE DENOMINATOR OF EACH OF THESE EQUATIONS IS FORMALLY x y y x y y u v y v u y u x v y u y v x i i i i i i i i i + = − − − 1 ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ FORMALLY REFERRED TO AS THE DETERMINANT OF THE JACOBIAN

(45)

Jacobian (tambahan juga)

• The general definition of the Jacobian for n

functions of n variables is the following set of partial derivatives: x f x f x f ∂ ∂ ∂ ∂ ∂ ∂ ... 1 1 1 n n n n n n n n x f x f x f x f x f x f x x x x x x f f f ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ = ∂ ∂ ... ... ... ... ... ... ... ) ,..., , ( ) ,..., , ( 2 1 2 2 2 1 2 2 1 2 1 2 1

(46)

Jacobian (ini juga tambahan)

• The Jacobian can be used to calculate derivatives from a

function in one coordinate sytem from the derivatives of that same function in another coordinate system.

• Equations u=f(x,y), v=g(x,y), then x and y can be determined as functions of u and v (possessing first partial derivatives) as

follows: x f f y f f y x f u = ( , ); = ∂ / ∂ ; = ∂ / ∂

• With similar functions for xv and yv.

• The determinants in the denominators are examples of the use of Jacobians. y x y x x y x y x y y x y x g g f f g u y g g f f g u x y g g x g g y x g v x f f y f f y x f u − = ∂ ∂ = ∂ ∂ ∂ ∂ = ∂ ∂ = = ∂ ∂ = ∂ ∂ = = / ; / ); , ( / ; / ); , (

(47)

Contoh

u = 2x3 + 2xy – 2 v = 2y + 4xy2 – 3

Mulai dengan nilai awal x0 = 0.5 dan y0 = 1.5

Mulai dengan nilai awal x0 = 0.5 dan y0 = 1.5

y

x

x

u

x

y

u

y

x

v

xy

y

v

2

6

;

2

;

4

;

8

2

+

=

2

=

=

2

+

=

Referensi

Dokumen terkait

Pelatihan Pengembangan Model Pembelajaran Kontekstual Untuk Mata Pelajaran Ekonomi Pada Mahasiswa Peserta Magang Di Sma Daerah Istimewa Yogyakarta. DIKS 1

bahwa berdasarkan pertimbangan sebagaimana dimaksud dalam huruf a, dan huruf b perlu menetapkan Keputusan Bupati Bantul tentang Pembentukan Tim

Lama fermentasi memberikan pengaruh berbeda sangat nyata terhadap kadar air, kadar tanin, aktivitas antioksidan, skor warna air seduhan, penampakan partikel, warna

Based on the result of the this research, the researcher concluded that generally, learning interest in chemistry of students at grade X and XI respectively were high

Berdasarkan data Badan Pusat Statistik, bahwa sektor perikanan (termasuk didalamnya adalah subsektor pertanian, peternakan, dan kehutanan) merupakan sektor industri yang

Pandangan Dunia Pengarang dalam Novel Atheis Karya Akhdurt Kartamiharja (Kajian Strukturalisme Genetik).. Universitas Pendidikan Indonesia |

[r]

Rasulullah s.a.w menyelimuti mereka termasuk diri baginda sendiri di dalam sehelai selimut dan memohon ke hadrat Allah s.w.t dengan sabdanya yang bermaksud:... &#34;Ya Allah