0% found this document useful (0 votes)
62 views62 pages

Kuliah Anum-2

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 62

KULIAH-2

AKAR PERSAMAAN
METODE TERTUTUP

MK ANALISA DAN PEMODELAN NUMERIK


DTK-FTK-ITS
ACUAN
Tugas 1a
Bisection Method
Basis of Bisection Method
Theorem: An equation f(x)=0, where f(x) is a real continuous function,
has at least one root between x and xu if f(xl) f(xu) < 0.

f(x)

x
x
xu

14
Theorem
If function f(x) in f(x)=0 does not change sign between
two points, roots may still exist between the two points.
f(x)

x x
xu

15
Theorem
If the function f(x) in f(x)=0 does not change sign between
two points, there may not be any roots between the two
points.
f(x)
f(x)

x xu

x x
x xu

16
Theorem
If the function f(x) in f(x)=0 changes sign between two points, more than one
root may exist between the two points.

f(x)

xu
x
x

17
Algorithm for Bisection
Method

18
http://numericalmethods.eng.usf.e
Step 1
• Choose x and xu as two guesses for the root such
that f(x) f(xu) < 0, or in other words, f(x) changes
sign between x and xu.
f(x)

x
x
xu

19
Step 2
Estimate the root, xm of the equation f (x) = 0 as the
mid-point between x and xu as
f(x)

x  xu
xm =
2
x
x
xu

20
Step 3
Now check the following
f(x)
If f(x) f(xm) < 0, then the root lies
between x and xm; then x = x ;
xu = xm.

If f(x ) f(xm) > 0, then the root lies


x xm
between xm and xu; then x = xm;
xu
x xu = xu.

If f(x) f(xm) = 0; then the root is xm.


Stop the algorithm if this is true.
21
Step 4

New estimate

x  xu
xm =
2
Absolute Relative Approximate Error

x new  x old

a   100
m m
new
x m

xmold  previous estimate of root


xmnew  current estimate of root
22
http://numericalmethods.eng.usf.e
Step 5

Yes Stop
Check if absolute relative
approximate error is less
than prespecified tolerance
or if maximum number
of iterations is reached.
Using the new upper
No
and lower guesses from
Step 3, go to Step 2.

23
http://numericalmethods.eng.usf.e
Example
• You are making a bookshelf to carry books that range
from 8 ½ ” to 11” in height and would take 29”of space
along length. The material is wood having Young’s
Modulus 3.667 Msi, thickness 3/8 ” and width 12”. You
are asked to find the maximum deflection of the
bookshelf.

The vertical deflection of the shelf is given by


v( x)  0.42493 x 10 -4 x 3  0.13533 x 10 -8 x 5  0.66722 x 10 -6 x 4  0.018507 x
where x is the position where the deflection is maximum. Hence to find the
maximum deflection we need to find where dv
f ( x)  0
dx

26
Solution
The equation that gives the position ‘x’ where
the deflection is maximum is given by:
f( x)  0.67665 x 10-8 x 4  0.26689 x 10-5 x3  0.12748 x 10-3 x 2  0.018507  0

Use the bisection method of finding


roots of equations to find the depth
‘x’ to which the ball is submerged Books
under water. Conduct three
iterations to estimate the root of the
above equation.

Bookshelf

27
Graph of function f(x)
f x   0.67665 x 10-8 x 4  0.26689 x 10-5 x3  0.12748 x 10-3 x 2  0.018507  0

0.02
0.01883

0.01

0
f ( x) 0

0.01

 0.01851 0.02
0 5 10 15 20 25 30
0 x 29
f(x)

28
http://numericalmethods.eng.usf.e
Checking if the bracket is valid
Entered function on given interval with initia l upper and lower guesses

0.01883
0.02 Choose the bracket

0.01 x  0
f ( x) xu  29
f 0  0.018507
0
f ( x) 0
f ( x)

0.01 f 29  0.01883

 0.01851 0.02
0 5 10 15 20 25 30
1 x x u  x l 29
f(x)
xu (upper guess)
xl (lower guess)

29
http://numericalmethods.eng.usf.e
Iteration #1

0.02
0.01883
x  0, xu  29
0  29
xm   14.5
0.01

f ( x)
2
f 0  0.018507
f ( x) 0
0
f ( x)

f ( x)
f 29  0.01883
f 14.5  1.3992x10 -4
0.01

 0.01851 0.02
0
1
f(x)
5 10 15
x x u  x l  x r
20 25 30
29 x  14.5
xu  29
xu (upper guess)
xl (lower guess)
new guess

30
http://numericalmethods.eng.usf.e
Iteration #2

0.02
0.01883
x  14.5, xu  29
14.5  29
0.01 xm   21.75
2
f ( x)

f ( x)
a  33.33%
0
0
f ( x)

f ( x) f 14.5  1.3992x10 -4
0.01
f 29  0.01883
f 21.75  0.01282
 0.01851 0.02
0 5 10 15 20 25 30 x  14.5, xu  21.75
0 x x u  x l  x r 29
f(x)
xu (upper guess)
xl (lower guess)
new guess

31
http://numericalmethods.eng.usf.e
Iteration #3

0.02
0.01883
x  14.5, xu  21.75
14.5  21.75
0.01
xm   18.125
f ( x) 2
f ( x)
0
f ( x)
0 a  20%
f ( x) f 14.5  1.3992 x10 -4
0.01
f 21.5  0.01282
f 18.125  6.75036 x10 -3
 0.01851 0.02
