Lec4 - Solving nonlinear equations Open methods...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Solving nonlinear equations Open methods
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 4 2 Newton-Raphson method Fast workhorse for finding roots Step 1: Start with an initial guess x i Step 2: Extrapolate tangent line to x -axis ( y = 0 ) to get next estimate of root. Step 3: Repeat until converges x i x i +1 f ( x i ) x f ( x ) Convergence condition: | x i +1 x i | < ε a tolerance 1 1 ii a i xx x + + < or
Background image of page 2
Lecture 4 3 Newton-Raphson method x i x i +1 f ( x i ) x f ( x ) x i x i +1 f ( x i ) 1 () i i ii f x fx xx + = 1 i i f x f x + ⇒= Formula for next x i+1 from x i : Slope at x i : Fundamental equation for Newton-Raphson method Note that the method fails if f ’(x i ) ever vanishes!
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 4 4 Using Newton-Raphson () ( 1 ) x fx e xx =− + 2 1 x f xe x NewtRaphL4('func', 'deriv’, x0, eps, imax) ε a # iterations to converge eps FalsePosL3 NewtRaphL4 x0 [-2. 0.] -2. 10 -3 74 10 -4 94 10 -5 11 5 10 -6 13 5 Newton-Raphson converges at least twice as fast! Example with MatLab …
Background image of page 4
MatLab work … script1_L4.m Lecture 4 5 z >> x=-2.5:0.2:2.5; z >> y=functL4(x); z >> plot(x,y,[-2.5 2.5],[0 0]) z >> xlabel('x') z >> ylabel('y') z >> grid z >> FalsePosL3('functL4', -2., 0., 1e-3, 20) z >> NewtRaphL4('functL4', 'derivL4', -2., 1e-3, 20) z >> FalsePosL3('functL4', -2., 0., 1e-4, 20) z >> NewtRaphL4('functL4', 'derivL4', -2., 1e-4, 20) z >> FalsePosL3('functL4', -2., 0., 1e-5, 20) z >> NewtRaphL4('functL4', 'derivL4', -2., 1e-5, 20) z >> FalsePosL3('functL4', -2., 0., 1e-6, 20) z >> NewtRaphL4('functL4', 'derivL4', -2., 1e-6, 20)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 4 6 Understanding the convergence of Newton-Raphson method 2 11 1 1 () ( ) ( ) ( ) ( ) ( ) [ ,] 2 ii i
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course CHE 132b taught by Professor Ceweb during the Fall '09 term at UCSB.

Page1 / 18

Lec4 - Solving nonlinear equations Open methods...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online