secant method another recursive method. secant method the secant method is a recursive method used...

5
Secant Method Another Recursive Method

Upload: helena-clarke

Post on 24-Dec-2015

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method

Secant Method

Another Recursive Method

Page 2: Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method

Secant Method

The secant method is a recursive method used to find the solution to an equation like Newton’s Method. The idea for it is to follow the secant line to its x-intercept and use that as an approximation for the root. This is like Newton’s Method (which follows the tangent line) but it requires two initial guesses for the root.

The big advantage of the secant method over Newton’s Method is that it does not require the given function f(x) to be a differential function or for the algorithm to have to compute a derivative. This can be a big deal in other languages since many derivatives can only be estimated.

The recursive function h(x,y) depends on two parameters x and y the x-coordinates of two points on the function.

x y

f(x)

f(y)

h(x,y)

xn-1 xn

f(xn-1)

f(xn)

xn+1=h(xn-1,xn)

Page 3: Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method

To get xn+1 from xn and xn-1 we write out the equation of the secant line and using the points xn and xn-1. We then plug in the point (xn+1,0) and solve for xn+1.

)()(

)(

)()(

)(

)()()(0

)()()(

1

11

11

1

11

1

1

1

nn

nnnnn

nnnn

nnn

nnnn

nnn

nnn

nnn

xfxf

xxxfxx

xxxfxf

xxxf

xxxx

xfxfxf

xxxx

xfxfxfy equation of secant

substitute (xn+1,0)

solve for xn+1

xn+1=h(xn-1,xn)

The equation above gives the recursively defined sequence for xn. This is what is used for the Secant Method. The halting condition is usually given by the Standard Cauchy Error.

Page 4: Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method

Here are some examples of how you apply the secant method.

))2()2((

)(2),(

)()(

))((),(

2)(

22

2

2

xy

xyxxyxh

xfyf

xyxfxyxh

xxf

n xn h(xn-1,xn)

0 0

1 1 2

2 2 1.33333

3 1.33333 1.4

)32()32(

)(32),(

)()(

)(),(

32)(

33

3

3

xxyy

xyxxxyxh

xfyf

xyxfxyxh

xxxf

n xn h(xn-1,xn)

0 0

1 1 -3

2 -3 1.8

3 1.8 1.95868

Page 5: Secant Method Another Recursive Method. Secant Method The secant method is a recursive method used to find the solution to an equation like Newton’s Method

Problems With the Secant Method

The number of iterations required can not be determined before the algorithm begins.

The algorithm will halt (program termination by division by zero if not checked for) if a horizontal secant line is encountered.

The secant method will sometimes find an extraneous root.