newton s method
play

Newtons method Newtons method 1 / 8 Newtons method Objective: - PowerPoint PPT Presentation

Newtons method Newtons method 1 / 8 Newtons method Objective: solving a non-linear problem f ( x ) = 0 Newtons method 2 / 8 Newtons method Objective: solving a non-linear problem f ( x ) = 0 Starting with an initial guess x 1 ,


  1. Newton’s method Newton’s method 1 / 8

  2. Newton’s method Objective: solving a non-linear problem f ( x ) = 0 Newton’s method 2 / 8

  3. Newton’s method Objective: solving a non-linear problem f ( x ) = 0 Starting with an initial guess x 1 , approximate f ( x ) by the tangent line, L and use that to obtain a new approximate, x 2 , Newton’s method 2 / 8

  4. A formula for the approximations The slope of the line L is f ′ ( x 1 ), so the point slope formula is y − f ( x 1 ) = f ′ ( x 1 )( x − x 1 ) Newton’s method 3 / 8

  5. A formula for the approximations The slope of the line L is f ′ ( x 1 ), so the point slope formula is y − f ( x 1 ) = f ′ ( x 1 )( x − x 1 ) x 2 is the x -intercept of L so ( x 2 , 0) is on L , therefore 0 − f ( x 1 ) = f ′ ( x 1 )( x 2 − x 1 ) Newton’s method 3 / 8

  6. A formula for the approximations The slope of the line L is f ′ ( x 1 ), so the point slope formula is y − f ( x 1 ) = f ′ ( x 1 )( x − x 1 ) x 2 is the x -intercept of L so ( x 2 , 0) is on L , therefore 0 − f ( x 1 ) = f ′ ( x 1 )( x 2 − x 1 ) Then assuming that f ′ ( x 1 ) � = 0, we can solve for x 2 , x 2 = x 1 − f ( x 1 ) f ′ ( x 1 ) Newton’s method 3 / 8

  7. A formula for the approximations The slope of the line L is f ′ ( x 1 ), so the point slope formula is y − f ( x 1 ) = f ′ ( x 1 )( x − x 1 ) x 2 is the x -intercept of L so ( x 2 , 0) is on L , therefore 0 − f ( x 1 ) = f ′ ( x 1 )( x 2 − x 1 ) Then assuming that f ′ ( x 1 ) � = 0, we can solve for x 2 , x 2 = x 1 − f ( x 1 ) f ′ ( x 1 ) x 2 is our second approximation and is closer to the root, r . Newton’s method 3 / 8

  8. Repeat! x 3 = x 2 − f ( x 2 ) f ′ ( x 2 ) Newton’s method 4 / 8

  9. Repeat! x 3 = x 2 − f ( x 2 ) x 4 = x 3 − f ( x 3 ) f ′ ( x 2 ) f ′ ( x 3 ) Newton’s method 4 / 8

  10. Convergence We obtain a sequence of approximations x 1 , x 2 , x 3 , . . . , where x n +1 = x n − f ( x n ) f ′ ( x n ) provided f ′ ( x n ) � = 0 Newton’s method 5 / 8

  11. Convergence We obtain a sequence of approximations x 1 , x 2 , x 3 , . . . , where x n +1 = x n − f ( x n ) f ′ ( x n ) provided f ′ ( x n ) � = 0 If the f ∈ C 2 ( i.e has continuous f ′ and f ′′ ) and if x 1 is chosen sufficiently close to r then n →∞ x n = r lim Newton’s method 5 / 8

  12. Convergence We obtain a sequence of approximations x 1 , x 2 , x 3 , . . . , where x n +1 = x n − f ( x n ) f ′ ( x n ) provided f ′ ( x n ) � = 0 If the f ∈ C 2 ( i.e has continuous f ′ and f ′′ ) and if x 1 is chosen sufficiently close to r then n →∞ x n = r lim We can quantify how fast the convergence occurs (see MA 427). Newton’s method 5 / 8

  13. Newton’s method may fail The initial guess needs to be sufficiently close to r Newton’s method 6 / 8

  14. Implementing Newton’s method: Stopping criterion We Loop until we are satisfied by the approximation x n +1 to r . In most practical cases the true solution is not known so | x n +1 − r | cannot be computed, so we approximate the error: | x n +1 − x n | ≈ | x n +1 − r | Given an error tolerance, ǫ , stop the loop when | x n +1 − x n | ≤ ǫ Newton’s method 7 / 8

  15. Implementing Newton’s method: Stopping criterion We Loop until we are satisfied by the approximation x n +1 to r . In most practical cases the true solution is not known so | x n +1 − r | cannot be computed, so we approximate the error: | x n +1 − x n | ≈ | x n +1 − r | Given an error tolerance, ǫ , stop the loop when | x n +1 − x n | ≤ ǫ Other stopping criteria: | f ( x n +1 ) | ≤ ǫ or � x n +1 − x n � � � � ≤ ǫ � � x n � Newton’s method 7 / 8

  16. Implementing Newton’s method >>[r, its] = newton_solver(f,x1,espilon) Input: initial guess and f Output: root r and number of iterations,its while (( | x n +1 − x n | > ǫ ) and (its < MAX ITS)) do x n +1 = x n − f ( x n ) f ′ ( x n ) its = its +1 end Algorithm 1: Newton’s method Use the MATLAB Symbolic Package to find and evaluate the derivative of f . Newton’s method 8 / 8

Recommend


More recommend