MATH 175: Numerical Analysis II

25
MATH 175: Numerical Analysis II Lecturer: Jomar Fajardo Rabajante IMSP, UPLB 2 nd Sem AY 2012-2013

description

MATH 175: Numerical Analysis II. Lecturer: Jomar Fajardo Rabajante IMSP, UPLB 2 nd Sem AY 2012-2013. Question:. What if we do not have means of getting an initial bracket? Let’s start with SECANT METHOD … - PowerPoint PPT Presentation

Transcript of MATH 175: Numerical Analysis II

Page 1: MATH 175: Numerical Analysis II

MATH 175: Numerical Analysis II

Lecturer: Jomar Fajardo RabajanteIMSP, UPLB

2nd Sem AY 2012-2013

Page 2: MATH 175: Numerical Analysis II

Question:

• What if we do not have means of getting an initial bracket?

Let’s start with SECANT METHOD…

Suppose that f is a continuous function . Pick two initial points (not necessarily forming a bracket), then do linear interpolation (not inverse).

Page 3: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Initial points:

Interpolating line:

Use x-intercept:

))(,( & ))(,( 2211 xfxxfx

)()()()( 112

121 xx

xxxfxfxfy

)()()(

12

12113 xfxf

xxxfxx

Page 4: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Approximate:

- Same as the formula for Regula Falsi- In an iteration, if the points form a bracket, then

the method is similar to Regula Falsi; else the method uses extrapolation. In whatever case, the new points will be

)()()(

12

12113 xfxf

xxxfxx

32

21

::xxxx

Old x2

Page 5: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

In short: Pick any two distinct points, draw the secant through them, and use the x-intercept (x3) of that secant line as the new estimate of the zero of the function. For the next iteration, discard the oldest point and add (x3, f(x3)) as the new point.

WE DO NOT NEED IZT (IVT) ANYMORE!

Page 6: MATH 175: Numerical Analysis II
Page 7: MATH 175: Numerical Analysis II
Page 8: MATH 175: Numerical Analysis II
Page 9: MATH 175: Numerical Analysis II
Page 10: MATH 175: Numerical Analysis II
Page 11: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Secant method can be considerably faster than the previous methods.

However, it may fail to converge. Example: if f(x1)=f(x2), then what would happen?

Page 12: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Notice that

can be written as

)()()(

12

12113 xfxf

xxxfxx

)()()(

12

12223 xfxf

xxxfxx

Page 13: MATH 175: Numerical Analysis II

and

can also be written as

You can use any of these formulas for Regula Falsi and Secant Method

4th Method: SECANT METHOD

)()()(

12

12223 xfxf

xxxfxx

)()()()(

12

12213 xfxf

xfxxfxx

Page 14: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

For Secant Method (not for Regula Falsi), we can generalize the formulas as follows (k=1,2,3,…)

)()()()(

21

2112

kk

kkkkk xfxf

xfxxfxx

)()()(

21

2111

kk

kkkkk xfxf

xxxfxx

Page 15: MATH 175: Numerical Analysis II

4th Method: SECANT METHODExample: Find a zero ofUse 0 & 1 as initial values.

)()()()(

21

2112

kk

kkkkk xfxf

xfxxfxx

1)( 3 xxxf

01 0.5

0.5 0.6363636360.636363636 0.6900523560.690052356 0.68202042

0.68202042 0.6823257810.682325781 0.6823278040.682327804 0.6823278040.682327804 0.6823278040.682327804 0.682327804

=(A1*(A2^3+A2-1)-A2*(A1^3+A1-1))/((A2^3+A2-1)-(A1^3+A1-1))

=B2

Page 16: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Assuming that the secant method converges to the root, the order of convergence of the method is

SUPERLINEAR!!! (but not yet quadratic)

62.12

51

p

Page 17: MATH 175: Numerical Analysis II

4th Method: SECANT METHOD

Stopping criterion: You can use

tolxx kk 1,3,3

tol=10^(-m): accurate at least up to m decimal places

Page 18: MATH 175: Numerical Analysis II

5th Method: Newton’s Method/Newton-Raphson Iteration

• What if we make the secant line is a tangent line?

• Hence, we only need one initial point.

• But we add another assumption: f should be differentiable!

Page 19: MATH 175: Numerical Analysis II

5th Method: Newton’s Method/Newton-Raphson Iteration

From Secant Method:

If we use tangent lines: as xk-2 approaches xk-1

)()()(

21

2111

kk

kkkkk xfxf

xxxfxx

)(')()(1

21

21

kkk

kk xfxxxfxf

Page 20: MATH 175: Numerical Analysis II

5th Method: Newton’s Method/Newton-Raphson Iteration

Hence:

)()()(

21

2111

kk

kkkkk xfxf

xxxfxx

)('1)(

111

kkkk xfxfxx

Page 21: MATH 175: Numerical Analysis II
Page 22: MATH 175: Numerical Analysis II
Page 23: MATH 175: Numerical Analysis II
Page 24: MATH 175: Numerical Analysis II
Page 25: MATH 175: Numerical Analysis II

• Newton’s Method: To be continued…

• Assignment: List the advantages and disadvantages of the discussed methods. Research other disadvantages that we did not mention in the class.