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

Home » Public Forums » archive » help regarding 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
help regarding curvefit [message #89833] Mon, 08 December 2014 22:56 Go to previous message
Krishnakumar M.A is currently offline  Krishnakumar M.A
Messages: 19
Registered: March 2013
Junior Member
Hello All,

I am trying to use the curvefit algorithm in IDL for fitting my data with a function as given in the code below. It is peacefully fitting and giving me the result, but only one problem, it is doing only one iteration and giving the same A=[] value as the fitted result. I'm not able to figure out what went wrong, and I have used cuurvefit before and it worked well. Do anybody have any idea to solve this issue?

Any help is appreciated....

Thanks,
Krishnakumar

code:

RO gfunct, X, A, F, pder


F = sqrt((!dpi^5.0 * A[0]^3.0) / (8 * x^5.0)) * exp( - (!dpi^2 * A[0]) / (4*x)) * 180.0

IF N_PARAMS() GE 1 THEN $ ; calculate the partial derivatives......

pder = [!dpi^5.0 * A[0] / (8*x^5.0) * exp(-!dpi^2.0 * A[0] / (4*x)) * 180.0* (1.5 - !dpi^2.0 * A[0]/ (4*x))]


END

openr,1,"data.dat"
xpy=fltarr(3,301)
readf,1,xpy
x=reform(xpy[1,*])
y=reform(xpy[2,*])

A=[100.0]

weights = 1.0/y^2.0

yfit=curvefit(x+10,y,weights,A,SIGMA,chisq=chisq,iter=it,fun ction_name='gfunct')
print,A,sigma,chisq,it
close,1

plot,x,yfit
oplot,x,y

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: loop for XML
Next Topic: Download IDL using Microsoft Explorer, not Firefox or Opera!

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

Current Time: Wed Oct 08 13:35:44 PDT 2025

Total time taken to generate the page: 0.00413 seconds