Fitting using integral
prathiba
I would like to fit using the function
Cv=a9Nk(x/θ)^3 Integral (dx (x^4 e^x)/((e^x-1)^2 )(With limits 0 to θ/x)
Can anyone help me how to write a User defined function for this expression.
I tried to write the integral part alone in the procedure:
#pragma rtGlobals=3 // Use modern global access method and strict wave access.
Function HCinteg(inX)
Variable inX
return (inX^4*e^inX)/((e^inX-1)^2)
End
printf "%.10f|r" Integrate1D(HCinteg, theta/inX, 0)
But the name of the function was not appearing in the Analysis/curve fitting menu.
I have attached the image of the function clearly.
Thank you very much
March 4, 2014 at 11:35 pm - Permalink
It seems like you have two variables with the same name here; you need a different name for the variable of integration...
Cv=a9Nk(x/θ)^3 Integral (dx' (x'^4 e^x')/((e^x'-1)^2 )(With limits 0 to θ/x)
It is also unclear to me what "a9Nk" is. Is that three variables? Perhaps a9, N and k?
What is the independent variable?
I guess Cv is the dependent variable.
You have no fitting function here- as sjr51 says, you need to wrap the call to Integrate1D in a properly constructed user-defined fitting function. All the stuff before the integral will need to be implemented in the wrapping function, too.
Perhaps you need to read the help for curve fitting:
DisplayHelpTopic "Curve Fitting"
Copy that command, paste it into Igor's command line and hit Enter.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
March 5, 2014 at 09:27 am - Permalink
I used the integrate1D function and I was successful.
March 5, 2014 at 08:42 pm - Permalink