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

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

[Octave-bug-tracker] [bug #62412] quadcc does not warn when quadrature f


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #62412] quadcc does not warn when quadrature fails to converge
Date: Thu, 5 May 2022 04:52:00 -0400 (EDT)

Follow-up Comment #10, bug #62412 (project octave):

Some points:

Yes, it is a good idea to make quadcc behave like the others and check for
convergence. It would be nice if in addition, when called from integral, the
different called quadrature functions could be muted, and the estimated
returned error compared within integral to return a warning that is formatted
agnostically to which integrator is used, but this is not necessary.

Handling complex integrands would obviously be no problem, within integral you
could pass in the real and imaginary parts of the integrand separately (which
would be a good idea anyway, as this could lead to better efficiency of the
adaptive refinement, when the hard parts of real and imaginary components are
different). 

In principle, a main point to consider would be the fact that Gaussian
quadrature (done by quadgk) and Clenshaw-Curtis quadrature (quadcc) have
different behaviour. However, surprisingly in typical cases they do seem to
have about equal efficiency: https://doi.org/10.1137/060659831. Thus, I think
that also the present overview in the documentation is not really correct:
perhaps this is about the default accuracy, but in principle, as long as the
integrand is not too obstinate, it should be possible to get close to eps with
all these algorithms. The only significant distinction, I would say, is
between quadv and the rest: the former uses the Simpson rule, which for smooth
enough integrands has much lower order (needs much more function evaluations
for high accuracy) than all the other ones. 

The opinions in the paragraph above are with respect to the characteristics of
the quadrature rules themselves. To come back to the observation in comment
#1: there a half-infinite interval is integrated over. And this is something
all these quadrature rules cannot do natively. What they do instead is to
transform it (essentially by substitution of the integration variable) to an
integral over a finite domain. Of course, there are different possibilities to
do that. Probably there is not much logic within the integrators to decide
that, they will use just one hard-coded transformation, and possibly the one
within quad just by chance gives a very well-behaved transformed integral,
while the transformation used by the others doesn't. We are probably not in a
position to improve on that, but it would be perhaps nice to state the used
transformations in the documentation, so that the user can decide which
integrator to use. 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62412>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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