NM Laboratory 2 Roots Non Linear Function Bracketing Methods

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

College of Engineering

NUMERICAL METHODS AND ANALYSIS -


LABORATORY
(GEN0130L)

LABORATORY EXERCISE NO. 2


Roots of Non-Linear Function: Bracketing
Techniques

FINAL GRADE

Name of Student:
Date of Performance:
Date of Submission:
Name of Instructor:
Signature of Instructor:

NUMERICAL METHODS AND ANALYSIS – LABORATORY 1|P a g e


College of Engineering

LABORATORY EXERCISE NO. 2


Roots of Non-Linear Function: Bracketing Techniques
OBJECTIVES:
At the end of this laboratory exercise, the students are expected to be:

1. To demonstrate the characteristics of bracketing techniques in solving non-linear


transcendental and polynomial functions.
2. To be able to learn how to use interhalving (Bisection) method on non-linear functions.
3. To be able to learn how to use Regula-Falsi on non-linear functions.

MATERIALS/EQUIPMENT REQUIRED:

Quantity Materials/Equipment

1 Computer (with MS Excel)

INTRODUCTION:
There are two types of closed-point system: the bisection method and the regula-falsi
method. The bisection method in mathematics is a root-finding method that 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 law. It is a very simple and robust method, but it
is also relatively slow. Because of this, it is often used to obtain rough approximation to a solution
which is then used as a starting point for more rapidly converging methods. The method is also
called interval halving method. This method is applicable for numerically solving the equation f(x)
= 0 for the real variable x, where f is a continuous function defined on an interval {a,b} and where
f(a) and f(b) are said to be bracket a root since, by the intermediate value theorem, the continuous
function f must have at least one root in the interval (a,b)

To refine the bisection method, we can choose a ‘false-position method’ instead of the midpoint.
The false position is defined as the x-position where a line connecting the two boundary points
crosses the axis.

NUMERICAL METHODS AND ANALYSIS – LABORATORY 2|P a g e


College of Engineering

DISCUSSION:
 INTERVAL HALVING (BISECTION) METHOD

Iterative root formula:

x0 + x 1 x 1−x 0
x 2= or x 2=x 0 + (midpoint formula)
2 2

After solving for a new root estimate x 2, substitute x 2 to the given function f(x) to obtain
f(x 2) .

If f(x 2) >0, then replace “+” function limit of x with x 2 but if f(x 2) <0, then replace “-“
function limit value of x with x 2. The process is repeated until the terminating condition is satisfied.

NUMERICAL METHODS AND ANALYSIS – LABORATORY 3|P a g e


College of Engineering

 REGULA-FALSI (FALSE POSITION) METHOD

After solving for a root estimate x 2, substitute x 2to the given function of f ( x ) to obtain
f (x ¿¿ 2)¿.

If f (x ¿¿ 2)¿.>0, then replace “+” function limit value of x with x 2 but if f (x ¿¿ 2)¿<0, then
replace “-“ function limit value of x with x 2. The process is repeated until the terminating condition
is satisfied.

NUMERICAL METHODS AND ANALYSIS – LABORATORY 4|P a g e


College of Engineering

