Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5641
| From | Martijn Mink <mink.m.p@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | SymbolicProcessing and NIntegrate |
| Date | 2011-10-14 09:57 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j79134$i3q$1@smc.vnet.net> (permalink) |
For my research I often need to evaluate numerical integrals as a
function of an external parameter, for example like
a) int[y_] := NIntegrate[ f[x,y] , {x, domain} ].
The question I have is about the 'option' symbolic processing in
NIntegrate. When i compare
b) Do[NIntegrate[Boole[x > 0], {x, -1, 1}] , {i, 1, 100}] // Timing
and
c) Do[NIntegrate[Boole[x > 0], {x, -1, 1}, Method -> {Automatic,
"SymbolicProcessing" -> 0}], {i, 1, 100}] // Timing,
I find that b) is much slower than c), which indicates that in this case
Mathematica does not reuse the result of SymbolicProcessing from a previous
integral for the next integral. For each integral in the Do loop, Mathematica
goes through the same "SymbolicProcessing".
My question is whether there is a way to let Mathematica perform the
"SymbolicProcessing" on a function, before giving it to NIntegrate. It would
help me a lot if i am able to perform a single "SymbolicProcessing" of the
integrand f(x,y) in a) and then use that result to perform the integral for
different y values without needing to do the SymbolicProcessing for each y-
value separately.
If you have other suggestions for "my problem" i would of course be very
happy to hear those.
Thanks on beforehand,
Kind regards,
Martijn Mink
PhD-student in Physics
The Netherlands
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
SymbolicProcessing and NIntegrate Martijn Mink <mink.m.p@gmail.com> - 2011-10-14 09:57 +0000
csiph-web