SlideShare a Scribd company logo
1 of 11
IT-2210 : Computational
mathematics LAB with
MATLAB
4/10/2017MATLAB by Tajim 1
Lecture 5: MATLAB – Bisection method.
4/10/2017MATLAB by Tajim 2
4/10/2017MATLAB by Tajim 3
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
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.
4/10/2017MATLAB by Tajim 4
Example 1 of Bisection method
4/10/2017MATLAB by Tajim 5
Example 2: 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)
x2 = (1.25+1.5)/2 = 1.375
f(x2) = f(1.375) = positive
Hence root lies between (1.25,1.375)
x3 = (1.25+1.375)/2 = 1.3125
f(x3) = f(1.3125) = negative
Hence root lies between (1.3125,1.375)
x4 = (1.3125+1.375)/2 = 1.34375
f(x4) = f(1.34375) = positive
Hence root lies between (1.3125,1.34375)
x5 = (1.3125+1.34375)/2 = 1.328125
f(x5) = f(1.328125) = positive
4/10/2017MATLAB by Tajim 6
Continued………………..
Hence root lies between (1.3125,1.328125)
x6 = (1.3125+1.328125)/2 = 1.320313
f(x6) = f(1.320313) = negative
Hence root lies between (1.320313,1.328125)
x7 = (1.320313+1.328125)/2 = 1.324219
f(x7) = f(1.324219) = negative
Hence root lies between (1.324219,1.328125)
x8 = (1.324219+1.328125)/2 = 1.326172
f(x8) = f(1.326172) = positive
Hence root lies between (1.324219,1.326172)
x9 = (1.324219+1.326172)/2 = 1.325195
f(x9) = f(1.325195) = positive
Hence root lies between (1.324219,1.325195)
x10 = (1.324219+1.325195)/2 = 1.324707
f(x10) = f(1.324707) = negative
Hence root lies between (1.324707,1.325195)
x11 = (1.324707+1.325195)/2 = 1.324951
f(x11) = f(1.324951) = positive
Hence root lies between (1.324707,1.324951)
x12 = (1.324707+1.324951)/2 = 1.324829
f(x12) = f(1.324829) = positive
Hence root lies between (1.324707,1.324829)
4/10/2017MATLAB by Tajim 7
Continued………………..
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 …. I know 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
4/10/2017MATLAB by Tajim 8
Algorithm for Bisection method
1. Input function and limits.
2. Repeat steps 3 and 4 100 times.
3. x=(a+b)/2
4. If f(x0)<0, a=x else b=x
5. Display x
6. Repeat steps 7 and 8 10 times.
7. Error = x-(a+b)/2
8. Store error values in array
9. Plot error
10. STOP.
4/10/2017MATLAB by Tajim 9
MATLAB code for Bisection method
4/10/2017MATLAB by Tajim 10
MATLAB output of Bisection method
4/10/2017MATLAB by Tajim 11
End of
LECTURE five
Thank You .
References: MSK and MMS sir’s
lecture.

More Related Content

What's hot

Crout s method for solving system of linear equations
Crout s method for solving system of linear equationsCrout s method for solving system of linear equations
Crout s method for solving system of linear equationsSugathan Velloth
 
Newtons Divided Difference Formulation
Newtons Divided Difference FormulationNewtons Divided Difference Formulation
Newtons Divided Difference FormulationSohaib H. Khan
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Syed Ahmed Zaki
 
5.2 the substitution methods
5.2 the substitution methods5.2 the substitution methods
5.2 the substitution methodsmath265
 
Solved exercises line integral
Solved exercises line integralSolved exercises line integral
Solved exercises line integralKamel Attar
 
Section 1.1 the distance and midpoint formulas
Section 1.1 the distance and midpoint formulas Section 1.1 the distance and midpoint formulas
Section 1.1 the distance and midpoint formulas Wong Hsiung
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
Cyclic group- group theory
Cyclic group- group theoryCyclic group- group theory
Cyclic group- group theoryAyush Agrawal
 
Volume of solid revolution
Volume of solid revolutionVolume of solid revolution
Volume of solid revolutionbeenishbeenish
 
The fundamental theorem of calculus
The fundamental theorem of calculusThe fundamental theorem of calculus
The fundamental theorem of calculusAbby Henry
 
Antiderivatives and indefinite integration2009
Antiderivatives and indefinite integration2009Antiderivatives and indefinite integration2009
Antiderivatives and indefinite integration2009Ron Eick
 
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONS
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONSNUMERICAL METHODS MULTIPLE CHOICE QUESTIONS
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONSnaveen kumar
 
Area between curves
Area between curvesArea between curves
Area between curvesShaun Wilson
 
03 truncation errors
03 truncation errors03 truncation errors
03 truncation errorsmaheej
 
Group homomorphism
Group homomorphismGroup homomorphism
Group homomorphismNaliniSPatil
 
