SlideShare a Scribd company logo
1 of 7
Download to read offline
NUMERICAL
METHODS
FAST-NUCES, | AK-BROHI ROAD, H-11/4, ISLAMABAD
SEMESTER PROJECT REPORT
ZEESHAN ALI, I14-1623, F
PROBLEM STATEMENT:
A devotee of Newton Raphson used the method to solve an equation x ^ 100
= 0, using the initial estimate xo=0. Calculate next fve Newton method and
Bisection estimates.
PLOT FORf (x)=x
100
:
DERIVATIVE OFf (x)=x
100
:
f
'
(x)=100 x
99
NEWTON REPHSON METHOD FORMULA:
xi+1=xi−
f (xi)
f
'
(xi)
, f
'
(xi )≠0
NEWTON RAPHSON METHOD IMPLIMENTATION:
Given that xo=0 is the initial guess, thereforef
'
(x)=0 , the method works only
iff ' (x)≠0.
Let’s change our assumption as xo=0.6 such thatf ' (x)≠0. The next fve iterations of
the Newton Raphson Method can be implemented as under;
% Let y = f(x) = 0 be our function such that;
y = @(x) x .^ 100;
% Let's plot the graph to analyse the behavior of y(x) for 'x'
figure;
X = -10:0.001:+10;
title('f(x)=x^{100}');
plot(X, X .^ 100);
xo = 0.1; % Initial estimate
% differentiate 'y' w.r.t. x such that;
diff_y = @(x) 100 * x .^ 99.0;
% Now, let's analyse the first five iterations
XN = [0, 0, 0, 0, 0];
YN = [0, 0, 0, 0, 0];
for iteration = 1:5
if diff_y(xo) == 0
disp('Error, Derivative is zero!')
break;
else
% let x be the next value and xo be the previous one;
% according to NRM, next value of x can be given as below
x = xo - y(xo)/diff_y(xo);
% replace the prev value with the next value for next iteration
xo = x;
% store the results to observe in near future
XN(iteration) = xo;
YN(iteration) = y(xo); % approx values of y(x)
% display the new estimate for x and respective f(x)
fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x));
end
end
OUTPUT:
x_1 = 0.099000, y(0.099000) = 0.000000
x_2 = 0.098010, y(0.098010) = 0.000000
x_3 = 0.097030, y(0.097030) = 0.000000
x_4 = 0.096060, y(0.096060) = 0.000000
x_5 = 0.095099, y(0.095099) = 0.000000
PLOT FORf (x)=x
99
:
DERIVATIVE OFf (x)=x
99
:
f
'
(x)=99 x
98
BISECTION METHOD:
For x ∈[a,b],midpoint=
a+b
2
if f (a)f (midpoint )<0:b=midpoint ,else:a=midpoint
BISECTION METHOD IMPLIMENTATION:
Let x∈[−1,6], therefore a=−1 and b=6 are satisfying f (a)f (b)<0. The frst fve
iterations can be observed using the following set of commands in MATLAB;
% Let y = f(x) = 0 be our function such that;
y = @(x) x .^ 99;
% Let's plot the graph to analyse the behavior of y(x) for 'x'
figure;
X = -10:0.001:+10;
title('f(x)=x^{99}');
plot(X, X .^ 99);
% initially we assume that 'x' lies in range [a, b] where;
a = -1; b = 6; % since y(a)y(b) < 0
% Now, let's analyse the first five iterations
XB = [0, 0, 0, 0, 0];
YB = [0, 0, 0, 0, 0];
for iteration = 1:5
% mid point of interval [a,b]
x = (a+b)/2.0;
% display the new estimate for x and respective f(x)
fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x));
% store the results to observe in near future
XB(iteration) = x;
YB(iteration) = y(x); % approx values of y(x)
if y(a) * y(x) < 0
b = x;
elseif y(x) * y(b) < 0
a = x;
end
end
OUTPUT:
x_1 = 2.500000, y(2.500000) =
2489206111144456600000000000000000000000.000000
x_2 = 0.750000, y(0.750000) = 0.000000
x_3 = -0.125000, y(-0.125000) = -0.000000
x_4 = 0.312500, y(0.312500) = 0.000000
x_5 = 0.093750, y(0.093750) = 0.000000
ANALYSIS OF THE APPROXIMATIONS:
In the above graph, ‘+’ represent the values of ‘f(x)’ at the approximated
values x in Bisection Method, while the ‘*’ represents the values of y=x
99
at the
respective values of x approximated using the Bisection Method.
The behavior of the Newton Raphson Method can be analyzed more clearly
by zooming the portion of graph in some range of x as under;
In the above graph we can see that for all the approximated values of ‘x’ we
are getting ‘f(x)’ approaching zero.
CONCLUSION:
Newton Raphson method, for the given function converges faster than the
Bisection Method as gives more accurate values for f(x). In other words, Newton
method can be seen more accurate than the Bisection Method, and is more
convergent as well.

