This document discusses different numerical methods for finding the roots of equations, including the bisection method, false position method, and Newton-Raphson method. It provides details on how the bisection method works, including defining an interval where the solution lies and bisecting that interval recursively until the approximate root is found. An example of using the bisection method to find the root of an equation is shown. The false position method is described as similar but using the slope of a line between two points to get a better first approximation than bisection. Newton-Raphson is also introduced but not explained in detail.
1. Bisection method in Scilab code
(Program) example with
algorithm
QUANTITATIVE TECHNIQUES
2. finding the roots of given equation
There are various methods available for finding the roots of given equation such
as
Bisection method,
False position method,
Newton Raphson method, etc
3. Bisection method
Bisection method is very simple but time consuming
method.
In this method, we first define an interval in which our
solution of equation lies.
As the name indicates, Bisection method uses the
bisecting (divide the range by 2) principle.
In this method we minimize the range of solution by
dividing it by integer 2.
4. steps to find the approximate solution of
given equation using Bisection method
Let us assume that we have to find out the roots of f(x), whose
solution is lies in the range (a,b), which we have to determine.
The only condition for bisection method is that f(a) and f(b) should
have opposite signs (f(a) negative and f(b) positive).
When f(a) and f(b) are of opposite signs at least one real root
between ‘a’ and ‘b’ should exist.
For the first approximation we assume that root to be,
x0=(a+b)/2
5. steps to find the approximate solution of
given equation using Bisection method
Then we have to find sign of f(x0).
If f(x0) is negative the root lies between a and x0. If f(x0) is positive the
root lies between x0 and b.
Now we have new minimized range, in which our root lies.
The next approximation is given by,
x1 = (a+x0)/2………….if f(x0) is negative.
x1 = (x0+b)/2………….if f(x0) is positive.
In this taking midpoint of range of approximate roots, finally both values
of range converges to a single value, which we can take as a approximate
root.
6. Example & Solution
Find the root of x^3 – x = 1 by using Bisection Method.
Let us assume that the root of x^3 – x – 1=0 lies between (1,2)
Here, f(1) = negative and f(2) = positive.
Hence root lies between (1,2)
For first approximation,
x0 = (1+2)/2 = 1.5
f(x0) = f(1.5) = positive
Hence root lies between (1,1.5)
x1 = (1+1.5)/2 = 1.25
f(x1) = f(1.25) = negative
Hence root lies between (1.25,1.5)
11. Example & Solution
x13 = (1.324707+1.324829)/2 = 1.324768
f(x13) = f(1.324768) = positive
Hence root lies between (1.324707,1.324768)
OK stop it …. you are getting tired… but there is no shortcut.
Now if you observe two limits (1.324707, 1.324768) of above range, they are
almost same. Which is our root of given equation.
Answer: x=1.3247
12. Algorithm for Bisection Method:
Input function and limits.
Repeat steps 3 and 4 100 times.
x=(a+b)/2
If f(x0)<0, a=x else b=x
Display x
Repeat steps 7 and 8 10 times.
Error = x-(a+b)/2
Store error values in array
Plot error
STOP.
13. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
The Regula falsi method is an oldest method for computing the real roots of an
algebraic equation.
The convergce process in the bisection method is very slow.
It depends only on the choice of end points of the interval [a,b].
The function f(x) does not have any role in finding the point c (which is just the
mid-point of a and b).
It is used only to decide the next smaller interval [a,c] or [c,b].
A better approximation to c can be obtained by taking the straight line L joining
the points (a,f(a)) and (b,f(b)) intersecting the x-axis.
To obtain the value of c we can equate the two expressions of the slope m of the
line L.
14. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
Locate the interval (a,b) such that f(a) and f(b) have opposite signs.
Consider the point C s. t. chord AB crosses X-axis at (C,0).
C=af(b)-bf(a)/f(b)-f(a)
Calculate f(c)
If f(a) and f(c) have opposite signs; then interval is (a,c) and if f(b) and f(c)
have opposite signs then interval is (c,b)
Reapet these steps for 2 to 3 iterationsto get desired precision
15. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
The Regula falsi method is an oldest method for computing the real roots of an
algebraic equation.
Examples:
Find the root between (2,3) of x3+ - 2x - 5 = 0, by using regular falsi method.
Given
f(x) = x3 - 2 x - 5
f(2) = 23 - 2 (2) - 5 = -1 (negative)
f(3) = 33 - 2 (3) - 5 = 16 (positive)
16. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
Examples continued:
Let us take a= 2 and b= 3.
The first approximation to root is x1 and is given by
x1 = (a f(a) - b f(b))/(f(b)-f(a))
=(2 f(3)- 3 f(2))/(f(3) - f(2))
=(2 x 16 - 3 (-1))/ (16- (-1))
= (32 + 3)/(16+1) =35/17
= 2.058
Now f(2.058) = 2.0583 - 2 x 2.058 - 5
= 8.716 - 4.116 - 5
= - 0.4
The root lies between 2.058 and 3
17. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
Examples continued:
Taking a = 2.058 and b = 3. we have the second approximation to the root given
by
x2 = (a f(a) - b f(b))/(f(b)-f(a))
= (2.058 x f(3) - 3 x f(2.058)) /(f(3) - f(2.058))
= (2.058 x 16 -3 x -0.4) / (16 - (-0.4))
= 2.081
Now f(2.081) = 2.0812 - 2 x 2.081 - 5
= -0.15
18. Solution of Algebraic and Transcendental
Equations
(The Method Of False Position)
Examples continued:
The root lies between 2.081 and 3
Take a = 2.081 and b = 3
The third approximation to the root is given by
x3 = (a f(a) - b f(b))/(f(b)-f(a))
= (2.089 X 16 - 3 x (-0.062))/ (16 - (-0.062))
= 2.093
The root is 2.09
19. Similarities with Bisection Method
Same Assumptions: This method also assumes that function is continuous in [a,
b] and given two numbers ‘a’ and ‘b’ are such that f(a) * f(b) < 0.
Always Converges: like Bisection, it always converges, usually considerably faster
than Bisection–but sometimes very much more slowly than Bisection.
20. Newton-Raphson Method to find the
roots of a polynomial
Consider the following single nonlinear equation
The Newton-Raphson method consists in obtaining improved values of the approximate root through the
recurrent application of the equation. The iterative procedure can be generalized in the form
below
After each iteration the program should check to see if the convergence condition is satisfied.