SlideShare a Scribd company logo
1 of 19
Download to read offline
TMS-301
NUMERICAL METHODS
Lecture 4: Newton-Raphson, Secant method, etc
3 Newton-Raphson method
3.1 Iterations
The Newton-Raphson method uses the slope (tangent) of the function f(x) at the current iterative
solution (xi) to find the solution (xi+1) in the next iteration.
The slope at (xi, f(xi)) is given by
f (xi) =
f(xi) − 0
xi − xi+1
Then xi+1 can be solved as
xi+1 = xi −
f(xi)
f (xi)
which is known as the Newton-Raphson formula.
Relative error: a =
xi+1−xi
xi+1
× 100%.
Iterations stop if a ≤ threshold.
14
Figure 5: Newton-Raphson method to find the roots of an equation
15
Example: Find the root of e−x
− 3x = 0.
Solution:
f(x) = e−x
− 3x
f (x) = −e−x
− 3
With these, the Newton-Raphson solu-
tion can be updated as
xi+1 = xi −
e−xi − 3xi
−e−xi − 3
−1 → 0.2795 → 0.5680 → 0.6172 →
0.6191 → 0.6191
Converges much faster than the bisection
method.
−1.5 −1 −0.5 0 0.5 1
−1
0
1
2
3
4
5
xf(x)
Newton−Raphson Method (from−1)
3.2 Errors and termination condition
The approximate percentage relative error is
a =
xi+1 − xi
xi+1
× 100%
16
The Newton-Raphson iteration can be terminated when a is less than a certain threshold (e.g.,
1%).
3.3 Error analysis of Newton-Raphson method using Taylor series
Let xt be the true solution to f(x) = 0. That is
f(xt) = 0
According to the Taylor’s theorem, we have
f(xt) = f(xi) + f (xi)(xt − xi) +
f (α)
2
(xt − xi)2
where α is an unknown value between xt and xi. Since f(xt) = 0, the above equation becomes
f(xi) + f (xi)(xt − xi) +
f (α)
2
(xt − xi)2
= 0 (1)
In Newton-Raphson method, we use the following iteration:
xi+1 = xi −
f(xi)
f (xi)
That is
f(xi) + f (xi)(xi+1 − xi) = 0 (2)
17
Subtracting (2) from (1), we have
f (xi)(xt − xi+1) +
f (α)
2
(xt − xi)2
= 0
Denoting ei = xt − xi, which is the error in the i-th iteration, we have
f (xi)ei+1 +
f (α)
2
(ei)2
= 0
With convergence, xi → xt, and α → xt. Then
ei+1 = −
f (xt)
2f (xt)
e2
i
and
|ei+1| =
f (xt)
2f (xt)
e2
i
|ei+1| ∝ |ei|2
The error in the current iteration is proportional to the square of the previous error. That is, we
have quadratic convergence with the Newton-Raphson method. The number of correct decimal
places in a Newton-Raphson solution doubles after each iteration.
Drawbacks of the Newton-Raphson method: (see Fig. 6.6 in [Chapra])
• It cannot handle repeated roots
18
• The solution may diverge near a point of inflection.
• The solution may oscillate near local minima or maxima.
• With near-zero slope, the solution may diverge or reach a different root.
Example:
Find the roots of function f(x) = x3
− 2x2
+ 0.25x + 0.75.
Solution:
To find the exact roots of f(x), we first factorize f(x) as
f(x) = x3
− 2x2
+ 0.25x + 0.75
= (x − 1)(x2
− x − 0.75)
= (x − 1) · (x − 1.5) · (x + 0.5)
Thus, x = 1, x = 1.5 and x = −0.5 are the exact roots of f(x).
To find the roots using the Newton-Raphson methods, write the iteration formula as
xi+1 = xi −
f(xi)
f (xi)
= xi −
x3
− 2x2
+ 0.25x + 0.75
3x2 − 4x + 0.25
• x0 = −1, x1 = −0.6552, x2 = −0.5221, x3 = −0.5005, x4 = −0.5000, x5 = −0.5000.
• x0 = 0, x1 = −3, x2 = −1.8535, x3 = −1.1328, x4 = −0.7211, x5 = −0.5410, x6 = −0.5018,
x7 = −0.5000, x8 = −0.5000.
19
Figure 6: Drawbacks of using NR method
20
• x0 = 0.5, x1 = 1, x2 = 1.
• x0 = 1.3, x1 = 1.5434, x2 = 1.5040, x3 = 1.5000, x4 = 1.5000.
• x0 = 1.25, x1 = −0.5000, x2 = −0.5000.
21
4 Secant method
In order to implement the Newton-Raphson method, f (x) needs to be found analytically and
evaluated numerically. In some cases, the analytical (or its numerical) evaluation may not be
feasible or desirable.
The Secant method is to evaluate the derivative online using two-point differencing.
f(x)
i+1 x i x i−1
x i−1 x i−1( ,f( ))
x i x i( , f( ))
xi+1 x i−1x i
x
x
Figure 7: Secant method to find the roots of an equation
As shown in the figure,
f (x) ≈
f(xi−1) − f(xi)
xi−1 − xi
22
Then the Newton-Raphson iteration can be modified as
xi+1 = xi −
f(xi)
f (xi)
= xi −
f(xi)
f(xi−1)−f(xi)
xi−1−xi
= xi −
f(xi)(xi − xi−1)
f(xi) − f(xi−1)
which is the Secant iteration.
The performance of the Secant iteration is typically inferior to that of the Newton-Raphson
method.
Example: f(x) = ex
− 3x = 0, find x.
Solution:
x0 = −1.1, x1 = −1, x2 = x1 − f(x1)(x1−x0)
f(x1)−f(x0) = 0.2709, a = x2−x1
x2
× 100% = 469.09%
x1 = −1, x2 = 0.2709, x3 = x2 − f(x2)(x2−x1)
f(x2)−f(x1) = 0.4917, a = x3−x2
x3
× 100% = 44.90%
x2 = 0.2709, x3 = 0.4917, x4 = x3 − f(x3)(x3−x2)
f(x3)−f(x2) = 0.5961, a = x4−x3
x4
× 100% = 17.51%
x5 = 0.6170, a = 3.4%
x6 = 0.6190, a = 0.32%
x7 = 0.6191, a = 5.93 × 10−5
23
5 False position method
f( )
x
xr xuxu
lx
xr
xuf( )
lxf( )
x
f(x)
xt lx
xu
f( )
l
Figure 8: False position method to find the roots of an equation
Idea: if f(xl) is closer to zero than f(xn), then the root is more likely to be closer to xl than to
xu. (NOT always true!)
False position steps:
(1). Find xl, xu, xl < xu, f(xl)f(xu) < 0
(2). Estimate xr using similar triangles:
−f(xl)
f(xu)
=
xr − xl
xu − xr
24
Find xr as
xr =
[f(xl) − f(xu)]xu + f(xu)(xu − xl)
f(xl) − f(xu)
or
xr = xu −
f(xu)(xu − xl)
f(xu) − f(xl)
(3). Determine next iteration interval
– If f(xl) · f(xr) < 0, then the root lies in (xl, xr), set xu = xr and return to Step (2).
– If f(xu) · f(xr) < 0, then the root lies in (xr, xu), set xl = xr and return to Step (2).
– If f(xu) · f(xr) = 0, then the root has been found. Set the solution x = xr and terminate
the computation.
(4). If a < threshold, x = xr; else, back to (2).
False position method is one of the incremental search methods.
In general, false position method performs better than bisection method. However, special case
exists (see fig. 5.14 in textbook).
25
Figure 9: Comparison between false position and Secant methods
26
27
6 Handling repeated (multiple) roots
Examples of multiple roots:
• f(x) = x2
− 4x + 3 = (x − 1)(x − 3) has unrepeated roots: x = 1, x = 3
• f(x) = (x − 1)2
(x − 3) has 2 repeated roots at x = 1
• f(x) = (x − 1)3
(x − 3) has 3 repeated roots at x = 1
• f(x) = (x − 1)4
(x − 3) has 4 repeated roots at x = 1
Observations:
• The sign of the function does not change around even multiple roots — bisection and false
position methods do not work
• Both f(x) and f (x) go to zero around multiple roots — Newton-Raphson and secant methods
may converge slowly or even diverge.
6.1 Modified Newton-Raphson method
Fact: Both f(x) and u(x) = f(x)
f (x)
have the same roots, but u(x) has better convergence properties.
Idea: to find the roots of u(x) instead of f(x).
28
0 1 2 3 4
−1
0
1
2
3
x
f(x)=(x−3).*(x−1)
0 1 2 3 4
−4
−2
0
2
4
x
f(x)=(x−3).*(x−1).
2
0 1 2 3 4
−4
−2
0
2
4
x
f(x)=(x−3).*(x−1).
3
0 1 2 3 4
−4
−2
0
2
4
x
f(x)=(x−3).*(x−1).
4
Figure 10: Repeated roots
29
The Newton-Raphson method iteration for u(x):
xi+1 = xi −
u(xi)
u (xi)
u (x) =
f (x)
2
− f(x)f (x)
f (x)
2
xi+1 = xi −
f (xi)
2
f (xi)
2
− f(xi)f (xi)
f(xi)
f (xi)
or
xi+1 = xi −
f(xi)f (xi)
f (xi)
2
− f(xi)f (xi)
Modified Newton-Raphson method has quadratic convergence even for multiple roots.
xt is an unrepeated root of u(x) = 0
f(x) has n repeated roots, n ≥ 2
f(x) = g(x) · (x − xt)n
where g(xt) = 0. Then
f (x) = g (x)(x − xt)n
+ g(x)n(x − xt)n−1
= (x − xt)n−1
g (x)(x − xt) + ng(x)
30
and
u(x) =
f(x)
f (x)
=
g(x) · (x − xt)n
(x − xt)n−1 g (x)(x − xt) + ng(x)
=
g(x) · (x − xt)
g (x)(x − xt) + ng(x)
Therefore, xt is an unrepeated root of u(x) = 0.
31

