comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Curvefit
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: curvefit [message #44427 is a reply to message #9041] Mon, 13 June 2005 21:02 Go to previous messageGo to previous message
nolan.smith1 is currently offline  nolan.smith1
Messages: 12
Registered: June 2005
Junior Member
Thank you!
I had a little typo in the function that I gave you,
it is y(x)=A/(1+x/B)^2.
Your answer was really helpful so thanks again!!!

Nolan

Vinay L. Kashyap wrote:
> In article <1118691431.765056.244800@f14g2000cwb.googlegroups.com>,
> <nolan.smith1@gmail.com> wrote:
>> Hello,
>>
>> I am new in IDL and I am trying to fit my data (x,y coordinates) in a
>> function of this form:
>>
>> y(x)=A/[(1+x/B)^1/2]^2
>>
>> so that I can calculate A and B.
>>
>> I have read the documentation but I am very confused as to how I should
>> set up my function to use it at the curvefit.
>> Could you please explain to me how to set up the function and how to
>> use curvefit correctly?
>>
>> Thank you,
>> Nolan Smith
>>
>
> Create a new procedure, say testfun.pro:
>
> pro testfun,x,y,par,dfdpar
> y=par[0]/((1+x/par[1])^(1./2.))^2
> ;question: why is this not y=par[0]/(1+x/par[1]) ?
> dfdpar=fltarr(n_elements(x),2)
> dfdpar[*,0]=y/par[0]
> dfdpar[*,1]= {partial}y/{partial}B ..
> ;calculation left as an exercise for the reader!
> return
> end
>
> and then call curvefit as
> yfit=curvefit(x,y,weights,par,function_name='testfun')
>
> vinay
> --
> ____________________________________________________________ __________________
> kashyap@head.cfa.harvard.edu 617 495 7173 [CfA/P-145] 617 496 7173 [F]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Locating IDL source code file
Next Topic: plotting data as it arrives using objects

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:51:42 PDT 2025

Total time taken to generate the page: 1.27932 seconds