You are on page 1of 12

Numerical Analysis

Lecture 2

Roots of Equations Bracketing Methods

1
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Roots of Equations
Bracketing methods
Bisection Method False position method

Open methods
Simple fixed point iteration Newton Raphson Secant Method Modified Newton Raphson

System of nonlinear equations Roots of polynomials


Using computers Mullers Method

2
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Roots of Equations
What is the root of equation?
It is the value of the equations variable which makes the equation equal to zero.

Direct method
What is the root for the equation below?
f ( x ) = ax 2 + bx + c = 0

We can use the quadratic formula


b b 2 4ac x = 2a

Exact solution but it is not always available.

Another example
f (x ) = e x x

or

f ( x ) = tan( x ) x
3

Can you find the roots??


Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Roots of Equations
Graphical Solution
What is the root for the equation below?
f ( x ) = ax 2 b

f(x)

roots

x f(x)=0 f(x)=0
4
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Graphical Solution
Example
t mg (1 e m ) The parachutist velocity is v = c c

What is the drag coefficient c needed to reach a velocity of 40 m/s if m=68.1 kg, t =10 s, g= 9.8 m/s2 c t mg f (c) = (1 e m ) v c 667.38 f (c) = (1 e 0.146843c ) 40 c c f(c)
4 8 12 16 20
Lecture 2

34.115 17.653 6.067 -2.269 -8.401

5
Eng. Malek Abuwarda

Numerical Analysis

Graphical Solution
Graphical techniques are of limited practical value because they are not precise. However, graphical methods can be utilized to obtain rough estimates of roots. Graphical methods are important tools for understanding the properties of the function.

6
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Graphical Solution
Use of computer graphics to locate roots
f ( x ) = sin 20 x + cos 3x

7
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Bracketing Methods
Two initial guesses (xl and xu) are required for the root which bracket the root (s). If one root of a real and continuous function, f(x)=0, is bounded by values xl, xu then f(xl).f(xu) <0
f(x)

f(xu)

xl

xu f(xu)

8
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Bracketing Methods
Bisection Method
Generally, if f(x) is real and continuous in the interval xl to xu and f(xl).f(xu)<0, then there is at least one real root between xl and xu to this function. The interval at which the function changes sign is located. Then the interval is divided in half with the root lies in the midpoint of the subinterval. This process is repeated to obtained refined estimates.
f(x) xr = ( xl + xu )/2 f(xu)

xl

xr1 f(xr1)

xu f(xu)

9
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Bisection Method
Step 1: Choose lower xl and upper xu guesses for the root such that:
f(x) xr = ( xl + xu )/2 f(xu)

f(xl).f(xu)<0
Step 2: The root estimate is: xr = ( xl + xu )/2 Step 3: Subdivide the interval according to:
f(x) xl

xr1 f(xr1)

xu f(xu)

If (f(xl).f(xr)<0) the root lies in the lower subinterval; xu = xr and go to step 2. If (f(xl).f(xr)>0) the root lies in the upper subinterval; xl = xr and go to step 2. If (f(xl).f(xr)=0) the root is xr and stop
Lecture 2 Numerical Analysis

(f(xl).f(xr)<0): xu = xr xr = ( xl + xu )/2 f(xu) f(xr2) xu xr2 f(xu)

xl

10

Eng. Malek Abuwarda

Bisection Method
Example
What is the root of the equation below? 667.38 f (c ) = (1 e 0.146843c ) 40 c From the graphical solution we can identify that the root lies in the interval (12 , 16)

11
Lecture 2 Numerical Analysis

Eng. Malek Abuwarda

Bisection Method
6.067

c 12 16 (12+16)/2=14 (14+16)/2=15 (14+15)/2=14.5 (14.5+15)/2=14.75 (14.75+15)/2=14.875

(c) 6.067 -2.268 1.569 -0.425 0.552 0.059

Interval (12, 16) (14, 16) (14, 15) (14.5, 15) (14.75, 15)
14 14.25 0.552 0.059 14.5 14.75 15 -0.425 1.569 12 13 1.569 14 15 -0.425 16 -2.268

-0.184 (14.75, 14.875)

(14.75+14.875)/2=14.812 -0.062 (14.75, 14.812) (14.75+14.812)/2=14.781 -0.001


0.059

14.75 -0.062

14.875 -0.184

15 -0.425

12

Lecture 2

Numerical Analysis

Eng. Malek Abuwarda

You might also like