SlideShare una empresa de Scribd logo
1 de 18
IT-2210 : Computational
mathematics LAB with
MATLAB
4/10/2017MATLAB by Tajim 1
Lecture 7: MATLAB – Regula falsi
or False position method.
4/10/2017MATLAB by Tajim 2
4/10/2017MATLAB by Tajim 3
Regula falsi or False position method.
False position method and regula falsi method are two early, and still
current, names for a very old method for solving an equation in one
unknown.
The Converge process in the bisection method is very slow. Because the
interval between x1 and x2 is divided into two equal half and calculate
the first approximate value[𝑥0=𝑥1+𝑥22]. Actually it is used only to
decide the next smaller interval. But a better approximation can be
obtained by taking a straight line both the two end points. Thus the point
of intersection of this line with x axis (x0) gives an improved estimate of
the root and is called the false position of the root. The value of this point
(x0) and its function is taking as the initial guesses.
4/10/2017MATLAB by Tajim 4
Regula falsi or False position method.
In scientific and engineering work, a frequently occurring
problem is to find the roots of equations of the form y=f(x)=0,
i.e finding the value of x where the value of y=f(x) is equal to
0. In quadratic, cubic or a biquadratic equations, algebraic
formulae are available for expressing the roots in terms of co-
efficient. But in the case, where f(x) is a polynomial of higher
degree or an expression involving transcendental functions, the
algebraic methods are not applicable and the help of
numerical method must be taken to find approximate roots.
4/10/2017MATLAB by Tajim 5
Objectives of this experiment
To write a program in order to find
out the roots of a nonlinear equation
by the method of False Position in
matlab.
4/10/2017MATLAB by Tajim 6
Theory
4/10/2017MATLAB by Tajim 7
Theory Cont……
-10 -5 0 5 10 15 20 25 30
-200
-100
0
100
200
300
400
500
x
y=f(x)
Fig.1
B[x1,f(x1)]
A[x0,f(x0)]
x2 x3 x4
real root, x
x0 x1
4/10/2017MATLAB by Tajim 8
Theory Cont……
4/10/2017MATLAB by Tajim 9
Ex-1: Find the positive root of 𝑥3=2𝑥-5 by false position method.
Solution: let 𝑓(𝑥)= 𝑥3−2𝑥-5……………………..(1)
Here, 𝑓(2)=8−9=−1<𝟎; 𝑓(3)=27−6−5=16>𝟎
So the root lies between 2 and 3. So, a=2; b=3
Now Regula falsi method: 𝒙𝟎=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎) =
2𝑓(3)−3𝑓(2)𝑓(3)−𝑓(2)=(2∗16−3∗(−1))16−(−1)=𝟐.𝟎𝟓𝟖𝟖𝟐𝟒
Now from (1) we can write: 𝑓(𝑥0)=(𝑥0)3−2𝑥0+5=(𝟐.𝟎𝟓𝟖𝟖𝟐𝟒)3−2∗𝟐.𝟎𝟓𝟖𝟖𝟐𝟒+5=
−0.390795<0
So the root lies between 𝟐.𝟎𝟓𝟖𝟖𝟐𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟓𝟖𝟖𝟐𝟒,𝑏=3]
𝒙𝟏=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=2.058824∗𝑓(3)−3𝑓(2.058824)𝑓(3)−𝑓(2.058824)=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒
From (1) we can write:
𝑓(𝑥1)=(𝑥1)3−2𝑥1+5=(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)3−2∗𝟐.𝟎𝟖𝟏𝟐𝟔𝟒+5= −0.147200<0
So the root lies between 𝟐.𝟎𝟖𝟏𝟐𝟔𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒,𝑏=3]
𝒙𝟐=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒∗𝑓(3)−3𝑓(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗
4/10/2017MATLAB by Tajim 10
Ex-1: cont………………….
From (1) we can write: 𝑓(𝑥2)=(𝑥2)3−2𝑥2+5=(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)3−2∗𝟐.𝟎𝟖𝟗𝟔𝟑𝟗+5= −0.054679<0
So the root lies between 𝟐.𝟎𝟖𝟗𝟔𝟑𝟗 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗,𝑏=3]
𝒙𝟑=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)𝑓(3)−𝑓(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)=𝟐.𝟎𝟗𝟐𝟕𝟒
From (1) we can write: 𝑓(𝑥3)=(𝑥3)3−2𝑥3+5=(𝟐.𝟎𝟗𝟐𝟕𝟒)3−2∗𝟐.𝟎𝟗𝟐𝟕𝟒+5= −0.020198<0
So the root lies between 𝟐.𝟎𝟗𝟐𝟕𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟐𝟕𝟒,𝑏=3]
𝒙𝟒=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟐𝟕𝟒∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟐𝟕𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟐𝟕𝟒)=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒
From (1) we can write: 𝑓(𝑥4)=(𝑥4)3−2𝑥4+5=(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)3−2∗𝟐.𝟎𝟗𝟑𝟖𝟖𝟒+5= −0.007448<0
So the root lies between 𝟐.𝟎𝟗𝟑𝟖𝟖𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒,𝑏=3]
𝒙𝟓=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔
From (1) we can write: 𝑓(𝑥5)=(𝑥5)3−2𝑥5+5=(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)3−2∗𝟐.𝟎𝟗𝟒𝟑𝟎𝟔+5= −0.002740<0
So the root lies between 𝟐.𝟎𝟗𝟒𝟑𝟎𝟔 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔,𝑏=3]
𝒙𝟔=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏
4/10/2017MATLAB by Tajim 11
Ex-1: cont………………….
𝒙𝟔=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏
From (1) we can write: 𝑓(𝑥6)=(𝑥6)3−2𝑥6+5=(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)3−2∗𝟐.𝟎𝟗𝟒𝟒𝟔𝟏+5= −0.0010098<0
So the root lies between 𝟐.𝟎𝟗𝟒𝟒𝟔𝟏 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏,𝑏=3]
𝒙𝟕=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)=𝟐.𝟎𝟗𝟒𝟓𝟏
From (1) we can write: 𝑓(𝑥7)=(𝑥7)3−2𝑥7+5=(𝟐.𝟎𝟗𝟒𝟓𝟏)3−2∗𝟐.𝟎𝟗𝟒𝟓𝟏+5= −0.0003914<0
So the root lies between 𝟐.𝟎𝟗𝟒𝟓𝟏 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟓𝟏,𝑏=3]
𝒙𝟖=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟓𝟏∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟓𝟏)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟓𝟏)=𝟐.𝟎𝟗𝟒𝟓𝟑
∴𝒙𝟕=𝒙𝟖=𝟐.𝟎𝟗𝟒𝟓
Hence the required root is : 𝟐.𝟎𝟗𝟒𝟓
4/10/2017MATLAB by Tajim 12
MATLAB code for
Regula falsi or False
position method.
4/10/2017MATLAB by Tajim 13
4/10/2017MATLAB by Tajim 14
MATLAB output for
Newton Raphson
method
For the equation: f(x) = x^3-2*x-5
4/10/2017MATLAB by Tajim 15
MATLAB output of false position method (Graph)
4/10/2017MATLAB by Tajim 16
MATLAB output of N-R method (Console)
For the equation: f(x) = x^3-2*x-5
4/10/2017MATLAB by Tajim 17
Now solve with MATLAB and show the output in console and
Graph for a positive root of the following equation by using
Regula Falsi Method.
1. 𝑥3−4𝑥−1=0 ⇾𝑓(1)=−2<0;𝑓(0)=1>0 [𝑎=0;𝑏=1]
2. 3𝑥−cos𝑥−1=0 ⇾𝑓(0.6)=−0.0253<0;𝑓(0.61)=0.0104>0
[𝑎=0.6;𝑏=0.61]
3. 𝑥3−2𝑥−5=0⇾𝑓(2)=−3<0;𝑓(3)=13>0 [𝑎=2;𝑏=3]
4. 𝑥3−5𝑥+3=0⇾𝑓(1)=−1<0;𝑓(2)=1>0 [𝑎=1;𝑏=2]
5. 𝑥log10𝑥−1.2=0⇾𝑓(2)=−0.597940<0;𝑓(3)=0.23136>0 [𝑎=2;𝑏=3]
6. x2−log𝑒𝑥−12=0⇾𝑓(3)=−4.0986<0;𝑓(4)=2.6137>0 [𝑎=3;𝑏=4]
4/10/2017MATLAB by Tajim 18
End of
LECTURE
seven
Thank You .
References: MSK and MMS sir’s
lecture.