More Related Content

What's hot

Eulermethod2
Eulermethod2Eulermethod2
Eulermethod2
stellajoh
 
IB Maths.Turning points. Second derivative test
IB Maths.Turning points. Second derivative testIB Maths.Turning points. Second derivative test
IB Maths.Turning points. Second derivative test
estelav
 
Derivatives Lesson Oct 13
Derivatives Lesson  Oct 13Derivatives Lesson  Oct 13
Derivatives Lesson Oct 13
ingroy
 
Lesson3.1 The Derivative And The Tangent Line
Lesson3.1 The Derivative And The Tangent LineLesson3.1 The Derivative And The Tangent Line
Lesson3.1 The Derivative And The Tangent Line
seltzermath
 
5.3 curve sketching
5.3 curve sketching5.3 curve sketching
5.3 curve sketching
dicosmo178
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest Descent
Jeremy Lane
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
m2699
 
Nhap du lieu
Nhap du lieuNhap du lieu
Nhap du lieu
bichdinh
 
Sinusoidal graphs example
Sinusoidal graphs  exampleSinusoidal graphs  example
Sinusoidal graphs example
monster2010
 

What's hot (20)

Eulermethod2
Eulermethod2Eulermethod2
Eulermethod2
 
Euler method in c
Euler method in cEuler method in c
Euler method in c
 
Faisal
FaisalFaisal
Faisal
 
Newton cotes method
Newton cotes methodNewton cotes method
Newton cotes method
 
IB Maths.Turning points. Second derivative test
IB Maths.Turning points. Second derivative testIB Maths.Turning points. Second derivative test
IB Maths.Turning points. Second derivative test
 
Derivatives Lesson Oct 13
Derivatives Lesson  Oct 13Derivatives Lesson  Oct 13
Derivatives Lesson Oct 13
 
Lesson3.1 The Derivative And The Tangent Line
Lesson3.1 The Derivative And The Tangent LineLesson3.1 The Derivative And The Tangent Line
Lesson3.1 The Derivative And The Tangent Line
 
5.3 curve sketching
5.3 curve sketching5.3 curve sketching
5.3 curve sketching
 
Calc 3.4
Calc 3.4Calc 3.4
Calc 3.4
 
Maple Code for Steepest Descent
Maple Code for Steepest DescentMaple Code for Steepest Descent
Maple Code for Steepest Descent
 
0.5.derivatives
0.5.derivatives0.5.derivatives
0.5.derivatives
 
Guia de estudio para aa5
Guia de estudio  para aa5 Guia de estudio  para aa5
Guia de estudio para aa5
 
Brains
BrainsBrains
Brains
 
Quadratic functions
Quadratic functionsQuadratic functions
Quadratic functions
 
5.3 Basic functions. Dynamic slides.
5.3 Basic functions. Dynamic slides.5.3 Basic functions. Dynamic slides.
5.3 Basic functions. Dynamic slides.
 
Application of partial derivatives
Application of partial derivativesApplication of partial derivatives
Application of partial derivatives
 
Nhap du lieu
Nhap du lieuNhap du lieu
Nhap du lieu
 
10CSL67 CG LAB PROGRAM 9
10CSL67 CG LAB PROGRAM 910CSL67 CG LAB PROGRAM 9
10CSL67 CG LAB PROGRAM 9
 
