lec5_BM-RFM-SFPI

Page 1

SOLUTIONS TO NON-LINEAR EQUATION

1


a. 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 xl and xu if f(xl) f(xu) < 0. f(x)

xď Ź xu

x

Figure 1 At least one root exists between the two points if the function is real, continuous, and changes sign.


Basis of Bisection Method f(x)

xď Ź

xu

x

) Figure 2 If function f ( xdoes not change sign between two points, 0 roots of the equation f ( x ) = may still exist between the two points.


Basis of Bisection Method f(x)

f(x)

x

xu

x

x

xu x

) Figure 3 If the function f ( xdoes not change sign between two ) =0 f ( xbetween points, there may not be any roots for the equation the two points.


Basis of Bisection Method f(x)

x

xu ď Ź

x

Figure 4 If the function f ( x ) changes sign between two points, more than one root for the equation f ( x ) = 0 may exist between the two points.


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. This was demonstrated in Figure 1. f(x)

x xu

Figure 1

x


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

xm xu

Figure 5 Estimate of xm

x


Step 3 Now check the following a) If

f ( xm ) = (+ )

b) If

f ( xm ) = (−)

c) If

f ( xm ) = 0

, then x  = x ; xu = xm. , then x  = xm; xu = xu. , then the root is x m.


Step 4 Find the new estimate of the root x + xu xm = 2

Find the absolute relative approximate error ∈a =

old x new − x m m

x

new m

×100

where xmold = previous estimate of root xmnew = current estimate of root


Example: 

Locate the first non-trivial root of sin x = x2. Use Bisection Method with initial interval from 0.5 to 1.0. Perform the εa <= 2% computation until

Solution: f(x) = x2-sin x

x∈(0.5,1)

εa <= 2%

ε a

i

Xl

Xu

Xm

F(xm)

0

0.5

1.0

0.75

-

1

0.75

1.0

0.875

-

14.29

2

0.875

1.0

0.9375

+

6.67

3

0.875

0.9375

0.9063

+

3.44

4

0.875

0.9063

0.8907

+

1.75

-


Example: 

Locate the first non-trivial root of sin x = x2. Use Bisection Method with initial interval from 0.5 to 1.0. Perform the εa <= 2% computation until

Solution: f(x) = x2-sin x

x∈(0.5,1)

εa <= 2%

ε a

i

Xl

Xu

Xm

F(xm)

1

0.5000

1.0000

0.7500

-0.1191

2

0.7500

1.0000

0.8750

-0.0019 14.2857

3

0.8750

1.0000

0.9375

0.0728

6.6667

4

0.8750

0.9375

0.9063

0.0341

3.4483

5

0.8750

0.9063

0.8906

0.0157

1.7544

-


Advantages Always convergent ď‚— The root bracket gets halved with each iteration - guaranteed. ď‚—


Drawbacks ď Ž ď Ž

Slow convergence If one of the initial guesses is close to the root, the convergence is slower


Drawbacks ď‚—

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 x

2


Drawbacks ď Ž

Function changes sign but root does not exist f(x)

1 f ( x) = x x


NEXT TOPIC:

b. REGULA-FALSI METHOD (FALSE POSITION METHOD)


f ( xu ) − f ( xl ) = xu −x r xr − xl

xr f ( xu ) − xl f ( xu ) = − xu f ( x l ) + xr f ( xl ) xr [ f ( xu ) − f ( xl )] = xl f ( xu ) − xu f ( xl ) xl f ( xu ) − xu f ( xl ) xr = f ( xu ) − f ( xl )


Example: 

Locate the first non-trivial root of sin x = x2. Use Bisection Method with initial interval from 0.5 to 1.0. Perform the computation until εa <= 2%

Solution: f(x) = x2-sin x

x∈(0.5,1)

εa <= 2%

xl f ( xu ) − xu f ( xl ) xr = f ( xu ) − f ( xl ) A

B

C

E= D F(xu)

AD-BC D-B

E

F

Xr

F(xr)

ε a

i

Xl

F(xl)

Xu

1

0.5

-0.2294

1.0

0.1585 0.7957 -0.0812

2

0.7957 -0.0812

1.0

0.1585 0.8649 -0.0130

3

0.8649 -0.0130

1.0

0.1585 0.8751 -0.0018 1.17

-

8


Example: 

Locate the first non-trivial root of sin x = x2. Use Bisection Method with initial interval from 0.5 to 1.0. Perform the εa <= 2% computation until

Solution: f(x) = x2-sin x i

A Xl

x∈(0.5,1) B F(xl)

C Xu

εa <= 2% D F(xu)

E Xm

F F(xm)

ε a

1

0.5000 -0.2294 1.0000 0.1585 0.7957 -0.0812

2

0.7957 -0.0812 1.0000 0.1585 0.8649 -0.0130

3

0.8649 -0.0130 1.0000 0.1585 0.8751 -0.0018 1.17%

xl f ( xu ) − xu f ( xl ) xr = f ( xu ) − f ( xl )

Xm=

AD-BC D-BC

-

8%


NEXT TOPIC:

c. SIMPLE FIXED-POINT ITERATION


SFPI - also known as Open Method

f ( x) = 0 ⇔ x = g ( x)


Example: 

Locate the first non-trivial root of sin x = x2. Use Bisection Method with initial interval from 0.5 to 1.0. Perform the εa <= 2% computation until

Solution: f(x) = x2-sin x

x∈(0.5,1)

εa <= 2%

x = sin x sin x x= x −1 2 x = sin x

(1) (2) (3)


If x = sin x 

At x = 0.5 i 0 1 2 3 4

xi 0.5 0.6924 0.7990 0.8466 0.8655

x (i+1) 0.6924 0.7990 0.8466 0.8655 0.8726

Ea 13.34 5.62 2.18 0.81

xi 1 0.9173

x (i+1) 0.9173 0.8911

Ea 2.95

At x = 1.0 i 0 1 2


If x = sin x 

At x = 0.5 i 0 1 2 3 4

xi 0.5 0.6924 0.7990 0.8466 0.8654

x (i+1) 0.6924 0.7990 0.8466 0.8654 0.8726

Ea 13.34 5.62 2.18 0.82

xi 1 0.9173 0.8911

x (i+1) 0.9173 0.8911 0.8819

Ea 2.95 1.04

At x = 1.0 i 0 1 2


sin x if x = x 

At x = 0.5 i 0 1 2 3

xi 0.5 0.9589

x (i+1) 0.9589 0.8537

Ea 12.32

xi 1 0.8415

x (i+1) 0.8415 0.8861

Ea 5.04

At x = 1.0 i 0 1 2


sin x if x = x 

At x = 0.5 i 0 1 2 3

xi 0.5 0.9589 0.8537 0.8829

x (i+1) 0.9589 0.8537 0.8829 0.8751

Ea 12.32 3.31 0.90

xi 1 0.8415 0.8861

x (i+1) 0.8415 0.8861 0.8742

Ea 5.04 1.36

At x = 1.0 i 0 1 2


Assignment: To be submitted on or before July 12, 2011

1.

Solve V1,V2,V3 of the circuit below using any of the iterative method.

2.

Solve for the roots of f(x) = with an interval of (0.5,1). Use BM, RFM, SFPI.

sin x − x


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.