(71B) Newton and Halley's methods with enhanced derivatives estimation
|
09-30-2017, 08:43 PM
(This post was last modified: 10-02-2017 04:57 PM by Namir.)
Post: #1
|
|||
|
|||
(71B) 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 fails to converge. Enjoy! |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(71B) Newton and Halley's methods with enhanced derivatives estimation - Namir - 09-30-2017 08:43 PM
|
User(s) browsing this thread: 1 Guest(s)