Re: Calculations with Interpolating Functions

*To*: mathgroup at smc.vnet.net*Subject*: [mg88532] Re: Calculations with Interpolating Functions*From*: dh <dh at metrohm.ch>*Date*: Wed, 7 May 2008 07:10:48 -0400 (EDT)*References*: <fvpcqn$mhn$1@smc.vnet.net>

Hi Joao, you can always re-interpolate a function of an interpolating function. Therefore, write your function Sin[...] as an interpolationg function. Here is an example: t=FunctionInterpolation[x^2,{x,0,2}]; ts=FunctionInterpolation[Sin[t[x]],{x,0,2}]; Integrate[ts[x],{x,0,2}] hope this helps, Daniel João Paulo Casquilho wrote: > Hi > > > > I obtain an Interpolating function as a solution of a differential equation > with the command NDSolve, lets call it =93solution=94, which gives x(t). Next I > want to use this solution for further calculations. With the commands > =93result=Evaluate[x(t)/. First[solution]]=94 or =93result= x(t)/.solution, > {t,0,tmax}=94 I do the plot x(t) without any problems. Now, with version 5.2 I > manage to integrate x(t) or linear functions of it. But when I try to > integrate non linear functions of x(t), like x(t)^2 or Sin[x(t)] (which is > what I want), Mathematica is unable to give a numerical result, all I get > is an integral saying that there is an InterpolatingFunction in the > integrand. With Mathematica 6 the linear integration does not work either. > > Any help would be appreciated. > > > > Best Regards > > > > Joao Paulo > > >