Assignmnt 4
Assignmnt 4Assignmnt 4
Assignmnt 4
 
Sinusoidal graphs example
Sinusoidal graphs  exampleSinusoidal graphs  example
Sinusoidal graphs example
 

Similar to Numerical methods course project report

Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equations
ZunAib Ali
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
ZunAib Ali
 
SECTION 7.3 word.docx
SECTION 7.3 word.docxSECTION 7.3 word.docx
SECTION 7.3 word.docx
LMinhTm26
 
Mathematics with awesome example.pdf
Mathematics with awesome example.pdfMathematics with awesome example.pdf
Mathematics with awesome example.pdf
elistemidayo
 
Roots equations
Roots equationsRoots equations
Roots equations
oscar
 
Roots equations
Roots equationsRoots equations
Roots equations
oscar
 
Famous problem IMO 1988 Q6.pdf
Famous problem IMO 1988 Q6.pdfFamous problem IMO 1988 Q6.pdf
Famous problem IMO 1988 Q6.pdf
AbdulHannif2
 

Similar to Numerical methods course project report (20)

Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equations
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
Application of derivative
Application of derivativeApplication of derivative
Application of derivative
 
SECTION 7.3 word.docx
SECTION 7.3 word.docxSECTION 7.3 word.docx
SECTION 7.3 word.docx
 
Lecture6
Lecture6Lecture6
Lecture6
 
Interpolation techniques - Background and implementation
Interpolation techniques - Background and implementationInterpolation techniques - Background and implementation
Interpolation techniques - Background and implementation
 
AJMS_389_22.pdf
AJMS_389_22.pdfAJMS_389_22.pdf
AJMS_389_22.pdf
 
Calculas
CalculasCalculas
Calculas
 
Continuity and Uniform Continuity
Continuity and Uniform ContinuityContinuity and Uniform Continuity
Continuity and Uniform Continuity
 
AJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdfAJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdf
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
 
Mathematics with awesome example.pdf
Mathematics with awesome example.pdfMathematics with awesome example.pdf
Mathematics with awesome example.pdf
 
Roots equations
Roots equationsRoots equations
Roots equations
 
Roots equations
Roots equationsRoots equations
Roots equations
 
Famous problem IMO 1988 Q6.pdf
Famous problem IMO 1988 Q6.pdfFamous problem IMO 1988 Q6.pdf
Famous problem IMO 1988 Q6.pdf
 
104newton solution
104newton solution104newton solution
104newton solution
 
Ch 2
Ch 2Ch 2
Ch 2
 
Logit model testing and interpretation
Logit model testing and interpretationLogit model testing and interpretation
Logit model testing and interpretation
 
Newton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsmNewton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsm
 

Recently uploaded

怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
vexqp
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
nirzagarg
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
cnajjemba
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
wsppdmt
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 

Recently uploaded (20)

怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
怎样办理伦敦大学城市学院毕业证(CITY毕业证书)成绩单学校原版复制
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Tumkur [ 7014168258 ] Call Me For Genuine Models We...
 
Data Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdfData Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdf
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Harnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptxHarnessing the Power of GenAI for BI and Reporting.pptx
Harnessing the Power of GenAI for BI and Reporting.pptx
 
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptxThe-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
The-boAt-Story-Navigating-the-Waves-of-Innovation.pptx
 

