octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #52074] Missing integration functions integral


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #52074] Missing integration functions integral2, integral3
Date: Thu, 21 Sep 2017 16:23:04 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #5, bug #52074 (project octave):

ahhh right. I see that. well, that throws out most of the previous convoluted
tolerance stuff. 

from quadcc's help, it seems you're right (it's not an m-file, so I didn't
peek inside to make sure the help text is right):


The optional argument tol defines the relative tolerance used to stop the
integration procedure. The default value is 1e^{-6}. 



I guess I was misled by the statement in dblquad:


The optional argument tol defines the absolute tolerance used to integrate
each sub-integral. The default value is 1e^{-6}. 



Looking at dblquad code it seems to just pass tol straight to the called
integrator.  So if left unspecified that will be quadcc and it will be a
relative tolerance.  if specified as quadgk, quadl, or quadv, it will be
passed as an absolute tolerance, so quadcc is unique in that regard.  quadgk
also assumes a default reltol, so even when dblquad is called for quadgk with
an abstol, a reltol that can't be modified is being checked as well. Quadgk is
the only one that does a composite convergence check, using rel and abs to
satisfy 


errbnd <= max(AbsTol,RelTol*|Q|).


assuming it follows matlab's convention.

my guess is matlab just wrote an array-valued version of quadgk, called it
'integral', and are basing integral2 and 3 on it. I'm beginning to see why.

OK.. so now what.  the point of the wrappers is to provide a compatible
script. integral2 and 3 are supposed to be able to take both (simultaneously)
abstol and reltol. the only integrator that takes both is quadgk, but
dbl/triplequad  doesn't give us access to both. 

1 - seems we should edit the help text on dblquad to clarify that the
specified tolerance is not necessarily an absolute tolerance,  and other
tolerances may be at work under the hood depending on integrator called.

2 - I can rewrite int2 and 3 so that it will take either an abstol OR a
reltol.  if it's a reltol, we call quadcc. if it's an abstol, we call quadgk
and need to also note that a default reltol is being applied as well. at least
quadgk should autoadjust that for double/single. 

I'd say that's about as good as a wrapper will get until someone puts together
a better 1d integral, or forgets dblquad and just implements a 2d integrator
calling quadgk directly. maybe that would have been faster.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52074>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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