PROCEDURES:
1.) Turn on and log in to your computer terminals.
2.) Click on MS Excel and prepare 2 excel worksheets for (a) Interval Halving (Bisection)
Method and (b) Regula-Falsi Method on the same file.
3.) Rename the worksheets by right clicking the lower left hand tab flap “sheet 1” to
“Bisection” and “sheet 2” to Regula-Falsi”.
4.) Obtain the roots of the given polynomial function (a) and transcendental function (b) with
its terminating criteria provided by your instructor using the worksheet for Bisection
Method.
5.) Provide a column devoted for the initial/previous values x 0 and x 1, the computed root
estimate x 2, along with their respective functions f (x ¿¿ 0)¿ , f (x ¿¿ 1)¿ and f (x ¿¿ 2)¿
respectively, and a remarks column.
6.) Program the excel worksheet to automatically compute for the new root estimate x 2 from
the given values x 0 and x 1 along with its respective functions f (x ¿¿ 0)¿ , f (x ¿¿ 1)¿ and
f (x ¿¿ 2)¿. The remarks column should be programmed automatically display if the
iterative process needs to continue (“continue”) or stop (“terminate”).
7.) Copy the program to repeat the process until the remarks column displays “terminate”.
8.) Fill the Bisection table provided in the data sheet (table 2.1) with the last 10 iterations
made.
9.) Obtain the roots of the given polynomial function (a) and transcendental function (b) with
its terminating criteria provided by your instructor using the worksheet for the Regula-Falsi
Method.
10.) Provide a column devoted for the initial/previous values x 0 and x 1, the computed root
estimate x 2, along with their respective functions f (x ¿¿ 0)¿ , f (x ¿¿ 1)¿ and f (x ¿¿ 2)¿
respectively, and a remarks column.
11.) Program the excel worksheet to automatically compute for the new root estimate x 2, from
the given values x 0 and x 1 along with its respective functions f (x ¿¿ 0)¿ , f (x ¿¿ 1)¿ and
f (x ¿¿ 2)¿. The remarks column should be programmed automatically display if the iterative
process needs to continue (“continue”) or stop (“terminate”).
12.) Copy the program to repeat the process until the remarks column display “terminate”.

NUMERICAL METHODS AND ANALYSIS – LABORATORY 5|P a g e


College of Engineering

13.) Fill in the Regula-Falsi table provided in the data sheet (table 2.2) with last 10 iterations
made.
14.) Save your work using a specified file name given by your instructor on your “my
documents”.

DATA SHEET

Given functions:
a. Polynomial Function: f ( x )=x 10−1
b. Transcendental Function: f ( x )=e x −2

Terminating Conditions:
a. 10 iterations
b. f ( x 2 ) ≤ 0.01

Table 2.1 Interhalving (Bisection) Method (Sample Excel Output)

Polynomial Function (a): Root 1 =


x0 x2 x1 f ( x0) f ( x2 ) f ( x1) Remarks

Transcendental Function (b): Root 1 =


x0 x2 x1 f ( x0) f ( x2 ) f ( x1) Remarks

NUMERICAL METHODS AND ANALYSIS – LABORATORY 6|P a g e


College of Engineering

Table 2.2 Regula-Falsi Method (Sample Excel Output)

Polynomial Function (a): Root 2 =


x0 x2 x1 f ( x0) f ( x2 ) f ( x1) Remarks

Transcendental Function (b): Root 2 =


x0 x2 x1 f ( x0) f ( x2 ) f ( x1) Remarks

NUMERICAL METHODS AND ANALYSIS – LABORATORY 7|P a g e


College of Engineering

Approved by:

Instructor

GRAPH:

NUMERICAL METHODS AND ANALYSIS – LABORATORY 8|P a g e


College of Engineering

DISCUSSION OF RESULTS:

NUMERICAL METHODS AND ANALYSIS – LABORATORY 9|P a g e


College of Engineering

CONCLUSION:

NUMERICAL METHODS AND ANALYSIS – LABORATORY 10 | P a g e


College of Engineering

PROBLEMS/EXERCISES:
1.) What function command did you use for the remarks? Show its syntax format.

2.) What function command is used for determining the succeeding iterative initial values
for x 0 and x 1? Show its syntax format.

3.) Evaluate 2 Chapter problems from the book Numerical Methods for Engineers (By Chapra
and Canale) involving Bisection Method (Chapter 5) using your excel Bisection Method
worksheet.

4.) Evaluate 2 Chapter problems from the book Numerical Methods for Engineers (By Chapra
and Canale) involving Regula-Falsi Method (Chapter 5) using your excel Bisection Method
worksheet.

NUMERICAL METHODS AND ANALYSIS – LABORATORY 11 | P a g e


College of Engineering

NUMERICAL METHODS AND ANALYSIS – LABORATORY 12 | P a g e

You might also like