More Related Content

What's hot

System of linear equations
System of linear equationsSystem of linear equations
System of linear equationsDiler4
 
Newton's forward difference
Newton's forward differenceNewton's forward difference
Newton's forward differenceRaj Parekh
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadraturesTarun Gehlot
 
Laplace Transform and its applications
Laplace Transform and its applicationsLaplace Transform and its applications
Laplace Transform and its applicationsDeepRaval7
 
euler's theorem
euler's theoremeuler's theorem
euler's theoremmihir jain
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolationHarshad Koshti
 
Euler's Method
Euler's MethodEuler's Method
Euler's Methoddmidgette
 
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 equationsRifat Rahamatullah
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equationsaman1894
 
L19 increasing &amp; decreasing functions
L19 increasing &amp; decreasing functionsL19 increasing &amp; decreasing functions
L19 increasing &amp; decreasing functionsJames Tagara
 
Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equationsZunAib Ali
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical AnalysisMohammad Tawfik
 
Classification of optimization Techniques
Classification of optimization TechniquesClassification of optimization Techniques
Classification of optimization Techniquesshelememosisa
 
Newton's Forward/Backward Difference Interpolation
Newton's Forward/Backward  Difference InterpolationNewton's Forward/Backward  Difference Interpolation
Newton's Forward/Backward Difference InterpolationVARUN KUMAR
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_spaceMahbub Alwathoni
 

