help-octave
[Top][All Lists]
Advanced

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

Re: Fzero for functions that are never negative?


From: Przemek Klosowski
Subject: Re: Fzero for functions that are never negative?
Date: Fri, 19 Oct 2012 11:01:30 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 10/18/2012 05:16 PM, Joza wrote:
As regards the fsolve function, is it possible to specify the x-convergence
test for EACH ITERATION? I know can input the absolute convergence error for
"TolX", but I would rather test each iteration, which will depend on the
value obtained in the previous iteration. Is that possible?

You can very simply modify almost all(*) Octave built-in functions, because they are often implemented in Octave/Matlab language. If you 'type fzero', you'll see the implementation of the function 'fzero'; you can edit it to do what you want and redefine fzero() or create my_fzero().


I'm also curious, does it happen often that simple self-made algorithms can
provide better answers than Octave's built-in functions?

For a specific case, yes, of course---the Octave built-ins are by design handling a general case, so if you can figure out a shortcut that works better for your specific case, it'll beat the built-in.

I don't know whether it 'happens often', but new algorithms do appear even though a lot of smart people worked for a long time to implement Octave's built-ins. If you can think of a self-made algorithm that's better than the current one, please contribute it---that's the beauty of Free Software.


(*) some Octave functions are implemented in C/C++/Fortran; it's possible to modify them as well but it's a little more involved.


reply via email to

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