Fitting using integral

Hello,

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

There's a specific format for inputting user-defined fit functions in the procedure window so that they show up in the Curve Fitting menu. It is best not to attempt this yourself, but to add and edit a user-defined function from within the curve fitting dialog window. Hope this helps.
Quote:
Cv=a9Nk(x/θ)^3 Integral (dx (x^4 e^x)/((e^x-1)^2 )(With limits 0 to θ/x)

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
Thanks a lot sjr51 and johnweeks.

I used the integrate1D function and I was successful.