help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fzero tolerance issue ... and a related bug


From: James Sherman Jr.
Subject: Re: fzero tolerance issue ... and a related bug
Date: Thu, 18 Oct 2012 14:18:21 -0400

On Thu, Oct 18, 2012 at 1:46 PM, Joza <address@hidden> wrote:
So related to all that above, how does one find the root of a function that
is always positive, or zero, but never negative? For instance, an absolute
value:  f(x) = abs(x - 2)

This has root 2, but I can't give it an initial bracket [x1,x2] since
f(x2)*f(x2) >= 0.
Indeed, how could fzero even find an initial bracket?

So how can one solve such a simple equation with fzero?



--
View this message in context: http://octave.1599824.n4.nabble.com/fzero-tolerance-issue-and-a-related-bug-tp4645391p4645433.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave

Since fzero depends on a change of sign, then I'd probably say for a function that is non-negative, you'd have to do some kind of preprocessing on that function.  You could try feeding the derivative of a function into fzero, thereby finding the local extrema, then checking whether the extrema are zeros.  In general, I believe finding zeros of those types of functions is better served using a gradient descent solution.

Hope this helps,

James Sherman


reply via email to

[Prev in Thread] Current Thread [Next in Thread]