22 the fundamental theorem of algebra x
22 the fundamental theorem of algebra x22 the fundamental theorem of algebra x
22 the fundamental theorem of algebra xmath260
 

What's hot (20)

Crout s method for solving system of linear equations
Crout s method for solving system of linear equationsCrout s method for solving system of linear equations
Crout s method for solving system of linear equations
 
Newtons Divided Difference Formulation
Newtons Divided Difference FormulationNewtons Divided Difference Formulation
Newtons Divided Difference Formulation
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
5.2 the substitution methods
5.2 the substitution methods5.2 the substitution methods
5.2 the substitution methods
 
Solved exercises line integral
Solved exercises line integralSolved exercises line integral
Solved exercises line integral
 
Section 1.1 the distance and midpoint formulas
Section 1.1 the distance and midpoint formulas Section 1.1 the distance and midpoint formulas
Section 1.1 the distance and midpoint formulas
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Cyclic group- group theory
Cyclic group- group theoryCyclic group- group theory
Cyclic group- group theory
 
Abstract algebra - Algebraic closed field, unit - 2 , M.Sc. l semester Maths
Abstract algebra -  Algebraic closed field, unit - 2 , M.Sc. l semester Maths Abstract algebra -  Algebraic closed field, unit - 2 , M.Sc. l semester Maths
Abstract algebra - Algebraic closed field, unit - 2 , M.Sc. l semester Maths
 
Volume of solid revolution
Volume of solid revolutionVolume of solid revolution
Volume of solid revolution
 
Secant method
Secant method Secant method
Secant method
 
Secant method
Secant methodSecant method
Secant method
 
The fundamental theorem of calculus
The fundamental theorem of calculusThe fundamental theorem of calculus
The fundamental theorem of calculus
 
Antiderivatives and indefinite integration2009
Antiderivatives and indefinite integration2009Antiderivatives and indefinite integration2009
Antiderivatives and indefinite integration2009
 
Episode 39 : Hopper Design
Episode 39 :  Hopper Design Episode 39 :  Hopper Design
Episode 39 : Hopper Design
 
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONS
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONSNUMERICAL METHODS MULTIPLE CHOICE QUESTIONS
NUMERICAL METHODS MULTIPLE CHOICE QUESTIONS
 
Area between curves
Area between curvesArea between curves
Area between curves
 
03 truncation errors
03 truncation errors03 truncation errors
03 truncation errors
 
Group homomorphism
Group homomorphismGroup homomorphism
Group homomorphism
 
22 the fundamental theorem of algebra x
22 the fundamental theorem of algebra x22 the fundamental theorem of algebra x
22 the fundamental theorem of algebra x
 

Similar to Matlab lecture 5 bisection method@taj

Quantitive Techniques: Bisection method
Quantitive Techniques: Bisection methodQuantitive Techniques: Bisection method
Quantitive Techniques: Bisection methodArti Parab Academics
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Asad Ali
 
Analysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionAnalysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionuttamna97
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representationsallyn joy calcaben
 
Solution 3
Solution 3Solution 3
Solution 3aldrins
 
Solution 3
Solution 3Solution 3
Solution 3aldrins
 
AP Calculus - Tutorial
AP Calculus - TutorialAP Calculus - Tutorial
AP Calculus - TutorialChris Wilson
 
Algebra 2 Section 2-7
Algebra 2 Section 2-7Algebra 2 Section 2-7
Algebra 2 Section 2-7Jimbo Lamb
 
maxima & Minima thoeyr&solved.Module-4pdf
maxima & Minima thoeyr&solved.Module-4pdfmaxima & Minima thoeyr&solved.Module-4pdf
maxima & Minima thoeyr&solved.Module-4pdfRajuSingh806014
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Glicerio Gavilan
 
Adv. Num. Tech. 1 Roots of function.pdf
Adv. Num. Tech. 1 Roots of function.pdfAdv. Num. Tech. 1 Roots of function.pdf
Adv. Num. Tech. 1 Roots of function.pdfchhatrapalnetam
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebralucysolischar
 
Algebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and PolynomialsAlgebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and Polynomialsbenedictbrian1
 

Similar to Matlab lecture 5 bisection method@taj (20)

Quantitive Techniques: Bisection method
Quantitive Techniques: Bisection methodQuantitive Techniques: Bisection method
Quantitive Techniques: Bisection method
 
Bca numer
Bca numerBca numer
Bca numer
 
Ch 2
Ch 2Ch 2
Ch 2
 
Evaluating definite integrals
Evaluating definite integralsEvaluating definite integrals
Evaluating definite integrals
 
Μαθηματικά Γ Λυκείου - Ν. Ράπτης
Μαθηματικά Γ Λυκείου - Ν. ΡάπτηςΜαθηματικά Γ Λυκείου - Ν. Ράπτης
Μαθηματικά Γ Λυκείου - Ν. Ράπτης
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2
 
Analysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionAnalysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruption
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
 
Solution 3
Solution 3Solution 3
Solution 3
 
Solution 3
Solution 3Solution 3
Solution 3
 
AP Calculus - Tutorial
AP Calculus - TutorialAP Calculus - Tutorial
AP Calculus - Tutorial
 
Algebra 2 Section 2-7
Algebra 2 Section 2-7Algebra 2 Section 2-7
Algebra 2 Section 2-7
 
maxima & Minima thoeyr&solved.Module-4pdf
maxima & Minima thoeyr&solved.Module-4pdfmaxima & Minima thoeyr&solved.Module-4pdf
maxima & Minima thoeyr&solved.Module-4pdf
 
Lesson 5: Continuity
Lesson 5: ContinuityLesson 5: Continuity
Lesson 5: Continuity
 
mc-ty-polynomial-2009-1.pdf
mc-ty-polynomial-2009-1.pdfmc-ty-polynomial-2009-1.pdf
mc-ty-polynomial-2009-1.pdf
 
Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721Mac2311 study guide-tcm6-49721
Mac2311 study guide-tcm6-49721
 
Adv. Num. Tech. 1 Roots of function.pdf
Adv. Num. Tech. 1 Roots of function.pdfAdv. Num. Tech. 1 Roots of function.pdf
Adv. Num. Tech. 1 Roots of function.pdf
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebra
 
Algebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and PolynomialsAlgebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and Polynomials
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 

More from Tajim Md. Niamat Ullah Akhund

Artificial intelligence LAB 1 overview &amp; intelligent systems
Artificial intelligence LAB 1   overview &amp; intelligent systemsArtificial intelligence LAB 1   overview &amp; intelligent systems
Artificial intelligence LAB 1 overview &amp; intelligent systemsTajim Md. Niamat Ullah Akhund
 
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajMatlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
Matlab lecture 8 – newton's forward and backword interpolation@taj   copyMatlab lecture 8 – newton's forward and backword interpolation@taj   copy
Matlab lecture 8 – newton's forward and backword interpolation@taj copyTajim Md. Niamat Ullah Akhund
 
Matlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajMatlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajMatlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 2 matlab basic syntax &amp; variables @taj
Matlab lecture 2   matlab basic syntax &amp; variables @tajMatlab lecture 2   matlab basic syntax &amp; variables @taj
Matlab lecture 2 matlab basic syntax &amp; variables @tajTajim Md. Niamat Ullah Akhund
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajTajim Md. Niamat Ullah Akhund
 
Circuit lab 9 verification of maximum power transfer theorem@taj
Circuit lab 9  verification of maximum power transfer theorem@tajCircuit lab 9  verification of maximum power transfer theorem@taj
Circuit lab 9 verification of maximum power transfer theorem@tajTajim Md. Niamat Ullah Akhund
 
Circuit lab 8 verification of thevenin's theorem@taj
Circuit lab 8  verification of thevenin's theorem@tajCircuit lab 8  verification of thevenin's theorem@taj
Circuit lab 8 verification of thevenin's theorem@tajTajim Md. Niamat Ullah Akhund
 

More from Tajim Md. Niamat Ullah Akhund (20)

AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
AI Lecture 6 (logical agents)
AI Lecture 6 (logical agents)AI Lecture 6 (logical agents)
AI Lecture 6 (logical agents)
 
AI Lecture 5 (game playing)
AI Lecture 5 (game playing)AI Lecture 5 (game playing)
AI Lecture 5 (game playing)
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)AI Lecture 2 (intelligent agents)
AI Lecture 2 (intelligent agents)
 
AI Lecture 1 (introduction)
AI Lecture 1 (introduction)AI Lecture 1 (introduction)
AI Lecture 1 (introduction)
 
Course outline (cse 412 - artificial intelligence)
Course outline (cse   412 - artificial intelligence)Course outline (cse   412 - artificial intelligence)
Course outline (cse 412 - artificial intelligence)
 
Artificial intelligence LAB 1 overview &amp; intelligent systems
Artificial intelligence LAB 1   overview &amp; intelligent systemsArtificial intelligence LAB 1   overview &amp; intelligent systems
Artificial intelligence LAB 1 overview &amp; intelligent systems
 
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@tajMatlab lecture 9 – simpson 1,3 and trapezoidal method@taj
Matlab lecture 9 – simpson 1,3 and trapezoidal method@taj
 
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
Matlab lecture 8 – newton's forward and backword interpolation@taj   copyMatlab lecture 8 – newton's forward and backword interpolation@taj   copy
Matlab lecture 8 – newton's forward and backword interpolation@taj copy
 
Matlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@tajMatlab lecture 7 – regula falsi or false position method@taj
Matlab lecture 7 – regula falsi or false position method@taj
 
Matlab lecture 6 – newton raphson method@taj copy
Matlab lecture 6 – newton raphson method@taj   copyMatlab lecture 6 – newton raphson method@taj   copy
Matlab lecture 6 – newton raphson method@taj copy
 
Matlab lecture 4 loops@taj
Matlab lecture 4  loops@tajMatlab lecture 4  loops@taj
Matlab lecture 4 loops@taj
 
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@tajMatlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
Matlab lecture 3 – commands, the m files, data types, bitwise op, set@taj
 
Matlab lecture 2 matlab basic syntax &amp; variables @taj
Matlab lecture 2   matlab basic syntax &amp; variables @tajMatlab lecture 2   matlab basic syntax &amp; variables @taj
Matlab lecture 2 matlab basic syntax &amp; variables @taj
 
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@tajMatlab lecture 1 - installation of matlab, introduction and course outline@taj
Matlab lecture 1 - installation of matlab, introduction and course outline@taj
 
Circuit lab 10 verification of norton's theorem@taj
Circuit lab 10  verification of norton's theorem@tajCircuit lab 10  verification of norton's theorem@taj
Circuit lab 10 verification of norton's theorem@taj
 
Circuit lab 9 verification of maximum power transfer theorem@taj
Circuit lab 9  verification of maximum power transfer theorem@tajCircuit lab 9  verification of maximum power transfer theorem@taj
Circuit lab 9 verification of maximum power transfer theorem@taj
 
Circuit lab 8 verification of thevenin's theorem@taj
Circuit lab 8  verification of thevenin's theorem@tajCircuit lab 8  verification of thevenin's theorem@taj
Circuit lab 8 verification of thevenin's theorem@taj
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

Matlab lecture 5 bisection method@taj

  • 1. IT-2210 : Computational mathematics LAB with MATLAB 4/10/2017MATLAB by Tajim 1
  • 2. Lecture 5: MATLAB – Bisection method. 4/10/2017MATLAB by Tajim 2
  • 3. 4/10/2017MATLAB by Tajim 3 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 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.
  • 4. 4/10/2017MATLAB by Tajim 4 Example 1 of Bisection method
  • 5. 4/10/2017MATLAB by Tajim 5 Example 2: 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) x2 = (1.25+1.5)/2 = 1.375 f(x2) = f(1.375) = positive Hence root lies between (1.25,1.375) x3 = (1.25+1.375)/2 = 1.3125 f(x3) = f(1.3125) = negative Hence root lies between (1.3125,1.375) x4 = (1.3125+1.375)/2 = 1.34375 f(x4) = f(1.34375) = positive Hence root lies between (1.3125,1.34375) x5 = (1.3125+1.34375)/2 = 1.328125 f(x5) = f(1.328125) = positive
  • 6. 4/10/2017MATLAB by Tajim 6 Continued……………….. Hence root lies between (1.3125,1.328125) x6 = (1.3125+1.328125)/2 = 1.320313 f(x6) = f(1.320313) = negative Hence root lies between (1.320313,1.328125) x7 = (1.320313+1.328125)/2 = 1.324219 f(x7) = f(1.324219) = negative Hence root lies between (1.324219,1.328125) x8 = (1.324219+1.328125)/2 = 1.326172 f(x8) = f(1.326172) = positive Hence root lies between (1.324219,1.326172) x9 = (1.324219+1.326172)/2 = 1.325195 f(x9) = f(1.325195) = positive Hence root lies between (1.324219,1.325195) x10 = (1.324219+1.325195)/2 = 1.324707 f(x10) = f(1.324707) = negative Hence root lies between (1.324707,1.325195) x11 = (1.324707+1.325195)/2 = 1.324951 f(x11) = f(1.324951) = positive Hence root lies between (1.324707,1.324951) x12 = (1.324707+1.324951)/2 = 1.324829 f(x12) = f(1.324829) = positive Hence root lies between (1.324707,1.324829)
  • 7. 4/10/2017MATLAB by Tajim 7 Continued……………….. 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 …. I know 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
  • 8. 4/10/2017MATLAB by Tajim 8 Algorithm for Bisection method 1. Input function and limits. 2. Repeat steps 3 and 4 100 times. 3. x=(a+b)/2 4. If f(x0)<0, a=x else b=x 5. Display x 6. Repeat steps 7 and 8 10 times. 7. Error = x-(a+b)/2 8. Store error values in array 9. Plot error 10. STOP.
  • 9. 4/10/2017MATLAB by Tajim 9 MATLAB code for Bisection method
  • 10. 4/10/2017MATLAB by Tajim 10 MATLAB output of Bisection method
  • 11. 4/10/2017MATLAB by Tajim 11 End of LECTURE five Thank You . References: MSK and MMS sir’s lecture.