Más contenido relacionado

La actualidad más candente

Lu decomposition
Lu decompositionLu decomposition
Lu decomposition
gilandio
 
Secent method
Secent methodSecent method
Secent method
ritu1806
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
Tayyaba Abbas
 

La actualidad más candente (20)

Taylors series
Taylors series Taylors series
Taylors series
 
Metric space
Metric spaceMetric space
Metric space
 
Runge-Kutta methods with examples
Runge-Kutta methods with examplesRunge-Kutta methods with examples
Runge-Kutta methods with examples
 
Numerical analysis ppt
Numerical analysis pptNumerical analysis ppt
Numerical analysis ppt
 
Bisection method
Bisection methodBisection method
Bisection method
 
Newton divided difference interpolation
Newton divided difference interpolationNewton divided difference interpolation
Newton divided difference interpolation
 
Fuzzy logic Notes AI CSE 8th Sem
Fuzzy logic Notes AI CSE 8th SemFuzzy logic Notes AI CSE 8th Sem
Fuzzy logic Notes AI CSE 8th Sem
 
Interpolation In Numerical Methods.
 Interpolation In Numerical Methods. Interpolation In Numerical Methods.
Interpolation In Numerical Methods.
 
Lu decomposition
Lu decompositionLu decomposition
Lu decomposition
 
