MathGroup Archive 2008

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

Search the Archive

Re: NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89213] Re: NIntegrate
  • From: antononcube <antononcube at gmail.com>
  • Date: Thu, 29 May 2008 07:05:55 -0400 (EDT)
  • References: <g1j6fa$qn4$1@smc.vnet.net>

Please try

Timing[Do[
  NIntegrate[Sin[x], {x, 0., 1.},
   Method -> {Automatic, "SymbolicProcessing" -> 0}], {k, 10000}]]

On my MacBook Pro it takes less than a second using Mathematica
6.0.2 .

You are right that version 5.2 uses a Gauss-Kronrod rule. The points
setting though is Points->5, which means that the rule would have 5
Gauss points and 6 Kronrod points.


Anton Antonov,
Wolfram Research, Inc.



On May 28, 4:51 am, Michael Weyrauch <michael.weyra... at gmx.de> wrote:
> Hello,
>
>    I evaluate in Mathematica 5.2
>
> Timing[Do[NIntegrate[Sin[x], {x, 0., 1.}], {k, 10000}]]
>
> {1.516 Second, Null}
>
> Doing this on the same computer in Mathematica 6.0.2
>
> Timing[Do[NIntegrate[Sin[x], {x, 0., 1.}], {k, 10000}]]
>
> {84.5, Null}
>
> which does not look like progress.
>
> I realize that Mathematica 6.0.2 may use much more sophisticated
> techniques than 5.2, therefore, I directed it what I think Mathematica
> 5.2 may use (??):
>
> Timing[Do[NIntegrate[Sin[x], {x, 0., 1.},
>            Method -> {"GaussKronrodRule", "Points" -> 2,
>                       "SymbolicProcessing" -> 0}], {=
k, 10000}]]
>
> {21.391, Null}
>
> Still not very convincing in comparison to 5.2.
>
> What is going on here? And how can I direct Mathematica 6 to be as fast
> as 5.2 in trivial cases as the example above?
>
> Michael Weyrauch



  • Prev by Date: Re: Lorentzian on a baseline
  • Next by Date: FindRoot with vector domain
  • Previous by thread: Re: NIntegrate
  • Next by thread: Solve can't solve