0 5 10 15 20 25 30
0 x x u  x l  x r 29
f(x)
xu (upper guess)
xl (lower guess)
new guess

32
http://numericalmethods.eng.usf.e
Convergence
Table 1: Root of f(x)=0 as function of number of iterations for bisection method.

a
Iteration x xu xm % f(xm)
1 0 29 14.5 ---------- -1.3992x10-4
2 14.5 29 21.75 33.33 0.01282
3 14.5 21.75 18.125 20.00 6.7504x10-3
4 14.5 18.125 16.3125 11.11 3.3512x10-3
5 14.5 16.3125 15.4063 5.8824 1.6101x10-3
6 14.5 15.4063 14.9531 3.0303 7.3536x10-4
7 14.5 14.9531 14.7266 1.5385 2.9758x10-4
8 14.5 14.7266 14.6133 0.7752 7.8859x10-5
9 14.5 14.6133 14.5566 0.3891 -3.0537x10-5
10 14.5566 14.6133 14.5849 0.1942 2.4159x10-5
33
http://numericalmethods.eng.usf.e
Advantages

• Always convergent
• The root bracket gets halved with each
iteration - guaranteed.

34
http://numericalmethods.eng.usf.e
Drawbacks

Slow convergence

35
http://numericalmethods.eng.usf.e
Drawbacks (continued)
 If one of the initial guesses is close to the
root, the convergence is slower

36
http://numericalmethods.eng.usf.e
Drawbacks (continued)

• If a function f(x) is such that it just


touches the x-axis it will be unable to find
the lower and upper guesses.
f(x)

f x   x 2

37
http://numericalmethods.eng.usf.e
Drawbacks (continued)

 Function changes sign but root does not


exist

f x  
f(x) 1
x
x

38
http://numericalmethods.eng.usf.e
Example 2
Tugas 1b
• You are working for ‘DOWN THE TOILET COMPANY’
that makes floats for ABC commodes. The ball has a
specific gravity of 0.6 and has a radius of 5.5 cm. You
are asked to find the distance to which the ball will get
submerged when floating in water.

39
Solution
The equation that gives the depth ‘x’ to which the ball is
submerged under water is given by

f x   x 3-0.165 x 2+3.993x10- 4
Use the Bisection method of finding
roots of equations to find the depth
‘x’ to which the ball is submerged
under water. Conduct three
iterations to estimate the root of the
above equation.

40
Graph of function f(x)

f x   x -0.165x +3.993x10
3 2 -4

41
http://numericalmethods.eng.usf.e
Checking if the bracket is valid

Choose the bracket

x  0.00
xu  0.11
f 0.0  3.993x10 4
f 0.11  2.662x10  4

42
http://numericalmethods.eng.usf.e
Iteration #1

x  0, xu  0.11
0  0.11
xm   0.055
2
f 0  3.993x10 4
f 0.11  2.662x10  4
f 0.055  6.655x10 5

x  0.055
xu  0.11
43
http://numericalmethods.eng.usf.e
Iteration #2

x  0.055, xu  0.11
0.055  0.11
xm   0.0825
2
a  33.33%

f 0.055  6.655x10 5
f 0.11  2.662x10  4
f 0.0825  1.62216x10  4
x  0.055, xu  0.0825

44
http://numericalmethods.eng.usf.e
Iteration #3

x  0.055, xu  0.0825
0.055  0.0825
xm   0.06875
2

a  20%
f 0.055  6.655x10 5
f 0.0825  1.62216x10  4
f 0.06875  5.5632x10 5

45
http://numericalmethods.eng.usf.e
Convergence
Table 1: Root of f(x)=0 as function of number of iterations for bisection
method.

Iteration x xu xm a % f(xm)

1 0.00000 0.11 0.055 ---------- 6.655x10-5

2 0.055 0.11 0.0825 33.33 -1.6222x10-4

3 0.055 0.0825 0.06875 20.00 -5.5632x10-5

4 0.055 0.06875 0.06188 11.11 4.4843x10-6

5 0.06188 0.06875 0.06531 5.263 -2.5939x10-5

6 0.06188 0.06531 0.06359 2.702 -1.0804x10-5

7 0.06188 0.06359 0.06273 1.369 -3.1768x10-6

8 0.06188 0.06273 0.0623 0.6896 6.4973x10-7

9 0.0623 0.06273 0.06252 0.3436 -1.2646x10-6

10 0.0623 0.06252 0.06241 0.1721 -3.0767x10-7 46


http://numericalmethods.eng.usf.e
Advantages

• Always convergent
• The root bracket gets halved with each
iteration - guaranteed.

47
http://numericalmethods.eng.usf.e
Drawbacks

Slow convergence

48
http://numericalmethods.eng.usf.e
Drawbacks (continued)
 If one of the initial guesses is close to the
root, the convergence is slower

49
http://numericalmethods.eng.usf.e
Drawbacks (continued)

• If a function f(x) is such that it just


touches the x-axis it will be unable to find
the lower and upper guesses.
f(x)

f x   x 2

50
http://numericalmethods.eng.usf.e
Drawbacks (continued)

 Function changes sign but root does not


exist

f x  
f(x)
1
x
x

51
http://numericalmethods.eng.usf.e
FALSE-POSITION METHOD
Tugas 1c
TERIMA KASIH
SEMOGA BERMANFAAT, AMIN

You might also like