ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open...

23
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open Methods
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    233
  • download

    0

Transcript of ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open...

ECIV 301

Programming & Graphics

Numerical Methods for Engineers

Lecture 8

Roots of Equations

Open Methods

Last Time The Problem

)(1)( tvec

gmcf

tm

c

Define Function

0)( cfc must satisfy

c is the ROOT of the equation

Last Time ClassificationMethods

Bracketing Open

• Graphical• Bisection Method• False Position

• Fixed Point Iteration• Newton-Raphson• Secand

Last Time Bisection MethodRepeat until convergence

f(c)

-10

-5

0

5

10

15

20

25

0 50 100 150 200

f(c)

xl xu

xr=0.5(xl+xu)

Last Time False Position Methodf(c)

-10

-5

0

5

10

15

20

25

0 50 100 150 200

f(c)

f(xl)

f(xu)xl

xuxr

ul

uluur xfxf

xxxfxx

Last Time Bisection MethodCheck Convergence

ErrorAcceptablex

xxnewr

oldr

newr

%100

Root = newrx

If Error

Last Time Convergence

Approximate Error vs Iteration Number

-4.0E+00

-3.5E+00

-3.0E+00

-2.5E+00

-2.0E+00

-1.5E+00

-1.0E+00

-5.0E-01

0.0E+00

5.0E-01

1.0E+00

1.5E+00

1 3 5 7 9 11 13 15 17 19 21 23

Iteration #

Ap

pro

xim

ate

Err

or

(%)

False Position

Bisection

Objectives

• OPEN Methods– Fixed Point Iteration– Newton Raphson– Secant

Open Methods

Bracketing Methods

Two Initial Estimates Needed that bracket the rootAlways Converge

Open Methods

ONE Initial Estimate NeededSometimes Diverge

Fixed Point Iteration

xexf x

X

xexf x root

x is a root if f(x) = 0

xe x 0

Fixed Point Iteration

X

X

f1(X)

f2(X)

xe x 0

+x

+x

xex

f1(X) f2(X)

root

root

Fixed Point Iteration

X

f1(X)

f2(X)

xex

f1(X) f2(X)

root

x is a root if

f1(x) = f2(x)

Fixed Point Iteration

X

f1(X) f2(X)

Initial Guess

ii xfx 1

New Guess

root

New Guess

Fixed Point Iteration

X

f1(X)

f2(X)

Initial Guess

ii xfx 1

New Guess

root

New Guess

Method Diverges

Condition for Convergence

X

f1(X) f2(X)

New Guess

1

dx

xdf i

Newton Raphson

X

g(x)

Initial Guess

NewGuess

NewGuess

g’(xi)

g’(xi)

Newton Raphson

ii

ii xf

xfxx

1

Newton Raphson

Inflection Point in Vicinity of Root

Newton Raphson

Persistent Oscillations near local max or min

Newton Raphson

Initial guess close to root jumps several roots away

Newton Raphson

Zero Derivative

Newton Raphson

• No Convergence Criteria• Depends on Nature of Function• Depends on Initial Guess• Use Initial Guess Sufficiently Close to Root

It converges very fast!!(when it does)

Homework

• 5.7

• 5.19

• 6.4

• 6.8 (a),(b),(c)

Due Date: September 22