Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.2K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

NIntegrate Issue: Changing integration limits increases calculation time

Posted 11 years ago
Attachments:
POSTED BY: dee khan

When a Method isn't specified for NIntegrate, it's hard to guess what it might be doing.

Yes, for simple numerical methods decreasing the range of integration is always going to make it run faster. If you used Method -> "TrapezoidalRule", then I would expect the behavior your mention. That's not the case for more complicated methods. NIntegrate also is likely doing some symbolic preprocessing.

The first thing I'd try is to set the NIntegrate option “SymbolicProcessing” to 0. This prevents Mathematica from manipulating the integral symbolically. By default, NIntegrate symbolically preprocesses integrands. This allows NIntegrate to evaluate more difficult integrals. However, the symbolic processing slows some calculations. To numerically integrate a function called f from 0 to 1 without symbolic processing, evaluate:

 NIntegrate[f[x], {x, 0, 1}, Method -> {Automatic, "SymbolicProcessing" -> 0}]

You can replace Automatic with any other method specification that you would like to use.

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