Services & Resources / Wolfram Forums
MathGroup Archive
*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 from NDSolve

  • To: mathgroup at
  • Subject: [mg58574] Re: Using InterpolatingFunction from NDSolve
  • From: Peter Pein <petsie at>
  • Date: Fri, 8 Jul 2005 00:46:05 -0400 (EDT)
  • References: <daitir$su4$>
  • Sender: owner-wri-mathgroup at

Tam=E1s schrieb:
> I solved a PDE with NDSolve in Mathematica 5.1. I could plot,
> differentiate and integrate the obtained InterpolatingFunction object,
> the result being a similar object. I was able to integrate the 2nd
> derivative of it. What I need is to integrate the square of the
> obtained InterpolatingFunction object (the square itself does not
> simplify to such an object).
> You can see the details on my homepage:
> Every suggestions are welcome!
> Thank you,
> Tam=E1s
uSol :=g u /. First[NDSolve[
  {D[u[t, x], {t, 1}] =g= D[u[t, x], {x, 2}] + u[t, x]^2 - u[t, x],
      u[0, x =g= Sin[x], u[t, 0] == 0, u[t, 2*Pi] == 0}, u,
     {t, 0, 1}, {x, 0, 2*Pi}]]
intSquare[s_?NumericQ, x_?NumericQ] :=g
  NIntegrate[uSol[t, x]^2, {t, 0, s}, MaxRecursion -> 20]
Plot3D[intSquare[s, x], {s, 0, 1}, {x, 0, 2*Pi}];

works ok on my PC.

Peter Pein

  • Prev by Date: Re: superscripts
  • Next by Date: Re: superscripts
  • Previous by thread: Using InterpolatingFunction from NDSolve
  • Next by thread: Re: Using InterpolatingFunction from NDSolve