Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Is it possible to make NIntegrate faster?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105163] Is it possible to make NIntegrate faster?
  • From: Leo Alekseyev <dnquark at gmail.com>
  • Date: Mon, 23 Nov 2009 06:50:40 -0500 (EST)

Dear Mathgroup,

Recently I have been using NIntegrate fairly extensively.  I am
dealing with an oscillatory integral that has a singularity.
NIntegrate is able to treat it reasonably well -- the only default I
had to change was increasing MaxRecursion.  However, it is slow.  10
points of my integrand take about 40 seconds to evaluate.  After I
ported my code to another system, this same integral took about a second using
the Gauss-Kronrod method (quadgk in the other system).  Furthermore, by
increasing the absolute and relative tolerance values, I could improve
the speed without losing too much precision, so currently the
integrals evaluate in 0.4 seconds.

I have been playing with various NIntegrate parameters to try to
improve the speed, to no effect.  My integrands are straightforward
(although long) algebraic expressions involving a few Bessel functions
and exponentials, wrapped inside a Module; all subexpressions use N[]
so that nothing should be symbolic...  Ideally I hoped to find some
sort of a speed/accuracy tradeoff, but that hasn't happened.

I read the numerical integration tutorial in the docs, but am finding
it hard to figure out how to improve the efficiency of my integration.
 I would expect Mathematica to get to at least within an order of
magnitude of the other system using the same integration strategy.  The current
performance isn't satisfactory -- but neither is the solution of
porting perfectly good Mathematica code to the other system...

I would much appreciate any suggestions.

Thanks,
--Leo


  • Prev by Date: ML estimators for Box-Cox Extreme Value distribution
  • Next by Date: A little C program calling MathLink
  • Previous by thread: ML estimators for Box-Cox Extreme Value distribution
  • Next by thread: Re: Is it possible to make NIntegrate faster?