implement bisection method in c, Assignments of Numerical Methods in Engineering

implement bisection method in c,

Typology: Assignments

2019/2020

Uploaded on 06/25/2020

ridoy-rider
ridoy-rider 🇧🇩

5

(1)

5 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Southern University
Report Name : Implement bisection method in c
Subject Name : Numerical methods Lab
Course Code : CS-2104
Submitted By :
Submitted To :
Name : Md. Alauddin
Maisha Maimuna
ID : 006-37-11
Lecturer, CSE
Dept. : CSE
Southern University
Remarks
Computer Science & Engineering
Spring 2020
pf3
pf4
pf5

Partial preview of the text

Download implement bisection method in c and more Assignments Numerical Methods in Engineering in PDF only on Docsity!

Southern University

Report Name : Implement bisection method in c Subject Name : Numerical methods Lab Course Code : CS-

Submitted By : Submitted To :

Name : Md. Alauddin Maisha Maimuna ID : 006- 37 - 11 Lecturer, CSE Dept. : CSE Southern University

Remarks

Computer Science & Engineering Spring 2020

Name of the Report : Implement bisection method in C

Objective :

  • Implement bisection method in C to find the root of given function X 3 -2x-5=

Description of Bisection method:

The 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 ) have opposite signs. In this case a and b are said to bracket a root since, by the intermediate value therom the continuous function f must have at least one root in the interval ( a , b ).

At each step the method divides the interval in two by computing the midpoint c = ( a + b ) / 2 of the interval and the value of the function f ( c ) at that point. Unless c is itself a root (which is very unlikely, but possible) there are now only two possibilities: either f ( a ) and f ( c ) have opposite signs and bracket a root, or f ( c ) and f ( b ) have opposite signs and bracket a root. The method selects the subinterval that is guaranteed to be a bracket as the new interval to be used in the next step. In this way an interval that contains a zero of f is reduced in width by 50% at each step. The process is continued until the interval is sufficiently small.

Explicitly, if f ( a ) and f ( c ) have opposite signs, then the method sets c as the new value for b , and if f ( b ) and f ( c ) have opposite signs then the method sets c as the new a. (If f ( c )=0 then c may be taken as the solution and the process stops.) In both cases, the new f ( a ) and f ( b ) have opposite signs, so the method is applicable to this smaller interval.

Iteration tasks

Screenshots of code: