Newton and Halley's methods with enhanced derivatives estimation
|
09-30-2017, 08:39 PM
Post: #1
|
|||
|
|||
Newton and Halley's methods with enhanced derivatives estimation
I present versions of Newton's method and Halley's method that use enhanced estimations for the first and second derivatives, using five point central difference schemes. Each listing will prompt you for the initial guess for the root and its tolerance value. Line 20 in each listing defines the function whose root you seek.
Here is the enhanced Newton's method Code: 10 REM NEWTON'S METHOD WITH ENHANCED DERIVATIVE Here is the enhanced Halley's method Code: 10 REM HALLEY'S METHOD WITH ENHANCED DERIVATIVE You are welcome to add iteration counters to also view the number of iterations needed. Moreover, these counters can also help prevent indefinite iterations in case the guess for the function you are using fail to converge. Enjoy! Namir |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)