What's hot (20)

System of linear equations
System of linear equationsSystem of linear equations
System of linear equations
 
Newton's forward difference
Newton's forward differenceNewton's forward difference
Newton's forward difference
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
 
Laplace Transform and its applications
Laplace Transform and its applicationsLaplace Transform and its applications
Laplace Transform and its applications
 
Jacobians new
Jacobians newJacobians new
Jacobians new
 
euler's theorem
euler's theoremeuler's theorem
euler's theorem
 
Newton's forward & backward interpolation
Newton's forward & backward interpolationNewton's forward & backward interpolation
Newton's forward & backward interpolation
 
Euler's Method
Euler's MethodEuler's Method
Euler's 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
 
Numerical method
Numerical methodNumerical method
Numerical method
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
L19 increasing &amp; decreasing functions
L19 increasing &amp; decreasing functionsL19 increasing &amp; decreasing functions
L19 increasing &amp; decreasing functions
 
Directional derivative and gradient
Directional derivative and gradientDirectional derivative and gradient
Directional derivative and gradient
 
Newton Raphson
Newton RaphsonNewton Raphson
Newton Raphson
 
Solution of non-linear equations
Solution of non-linear equationsSolution of non-linear equations
Solution of non-linear equations
 
Introduction to Numerical Analysis
Introduction to Numerical AnalysisIntroduction to Numerical Analysis
Introduction to Numerical Analysis
 
