MathGroup Archive 2011

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

Search the Archive

Re: FunctionInterpolation and NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120836] Re: FunctionInterpolation and NIntegrate
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Fri, 12 Aug 2011 05:05:35 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201108111155.HAA09067@smc.vnet.net>

Hi,

since you don't know what exactly FunctionInterpolation makes with your
f[r] you should ensure that it is only evaluated to the rhs if the
parameter r is numeric.

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

and everything should be fine.

Cheers
Patrick


On Thu, 2011-08-11 at 07:55 -0400, 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: work?
  • Next by Date: Re: FunctionInterpolation and NIntegrate
  • Previous by thread: FunctionInterpolation and NIntegrate
  • Next by thread: Re: FunctionInterpolation and NIntegrate