MathGroup Archive 2005

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

Search the Archive

Re: Using InterpolatingFunction from NDSolve

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

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:
> http://www.math.bme.hu/~tladics/nds.nb
>
> Every suggestions are welcome!
>
> Thank you,
> Tam=E1s
>
In[1]:=g
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}]]
In[2]:=g
intSquare[s_?NumericQ, x_?NumericQ] :=g
  NIntegrate[uSol[t, x]^2, {t, 0, s}, MaxRecursion -> 20]
In[3]:=g
Plot3D[intSquare[s, x], {s, 0, 1}, {x, 0, 2*Pi}];

works ok on my PC.

--
Peter Pein
Berlin
http://people.freenet.de/Peter_Berlin/


  • 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