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


Groups > comp.soft-sys.math.mathematica > #4337 > unrolled thread

Re: FunctionInterpolation and NIntegrate

Started byHeike Gramberg <heike.gramberg@gmail.com>
First post2011-08-12 09:04 +0000
Last post2011-08-12 09:04 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: FunctionInterpolation and NIntegrate Heike Gramberg <heike.gramberg@gmail.com> - 2011-08-12 09:04 +0000

#4337 — Re: FunctionInterpolation and NIntegrate

FromHeike Gramberg <heike.gramberg@gmail.com>
Date2011-08-12 09:04 +0000
SubjectRe: FunctionInterpolation and NIntegrate
Message-ID<j22qa7$gm0$1@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
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web