MathGroup Archive 2006

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

Search the Archive

Re: Reconstructing data points from a InterpolatingFunction object

  • To: mathgroup at
  • Subject: [mg66576] Re: Reconstructing data points from a InterpolatingFunction object
  • From: Paul Abbott <paul at>
  • Date: Sat, 20 May 2006 04:48:01 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <e4bits$1a9$> <e4ella$9o6$> <e4jtte$d24$>
  • Sender: owner-wri-mathgroup at

In article <e4jtte$d24$1 at>,
 "Eckhard Schlemm" <e.schlemm at> wrote:

> Thanks to your help - and the other answers of course - I managed to get
> hold of the data points created by NDSolve to sample the
> InterpolatingFunction..But still when I use NonlinearFit[] to fit a model to
> these data the outcome is somewhat strange...for a listplot of data and a
> plot of the "best fit function" clearly indicates that there are better
> paramters to fit the model to the data....I think this problem has nothing
> to do with from where I got the data points,,, 


> in my case from the InterpolatingFunction object but I don't think that
> is the cause of this strange behavior.

> Can you tell me, why ff[t] is so much different from the data points of
> data?... Oh I almost forgot... it works properly for some values of a and
> T... for example (a,T)=(.5 , 30) seems to work.. but others do not....for
> instance (a,T)=(.7 , 30) yields a result which I cannot quite belief to be
> the best fit....

NonlinearFit and FindFit are both sensitive to the choice of starting 
parameters. For a = 0.7, if you do

  NonlinearFit[data, a Sin[b t + g], t, {{a, 0.7}, {b, 1/2}, {g, Pi/2}}]

you will get a much better fit.

The solution to the differential equation looks like a Jacobi elliptic 

Also, you are fitting to a trig function -- so why not use Fourier 
methods to determine the amplitude and frequency?


Paul Abbott                                      Phone:  61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    

  • Prev by Date: Re: Packages--JLink class is loaded but cannot be found?
  • Next by Date: Re: Graphics--triangle intersection
  • Previous by thread: Re: Reconstructing data points from a InterpolatingFunction object
  • Next by thread: NestWhile iterator.