+ All Categories
Home > Documents > 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข...

2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข...

Date post: 27-Mar-2019
Category:
Upload: buidang
View: 241 times
Download: 1 times
Share this document with a friend
8
2.1 The Bisection Method 1
Transcript
Page 1: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

2.1 The Bisection Method

1

Page 2: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

Basic Idea

โ€ข Suppose function ๐‘“(๐‘ฅ) is continuous on [๐‘Ž, ๐‘], and ๐‘“(๐‘Ž), ๐‘“(๐‘) have opposite signs.

โ€ข By the Intermediate Value Theorem (IVT), there must exist an ๐‘ in (๐‘Ž, ๐‘) with ๐‘“ ๐‘ = 0.

โ€ข Bisect (sub)intervals and apply IVT repeatedly.

2

Page 3: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

โ€ข The sequence of intervals {(๐‘Ž๐‘– , ๐‘๐‘–)}๐‘–=1โˆž contains

the desired root. 3

Page 4: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

โ€ข Intervals containing the root: ๐‘Ž1, ๐‘1 โŠƒ๐‘Ž2, ๐‘2 โŠƒ ๐‘Ž3, ๐‘3 โŠƒ ๐‘Ž4, ๐‘4 โ€ฆ

โ€ข After ๐‘› steps, the interval ๐‘Ž๐‘›, ๐‘๐‘› has the length:

๐‘๐‘› โˆ’ ๐‘Ž๐‘› = 12

๐‘›โˆ’1(๐‘ โˆ’ ๐‘Ž)

โ€ข Let ๐‘๐‘› =๐‘๐‘›+๐‘Ž๐‘›

2 be the mid-point of ๐‘Ž๐‘›, ๐‘๐‘› . The

limit of sequence {๐‘๐‘›}๐‘›=1โˆž is the root.

4

Page 5: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

The Algorithm

5

INPUT a,b; tolerance TOL; maximum number of iterations N0.

OUTPUT solution p or message of failure.

STEP1 Set i = 1;

FA = f(a);

STEP2 While i โ‰ค N0 do STEPs 3-6.

STEP3 Set p = a + (b-a)/2; // a good way of computing middle point

FP = f(p).

STEP4 IF FP = 0 or (b-a) < TOL then

OUTPUT (p);

STOP.

STEP5 Set i = i +1.

STEP6 If FPโˆ™FA > 0 then

Set a = p;

FA = FP.

else

set b = p;

STEP7 OUTPUT(โ€œMethod failed after N0 iterationsโ€);

STOP.

Page 6: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

Matlab Code

function p=bisection(f,a,b,tol) while 1 p=(a+b)/2; if p-a<tol, break; end if f(a)*f(p)>0 a=p; else b=p; end end %while 1

6

Page 7: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

Stopping Criteria

โ€ข Method 1: ๐‘๐‘› โˆ’ ๐‘๐‘›โˆ’1 < ๐œ€

โ€ข Method 2:

|๐‘๐‘›โˆ’๐‘๐‘›โˆ’1|

|๐‘๐‘›|< ๐œ€, ๐‘๐‘› โ‰  0 or

๐‘“ ๐‘๐‘› < ๐œ€

โ€ข None is perfect. Use a combination in real applications.

7

Page 8: 2.1 The Bisection Method - University of Notre Damezxu2/acms40390F13/Lec-2.1.pdfย ยท Convergence โ€ข Theorem Suppose function ๐‘“(๐‘ฅ) is continuous on [ , ], and ๐‘“ โˆ™๐‘“

Convergence

โ€ข Theorem

Suppose function ๐‘“(๐‘ฅ) is continuous on [๐‘Ž, ๐‘], and ๐‘“ ๐‘Ž โˆ™ ๐‘“ ๐‘ < 0. The Bisection method generates a sequence {๐‘๐‘›}๐‘›=1

โˆž approximating a zero ๐‘ of ๐‘“(๐‘ฅ) with

๐‘๐‘› โˆ’ ๐‘ = 12

๐‘›๐‘ โˆ’ ๐‘Ž , when ๐‘› โ‰ฅ 1

โ€ข Convergence rate

The sequence {๐‘๐‘›}๐‘›=1โˆž converges to ๐‘ with the

rate of convergence ๐‘‚( 12

๐‘›):

๐‘๐‘› = ๐‘ + ๐‘‚( 12

๐‘›)

8


Recommended