MathGroup Archive 1995

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

Search the Archive

Speeding up a numerical integrator

  • To: mathgroup at
  • Subject: [mg1891] Speeding up a numerical integrator
  • From: Scott.A.Hill at (Lancelot)
  • Date: Sat, 12 Aug 1995 22:51:53 -0400
  • Organization: Williams College, Williamstown MA

	Hello.  I've found it necessary to write a simple numerical
integrator in Mathematica, as NIntegrate is not cooperating with me
for some reason.  Anyway, here is the "Integrator"

does a numerical integration over the variables x, y, and z, to the
limits specified, with div divisions per dimension.";


	I have the "If" statement there in case the function blows up
to infinity at some point.  I figured it was faster than using a Limit
command on everything.

	However, the thing runs rather slowly.  For the command
Integrator[x*y*z,{x,0,1},{y,0,1},{z,0,1},20] it took approximately 28
seconds.  Replacing the 20 by 40 upped the time to 205 seconds.  Note
that even at 40 the answer is 0.1346, which is still rather far off
from the correct answer of .125.  At this rate the thing will take
4000 seconds = over an hour to evaluate
Integrator[x*y*z,{x,0,1},{y,0,1},{z,0,1},100], and my function is much
more complex than x*y*z.
	Thanks in advance.

:@-) Scott

  • Prev by Date: Re: Comparison of MMA on Various Machines
  • Next by Date: math/science teacher wanted
  • Previous by thread: Re: Speeding up a numerical integrator
  • Next by thread: Re: Speeding up a numerical integrator