help-octave
[Top][All Lists]
Advanced

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

Re: fsolve shows repeated results


From: Fausto Arinos de A. Barbuto
Subject: Re: fsolve shows repeated results
Date: Fri, 16 Oct 2015 20:06:01 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 16-10-2015 18:07, John Guin wrote:
You could write your loop like this:

function raizes3

     format long;
     options =  optimset('TolX',1.0e-15,'TolFun',1.0e-15);

[x,fval] = fsolve(@f, 0.10000,options)
fprintf('\n');
[x,fval] = fsolve(@f, 0.60000,options)
fprintf('\n');
[x,fval] = fsolve(@f, 1.10000,options)
fprintf('\n');
[x,fval] = fsolve(@f, 1.60000,options)
fprintf('\n');
[x,fval] = fsolve(@f, 2.10000,options)
fprintf('\n');

[...]

It’s just odd looking in that the roots have the same values for different 
inputs.

That's because (I reckon) I passed a very small tolerance to fsolve(). Had I 
used a
tolerance of, say, 1.0e-06 and things would be quite different (and I tried 
that).

Does this make a little more sense now?

Yes it does, John. Thanks a lot.

Fausto






reply via email to

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