MathGroup Archive 2011

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

Search the Archive

Re: A problem with NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119176] Re: A problem with NIntegrate
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Mon, 23 May 2011 08:40:56 -0400 (EDT)

The magnitude of the imaginary part is less than 10^-25 on my machine, i.e., less than machine precision. These are arifacts of numerical noise. Look up Chop.

Table[
  NIntegrate[((1 - (u/40)^2.5)*
      ((1/((1 + 0.06*(u - t)))))/
       Exp[0.01*u*(1.5 - 1)])^(1/1.5),
   {u, t, 40}],
  {t, 0, 40}] // Chop

{19.7871, 19.2601, 18.7278, 18.1903, 17.6475, 17.0997, 16.5472, 15.99, \
15.4286, 14.8633, 14.2945, 13.7225, 13.1479, 12.5712, 11.993, 11.4137, \
10.8341, 10.2548, 9.6765, 9.1001, 8.52637, 7.95624, 7.39067, 6.83071, \
6.27749, 5.73225, 5.19632, 4.67117, 4.15839, 3.65976, 3.17726, 2.71308, \
2.26972, 1.85006, 1.45742, 1.09575, 0.769879, 0.485919, 0.252122, 0.0810213,
  0}

Or rationalize the powers

Table[
 NIntegrate[((1 - (u/40)^(5/2))*
     ((1/((1 + 0.06*(u - t)))))/
      Exp[0.01*u*(1.5 - 1)])^(2/3),
  {u, t, 40}],
 {t, 0, 40}]

{19.7871, 19.2601, 18.7278, 18.1903, 17.6475, 17.0997, 16.5472, 15.99, \
15.4286, 14.8633, 14.2945, 13.7225, 13.1479, 12.5712, 11.993, 11.4137, \
10.8341, 10.2548, 9.6765, 9.1001, 8.52637, 7.95624, 7.39067, 6.83071, \
6.27749, 5.73225, 5.19632, 4.67117, 4.15839, 3.65976, 3.17726, 2.71308, \
2.26972, 1.85006, 1.45742, 1.09575, 0.769879, 0.485919, 0.252122, 0.0810213, \
0.}

% == %%

True


Bob Hanlon

---- Anna Kaladze <anna.kaladze at gmail.com> wrote: 

=============
Hi all,

I need to numerically integrate a function by utilizing =93Table=94 commandin
the process (please see the code below), but for the parameter values I am
interested in, I get complex results. I do not know why this is happening.
Also, how do I get "normal" real values instead, and also ensuring that the
answer is reasonably correct which one would expect from NIntegrate command.
Thanks a lot.

Table[NIntegrate[((1-(u/40)^2.5)*((1/((1+0.06*(u-t)))))/Exp[0.01*u*(1.5-1)])^(1/1.5),{u,t,40}],{t,0,40,1}]

--

Bob Hanlon



  • Prev by Date: Re: Very (very very) slow typing for Mathematica in large cells.
  • Next by Date: Re: Points conditionnal Coloring
  • Previous by thread: A problem with NIntegrate
  • Next by thread: Re: A problem with NIntegrate