Re: FunctionInterpolation and NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg120831] Re: FunctionInterpolation and NIntegrate
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Fri, 12 Aug 2011 05:04:39 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201108111155.HAA09067@smc.vnet.net>
- Reply-to: drmajorbob at yahoo.com
This eliminates the error message: Clear[f] f[r_?NumericQ] := NIntegrate[r + s, {s, 0, 1}] g = FunctionInterpolation[f[r], {r, 0, 1}] NDSolve gives the same interpolation in one go: Clear[h] h = h /. First@NDSolve[{h'[r] == 1, h[0] == 1/2}, h, {r, 0, 1}]; Table[Plot[fun@r, {r, 0, 1}], {fun, {f, g, h}}] Bobby On Thu, 11 Aug 2011 06:55:57 -0500, gac <g.crlsn at gmail.com> 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 > -- DrMajorBob at yahoo.com
- References:
- FunctionInterpolation and NIntegrate
- From: gac <g.crlsn@gmail.com>
- FunctionInterpolation and NIntegrate