Classification of optimization Techniques
Classification of optimization TechniquesClassification of optimization Techniques
Classification of optimization Techniques
 
Legendre functions
Legendre functionsLegendre functions
Legendre functions
 
Newton's Forward/Backward Difference Interpolation
Newton's Forward/Backward  Difference InterpolationNewton's Forward/Backward  Difference Interpolation
Newton's Forward/Backward Difference Interpolation
 
7.5 lines and_planes_in_space
7.5 lines and_planes_in_space7.5 lines and_planes_in_space
7.5 lines and_planes_in_space
 

Viewers also liked

Secent method
Secent methodSecent method
Secent methodritu1806
 
algebric solutions by newton raphson method and secant method
algebric solutions by newton raphson method and secant methodalgebric solutions by newton raphson method and secant method
algebric solutions by newton raphson method and secant methodNagma Modi
 
Secant method
Secant methodSecant method
Secant methoduis
 
Newton raphson
Newton raphsonNewton raphson
Newton raphsonbaxter89
 
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
 
A review
A reviewA review
A reviewedzam
 
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...IOSR Journals
 
Recognize learning with the ELD method
Recognize learning with the ELD methodRecognize learning with the ELD method
Recognize learning with the ELD methodTerese Raymond
 
Hybrid Approach to Economic Load Dispatch
Hybrid Approach to Economic Load DispatchHybrid Approach to Economic Load Dispatch
Hybrid Approach to Economic Load DispatchSatyendra Singh
 
Genetic Algorithm for Solving the Economic Load Dispatch
Genetic Algorithm for Solving the Economic Load DispatchGenetic Algorithm for Solving the Economic Load Dispatch
Genetic Algorithm for Solving the Economic Load DispatchSatyendra Singh
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysisVishal Singh
 
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMSOPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMSIAEME Publication
 

Viewers also liked (20)

Secant method
Secant methodSecant method
Secant method
 
Secent method
Secent methodSecent method
Secent method
 
algebric solutions by newton raphson method and secant method
algebric solutions by newton raphson method and secant methodalgebric solutions by newton raphson method and secant method
algebric solutions by newton raphson method and secant method
 
Secante
SecanteSecante
Secante
 
Secant method
Secant methodSecant method
Secant method
 
Newton-Raphson Method
Newton-Raphson MethodNewton-Raphson Method
Newton-Raphson Method
 
Newton raphson
Newton raphsonNewton raphson
Newton raphson
 
bisection method
bisection methodbisection method
bisection method
 
Numerical Methods 1
Numerical Methods 1Numerical Methods 1
Numerical Methods 1
 
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
 
A review
A reviewA review
A review
 
Ll1411
Ll1411Ll1411
Ll1411
 
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
Economic Load Dispatch Optimization of Six Interconnected Generating Units Us...
 
Recognize learning with the ELD method
Recognize learning with the ELD methodRecognize learning with the ELD method
Recognize learning with the ELD method
 
Hybrid Approach to Economic Load Dispatch
Hybrid Approach to Economic Load DispatchHybrid Approach to Economic Load Dispatch
Hybrid Approach to Economic Load Dispatch
 
Genetic Algorithm for Solving the Economic Load Dispatch
Genetic Algorithm for Solving the Economic Load DispatchGenetic Algorithm for Solving the Economic Load Dispatch
Genetic Algorithm for Solving the Economic Load Dispatch
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysis
 
Newton raphson
Newton raphsonNewton raphson
Newton raphson
 
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMSOPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
OPTIMAL ECONOMIC LOAD DISPATCH USING FUZZY LOGIC & GENETIC ALGORITHMS
 
