using curve fitting

Hi all
I have one plot and I want to use curve fitting to fit this plot with Bessel function but there is not Bessel function between the another function in curve fitting tab and also I define this function but it dose not work. I am not sure my definition is curect and also what do I add in the coefficients?
Thanks
Have you read the Curve Fitting help? In particular, the help that this command will take you to:

DisplayHelpTopic "Fitting to a User-Defined Function"

If not, then you better post a complete example. An Igor experiment file with your user-defined fit function and a data set, plus a description of what you tried and what happened. "Does not work" doesn't give us enough information to begin trying to help you.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks for reply,
I am newbie in Igor. I read this help and I use that, I like after using this fitting the fitting appeare in my plot like Quick fit but it did not happen.
I attached my code and as you see I have one plot which I want to fit the first order of the Bessel function.
Experiment_4.pxp (25.34 KB) Experiment_4.pxp (25.34 KB) Experiment_4.pxp (25.34 KB)
You have confused the fit coefficients with the independent variable. The independent variable is x- it corresponds to the values in your wave0. The fit coefficients are adjustable parameters of the fitting function that Igor will adjust in order to minimize the difference between the model (your fitting function) and your data set (wave1 vs wave0).

I'm not sure what part of your fit function you intend to be coefficients. You probably want to be able to adjust the X scale, possibly the X location, and probably the amplitude.

You probably should use the built-in Besselj, Besseli, etc. functions that Igor provides.

I tried to create a fit function based on the built-in Besselj function with n=0. That function doesn't look much like your data, so I didn't continue. Here is my function, for what it's worth:
Function Beselj(w,x) : FitFunc
    Wave w
    Variable x

    //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will
    //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog.
    //CurveFitDialog/ Equation:
    //CurveFitDialog/ f(x) = A*Besselj(0, (x-x0)/d)
    //CurveFitDialog/ End of Equation
    //CurveFitDialog/ Independent Variables 1
    //CurveFitDialog/ x
    //CurveFitDialog/ Coefficients 3
    //CurveFitDialog/ w[0] = A
    //CurveFitDialog/ w[1] = x0
    //CurveFitDialog/ w[2] = d

    return w[0]*Besselj(0, (x-w[1])/w[2])
End


John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Since your data show an initial super-linear increase with respect to x, one should not expect a good fit to the n=0 or 1 Bessel functions. The results are better with n=2, but still not very good. Modify John's function accordingly (change the first '0' argument), and try again.
thanks.
I got my mistake.
I have another question:
How can I write this equation
(x^2 ){d^2 y/dx^2} + x *{dy/dx} + (x^2 - alpha^2)*y = 0 in Fit expression in fit function part?
Because it did not accept differential part in this form.
Quote:
I have another question:

It's generally better to start a new thread.

You need to solve your differential equation, and then write a fitting function that uses that solution. That's two problems... If there is an analytic solution to your equation, it is best to find it and then implement your function using that analytic solution. If there is no analytic solution, then you need to solve it numerically. Read about that here:

DisplayHelpTopic "Solving Differential Equations"

I strongly recommend that you get that working before trying to do a curve fit using your solution.

Once you have a working numerical solution, you need to wrap the call to IntegrateODE in an all-at-once fit function. Read about all-at-once fit functions:

DisplayHelpTopic "All-At-Once Fitting Functions"

There is a demo experiment that does a curve fit to a simple differential equation. Pull down the File menu and select Example Experiments->Analysis->Differential Equation Demo.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com