You are on page 1of 24

non-linear equation (Root

finding)

9/25/15

Mr.N Kannan, MIT, Manipal

Bisection method
This is the simplest method for finding a root to an equation.
We need lower and higher (xa and xb) values which bracket the
root:
let fa = f(xa) and fb = f(xb) such that fa fb <= 0.
If fa fb = 0 then one or both of xa and xb must be a root of f(x)
= 0.

9/25/15

Mr.N Kannan, MIT, Manipal

if fc < 0 then the root lies in the interval


(xc,xb),

if fc > 0 then the root lies in the interval


(xa,xc),
if fc < 0 then the root lies in the interval
(xc,xb),

algorithm
The basic algorithm for the bisection method,
1. Let xc = (xa+xb)/2,

2. if fc = f(c) = 0 then x = xc is an exact solution,


3. elseif fa fc < 0 then the root lies in the interval
(xa,xc),
4. else the root lies in the interval (xc,xb).

. By replacing the interval (xa,xb) with either (xa,xc) or


(xc,xb) (whichever brackets the root), the error in our
estimate of the solution to f(x) = 0.
.9/25/15
We repeat this interval
halving until either the exact 6
Mr.N Kannan, MIT, Manipal

INPUT VALUES

9/25/15

Mr.N Kannan, MIT, Manipal

9/25/15

Mr.N Kannan, MIT, Manipal

9/25/15

Mr.N Kannan, MIT, Manipal

Linear interpolation (regula falsi)


This method is similar to the bisection method in that
it requires two initial guesses to bracket the root.
Instead of simply dividing the region in two, a linear
interpolation is used to obtain a new point which is
(hopefully, but not necessarily) closer to the root than
the equivalent estimate for the bisection method.

9/25/15

Mr.N Kannan, MIT, Manipal

10

Regula Falsi
Method
By the principle of slope of a line we
have

Then c will replace a according to Figure,


since f(c) < O.

algorithm

9/25/15

Mr.N Kannan, MIT, Manipal

12

9/25/15

Mr.N Kannan, MIT, Manipal

13

9/25/15

Mr.N Kannan, MIT, Manipal

14

Example :
The heat capacity of carbon dioxide is given as a function of
temperature as
where the units of Cp are (kJ/kg K) and the unit of
temperature T is (K). determine the temperature which
yields a value of the heat capacity of 1 (kJ/kg K).
Initial Guess
T = 400 K and T = 600 K

Iteration

F( a )

F(b)

F(c)

400

600

-0.038

0.099

500

0.041

400

500

-0.038

0.041

450

0.0051

400

450

-0.038

0.0051

425

-0.015

425

450

-0.015

0.0051

437.5

-0.0049

437.5

450

-0.0049

0.0051

443.75

0.00014

437.5

443.75

-0.0049

0.00014

440.625

-0.0024

440.625

443.75

-0.0024

0.00014

F(T)
0.12

0.1

0.08

0.06

F(T)

0.04
F( T)
0.02

0
350

400

450

500

550

-0.02

-0.04

-0.06

Temperature ( K )

600

650

Regula Falsi Method :

The convergence using Regular Falsi is more rapid


than that by bisection.

Newton Raphson
Method
-This widely used derivative-based method for a single
nonlinear algebraic equation.
- Here we solve equation f (x) = 0.

-The slope or derivative of f(x) is computed at an initial


guess, a, for the root of f(x) = 0 .
-The new value of the root, b, is computed based on a
first-order Taylor series expansion of f(x) about the
initial guess, a.

-This method is iterative, but it only requires one initial


guess
-An important advantage of the Newton method is its
rapid convergence.

Algorithm of Newton Raphson Method


Step 1: Selection of initial approximation in values of x i.e. x0.
Step 2: Find the value of f(x) & f(x) at x0
Step 3: Find the new approximation xi by Newton Raphson
method i.e. xi = x0 f(x0)/f(x0)
Step 4: Now replace the value of x0 by xi.
Step 5: Repeat step 2: through to step 4: until the absolute value
of f(x) at xi becomes equal to zero (or less than tolerance).
Step 6: Hence the required root is xi.

9/25/15

Mr.N Kannan, MIT, Manipal

23

9/25/15

Mr.N Kannan, MIT, Manipal

24