MathGroup Archive 2006

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

Search the Archive

Re: Reconstructing data points from a InterpolatingFunction object

Eckhard Schlemm wrote:
> Hello everyone,
> My question is probably rather simple to answer but I just don't know how to
> do it.
> I am nummerically solving a differential equation using NDSolve and then I
> want to apply a NonlinearFit on the resulting InterpolatingFunction
> object....and therefore need to have access to the data points which NDSolve
> created and from which the InterpolatingFunction is created....Is there any
> fast and direct way to get these data points ? (There must be....)
> Thanks in advance
> Eckhard
Hi Eckhard,

Although you can always manipulate the result of NDSolve as any 
expression (see In[1]), using the functions located in the package 
"InterpolatingFunctionAnatomy" (see In[3] and In[4])should be easier and 
better since they are version independent:

"[...] occasionally it is useful to access the data inside [of the 
interpolating function], which includes the actual values and points 
NDSolve computed when taking steps.

The exact structure of an InterpolatingFunction object is arranged to 
make the data storage efficient and evaluation at a given point fast.

This structure may change between Mathematica versions, so code which is 
written in terms of accessing parts of InterpolatingFunction objects may 
not work with new versions of Mathematica.

The DifferentialEquations`InterpolatingFunctionAnatomy` package provides 
an interface to the data in an InterpolatingFunction object which will 
be maintained for future Mathematica versions [1]."

sol = NDSolve[{Derivative[1][y][x] == y[x],
     y[1] == 2}, y, {x, 0, 3}]




Best regards,


  • Prev by Date: Re: ContourListPlot
  • Next by Date: RE: Re: Re: level curve selection
  • Previous by thread: Re: Reconstructing data points from a InterpolatingFunction object
  • Next by thread: Re: Reconstructing data points from a InterpolatingFunction object