Newton Raphson
Newton RaphsonNewton Raphson
Newton Raphson
 
Secent method
Secent methodSecent method
Secent method
 
Presentation on Solution to non linear equations
Presentation on Solution to non linear equationsPresentation on Solution to non linear equations
Presentation on Solution to non linear equations
 
Newton’s Forward & backward interpolation
Newton’s Forward &  backward interpolation Newton’s Forward &  backward interpolation
Newton’s Forward & backward interpolation
 
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
 
Fuzzy expert system
Fuzzy expert systemFuzzy expert system
Fuzzy expert system
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
 
False Position Method.pptx
False Position Method.pptxFalse Position Method.pptx
False Position Method.pptx
 
Modeling with Recurrence Relations
Modeling with Recurrence RelationsModeling with Recurrence Relations
Modeling with Recurrence Relations
 
Regula Falsi (False position) Method
Regula Falsi (False position) MethodRegula Falsi (False position) Method
Regula Falsi (False position) Method
 
combinatorics
combinatoricscombinatorics
combinatorics
 

Similar a Matlab lecture 7 – regula falsi or false position method@taj

Maths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paperMaths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paper
Fabian Hkb
 
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdfPRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
edwinllantoy2
 

Similar a Matlab lecture 7 – regula falsi or false position method@taj (20)

5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functions5.3 Graphs of Polynomial Functions
5.3 Graphs of Polynomial Functions
 
Lesson 21: More Algebra
Lesson 21: More AlgebraLesson 21: More Algebra
Lesson 21: More Algebra
 
5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions5.5 Zeros of Polynomial Functions
5.5 Zeros of Polynomial Functions
 
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
MCA_UNIT-1_Computer Oriented Numerical Statistical MethodsMCA_UNIT-1_Computer Oriented Numerical Statistical Methods
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
Algorithm Assignment Help
Algorithm Assignment HelpAlgorithm Assignment Help
Algorithm Assignment Help
 
