This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: i+1 by Newton's method is: where f ' is the derivative of f. Note that the method fails if f '(x) = 0 , at some approximation. Note f ' is n * x n-1 . This process terminates when the positive difference between two consecutive approximations is sufficiently small. 1 Write a class called NewtonRaphson that can be used to find an approximate solution of √ a using Newton's method, for any positive real number. Note: √ a can be expressed in functional notation as follows: f(x) = x 2 – a, From which f ' (x) = 2 * x, Print the iteration sequence and the approximation for each iteration. (That is, in a tabular form). Write a driver class called TestNewton . Use the following data to test the class NewtonRaphson . • The initial guess is 5.0 • In this exercise, the process terminates when the difference between two consecutive approximations is less than 0.00005 2...
View Full Document
This note was uploaded on 01/06/2012 for the course COP 2250 taught by Professor Staff during the Fall '08 term at FIU.
- Fall '08