Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods,...
-
Upload
zoe-robbins -
Category
Documents
-
view
213 -
download
0
Transcript of Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods,...
![Page 1: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/1.jpg)
Today’s class
• Roots of equation• Finish up incremental search • Open methods
Numerical Methods, Lecture 5 1
Prof. Jinbo Bi CSE, UConn
![Page 2: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/2.jpg)
• Although the interval [a,b] where the root becomes iteratively closer with the false position method, unlike the bisection method, the size of the interval does not necessarily converge to zero.
• Sometimes it can cause the false position to converge slower than bisection
False Position Method
Numerical Methods, Lecture 5 2
Prof. Jinbo Bi CSE, UConn
![Page 3: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/3.jpg)
False Position Method
Numerical Methods, Lecture 5 3
Prof. Jinbo Bi CSE, UConn
![Page 4: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/4.jpg)
• Modified False Position Method• Detect when you get stuck and use a
bisection method• Can get you to convergence faster
False Position Method
Numerical Methods, Lecture 5 4
Prof. Jinbo Bi CSE, UConn
![Page 5: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/5.jpg)
• Dependent on knowing the bracket in which the root falls
• Can use bracketed incremental search to speed up exhaustive search• How big a bracket or increment can
determine how long the search will take• Too small increment and it will take too long• Too big increment may miss roots, in
partular, the multiple roots
Incremental Searches
Numerical Methods, Lecture 5 5
Prof. Jinbo Bi CSE, UConn
![Page 6: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/6.jpg)
Incremental Searches
Numerical Methods, Lecture 5 6
Prof. Jinbo Bi CSE, UConn
![Page 7: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/7.jpg)
Open Methods
• Bracket methods depend on knowing the interval in which the root resides
• What if you don’t know the upper and lower bound on the root?
• Open methods• Use a single estimate of the root• Use two starting points but not bracketing the
root• May not converge on root
Numerical Methods, Lecture 5 7
Prof. Jinbo Bi CSE, UConn
![Page 8: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/8.jpg)
Open Methods
Numerical Methods, Lecture 5 8
Prof. Jinbo Bi CSE, UConn
![Page 9: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/9.jpg)
Open Methods
• Fixed-Point Iteration• One-point iteration• Successive substitution
• Start with equation f(x) = 0 and rearrange so x is on left hand side.
• If algebraic manipulation doesn’t work, just add x to both sides
Numerical Methods, Lecture 5 9
Prof. Jinbo Bi CSE, UConn
![Page 10: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/10.jpg)
Fixed-point iteration
• The function transformation allows us to use g(x) to calculate a new guess of x
Numerical Methods, Lecture 5 10
Prof. Jinbo Bi CSE, UConn
![Page 11: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/11.jpg)
• Find root of f(x)=e-x-x• Transform f(x)=0 to x=g(x)=e-x
• Start with an estimate of x0=0
• x1=g(x0)=e-0=1
Example
Numerical Methods, Lecture 5 11
Prof. Jinbo Bi CSE, UConn
![Page 12: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/12.jpg)
Example
• true value of the root: 0.56714329
Numerical Methods, Lecture 5 12
Prof. Jinbo Bi CSE, UConn
![Page 13: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/13.jpg)
Example
Numerical Methods, Lecture 5 13
Prof. Jinbo Bi CSE, UConn
![Page 14: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/14.jpg)
Fixed-point iteration
• Convergence properties• If converge, much faster than bracketing
methods• May not converge• Depends on the curve characteristics
Numerical Methods, Lecture 5 14
Prof. Jinbo Bi CSE, UConn
![Page 15: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/15.jpg)
Fixed-point iteration
Numerical Methods, Lecture 5 15
Prof. Jinbo Bi CSE, UConn
![Page 16: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/16.jpg)
Fixed-point iteration
Numerical Methods, Lecture 5 16
Prof. Jinbo Bi CSE, UConn
![Page 17: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/17.jpg)
Fixed-point iteration
Numerical Methods,Lecture 5 17
Prof. Jinbo Bi CSE, UConn
![Page 18: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/18.jpg)
Fixed-point iteration
Numerical Methods, Lecture 5 18
Prof. Jinbo Bi CSE, UConn
![Page 19: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/19.jpg)
• Assume xr is the true root
• Combine with the iterative relationship
Convergence Analysis
Numerical Methods, Lecture 5 19
Prof. Jinbo Bi CSE, UConn
![Page 20: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/20.jpg)
• Use derivative mean-value theorem
• If the derivative is less than 1, the error will get smaller with each iteration (monotonic or oscillating).
• If the derivative is greater than 1, the error will get larger with each iteration.
Fixed-point iteration
Numerical Methods, Lecture 5 20
Prof. Jinbo Bi CSE, UConn
![Page 21: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/21.jpg)
• Similar idea to False Position Method• Use tangent to guide you to the root
Newton-Raphson Method
Numerical Methods, Lecture 5 21
Prof. Jinbo Bi CSE, UConn
![Page 22: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/22.jpg)
• Find root of f(x)=e-x-x
• Start with an estimate of x0=0
Example
Numerical Methods, Lecture 5 22
Prof. Jinbo Bi CSE, UConn
![Page 23: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/23.jpg)
Example
• true value of the root: 0.56714329
Numerical Methods, Lecture 5 23
Prof. Jinbo Bi CSE, UConn
![Page 24: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/24.jpg)
• Convergence analysis• First-order Taylor series expansion
• At root
Newton-Raphson Method
Numerical Methods, Lecture 5 24
Prof. Jinbo Bi CSE, UConn
![Page 25: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/25.jpg)
• Newton-Raphson method is quadratically convergent
Newton-Raphson Method
2,1, )('2
)("it
r
rit E
xf
xfE
Numerical Methods, Lecture 5 25
Prof. Jinbo Bi CSE, UConn
![Page 26: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/26.jpg)
• Problems and Pitfalls• Slow convergence when initial guess is not
close enough• May not converge at all• Problems with multiple roots
Newton-Raphson Method
Numerical Methods, Lecture 5 26
Prof. Jinbo Bi CSE, UConn
![Page 27: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/27.jpg)
Newton-Raphson Method
Numerical Methods, Lecture 5 27
Prof. Jinbo Bi CSE, UConn
![Page 28: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/28.jpg)
Newton-Raphson Method
Numerical Methods, Lecture 5 28
Prof. Jinbo Bi CSE, UConn
![Page 29: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/29.jpg)
Newton-Raphson Method
Numerical Methods, Lecture 5 29
Prof. Jinbo Bi CSE, UConn
![Page 30: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/30.jpg)
Newton-Raphson Method
Numerical Methods, Lecture 5 30
Prof. Jinbo Bi CSE, UConn
![Page 31: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/31.jpg)
• Algorithm should guard against slow convergence or divergence
• If slow convergence or divergence detected, use another method
Newton-Raphson Method
Numerical Methods, Lecture 5 31
Prof. Jinbo Bi CSE, UConn
![Page 32: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/32.jpg)
• Newton-Raphson method requires calculation of the derivative
• Instead, approximate the derivative using backward finite divided difference
Secant method
Numerical Methods, Lecture 5 32
Prof. Jinbo Bi CSE, UConn
![Page 33: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/33.jpg)
• From Newton-Raphson method
• Replace with backward finite difference approximation
Secant method
Numerical Methods, Lecture 5 33
Prof. Jinbo Bi CSE, UConn
![Page 34: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/34.jpg)
• Find root of f(x)=e-x-x
• Start with an estimate of x-1=0 and x0=1
Example
Numerical Methods, Lecture 5 34
Prof. Jinbo Bi CSE, UConn
![Page 35: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/35.jpg)
Example
• true value of the root: 0.56714329
Numerical Methods, Lecture 5 35
Prof. Jinbo Bi CSE, UConn
![Page 36: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/36.jpg)
• False-Position method always brackets the root
• False-Position will always converge• Secant method may not converge• Secant method usually converges much
faster
Secant Method vs. False-Position Method
Numerical Methods, Lecture 5 36
Prof. Jinbo Bi CSE, UConn
![Page 37: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/37.jpg)
Secant Method vs. False-Position Method
Numerical Methods, Lecture 5 37
Prof. Jinbo Bi CSE, UConn
![Page 38: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/38.jpg)
• Instead of using backward finite difference to estimate the derivative, use a small delta
• Substitute back into Newton-Raphson formula
Modified Secant Method
Numerical Methods, Lecture 5 38
Prof. Jinbo Bi CSE, UConn
![Page 39: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/39.jpg)
• Find root of f(x)=e-x-x
• Start with an estimate of x0=1 and δ=0.01
Example
Numerical Methods, Lecture 5 39
Prof. Jinbo Bi CSE, UConn
![Page 40: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/40.jpg)
Example
• true value of the root: 0.56714329
Numerical Methods, Lecture 5 40
Prof. Jinbo Bi CSE, UConn
![Page 41: Today’s class Roots of equation Finish up incremental search Open methods Numerical Methods, Lecture 5 1 Prof. Jinbo Bi CSE, UConn.](https://reader035.fdocuments.us/reader035/viewer/2022062804/5697bf931a28abf838c8f56a/html5/thumbnails/41.jpg)
• Polynomial roots• Read Chapter 7
Next class
Numerical Methods, Lecture 5 41
Prof. Jinbo Bi CSE, UConn