MathGroup Archive 2011

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

Search the Archive

Re: FunctionInterpolation and NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120825] Re: FunctionInterpolation and NIntegrate
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Fri, 12 Aug 2011 05:03:33 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201108111155.HAA09067@smc.vnet.net>

It looks like FunctionInterpolation tries to evaluate f[r] symbolically 
first before substituting numeric values for r (similar to for example
NIntegrate) which produces an error message since f[r] only makes sense 
for numeric values of r. To get rid of the message you can redefine
f according to

Clear[f]
f[r_?NumericQ] := NIntegrate[r + s , {s, 0, 1}]

thus avoiding f[r] from being evaluated for non-numeric values of r.

Heike.

On 11 Aug 2011, at 13:55, 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: FunctionInterpolation and NIntegrate
  • Next by Date: Re: Just another Mathematica "Gotcha"
  • Previous by thread: Re: FunctionInterpolation and NIntegrate
  • Next by thread: Re: FunctionInterpolation and NIntegrate