Maths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paperMaths notes for 4038 and 4016 paper
Maths notes for 4038 and 4016 paper
 
Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
Lesson 1: The Real Number System
Lesson 1: The Real Number SystemLesson 1: The Real Number System
Lesson 1: The Real Number System
 
P1-Chp13-Integration.pptx
P1-Chp13-Integration.pptxP1-Chp13-Integration.pptx
P1-Chp13-Integration.pptx
 
Logarithm
LogarithmLogarithm
Logarithm
 
Fst ch3 notes
Fst ch3 notesFst ch3 notes
Fst ch3 notes
 
Overviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdfOverviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdf
 
Lesson 15: Geometry
Lesson 15: GeometryLesson 15: Geometry
Lesson 15: Geometry
 
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
 
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdfPRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
PRIMER GRADO ECUACIONES Y DESIGUALDADES EN UNA VARIABLE.pdf
 
MODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptxMODULE_05-Matrix Decomposition.pptx
MODULE_05-Matrix Decomposition.pptx
 
Basic%20Cal%20Final.docx.docx
Basic%20Cal%20Final.docx.docxBasic%20Cal%20Final.docx.docx
Basic%20Cal%20Final.docx.docx
 
Lesson 11: Functions and Function Notation
Lesson 11: Functions and Function NotationLesson 11: Functions and Function Notation
Lesson 11: Functions and Function Notation
 
Lesson 7: Graphing Inequalities
Lesson 7: Graphing InequalitiesLesson 7: Graphing Inequalities
Lesson 7: Graphing Inequalities
 

Más de Tajim Md. Niamat Ullah Akhund

Más de 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 5 bisection method@taj
Matlab lecture 5  bisection method@tajMatlab lecture 5  bisection method@taj
Matlab lecture 5 bisection method@taj
 
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
 
Circuit lab 7 verification of superposition theorem@taj
Circuit lab 7  verification of superposition theorem@tajCircuit lab 7  verification of superposition theorem@taj
Circuit lab 7 verification of superposition theorem@taj
 

Último

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
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
 

