Lecture 3 Root Finding using Open Methods Dr

  • Slides: 13
Download presentation
Lecture 3 Root Finding using Open Methods Dr. Qi Ying

Lecture 3 Root Finding using Open Methods Dr. Qi Ying

Objectives • Open methods – Fixed point iteration – Newton-Raphson – Modified secant method

Objectives • Open methods – Fixed point iteration – Newton-Raphson – Modified secant method

Open Methods vs. Bracketing Methods • Bracketing methods – Root is located within the

Open Methods vs. Bracketing Methods • Bracketing methods – Root is located within the lower and upper bound. – Pro: Always converge to the solution – Con: Relatively slow • Open methods – Usually starting from a single starting point (initial estimate) – Iteratively finding a new estimate – Pro: Faster convergence (when they work) – Con: Sometimes diverge from the true root

Single fixed point iteration • Idea: f(x)=0 can be rewritten in a different form:

Single fixed point iteration • Idea: f(x)=0 can be rewritten in a different form: x=g(x). If xr is the root, i. e. , f(xr)=0, then xr=g(xr) • Iteration process: – The single fixed point iterations starts from an initial guess of the root x 0 is usually not the root, i. e. , x 0≠g(x 0). However, – g(x 0) can be used as the new estimate of the root: x 1=g(x 0) – If x 1 is quite different from x 0, then g(x 1) is evaluated to get the new next estimate of the root, and the process is repeated: xi+1=g(xi). – The iteration stops when xi+1 is sufficiently close to xi.

Example Find a root for using fixed point iteration, x 0=0 Solution: rearrange the

Example Find a root for using fixed point iteration, x 0=0 Solution: rearrange the above function to x=g(x) form. Thus, g(x)=e-x x 1=exp(-0)=1 x 2=exp(-1)=0. 36787944117144233 x 3=exp(-0. 36787944117144233)=0. 6922006275553464 x 4=exp(-0. 6922006275553464)=0. 5004735005636368 x 5=exp(-0. 5004735005636368)=0. 6062435350855974 x 6=exp(-0. 6062435350855974)=0. 545395785975027 x 7=exp(-0. 545395785975027)=0. 5796123355033789 …

Graphical explanation of the fixed point iteration method From Chapra, Figure 6. 3

Graphical explanation of the fixed point iteration method From Chapra, Figure 6. 3

Newton-Raphson method • First conceived by Newton (1671) and Joseph Raphson (1690). Generalized by

Newton-Raphson method • First conceived by Newton (1671) and Joseph Raphson (1690). Generalized by Thomas Simpson (1740) to modern forms. • Very widely used • Fast convergence (quadratic convergence) • Need to evaluate first derivative of f(x) • Also used in optimization

Newton-Raphson method Since: Rearrange:

Newton-Raphson method Since: Rearrange:

Example Find a root for Solution: find f’(x) first: using N-R method, x 0=0

Example Find a root for Solution: find f’(x) first: using N-R method, x 0=0

Problems with N-R method

Problems with N-R method

The Modified Secant Method • Evaluating f’(x) is not always possible, thus, we need

The Modified Secant Method • Evaluating f’(x) is not always possible, thus, we need to a method to approximate f’(x). One way to do this is: Thus, you get the iteration equation for the modified secant method

The Modified Secant Method • Advantage: – No need for a separate derivative input

The Modified Secant Method • Advantage: – No need for a separate derivative input – Especially useful when f’(x) cannot be easily determined • Difficulty: – Choose of δx is not automatic. • Too small – roundoff error may dominate and lead to wrong results. • Too big – may become divergent

Exercise • Program the modified secant method based on the N-R code.

Exercise • Program the modified secant method based on the N-R code.