Code covered by the BSD License  

Highlights from
newtzero

4.125

4.1 | 8 ratings Rate this file 17 Downloads (last 30 days) File Size: 3.38 KB File ID: #6924
image thumbnail

newtzero

by Matt Fig

 

15 Feb 2005 (Updated 21 May 2009)

Finds the root(s) of a function of one variable, including complex roots, using Newton's method.

| Watch this File

File Information
Description

NEWTZERO(f,xr,n,tol) finds roots of function f near guess xr with n iterations to tolerance tol. May find more than one root, even if guess is way off. NEWTZERO often works to find complex roots where FZERO fails. See examples in help.
The initial guess, number of iterations, and tolerance are optional arguments.

NEWTZERO finds the roots of functions of only one variable!

Please email me about bugs or other concerns. Thanks.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (11)
29 Apr 2005 clement marchand

Nice work

29 Apr 2005 mike owens

Novel approach works well. Good job!

14 Oct 2005 Mike Zand

Me likey. Well done.

20 Feb 2007 Yang Xiao

The program can't work for the fuction:
     f(x) = det(eye(2)*x-[-0.8333 -0.0278;500.0000 -10.0000]-[-0.8333 -0.0167;0 0]*exp(-0.01*x))
  However, fzero.m of Matlab can find the root of the function. Please check your program, and relpy me.

25 Sep 2007 Jimmy Banker

when i run it, it throw up an error

Error in ==> newt2 at 20
if f(xr) == 0, root = xr; return, end

whats wrong with it?

31 Dec 2007 taoufik brahim

i think it's good mathematical idea but it not work execellent with complex nonliear algébric equation

thanks

03 Jan 2008 matt fig (author)

Taoufik tried to apply this root finder to an implicitly defined function of the form:

T(m) = ((T^4-const)/const + f(m))

This file only works on explicitly defined functions of one variable.

10 Jul 2008 Kalid M

Great work

15 Feb 2009 Andrew O'Connor

Absolutely awsome. fzero was very unstable and gave single answers which were often incorrect when near the boundies. This program gave ALL solutions to the equation with almost no dependance on the guess. Thanks Matt

22 Jun 2011 Fabro

Very helpfull, u deserve 10 stars... at list, I give u 5

19 Jul 2011 Nate

Great Work. Solves equations far from initial guess where fzero fails

Please login to add a comment or rating.
Updates
17 Feb 2005

Bug fix.

11 Jul 2008

I wrote the initial version a long time ago, there was no commenting or arg checking, so I fixed it.

14 Jul 2008

Description needed updating.

31 Jul 2008

TYPO fix

22 Jan 2009

Better filtering

21 May 2009

Faster method.

Tag Activity for this File
Tag Applied By Date/Time
root finder Matt Fig 22 Oct 2008 07:41:16
newtons method Matt Fig 22 Oct 2008 07:41:16
zeros Matt Fig 22 Oct 2008 07:41:16
roots Matt Fig 22 Oct 2008 07:41:16
raphson Matt Fig 22 Oct 2008 07:41:16
fzero Matt Fig 22 Oct 2008 07:41:16
complex Matt Fig 23 Jan 2009 14:41:03

Contact us at files@mathworks.com