+ All Categories
Home > Documents > ROOTS OF Non Linier Equations -...

ROOTS OF Non Linier Equations -...

Date post: 19-Mar-2019
Category:
Upload: vannhi
View: 219 times
Download: 0 times
Share this document with a friend
47
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 Metode Secant
Transcript

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

• Metode Secant

Solusi Persamaan Kuadrat Tingkat 2

a

acbbx

cbxaxxf

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

Kalau persaamaannya f(x) = e-x - x?

Overview of Methods

• Bracketing methods

Graphing method

Bisection methodBisection method

False position

• Open methods

One point iteration

Newton-Raphson

Secant method

• 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

sebenarnya.

Metode Tertutup

• Graphical

• Bisection method

• False position method• False position method

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

10

-2 -1 0 1 2

x

f(x)

Cara Grafik (limited practical value)

x

f(x)

x

f(x)Pembatas atas dan

Bawah memiliki

tanda sama.

Akar tidak ada atau

banyak akarx x

x

f(x)

x

f(x)

banyak akar

Tanda berbeda,

jumlah akar-akar ganjil

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)

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

f(xl)f(xr) =0 then root equals xr - COMPLETE

Metode Bagi Dua

Asumsi: Fungsi f(x) kontinu dalam interval [ ]00 ,ba

