Re: Problems integrating InterpolatingFunction
- To: mathgroup at smc.vnet.net
- Subject: [mg116046] Re: Problems integrating InterpolatingFunction
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Sun, 30 Jan 2011 03:32:02 -0500 (EST)
Did you do something like this? s = y /. First@ NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]; Plot[s@x, {x, 0, 30}] NIntegrate[1/s[x]^2, {x, 0, 30}] 10325.5 Bobby On Sat, 29 Jan 2011 18:43:59 -0600, Sergio Miguel Terrazas Porras <sterraza at uacj.mx> wrote: > Hello group, > > I use NDSolve for a nonlinear differential equation, and I get an > InterpolatingFunction, as expected. > > I can plot it, evaluate it, etc. > > The problem I have is that now I need to integrate 1/(the square of the > InterpolatingFunction), and I get nothing but the input back. > > Any ideas? > > Thanks in advance. > > Sergio Terrazas > -- DrMajorBob at yahoo.com