Bisection Regula Falsi Method
Bisection Regula Falsi Method
PRE-REQUISITE:
THEORY:
The bisection method in mathematics is a root finding method which repeatedly bisects an
interval and then selects a subinterval in which a root must lie for further processing. It is a very
simple and robust method, but it is also relatively slow. Because of this it is often used to obtain a
rough approximation to a solution which is then used as a starting point for more rapidly converging
methods. The method is also called Binary Search method and Internal Halving method, and is
similar to the concept of binary search, where the range of possible solutions is halved for each
iteration.
Step 3: Make the following evaluations to determine in which subinterval the root lies
a) If (a)(c) < 0, the root lies in the lower subinterval. Therefore, set b = c and return to
step 2.
b) If (a)(c) > 0, the root lies in the upper subinterval. Therefore, set a = c and return to step
2.
c) If (a)(c) = 0, the root equals c, terminate the computation.
PSEUDOCODE
SCILAB IMPLEMENTATION
function [xr, ea] = bisect(xl, xu, es, imax)
//==========================================================
// This function implements the bisection algorithm for finding roots of equation in single variable
//==========================================================
// Syntax: [xr, ea] = bisect(xl, xu, es, imax)
// Input(s):
// xl = Lower guess
// xu = Upper guess
// es = Percentage value of error tolerance
// imax = Maximum number of iterations
// Output(s):
// xr = Estimated value of root at last iteration
// ea = Percentage relative approximate error at last iteration
//////////////////////////////////////////////////////////////////////////
//Initialize iteration counter
iter = 0;
//display string
printf("Iteration \t Xr \t ea\n") ;
while (1) //this loop is ALWAYS true but will be stopped by the stopping criterion
//Bisection method
xr = (xl + xu) / 2;
//stopping criterion
//terminate the loop if solution is found or if maximum no. iterationis reached
if (ea < es) | (iter >= imax)
break; //end loop
end
end
endfunction
LAB WORK
Instructions: Do the following. Show your results in tabular form. Submit your implemented
scilab code together with this file in rar/zip file with filename “lastname_Activity1.rar”. Submit
your answer in Mole.
1.a Using the attached Bisection Scilab Code, write a program to find out the root of equation x3
1.8x2 10x 17 0 and roots lie between [1,2] by using Non-Linear Algebraic Method (Bisection
Method) using Scilab. Note: ((%)) is less than 𝜀𝑠 = 0.5%)
1.b The algorithm for false position is the same with bisection method. The two methods only differ in
the calculation of the estimated root (c). Implement False Position method based on the scilab code
implemented in bisection method and solve the same problem (problem 1.a).
19