Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Using InterpolatingFunction in Argument of NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57802] Re: Using InterpolatingFunction in Argument of NIntegrate
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Thu, 9 Jun 2005 05:17:35 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <d8691p$c70$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

f[t_?NumericQ] =
    x[t] /. NDSolve[

             {x''[t] + x[t] == 0, x[0] == 0, x'[0] 
== 1},

              x[t], {t, 0, 2Pi}][[1]]



Plot[f[t], {t, 0, 2Pi}]

NIntegrate[f[t], {t, 0, Pi}]

??

Regards

  Jens

"Iggy" <blah at blah.com> schrieb im Newsbeitrag 
news:d8691p$c70$1 at smc.vnet.net...
> Hi,
>
> I am solving numberically an ODE and outputing 
> the results into a function
> f(x). This f(x) is some InterpolatingFunction.
>
> I would like to then use f(x) in a call to 
> NIntegrate in a way such as:
>
> NIntegrate[g(f(x),{x,0,1}]
>
> However I get an integrand not numerical error. 
> I can easily Plot g(f(x))
> and if I replace f(x) with some function like 
> x^2 everything works too.
>
> How can I get around this?
>
> Thanks,
>
> Iggy
> 



  • Prev by Date: Re: Simplify expression
  • Next by Date: Re: Remove definitions from I
  • Previous by thread: Re: Using InterpolatingFunction in Argument of NIntegrate
  • Next by thread: Numbering equations