Unit4
Unit4Unit4
Unit4
 

Similar to Lecture 04 newton-raphson, secant method etc

Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4CAALAAA
 
Analysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionAnalysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionuttamna97
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlabsheetslibrary
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlabZunAib Ali
 
Numericals Reasoning.pdf
Numericals Reasoning.pdfNumericals Reasoning.pdf
Numericals Reasoning.pdfAvirup Pal
 
Roots of equations
Roots of equationsRoots of equations
Roots of equationsMileacre
 
Equations root
Equations rootEquations root
Equations rootMileacre
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayDr. Asish K Mukhopadhyay
 
Numarical values
Numarical valuesNumarical values
Numarical valuesAmanSaeed11
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
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
 
Newton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsmNewton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsmNemish Bhojani
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson methodSaloni Singhal
 

Similar to Lecture 04 newton-raphson, secant method etc (20)

Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Mit18 330 s12_chapter4
Mit18 330 s12_chapter4Mit18 330 s12_chapter4
Mit18 330 s12_chapter4
 
Ch 2
Ch 2Ch 2
Ch 2
 
Analysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruptionAnalysis for engineers _roots_ overeruption
Analysis for engineers _roots_ overeruption
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
Non linearequationsmatlab
Non linearequationsmatlabNon linearequationsmatlab
Non linearequationsmatlab
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 
Numericals Reasoning.pdf
Numericals Reasoning.pdfNumericals Reasoning.pdf
Numericals Reasoning.pdf
 
Roots of equations
Roots of equationsRoots of equations
Roots of equations
 
Equations root
Equations rootEquations root
Equations root
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K Mukhopadhyay
 
Numarical values
Numarical valuesNumarical values
Numarical values
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
Derivatives
DerivativesDerivatives
Derivatives
 
Bca numer
Bca numerBca numer
Bca numer
 
Lecture6
Lecture6Lecture6
Lecture6
 
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
 
Newton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsmNewton-Raphson Iteration marths 4 ntsm
Newton-Raphson Iteration marths 4 ntsm
 
AJMS_389_22.pdf
AJMS_389_22.pdfAJMS_389_22.pdf
AJMS_389_22.pdf
 
Newton's Raphson method
Newton's Raphson methodNewton's Raphson method
Newton's Raphson method
 

Recently uploaded

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringJuanCarlosMorales19600
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 

Recently uploaded (20)

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Piping Basic stress analysis by engineering
Piping Basic stress analysis by engineeringPiping Basic stress analysis by engineering
Piping Basic stress analysis by engineering
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 