Último (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
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 for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
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...
 
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, ...
 

Matlab lecture 7 – regula falsi or false position method@taj

  • 1. IT-2210 : Computational mathematics LAB with MATLAB 4/10/2017MATLAB by Tajim 1
  • 2. Lecture 7: MATLAB – Regula falsi or False position method. 4/10/2017MATLAB by Tajim 2
  • 3. 4/10/2017MATLAB by Tajim 3 Regula falsi or False position method. False position method and regula falsi method are two early, and still current, names for a very old method for solving an equation in one unknown. The Converge process in the bisection method is very slow. Because the interval between x1 and x2 is divided into two equal half and calculate the first approximate value[𝑥0=𝑥1+𝑥22]. Actually it is used only to decide the next smaller interval. But a better approximation can be obtained by taking a straight line both the two end points. Thus the point of intersection of this line with x axis (x0) gives an improved estimate of the root and is called the false position of the root. The value of this point (x0) and its function is taking as the initial guesses.
  • 4. 4/10/2017MATLAB by Tajim 4 Regula falsi or False position method. In scientific and engineering work, a frequently occurring problem is to find the roots of equations of the form y=f(x)=0, i.e finding the value of x where the value of y=f(x) is equal to 0. In quadratic, cubic or a biquadratic equations, algebraic formulae are available for expressing the roots in terms of co- efficient. But in the case, where f(x) is a polynomial of higher degree or an expression involving transcendental functions, the algebraic methods are not applicable and the help of numerical method must be taken to find approximate roots.
  • 5. 4/10/2017MATLAB by Tajim 5 Objectives of this experiment To write a program in order to find out the roots of a nonlinear equation by the method of False Position in matlab.
  • 7. 4/10/2017MATLAB by Tajim 7 Theory Cont…… -10 -5 0 5 10 15 20 25 30 -200 -100 0 100 200 300 400 500 x y=f(x) Fig.1 B[x1,f(x1)] A[x0,f(x0)] x2 x3 x4 real root, x x0 x1
  • 8. 4/10/2017MATLAB by Tajim 8 Theory Cont……
  • 9. 4/10/2017MATLAB by Tajim 9 Ex-1: Find the positive root of 𝑥3=2𝑥-5 by false position method. Solution: let 𝑓(𝑥)= 𝑥3−2𝑥-5……………………..(1) Here, 𝑓(2)=8−9=−1<𝟎; 𝑓(3)=27−6−5=16>𝟎 So the root lies between 2 and 3. So, a=2; b=3 Now Regula falsi method: 𝒙𝟎=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎) = 2𝑓(3)−3𝑓(2)𝑓(3)−𝑓(2)=(2∗16−3∗(−1))16−(−1)=𝟐.𝟎𝟓𝟖𝟖𝟐𝟒 Now from (1) we can write: 𝑓(𝑥0)=(𝑥0)3−2𝑥0+5=(𝟐.𝟎𝟓𝟖𝟖𝟐𝟒)3−2∗𝟐.𝟎𝟓𝟖𝟖𝟐𝟒+5= −0.390795<0 So the root lies between 𝟐.𝟎𝟓𝟖𝟖𝟐𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟓𝟖𝟖𝟐𝟒,𝑏=3] 𝒙𝟏=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=2.058824∗𝑓(3)−3𝑓(2.058824)𝑓(3)−𝑓(2.058824)=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒 From (1) we can write: 𝑓(𝑥1)=(𝑥1)3−2𝑥1+5=(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)3−2∗𝟐.𝟎𝟖𝟏𝟐𝟔𝟒+5= −0.147200<0 So the root lies between 𝟐.𝟎𝟖𝟏𝟐𝟔𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒,𝑏=3] 𝒙𝟐=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟖𝟏𝟐𝟔𝟒∗𝑓(3)−3𝑓(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟖𝟏𝟐𝟔𝟒)=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗
  • 10. 4/10/2017MATLAB by Tajim 10 Ex-1: cont…………………. From (1) we can write: 𝑓(𝑥2)=(𝑥2)3−2𝑥2+5=(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)3−2∗𝟐.𝟎𝟖𝟗𝟔𝟑𝟗+5= −0.054679<0 So the root lies between 𝟐.𝟎𝟖𝟗𝟔𝟑𝟗 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗,𝑏=3] 𝒙𝟑=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟖𝟗𝟔𝟑𝟗∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)𝑓(3)−𝑓(𝟐.𝟎𝟖𝟗𝟔𝟑𝟗)=𝟐.𝟎𝟗𝟐𝟕𝟒 From (1) we can write: 𝑓(𝑥3)=(𝑥3)3−2𝑥3+5=(𝟐.𝟎𝟗𝟐𝟕𝟒)3−2∗𝟐.𝟎𝟗𝟐𝟕𝟒+5= −0.020198<0 So the root lies between 𝟐.𝟎𝟗𝟐𝟕𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟐𝟕𝟒,𝑏=3] 𝒙𝟒=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟐𝟕𝟒∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟐𝟕𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟐𝟕𝟒)=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒 From (1) we can write: 𝑓(𝑥4)=(𝑥4)3−2𝑥4+5=(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)3−2∗𝟐.𝟎𝟗𝟑𝟖𝟖𝟒+5= −0.007448<0 So the root lies between 𝟐.𝟎𝟗𝟑𝟖𝟖𝟒 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒,𝑏=3] 𝒙𝟓=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟑𝟖𝟖𝟒∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟑𝟖𝟖𝟒)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔 From (1) we can write: 𝑓(𝑥5)=(𝑥5)3−2𝑥5+5=(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)3−2∗𝟐.𝟎𝟗𝟒𝟑𝟎𝟔+5= −0.002740<0 So the root lies between 𝟐.𝟎𝟗𝟒𝟑𝟎𝟔 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔,𝑏=3] 𝒙𝟔=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏
  • 11. 4/10/2017MATLAB by Tajim 11 Ex-1: cont…………………. 𝒙𝟔=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟑𝟎𝟔∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟑𝟎𝟔)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏 From (1) we can write: 𝑓(𝑥6)=(𝑥6)3−2𝑥6+5=(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)3−2∗𝟐.𝟎𝟗𝟒𝟒𝟔𝟏+5= −0.0010098<0 So the root lies between 𝟐.𝟎𝟗𝟒𝟒𝟔𝟏 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏,𝑏=3] 𝒙𝟕=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟒𝟔𝟏∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟒𝟔𝟏)=𝟐.𝟎𝟗𝟒𝟓𝟏 From (1) we can write: 𝑓(𝑥7)=(𝑥7)3−2𝑥7+5=(𝟐.𝟎𝟗𝟒𝟓𝟏)3−2∗𝟐.𝟎𝟗𝟒𝟓𝟏+5= −0.0003914<0 So the root lies between 𝟐.𝟎𝟗𝟒𝟓𝟏 𝑎𝑛𝑑 3 ⇒[𝑎=𝟐.𝟎𝟗𝟒𝟓𝟏,𝑏=3] 𝒙𝟖=𝑎𝑓(𝑏)−𝑏𝑓(𝑎)𝑓(𝑏)−𝑓(𝑎)=𝟐.𝟎𝟗𝟒𝟓𝟏∗𝑓(3)−3∗𝑓(𝟐.𝟎𝟗𝟒𝟓𝟏)𝑓(3)−𝑓(𝟐.𝟎𝟗𝟒𝟓𝟏)=𝟐.𝟎𝟗𝟒𝟓𝟑 ∴𝒙𝟕=𝒙𝟖=𝟐.𝟎𝟗𝟒𝟓 Hence the required root is : 𝟐.𝟎𝟗𝟒𝟓
  • 12. 4/10/2017MATLAB by Tajim 12 MATLAB code for Regula falsi or False position method.
  • 14. 4/10/2017MATLAB by Tajim 14 MATLAB output for Newton Raphson method For the equation: f(x) = x^3-2*x-5
  • 15. 4/10/2017MATLAB by Tajim 15 MATLAB output of false position method (Graph)
  • 16. 4/10/2017MATLAB by Tajim 16 MATLAB output of N-R method (Console) For the equation: f(x) = x^3-2*x-5
  • 17. 4/10/2017MATLAB by Tajim 17 Now solve with MATLAB and show the output in console and Graph for a positive root of the following equation by using Regula Falsi Method. 1. 𝑥3−4𝑥−1=0 ⇾𝑓(1)=−2<0;𝑓(0)=1>0 [𝑎=0;𝑏=1] 2. 3𝑥−cos𝑥−1=0 ⇾𝑓(0.6)=−0.0253<0;𝑓(0.61)=0.0104>0 [𝑎=0.6;𝑏=0.61] 3. 𝑥3−2𝑥−5=0⇾𝑓(2)=−3<0;𝑓(3)=13>0 [𝑎=2;𝑏=3] 4. 𝑥3−5𝑥+3=0⇾𝑓(1)=−1<0;𝑓(2)=1>0 [𝑎=1;𝑏=2] 5. 𝑥log10𝑥−1.2=0⇾𝑓(2)=−0.597940<0;𝑓(3)=0.23136>0 [𝑎=2;𝑏=3] 6. x2−log𝑒𝑥−12=0⇾𝑓(3)=−4.0986<0;𝑓(4)=2.6137>0 [𝑎=3;𝑏=4]
  • 18. 4/10/2017MATLAB by Tajim 18 End of LECTURE seven Thank You . References: MSK and MMS sir’s lecture.