ROOTS OF NON LINIER EQUATIONS
• Metode Bagi dua (Bisection Method)• Metode Regula Falsi (False Position Method)
• Metode Grafik
• Iterasi Titik-Tetap (Fix Point Iteration)
• Metode Newton-Raphson
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
OVERVIEW OF METHODS
• Bracketing methods Graphing method Bisection method False position • Open methodsOne point iteration Newton-Raphson Secant method
SPECIFIC STUDY OBJECTIVES
•
Memahami konsep konvergensi dan
divergensi.
•
Memahami bahwa metode tertutup
selalu konvergen, sedangkan metode
terbuka kadang-kadang divergen.
•
Konvergensi pada metode terbuka
biasanya didapat jika initial guess –nya
dekat dengan akar sebenarnya.
METODE TERTUTUP
• Graphical
• Bisection method
CARA GRAFIK
• Plotkan fungsinya dan tentukan dimana
memotong sumbu x.
• Lacks precision
• Trial and error f(x)=e
-x-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) x f(x) x f(x)Pembatas atas dan Bawah memiliki tanda sama.
Akar tidak ada atau banyak akar
Tanda berbeda,
BISECTION METHOD
• Memanfaatkan beda tanda dua nilai batas
• f(xl)f(xu) < 0 dimana l=lower (batas bawah) dan
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 bawah
f(xl)f(xr) < 0 then xu baru = xr RETURN f(xl)f(xr) >0 then xl baru = xr RETURN
METODE BAGI DUA
Asumsi: Fungsi f(x) kontinu dalam interval
a
0, b
0
0
)
(
)
(
a
0f
b
0
f
do n = 0,1,…
2
/
)
(
a
nb
nm
if
f
(
a
n)
f
(
m
)
0
,
then
a
n1
a
n,
b
n1
m
else
a
n1
m
,
b
n1
b
nif
b
n1
a
n1
exit
end do
or
f
(
m
)
0
ERROR
100
akhir awal akhir aperkiraan
perkiraan
perkiraan
•f(x) = e
-x- x
•x
l= -1 x
u= 1
CONTOH
Gunakan bisection method untuk mencari
akar-akar persamaan
3.7 18282 -0.63212 -2 0 2 4 6 8 10 -2 -1 0 1 2 x f( x )SOLUTION
3.7 18282 -0.63212 1 -2 0 2 4 6 8 10 -2 -1 0 1 2 x f( x )-0.63212 1 0.106531 -2 0 2 -1 0 1 2 x f( x )
SOLUTION
FALSE POSITION METHOD
• “Brute Force” dari metode bagi dua kurang efisien • Menghubungkan dua nilai batas dengan garis lurus • Mengganti kurva menjadi garis lurus memberikan
“false position”
xl xu f(xl) f(xu) next estimate, xr
f x
x
x
f x
x
x
x
x
f x
x
x
f x
f x
l r l u r u r u u l u l u
Based on similar trianglesNilai f(xr) dicek tandanya, kemudian tentukan xu dan xl yang baru
REGULA FALSI
Asumsi: Fungsi f(x) kontinu dalam interval
a
0, b
0
0
)
(
)
(
a
0f
b
0
f
do n = 0,1,…
)]
(
)
(
/[
]
)
(
)
(
[
f
b
na
nf
a
nb
nf
b
nf
a
nw
if
f
(
a
n)
f
(
w
)
0
,
then
a
n1
a
n,
b
n1
w
else
a
n1
w
,
b
n1
b
nif
b
n1
a
n1
exit
end do
or
f
(
w
)
0
CONTOH
Tentukan akar persamaan dari persamaan
berikut menggunakan false position method,
mulai dengan initial estimate x
l=4.55 and
x
u=4.65
f(x) = x
3
- 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
• Pada metode tertutup, akar terdapat di antara kedua interval
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 gives next estimate. xi f(x) x f(xi) xi+1 f(xi+1 )
Solution can “overshoot” the root and potentially diverge x0 f(x) x x1 x2
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
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 + x
• Hitung nilai x = g(x)
• Perkiraan nilai berikut berdasar pada
CONTOH
• Untuk f(x) = e-x -3x • Ubah menjadi g(x) = e-x / 3 • Initial guess x = 0 -6 -4 -20 2 4 6 8 1012 14 16 -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 0.256 0.005 2.395 0.258 -0.001 0.612 0.258 0.000 0.158 0.258 0.000 0.041 -6 -4 -20 2 4 6 8 1012 14 16 -2 -1 0 1 2 x f( x )
METODE NEWTON RAPHSON
tangent
dy
dx
f
f
x
f x
x
x
rearrange
x
x
f x
f
x
i i i i i i i i'
'
'
0
1 1 f(xi) xi tangent xi+1NEWTON RAPHSON
PITFALLS
CONTOH
Gunakan metode
Newton Raphson
untuk mencari
akar-akar dari
f(x) = x
2- 11 memakai
initial guess x
i= 3
-20 0 20 40 60 80 100 0 2 4 6 8 10 x f( x )NEWTON RHAPSON SECANT
• Include an upper limit on the number of
iterations
• Establish a tolerance, s
• Check to see if a is increasing
Bagaimana jika turunan fungsinya sulit dipecahkan?
SECANT METHOD
f x f x f x x x i i i i ' 1 1Memperkirakan turunan menggunakan finite divided difference
APAKAH finite divided difference? HINT: dy / dx = y / x Masukkan FDD pada rumus untuk Newton Raphson
SECANT
METHOD
ii i
ii i i i i i i x f x f x x x f x x x f x f x x 1 1 1 1 ' Masukkan perkiraan dengan finitedifference pada rumus untuk Newton
SECANT METHOD
•
Membutuhkan dua nilai perkiraan awal
•
f(x) tidak harus berbeda tanda,
membedakan dengan metode tertutup,
false position method.
ii i ii i ix
f
x
f
x
x
x
f
x
x
1 1 1x f(x) 1 2 new est. x f(x) 1 new est. 2 FALSE POSITION SECANT METHOD 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 konstanta
• Maka, perhatikan sistem persamaan non-linier
y = -x2 + x + 0.5
y + 5xy = x3
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 • 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
1
0
1
0
0
1
3
57
10
x
y
y
y
x
x
METODE NEWTON RHAPSON
x
v
y
u
y
v
x
u
x
u
v
x
v
u
y
y
x
v
y
u
y
v
x
u
y
u
v
y
v
u
x
x
i i i i i i i i i i i i i i i i i i
1 1Versi dua persamaan untuk Newton-Raphson
u(x,y) dan
DETERMINAN JACOBIAN
(TAMBAHAN SAJA)
x
v
y
u
y
v
x
u
x
u
v
x
v
u
y
y
x
v
y
u
y
v
x
u
y
u
v
y
v
u
x
x
i i i i i i i i i i i i i i i i i i
1 1 THE DENOMINATOR OF EACH OF THESE EQUATIONS IS FORMALLY REFERRED TO AS THE DETERMINANT OF THE JACOBIANJACOBIAN (TAMBAHAN
JUGA)
• The general definition of the Jacobian for n
functions of n variables is the following set of partial derivatives: n n n n n n n n
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x
f
x
x
x
f
f
f
...
...
...
...
...
...
...
)
,...,
,
(
)
,...,
,
(
2 1 2 2 2 1 2 1 2 1 1 1 2 1 2 1JACOBIAN (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:
• 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 / ; / ); , ( / ; / ); , (
CONTOH
u = 2x3 + 2xy – 2
v = 2y + 4xy2 – 3
Mulai dengan nilai awal x0 = 0.5 dan y0 = 1.5