MathGroup Archive 2010

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

Search the Archive

InterpolatingFunction and NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108431] InterpolatingFunction and NIntegrate
  • From: Benjamin Hell <hell at exoneon.de>
  • Date: Wed, 17 Mar 2010 04:41:21 -0500 (EST)

Hi,
sorry for posting a similar question to my last one on such after such 
little time. This is due to the problem being a little bit different 
now. Last time I tried using Integrate, this time I am going with 
NIntegrate. The problem now is that using NIntegrate with the 
InterpolatingFunction works, but when for example adding a vector I get 
an NIntegrate::inum error, which does not make sense to me.

Here is an example of what I mean:
/timevector = Table[i*0.1, {i, 0, 10}];
discretesolution = Table[{RandomReal[], RandomReal[]}, {i, 0, 10}];
spline = Interpolation[Thread[{timevector, discretesolution}], 
InterpolationOrder -> 1]/

This does work:
/NIntegrate[Norm[spline[t]], {t, 0, 1}]/

But here I get the NIntegrate::inum error, which says that at a certain 
point t the value of Norm[spline[t] + {2, 2}] is not numerical:
NIntegrate[Norm[spline[t] + {2, 2}], {t, 0, 1}]

The error does not make sense to me. First I figured I should use 
Evaluate, because NIntegrate has the HoldAll attribute, but as 
Norm[spline[t] + {2, 2}] does not seem to be affected by HoldAll this 
does not make any difference.
So why is this not working?

Thanks again,
Benjamin



  • Prev by Date: Re: Pi day
  • Next by Date: Re: Integration of InterpolatingFunction
  • Previous by thread: Re: Relation Problem in Mathematica
  • Next by thread: Re: InterpolatingFunction and NIntegrate