Lecture 04 newton-raphson, secant method etc

  • 1. TMS-301 NUMERICAL METHODS Lecture 4: Newton-Raphson, Secant method, etc
  • 2. 3 Newton-Raphson method 3.1 Iterations The Newton-Raphson method uses the slope (tangent) of the function f(x) at the current iterative solution (xi) to find the solution (xi+1) in the next iteration. The slope at (xi, f(xi)) is given by f (xi) = f(xi) − 0 xi − xi+1 Then xi+1 can be solved as xi+1 = xi − f(xi) f (xi) which is known as the Newton-Raphson formula. Relative error: a = xi+1−xi xi+1 × 100%. Iterations stop if a ≤ threshold. 14
  • 3. Figure 5: Newton-Raphson method to find the roots of an equation 15
  • 4. Example: Find the root of e−x − 3x = 0. Solution: f(x) = e−x − 3x f (x) = −e−x − 3 With these, the Newton-Raphson solu- tion can be updated as xi+1 = xi − e−xi − 3xi −e−xi − 3 −1 → 0.2795 → 0.5680 → 0.6172 → 0.6191 → 0.6191 Converges much faster than the bisection method. −1.5 −1 −0.5 0 0.5 1 −1 0 1 2 3 4 5 xf(x) Newton−Raphson Method (from−1) 3.2 Errors and termination condition The approximate percentage relative error is a = xi+1 − xi xi+1 × 100% 16
  • 5. The Newton-Raphson iteration can be terminated when a is less than a certain threshold (e.g., 1%). 3.3 Error analysis of Newton-Raphson method using Taylor series Let xt be the true solution to f(x) = 0. That is f(xt) = 0 According to the Taylor’s theorem, we have f(xt) = f(xi) + f (xi)(xt − xi) + f (α) 2 (xt − xi)2 where α is an unknown value between xt and xi. Since f(xt) = 0, the above equation becomes f(xi) + f (xi)(xt − xi) + f (α) 2 (xt − xi)2 = 0 (1) In Newton-Raphson method, we use the following iteration: xi+1 = xi − f(xi) f (xi) That is f(xi) + f (xi)(xi+1 − xi) = 0 (2) 17
  • 6. Subtracting (2) from (1), we have f (xi)(xt − xi+1) + f (α) 2 (xt − xi)2 = 0 Denoting ei = xt − xi, which is the error in the i-th iteration, we have f (xi)ei+1 + f (α) 2 (ei)2 = 0 With convergence, xi → xt, and α → xt. Then ei+1 = − f (xt) 2f (xt) e2 i and |ei+1| = f (xt) 2f (xt) e2 i |ei+1| ∝ |ei|2 The error in the current iteration is proportional to the square of the previous error. That is, we have quadratic convergence with the Newton-Raphson method. The number of correct decimal places in a Newton-Raphson solution doubles after each iteration. Drawbacks of the Newton-Raphson method: (see Fig. 6.6 in [Chapra]) • It cannot handle repeated roots 18
  • 7. • The solution may diverge near a point of inflection. • The solution may oscillate near local minima or maxima. • With near-zero slope, the solution may diverge or reach a different root. Example: Find the roots of function f(x) = x3 − 2x2 + 0.25x + 0.75. Solution: To find the exact roots of f(x), we first factorize f(x) as f(x) = x3 − 2x2 + 0.25x + 0.75 = (x − 1)(x2 − x − 0.75) = (x − 1) · (x − 1.5) · (x + 0.5) Thus, x = 1, x = 1.5 and x = −0.5 are the exact roots of f(x). To find the roots using the Newton-Raphson methods, write the iteration formula as xi+1 = xi − f(xi) f (xi) = xi − x3 − 2x2 + 0.25x + 0.75 3x2 − 4x + 0.25 • x0 = −1, x1 = −0.6552, x2 = −0.5221, x3 = −0.5005, x4 = −0.5000, x5 = −0.5000. • x0 = 0, x1 = −3, x2 = −1.8535, x3 = −1.1328, x4 = −0.7211, x5 = −0.5410, x6 = −0.5018, x7 = −0.5000, x8 = −0.5000. 19
  • 8. Figure 6: Drawbacks of using NR method 20
  • 9. • x0 = 0.5, x1 = 1, x2 = 1. • x0 = 1.3, x1 = 1.5434, x2 = 1.5040, x3 = 1.5000, x4 = 1.5000. • x0 = 1.25, x1 = −0.5000, x2 = −0.5000. 21
  • 10. 4 Secant method In order to implement the Newton-Raphson method, f (x) needs to be found analytically and evaluated numerically. In some cases, the analytical (or its numerical) evaluation may not be feasible or desirable. The Secant method is to evaluate the derivative online using two-point differencing. f(x) i+1 x i x i−1 x i−1 x i−1( ,f( )) x i x i( , f( )) xi+1 x i−1x i x x Figure 7: Secant method to find the roots of an equation As shown in the figure, f (x) ≈ f(xi−1) − f(xi) xi−1 − xi 22
  • 11. Then the Newton-Raphson iteration can be modified as xi+1 = xi − f(xi) f (xi) = xi − f(xi) f(xi−1)−f(xi) xi−1−xi = xi − f(xi)(xi − xi−1) f(xi) − f(xi−1) which is the Secant iteration. The performance of the Secant iteration is typically inferior to that of the Newton-Raphson method. Example: f(x) = ex − 3x = 0, find x. Solution: x0 = −1.1, x1 = −1, x2 = x1 − f(x1)(x1−x0) f(x1)−f(x0) = 0.2709, a = x2−x1 x2 × 100% = 469.09% x1 = −1, x2 = 0.2709, x3 = x2 − f(x2)(x2−x1) f(x2)−f(x1) = 0.4917, a = x3−x2 x3 × 100% = 44.90% x2 = 0.2709, x3 = 0.4917, x4 = x3 − f(x3)(x3−x2) f(x3)−f(x2) = 0.5961, a = x4−x3 x4 × 100% = 17.51% x5 = 0.6170, a = 3.4% x6 = 0.6190, a = 0.32% x7 = 0.6191, a = 5.93 × 10−5 23
  • 12. 5 False position method f( ) x xr xuxu lx xr xuf( ) lxf( ) x f(x) xt lx xu f( ) l Figure 8: False position method to find the roots of an equation Idea: if f(xl) is closer to zero than f(xn), then the root is more likely to be closer to xl than to xu. (NOT always true!) False position steps: (1). Find xl, xu, xl < xu, f(xl)f(xu) < 0 (2). Estimate xr using similar triangles: −f(xl) f(xu) = xr − xl xu − xr 24
  • 13. Find xr as xr = [f(xl) − f(xu)]xu + f(xu)(xu − xl) f(xl) − f(xu) or xr = xu − f(xu)(xu − xl) f(xu) − f(xl) (3). Determine next iteration interval – If f(xl) · f(xr) < 0, then the root lies in (xl, xr), set xu = xr and return to Step (2). – If f(xu) · f(xr) < 0, then the root lies in (xr, xu), set xl = xr and return to Step (2). – If f(xu) · f(xr) = 0, then the root has been found. Set the solution x = xr and terminate the computation. (4). If a < threshold, x = xr; else, back to (2). False position method is one of the incremental search methods. In general, false position method performs better than bisection method. However, special case exists (see fig. 5.14 in textbook). 25
  • 14. Figure 9: Comparison between false position and Secant methods 26
  • 15. 27
  • 16. 6 Handling repeated (multiple) roots Examples of multiple roots: • f(x) = x2 − 4x + 3 = (x − 1)(x − 3) has unrepeated roots: x = 1, x = 3 • f(x) = (x − 1)2 (x − 3) has 2 repeated roots at x = 1 • f(x) = (x − 1)3 (x − 3) has 3 repeated roots at x = 1 • f(x) = (x − 1)4 (x − 3) has 4 repeated roots at x = 1 Observations: • The sign of the function does not change around even multiple roots — bisection and false position methods do not work • Both f(x) and f (x) go to zero around multiple roots — Newton-Raphson and secant methods may converge slowly or even diverge. 6.1 Modified Newton-Raphson method Fact: Both f(x) and u(x) = f(x) f (x) have the same roots, but u(x) has better convergence properties. Idea: to find the roots of u(x) instead of f(x). 28
  • 17. 0 1 2 3 4 −1 0 1 2 3 x f(x)=(x−3).*(x−1) 0 1 2 3 4 −4 −2 0 2 4 x f(x)=(x−3).*(x−1). 2 0 1 2 3 4 −4 −2 0 2 4 x f(x)=(x−3).*(x−1). 3 0 1 2 3 4 −4 −2 0 2 4 x f(x)=(x−3).*(x−1). 4 Figure 10: Repeated roots 29
  • 18. The Newton-Raphson method iteration for u(x): xi+1 = xi − u(xi) u (xi) u (x) = f (x) 2 − f(x)f (x) f (x) 2 xi+1 = xi − f (xi) 2 f (xi) 2 − f(xi)f (xi) f(xi) f (xi) or xi+1 = xi − f(xi)f (xi) f (xi) 2 − f(xi)f (xi) Modified Newton-Raphson method has quadratic convergence even for multiple roots. xt is an unrepeated root of u(x) = 0 f(x) has n repeated roots, n ≥ 2 f(x) = g(x) · (x − xt)n where g(xt) = 0. Then f (x) = g (x)(x − xt)n + g(x)n(x − xt)n−1 = (x − xt)n−1 g (x)(x − xt) + ng(x) 30
  • 19. and u(x) = f(x) f (x) = g(x) · (x − xt)n (x − xt)n−1 g (x)(x − xt) + ng(x) = g(x) · (x − xt) g (x)(x − xt) + ng(x) Therefore, xt is an unrepeated root of u(x) = 0. 31