Hampiran Numerik Solusi Persamaan Nirlanjar: Pertemuan 3

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 29

Matakuliah : K0342 / Metode Numerik I

Tahun : 2006

HAMPIRAN NUMERIK SOLUSI


PERSAMAAN NIRLANJAR
Pertemuan 3

1
Pertemuan 3
HAMPIRAN NUMERIK
SOLUSI PERSAMAAN
NIRLANJAR

2
PERSAMAAN NIRLANJAR (N0N LINIER)

Yaitu persamaan yang mengandung variabel berpangkat lebih


dari satu dan/atau yang mengandung fungsi-fungsi transenden
Contoh:
n
1. f ( x) a k x k a0 x 0 a1 x a 2 x 2 a3 x 3 ... a n x n 0
k 0
2. f ( x) e x x 2 2 0
x
3. f ( x) e sin x x 0

dsb

3
Numerical method for finding
roots of non linear equations

Bracketing Open
methods methods

Bisecton False position Fixed point Newton-


method method method Raphson
method

Secant
method

4
Bracketing Methods:
- At least two guesses are required
- Require that the guesses bracket the root of
an equation
- More robust that open methods

Open Methods:
- Most of the time, only one initial guess is
required
- Do that require that the guesses bracket
the
root of the equation
- More computationally efficient than
bracketing methods but they do not always
work..may blow up !! 5
Bracketing Methods
Bisection method
Method of False position

These methods are known as bracketing methods


because they rely on having two initial guesses.
- xl - lower bound and
- xu - upper bound.

The guesses must bracket (be either side of) the root. WHY ?

6
f(x)

Bila f(xu) dan f(xl) berlainan tanda


xu x maka pasti akar, xr, diantara xu dan xl.
xl xr i.e. xl < xr < xu.

f(x)

xr xr xr xu x
xl
Atau terdapat akar yang banyaknya ganjil.

7
f(x)
Bila f(xu) dan f(xl) mempunyai tanda
yang sama, maka kemungkinan tidak
x terdapa akar diantara xl and xu.
xl xu

f(x)
Atau kemungkinan terdapat banyaknya
akar genap diantara xl and xu.
xr xr x
xl xu

8
There are exceptions to the rules
f(x)

x When the function is tangential


to the x-axis, multiple roots occur
Multiple
roots occur
here

f(x)

Functions with discontinuities


x do not obey the rules above

9
The Bisection Method can be used to solve the roots for
such an equation. The method can be described by the
following algorithm to solve for a root for the function
f(x):
1. Choose upper and lower limits (a and b)
2. Make sure a < b, and that a and b lie within the range for
which the function is defined.
3. Check to see if a root exists between a and b (check to
see if f(a)*f(b) < 0)
4. Calculate the midpoint of a and b (mid = (a+b)/2)
5. if f(mid)*f(a) < 0 then the root lies between mid and a
(set b=mid), otherwise it lies between b and mid (set
a=mid)
6. if f(mid) is greater than epsilon then loop back to step
4, otherwise report the value of mid as the root.
10
Metoda Bisection

11
Bisection method

This method converges to any pre-


specified tolerance when a single root
exists on a continuous function

Example Exercise: write a function that


finds the square root of any positive
number that does not require
programmer to specify estimates

12
Iterasi Metoda bagi dua Double Click disini

13
14
15
16
17
Metoda Posisi Salah
Metoda posisi salah (Regula Falsi) tetap menggunakan dua
titik perkiraan awal seperti pada metoda bagi dua yaitu a0 dan
b0 dengan syarat f(a0).f(b0) < 0. Metoda Regula Falsi dibuat
untuk mempecepat konvergensi iterasi pada metoda bagi dua
yaitu dengan melibatkan f(a) dan f(b)

Rumus iterasi Regula Falsi:


(bn an )
cn1 bn f (bn ) n=0,1,2,3,
( f (bn ) f (an ))

18
Metoda Posisi Salah

19
20
Metoda Terbuka

1. Metoda titik tetap


Pada metoda tetap, rumus iterasi diperoleh dari f(x) =0 yaitu
dengan mengubah f(x) = 0 menjadi:

xn1 g ( xn ) n 0,1,2,3,...
atau

xn1 xn f ( xn ) n 0,1,2,3,...
21
22
23
Contoh:
f(x) = 1 x x^3=0
Rumus iterasi diperoleh
dengan x=x +f(x) yaitu: 0.6875 1 - 0.6875 3
1-2x-x^3 = -x, kemudian x3
2
diubah menjadi: 0.6813

x 1 - x^3 0.6813 1 - 0.6813 3


x4
x n n 2
n 1 2 0.6825
Jawab : x0 0 0.6825 1 - 0.6825 3
x5
2
0.6823
0 1 - 0 3
x 0.6823 1 - 0.6823 3
1
2 x6
2
0.5
0.5 1 - 0.53 0.6823
x2
2 Jadi akar pendekatan adalah 0.6823
0.6875
24
Hitung f(x) = 3 x2

X + kx + 3 x2 = x + kx

Jawab :

x0 = 1
x1= (1) + 1-(1)2/3 =1.666667

x2= (1.666667) + 1-(1.666667)2/3 =1.740741

x3= (1.740741) + 1-(1.740741)2/3 =1.730681

x4= (1.730681) + 1-(1.730681)2/3 =1.732018

x5= (1.732018) + 1-(1.732018)2/3 =1.732056

x6= (1.732056) + 1-(1.732056)2/3 =1.732051

Jadi akar pendekatan adalah 1.732051

25
26
Metode Newton

27
Double click disini

28
Terima kasih
29

You might also like