Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4346 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2011-08-12 09:10 +0000 |
| Last post | 2011-08-12 09:10 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: FunctionInterpolation and NIntegrate Bill Rowe <readnews@sbcglobal.net> - 2011-08-12 09:10 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2011-08-12 09:10 +0000 |
| Subject | Re: FunctionInterpolation and NIntegrate |
| Message-ID | <j22qmo$gru$1@smc.vnet.net> |
On 8/11/11 at 7:55 AM, g.crlsn@gmail.com (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}}."
My *guess* is Mathematica first attempts to evaluate NIntegrate
before r is assigned a numeric value, generates the error
message then assigns a numeric value to r and correctly
evaluates the expression.
>Can the statements be reformed to avoid the msg?
This is simpler to answer. Just define f to work on numeric
values, i.e.
f[r_?NumericQ] := NIntegrate[r + s , {s, 0, 1}]
g = FunctionInterpolation[f[r], {r, 0, 1}]
will do what you want without the error message being generated
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web