MathGroup Archive 2006

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

Search the Archive

Re: Reconstructing data points from a InterpolatingFunction object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66538] Re: Reconstructing data points from a InterpolatingFunction object
  • From: "Eckhard Schlemm" <e.schlemm at hotmail.de>
  • Date: Fri, 19 May 2006 03:39:50 -0400 (EDT)
  • References: <e4bits$1a9$1@smc.vnet.net> <e4ella$9o6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Paul,

Thanks for your answer.

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.

I attached the code run on a WinXP machine, mathematica version 5.0

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

So Thanks for your answer again
cheers

Eckhard


> I think a concrete example is likely to generate a more useful answer.
>


> > and therefore need to have access to the data points which NDSolve
> > created and from which the InterpolatingFunction is created....
>
> I don't follow the use of therefore here. The data points at which
> NDSolve samples the solution depends on the automatic and optional
> settings supplied to NDSolve -- so I don't see why accessing these
> points is required. You can, of course, just generate a Table of points
> by re-sampling the InterpolatingFunction.
>
> > Is there any fast and direct way to get these data points ?
> > (There must be....)
>
> See the Advanced Documentation for NDSolve. This can be opened directly
> be executing the following command:
>
>  NotebookOpen[FrontEnd`FileName[
>   {$TopDirectory, "Documentation", "English","RefGuide",
>     "AdvancedDocumentation","DifferentialEquations"}, "Packages.nb"]]
>
> 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
>


begin 666 nonlinearfit.nb
M*"HJ*BHJ*BHJ*BHJ*BHJ($-O;G1E;G0M='EP93H@87!P;&EC871I;VXO;6%T
M:&5M871I8V$@*BHJ*BHJ*BHJ*BHJ*BH-"B @(" @(" @(" @(" @(" @(" @
M($-R96%T961">3TG36%T:&5M871I8V$@-2XP)PT*#0H@(" @(" @(" @(" @
M(" @(" @($UA=&AE;6%T:6-A+4-O;7!A=&EB;&4@3F]T96)O;VL-"@T*5&AI
M<R!N;W1E8F]O:R!C86X@8F4@=7-E9"!W:71H(&%N>2!-871H96UA=&EC82UC
M;VUP871I8FQE#0IA<'!L:6-A=&EO;BP@<W5C:"!A<R!-871H96UA=&EC82P@
M36%T:%)E861E<B!O<B!0=6)L:6-O;BX@5&AE(&1A=&$-"F9O<B!T:&4@;F]T
M96)O;VL@<W1A<G1S('=I=&@@=&AE(&QI;F4@8V]N=&%I;FEN9R!S=&%R<R!A
M8F]V92X-"@T*5&\@9V5T('1H92!N;W1E8F]O:R!I;G1O(&$@36%T:&5M871I
M8V$M8V]M<&%T:6)L92!A<'!L:6-A=&EO;BP@9&\-"F]N92!O9B!T:&4@9F]L
M;&]W:6YG.@T*#0HJ(%-A=F4@=&AE(&1A=&$@<W1A<G1I;F<@=VET:"!T:&4@
M;&EN92!O9B!S=&%R<R!A8F]V92!I;G1O(&$@9FEL90T*("!W:71H(&$@;F%M
M92!E;F1I;F<@:6X@+FYB+"!T:&5N(&]P96X@=&AE(&9I;&4@:6YS:61E('1H
M90T*("!A<'!L:6-A=&EO;CL-"@T**B!#;W!Y('1H92!D871A('-T87)T:6YG
M('=I=&@@=&AE(&QI;F4@;V8@<W1A<G,@86)O=F4@=&\@=&AE#0H@(&-L:7!B
M;V%R9"P@=&AE;B!U<V4@=&AE(%!A<W1E(&UE;G4@8V]M;6%N9"!I;G-I9&4@
M=&AE(&%P<&QI8V%T:6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179A;'5A=&5;3F]N;&EN96%R1FET6V1A=&$L(%P@7%M!;'!H
M85TJ4VEN6UQ;0F5T85TJ=" K(%Q;1V%M;6%=72P@#0H@(" @(" @(" @="P@
M>UQ;06QP:&%=+"!<6T)E=&%=+"!<6T=A;6UA77U=75PI+" B7%M);F1E;G1I
M;F=.97=,:6YE72(L( T*(" @(%PH9F9;=%U<*2P@(EQ;26YD96YT:6YG3F5W
M3&EN95TB+" -"B @("!<*%PH9V8@/2 -"B @(" @(" @4&QO=%MF9EMT72P@
M>W0L(# L(%1]+"!<( T*(" @(" @(" @($)A8VMG<F]U;F0@7%M2=6QE72!2
M1T)#;VQO<EL@+CDU+" @+CDU+" @+CDU72P@#0H@(" @(" @(" @4&QO=%-T
M>6QE("T^(%)'0D-O;&]R6S$L(# L(#!=+" -"B @(" @(" @("!!>&5S3&%B
M96P@7%M2=6QE72![="P@(EP\>%MT72!.;VYL:6YE87)&:71</B)]73M<*5PI
M+" B7 T*7%M);F1E;G1I;F=.97=,:6YE72(L( T*(" @(%PH7"A0;&]T6W5;
M=%TL('MT+" P+"!4?2P@7" -"B @(" @(" @0F%C:V=R;W5N9"!<6U)U;&5=
M(%)'0D-O;&]R6R N.34L(" N.34L(" N.35=+" -"B @(" @(" @4&QO=%-T
M>6QE(%Q;4G5L95T@4D="0V]L;W);,"P@,"P@,5TL( T*(" @(" @("!!>&5S
M3&%B96P@7%M2=6QE72![="P@(EP\>%MT72!N=6UE<FEC86QL>5P^(GU=.UPI
M7"DL(")<#0I<6TEN9&5N=&EN9TYE=TQI;F5=(BP@#0H@(" @7"A<*&QP(#T@
M3&ES=%!L;W1;9&%T85T[7"E<*2P@(EQ;26YD96YT:6YG3F5W3&EN95TB+" -
M"B @("!<*%PH4&QO=%M[=5MT72P@9F9;=%U]+"![="P@,"P@5'TL(%P@#0H@
M(" @(" @($)A8VMG<F]U;F0@7%M2=6QE72!21T)#;VQO<EL@+CDU+" @+CDU
M+" @+CDU72P@#0H@(" @(" @(%!L;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M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*0T*#0HH*D-E;&Q486=S3W5T;&EN90T*0V5L;%1A9W-)
M;F1E>"T^>WT-"BHI#0H-"B@J0V5L;%1A9W-);F1E> T*0V5L;%1A9W-);F1E
M>"T^>WT-"BHI#0H-"B@J3F]T96)O;VM&:6QE3W5T;&EN90T*3F]T96)O;VM;
M>PT*0V5L;%LQ-S4T+" U,2P@,C,T."P@-3 L(#4T,2P@(DEN<'5T(ET-"GT-
M"ET-"BHI#0H-"@T*#0HH*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*@T*16YD(&]F
M($UA=&AE;6%T:6-A($YO=&5B;V]K(&9I;&4N#0HJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
+*BHJ*BHJ*0T*#0H`
`
end


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