0)()( 00 <bfaf

do n = 0,1,…

2/)( bam += 2/)( nn bam +=

if ,0)()( <mfaf nthen ,1 nn aa =+ mbn =+1

else ,1 ma n =+ nn bb =+1

if ε≤− ++ 11 nn ab exit

end do

or 0)( =mf

Bisection Method

Error

100×−

=awal

awalakhira

perkiraan

perkiraanperkiraanε

•f(x) = e-x - x

CONTOH

Gunakan bisection method untuk mencari

akar-akar persamaan

8

10

•f(x) = e - x

•xl = -1 xu = 1 3.7 18282

-0.63212

-2

0

2

4

6

8

-2 -1 0 1 2

x

f(x)

SOLUTION

6

8

10

f(x)

3.7 18282

-0.63212

1

-2

0

2

4

-2 -1 0 1 2

x

f(x)

1

2

SOLUTION

-0.632120.106531

-2

0

-1 0 1 2

x

f(x)

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”

• Mempercepat perkiraan

xl

xu

f(xu)next estimate, xr

( ) ( )f x

x x

f x

x x

l u

−=

Based on

similar

triangles

xuf(xl)

( )( )

( ) ( )

x x x x

x xf x x x

f x f x

r l r u

r u

u l u

l u

−=

= −−

Regula Falsi

Asumsi: Fungsi f(x) kontinu dalam interval [ ]00 ,ba

0)()( 00 <bfaf

do n = 0,1,…

)]()(/[])()([ afbfbafabfw −−= )]()(/[])()([ nnnnnn afbfbafabfw −−=

if ,0)()( <wfaf nthen ,1 nn aa =+

wbn =+1

else ,1 wa n =+ nn bb =+1

if ε≤− ++ 11 nn ab exit

end do

or 0)( =wf

Regula Falsi

CONTOH

Tentukan akar persamaan dari persamaan berikut

menggunakan false position method, mulai

dengan initial estimate xl=4.55 and xu=4.65

f(x) = x3 - 98

-40

-30

-20

-10

0

10

20

30

4 4.5 5

x

f(x)

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

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

The tangent

f(x)

f(x ) The tangent

gives next

estimate.xi

x

f(xi)

xi+1

f(xi+1 )

Solution can “overshoot”

the root and potentially

diverge

f(x)

x

x0 x

x1x2

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

x = (x2 + 3) / 2

Simple one point iteration

• Contoh lain, untuk

f(x) = sin x = 0,

menjadi

x = sin x + xx = sin x + x

• Hitung nilai x = g(x)

• Perkiraan nilai berikut berdasar pada

x i+1 = g(xi)

Iterasi Titik Tetap

CONTOH

• Untuk f(x) = e-x -3x

• Ubah menjadi g(x) = e-x / 3

• Initial guess x = 0• Initial guess x = 0

-6-4-20246810121416

-2 -1 0 1 2

x

f(x)

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-20246810121416

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

Metode Newton Raphson

( )( )

tangent = =

=−

dy

dxf

f xf xi

'

'0

f(xi)

tangent

( )( )

( )( )

=−

= −

+

+

f xf x

x x

rearrange

x xf x

f x

i

i

i i

i i

i

i

'

'

0

1

1

xixi+1

Metode Newton-Raphson

Newton Raphson

Pitfalls

CONTOH

Gunakan metode

Newton Raphson untuk

mencari akar-akar dari 60

80

100

mencari akar-akar dari

f(x) = x2 - 11 memakai

initial guess xi = 3

-20

0

20

40

60

0 2 4 6 8 10

x

f(x)

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

Secant method

( )( ) ( )

f xf x f x

x x

i i

i i

' =−

1

1

Memperkirakan turunan menggunakan finite divided difference

i i−1

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

Masukkan FDD pada rumus untuk Newton Raphson

( )( )i

iii

xf

xfxx −=+1

'

Masukkan perkiraan

dengan finite difference

pada rumus untuk

Newton Raphson

Secant method( )( )( ) ( )ii

iiiii

xfxf

xxxfxx

−−=

−+

1

11

Metode Secant

Secant method

( )( )( ) ( )ii

iiiii

xfxf

xxxfxx

−−=

−+

1

11

• Membutuhkan dua nilai perkiraan awal

• f(x) tidak harus berbeda tanda, membedakan dengan

metode tertutup, false position method.

f(x)

1

2

f(x)

2

FALSE POSITION

SECANT METHOD

x

1

new est.

x1

new est.

Perkiraan baru

dipilih dari potongan

garis dengan sumbu x

Perkiraan baru bisa diluar

batas kurva

Systems of Non-Linear Equations

• Kita telah mengenal sistem persamaan linier

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

dimana a1 , a2 .... an dan C adalah konstanta1 2 n

• Maka, perhatikan sistem persamaan non-linier

y = -x2 + x + 0.5

y + 5xy = x3

• Selesaikan x dan y

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.

Metode Titik Tetap

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

001 10 yxx −=

1

01

001

3

57

10

x

yy

yxx

−=

−=

Metode Newton Rhapson

x x

uv

yv

u

y

u

x

v

y

u

y

v

x

i i

ii

i

i i i i+ = −

−1

u(x,y) dan

v(x,y) x y y x

y y

uv

yv

u

y

u

x

v

y

u

y

v

x

i i

ii

i

i i i i+ = −

−1

∂ ∂ ∂ ∂

Versi dua persamaan untuk Newton-Raphson

v(x,y)

Determinan Jacobian

(tambahan saja)

x x

uv

yv

u

y

u

x

v

y

u

y

v

x

i i

ii

i

i i i i+ = −

−1

THE DENOMINATOR

OF EACH OF THESE

EQUATIONS IS

FORMALLYx y y x

y y

uv

yv

u

y

u

x

v

y

u

y

v

x

i i

ii

i

i i i i+ = −

−1

∂ ∂ ∂ ∂

FORMALLY

REFERRED TO

AS THE DETERMINANT

OF THE

JACOBIAN

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

∂... 111

n

nnn

n

n

n

n

x

f

x

f

x

f

x

f

x

f

x

f

xxx

xxx

fff

∂∂∂

=∂

...

............

...

...

),...,,(

),...,,(

21

2

2

2

1

2

21

21

21

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:

xffyffyxfu ∂∂=∂∂== /;/);,(

• With similar functions for xv and yv.

• The determinants in the denominators are examples of the use of

Jacobians.

yx

yx

x

yx

yx

y

yx

yx

gg

ff

g

u

y

gg

ff

g

u

x

yggxggyxgv

xffyffyxfu

−=

∂=

∂∂=∂∂==

∂∂=∂∂==

/;/);,(

/;/);,(

Contoh

u = 2x3 + 2xy – 2

v = 2y + 4xy2 – 3

Mulai dengan nilai awal x0 = 0.5 dan y0 = 1.5Mulai dengan nilai awal x0 = 0.5 dan y0 = 1.5

yxx

ux

y

uy

x

vxy

y

v26;2;4;82 22 +===+=


Recommended