MathGroup Archive 2006

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

Search the Archive

Re: Reconstructing data points from a InterpolatingFunction object


In article <e4jtte$d24$1 at smc.vnet.net>,
 "Eckhard Schlemm" <e.schlemm at hotmail.de> 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,,, 

Correct.

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

Correct.
 
> 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 
function. 

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

Cheers,
Paul

_______________________________________________________________________
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)    
AUSTRALIA                               http://physics.uwa.edu.au/~paul


  • 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.