Numerical methods course project report

  • 1. NUMERICAL METHODS FAST-NUCES, | AK-BROHI ROAD, H-11/4, ISLAMABAD SEMESTER PROJECT REPORT ZEESHAN ALI, I14-1623, F
  • 2. PROBLEM STATEMENT: A devotee of Newton Raphson used the method to solve an equation x ^ 100 = 0, using the initial estimate xo=0. Calculate next fve Newton method and Bisection estimates. PLOT FORf (x)=x 100 : DERIVATIVE OFf (x)=x 100 : f ' (x)=100 x 99 NEWTON REPHSON METHOD FORMULA:
  • 3. xi+1=xi− f (xi) f ' (xi) , f ' (xi )≠0 NEWTON RAPHSON METHOD IMPLIMENTATION: Given that xo=0 is the initial guess, thereforef ' (x)=0 , the method works only iff ' (x)≠0. Let’s change our assumption as xo=0.6 such thatf ' (x)≠0. The next fve iterations of the Newton Raphson Method can be implemented as under; % Let y = f(x) = 0 be our function such that; y = @(x) x .^ 100; % Let's plot the graph to analyse the behavior of y(x) for 'x' figure; X = -10:0.001:+10; title('f(x)=x^{100}'); plot(X, X .^ 100); xo = 0.1; % Initial estimate % differentiate 'y' w.r.t. x such that; diff_y = @(x) 100 * x .^ 99.0; % Now, let's analyse the first five iterations XN = [0, 0, 0, 0, 0]; YN = [0, 0, 0, 0, 0]; for iteration = 1:5 if diff_y(xo) == 0 disp('Error, Derivative is zero!') break; else % let x be the next value and xo be the previous one; % according to NRM, next value of x can be given as below x = xo - y(xo)/diff_y(xo); % replace the prev value with the next value for next iteration xo = x; % store the results to observe in near future XN(iteration) = xo; YN(iteration) = y(xo); % approx values of y(x) % display the new estimate for x and respective f(x) fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x)); end end OUTPUT: x_1 = 0.099000, y(0.099000) = 0.000000 x_2 = 0.098010, y(0.098010) = 0.000000 x_3 = 0.097030, y(0.097030) = 0.000000
  • 4. x_4 = 0.096060, y(0.096060) = 0.000000 x_5 = 0.095099, y(0.095099) = 0.000000 PLOT FORf (x)=x 99 : DERIVATIVE OFf (x)=x 99 : f ' (x)=99 x 98 BISECTION METHOD: For x ∈[a,b],midpoint= a+b 2 if f (a)f (midpoint )<0:b=midpoint ,else:a=midpoint
  • 5. BISECTION METHOD IMPLIMENTATION: Let x∈[−1,6], therefore a=−1 and b=6 are satisfying f (a)f (b)<0. The frst fve iterations can be observed using the following set of commands in MATLAB; % Let y = f(x) = 0 be our function such that; y = @(x) x .^ 99; % Let's plot the graph to analyse the behavior of y(x) for 'x' figure; X = -10:0.001:+10; title('f(x)=x^{99}'); plot(X, X .^ 99); % initially we assume that 'x' lies in range [a, b] where; a = -1; b = 6; % since y(a)y(b) < 0 % Now, let's analyse the first five iterations XB = [0, 0, 0, 0, 0]; YB = [0, 0, 0, 0, 0]; for iteration = 1:5 % mid point of interval [a,b] x = (a+b)/2.0; % display the new estimate for x and respective f(x) fprintf('x_%d = %f, y(%f) = %fn', iteration, x, x, y(x)); % store the results to observe in near future XB(iteration) = x; YB(iteration) = y(x); % approx values of y(x) if y(a) * y(x) < 0 b = x; elseif y(x) * y(b) < 0 a = x; end end OUTPUT: x_1 = 2.500000, y(2.500000) = 2489206111144456600000000000000000000000.000000 x_2 = 0.750000, y(0.750000) = 0.000000 x_3 = -0.125000, y(-0.125000) = -0.000000 x_4 = 0.312500, y(0.312500) = 0.000000 x_5 = 0.093750, y(0.093750) = 0.000000
  • 6. ANALYSIS OF THE APPROXIMATIONS: In the above graph, ‘+’ represent the values of ‘f(x)’ at the approximated values x in Bisection Method, while the ‘*’ represents the values of y=x 99 at the respective values of x approximated using the Bisection Method.
  • 7. The behavior of the Newton Raphson Method can be analyzed more clearly by zooming the portion of graph in some range of x as under; In the above graph we can see that for all the approximated values of ‘x’ we are getting ‘f(x)’ approaching zero. CONCLUSION: Newton Raphson method, for the given function converges faster than the Bisection Method as gives more accurate values for f(x). In other words, Newton method can be seen more accurate than the Bisection Method, and is more convergent as well.