Problem in New Fit Function name

Hi guys

I am trying to define a new fit function for curve fitting

The original fucntion is called Guinier Approximation:

f(Q) =A*Q^2exp(-((Q*R)^2)/3)

But when I put that in, it returns:

names must start with a letter and contain letters, digits or '_'

What is wrong with my function name?
if you read the error message, you'll notice that white space is not listed!
Take the space out of the function name or join the words with _

 
Guinier_Approximation
 


--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Igor_user wrote:
The original fucntion is called Guinier Approximation:

f(Q) =A*Q^2exp(-((Q*R)^2)/3)

But ...


You probably also will need to write your equation in one or the other of the following forms (you are missing a "*" somewhere):

f(Q) =A*(Q^2)*(exp(-((Q*R)^2)/3))

f(Q) =A*Q^(2*(exp(-((Q*R)^2)/3)))


Also, since the parameter Q^2 appears twice, a "cleaner" format could be rendered with Qsq=Q^2 as ...

f(Qsq) =A*Qsq*exp(-Qsq*R^2/3)

f(Qsq) =A*Qsq^(exp(-Qsq*R^2/3))


--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Problem in the fitting:

Well, after the function is defined, I used it to fit the curve that follows an exponential decay (See attached image).

Upon the fitting, I was asked to provide some initial guess for the values of the coefficients that I wish to calculate.

Some approximate numbers were therefore put in for the evaluation.

But apparently it didn't fit well at all. The fitting curve isn't steep enough as compare to the actual data curve in the graph.

By increasing the coefficient R in the exponential term and changing the number for A won't make the fitting better though.

Is there another way in Igor to make a better fit than this.

Any suggestions? Thx!

Guinier eq2..JPG (26.49 KB)
Igor_user wrote:
Problem in the fitting:
.....


First ...

Is your equation valid (my quick search on Guinier equations give a few other forms)? Is it a proper approximation to a truer equation that should instead be used (because you are not in the proper range of parameter space to apply the limiting form versus the expanded form)? Are you missing any parameters in what you are fitting (perhaps because your experiment includes other factors)? Did you code the equation correctly (this happens a lot!)?

Igor_user wrote:
Is there another way in Igor to make a better fit than this.


You might instead want to address the above questions first. Your results from fitting may indeed be limited by the accuracy of your equation as a representation of the experiment, not by the ability of Igor (or any other program) to fit the equation to the data.

After all this ...

Can you adjust the fitting parameters manually to give a truer fit of the expectation to the data than shown by your results? If so, start from those as the initial guesses.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville