MathGroup Archive 2011

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

Search the Archive

Re: FunctionInterpolation and NIntegrate

  • To: mathgroup at
  • Subject: [mg120826] Re: FunctionInterpolation and NIntegrate
  • From: "Kevin J. McCann" <kjm at>
  • Date: Fri, 12 Aug 2011 05:03:44 -0400 (EDT)
  • Delivered-to:
  • References: <j20g47$8vd$>


I believe this happens because, in spite of the fact that NIntegrate is 
numerical, it still tries to do symbolic things before getting down to 
it. I don't exactly understand. Anyway, to get around this, you can set 
up your function f so that it only evaluates if the argument is numeric 
by doing the following:


Try evaluating f[a] with and without the addition, and you will see that 
with it, you just get back f[a].


On 8/11/2011 7:57 AM, gac wrote:
> f[r_] := NIntegrate[r + s , {s, 0, 1}]
> g = FunctionInterpolation[f[r], {r, 0, 1}]
> Can anyone explain why this works, yet I get the msg:
> NIntegrate::inumr: "The integrand r+s has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,1}}."
> Can the statements be reformed to avoid the msg?
> Thanks.
> Glenn

  • Prev by Date: Re: Just another Mathematica "Gotcha"
  • Next by Date: R: Re: am I correctly perceiving a weakness in FinancialDerivative[] ?
  • Previous by thread: Re: FunctionInterpolation and NIntegrate
  • Next by thread: Re: FunctionInterpolation and NIntegrate