Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2661

Re: A problem with NIntegrate

From Bob Hanlon <hanlonr@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: A problem with NIntegrate
Date 2011-05-23 12:41 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irdkl3$13q$1@smc.vnet.net> (permalink)

Show all headers | View raw


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@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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: A problem with NIntegrate Bob Hanlon <hanlonr@cox.net> - 2011-05-23 12:41 +0000

csiph-web