Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fzero, change tolerance

0 views
Skip to first unread message

rockybalboa

unread,
Jul 19, 2008, 5:57:45 PM7/19/08
to
Dear all, fzero takes too much time to converge so I am trying to change the tolerance. how should I do it?

I tried:

optimset('TolX', [1e-1])

but it doesn't work since when I do

optimset('fzero')

I keep having 2.2204e-016

any help is greatly appreciated,

Javier

John D'Errico

unread,
Jul 19, 2008, 7:37:02 PM7/19/08
to
rockybalboa <javier....@yahoo.com> wrote in message
<14475066.1216504695...@nitrogen.mathforum.org>...

You must pass the output of optimset
into fzero.

john

rockybalboa

unread,
Jul 20, 2008, 11:36:01 AM7/20/08
to
Thanks John. I got that part.

Let me just ask some basic questions, I am new in the use of the optimization toolbox...

What does TolX do? Is it about stopping criterium for changes in the value of X along the iterations.

I think what I would like is changing fzero so that an "almost zero" is returned. Would that be tolFun.
As far as I can see, fzero doesn't use it in the code?

Because of that, I was planning to use one of the bisection codes available in the web...but the "problem"
is that they don't allow for changing the values of parameters in the same way fzero does...like solve for x such that f(x,c)=0 and fix the value of c.

any suggestions really appreciated

Javier

John D'Errico

unread,
Jul 20, 2008, 4:30:05 PM7/20/08
to
rockybalboa <javier....@yahoo.com> wrote in message
<24352336.1216568191...@nitrogen.mathforum.org>...

> Thanks John. I got that part.
>
> Let me just ask some basic questions, I am new in the use of the
optimization toolbox...
>
> What does TolX do? Is it about stopping criterium for changes in the value
of X along the iterations.

In the context of fzero, TolX should be a
measure of the size of the interval that is
known to contain the root.


> I think what I would like is changing fzero so that an "almost zero" is
returned. Would that be tolFun.

The help for fzero says that tolx is not used,
but tolfun is not indicated.


> As far as I can see, fzero doesn't use it in the code?

No. I just now checked. It is not.


> Because of that, I was planning to use one of the bisection codes available
in the web...but the "problem"
> is that they don't allow for changing the values of parameters in the same
way fzero does...like solve for x such that f(x,c)=0 and fix the value of c.

Nothing stops you from writing your own
bisection scheme that allows you to use
a function value tolerance. Because of the
way these codes are written, a tolerance on
x is more common, and I think more logical.
That would apply to a bisection code too.
But you can do a function tolerance easily
enough.

John

rockybalboa

unread,
Jul 21, 2008, 6:59:59 PM7/21/08
to
Thanks John, you have been incredibly helpful.

Javier

0 new messages