Group Abstract Group Abstract

Message Boards Message Boards

2
|
12.9K Views
|
5 Replies
|
16 Total Likes
View groups...
Share
Share this post:

Integration method used in NIntegrate

Posted 11 years ago

Is in there any way in Mathematica how to find out which integration method was actually used in NIntegrate[f[x],{x,xmin,xmax}] if no method is explicitly specified by user?

POSTED BY: Tomas Rihacek
5 Replies

I updated the notebook with explanations for this discussion with a new section where it is given and explained NIntegrate methods tracing code.

Here is an example output of the tracing (see the notebook for details): enter image description here

POSTED BY: Anton Antonov
Attachments:
POSTED BY: Anton Antonov

In many cases I find it helpful to look at the sampling points used by NIntegrate. Below are some examples:

Needs["Integration`NIntegrateUtilities`"]

NIntegrateProfile[NIntegrate[1/Sqrt[x], {x, 0, 1}]]

NIntegrateSamplingPoints[NIntegrate[1/Sqrt[x], {x, 0, 1}]]

NIntegrateSamplingPoints[
 NIntegrate[1/Sqrt[x], {x, 0, 1}, 
  Method -> {"GlobalAdaptive", "SingularityHandler" -> "IMT"}]]

NIntegrateSamplingPoints[
 NIntegrate[1/Sqrt[x], {x, 0, 1}, 
  Method -> {"LocalAdaptive", "SymbolicProcessing" -> 0, 
    "SingularityHandler" -> "IMT"}]]

NIntegrateSamplingPoints[
 NIntegrate[1/Sqrt[x], {x, 0, 1}, 
  Method -> {"GlobalAdaptive", "SingularityDepth" -> 20}]]

NIntegrateSamplingPoints[
 NIntegrate[1/Sqrt[Abs[x]], {x, -2, 1}, 
  Method -> {"GlobalAdaptive", "SingularityD> 2}]]

NIntegrateSamplingPoints[
  NIntegrate[1/Sqrt[Sin[x]], {x, 0, \[Pi]}, 
    Method -> {"GlobalAdaptive", "SingularityDepth" -> 2}]]
POSTED BY: Anton Antonov
Posted 11 years ago

Dear Anton Antonov,

In your profile you say that you "implemented and documented the framework and integrators of NIntegrate". Based on this I expect that you as the developer of course have all the tools to obtain such a basic information as the method which is automatically chosen by NIntegrate. But your answer confuses me: is "looking at the sampling points" the best way YOU have to find out which method is chosen by NIntegrate? Or may be you cannot say more just because it is a commercial secret? If the latter is true, why is it considered as a commercial secret?

POSTED BY: Alexey Popkov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard