help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Bug (or not?) in multiroots/fdjacobian.c


From: Brian Gough
Subject: Re: [Help-gsl] Bug (or not?) in multiroots/fdjacobian.c
Date: Mon, 12 Jun 2006 15:22:39 +0100

eknecronzontas writes:
 > The stepsize for finite-differencing in
 > gsl-1.8/multiroots/fdjacobian.c is specified by the
 > lines
 > 
 > > double xj = gsl_vector_get (x, j);
 > > double dx = epsrel * fabs (xj);
 > 
 > This is, of course mathematically correct.
 > Nevertheless, the behavior is less than ideal if one
 > of the elements of the vector 'x' is sufficiently
 > small. This occurs often if one component of the root
 > happens to be zero. If this occurs, then 'dx' can be
 > so small that one of the columns of the Jacobian is
 > identically zero. This immediately leads to NAN's
 > which are not easy to trace.

Hello, 

Thanks for your email.  I agree the behavior is not good for
small/zero x.  Probably the best thing would be to signal an error if
the step size goes to zero or the derivative overflows.  I'll add a
note to the documentation to make it clearer anyway.  

You can change the behavior with a new drop-in routine copying from
multiroots/hybrid.c into your own application, no need to modify the source.

-- 
Brian Gough

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/




reply via email to

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