eciv 301 programming & graphics numerical methods for engineers lecture 8 roots of equations...
Post on 22-Dec-2015
233 views
TRANSCRIPT
ECIV 301
Programming & Graphics
Numerical Methods for Engineers
Lecture 8
Roots of Equations
Open Methods
Last Time The Problem
)(1)( tvec
gmcf
tm
c
Define Function
0)( cfc must satisfy
c is the ROOT of the equation
Last Time ClassificationMethods
Bracketing Open
• Graphical• Bisection Method• False Position
• Fixed Point Iteration• Newton-Raphson• Secand
Last Time Bisection MethodRepeat until convergence
f(c)
-10
-5
0
5
10
15
20
25
0 50 100 150 200
f(c)
xl xu
xr=0.5(xl+xu)
Last Time False Position Methodf(c)
-10
-5
0
5
10
15
20
25
0 50 100 150 200
f(c)
f(xl)
f(xu)xl
xuxr
ul
uluur xfxf
xxxfxx
Last Time Bisection MethodCheck Convergence
ErrorAcceptablex
xxnewr
oldr
newr
%100
Root = newrx
If Error
Last Time Convergence
Approximate Error vs Iteration Number
-4.0E+00
-3.5E+00
-3.0E+00
-2.5E+00
-2.0E+00
-1.5E+00
-1.0E+00
-5.0E-01
0.0E+00
5.0E-01
1.0E+00
1.5E+00
1 3 5 7 9 11 13 15 17 19 21 23
Iteration #
Ap
pro
xim
ate
Err
or
(%)
False Position
Bisection
Open Methods
Bracketing Methods
Two Initial Estimates Needed that bracket the rootAlways Converge
Open Methods
ONE Initial Estimate NeededSometimes Diverge
Newton Raphson
• No Convergence Criteria• Depends on Nature of Function• Depends on Initial Guess• Use Initial Guess Sufficiently Close to Root
It converges very fast!!(when it does)