FitFunc format for Curve Fitting dialoge wrt number of coefs
thomas_braun
I have the following Fit function (Igor 6.12A on Windows XP) in use.
Function TwoVoightWithBG(w,x) : FitFunc
wave w
variable x
//CurveFitDialog/ Coefficients 10
//CurveFitDialog/ w[0] = o
//CurveFitDialog/ w[1] = A
//CurveFitDialog/ w[2] = u
//CurveFitDialog/ w[3] = E0
//CurveFitDialog/ w[4] = m
//CurveFitDialog/ w[5] = o2
//CurveFitDialog/ w[6] = A2
//CurveFitDialog/ w[7] = u2
//CurveFitDialog/ w[8] = E02
//CurveFitDialog/ w[9] = m2
wave background = testData_bg
Make/O/D/N=6 firstFunc, secondFunc
firstFunc[0,4] = w[p]
secondFunc[0,4] = w[p+5]
return VoigtFit(firstFunc,x) + VoigtFit(secondFunc,x) + background(x)
End
wave w
variable x
//CurveFitDialog/ Coefficients 10
//CurveFitDialog/ w[0] = o
//CurveFitDialog/ w[1] = A
//CurveFitDialog/ w[2] = u
//CurveFitDialog/ w[3] = E0
//CurveFitDialog/ w[4] = m
//CurveFitDialog/ w[5] = o2
//CurveFitDialog/ w[6] = A2
//CurveFitDialog/ w[7] = u2
//CurveFitDialog/ w[8] = E02
//CurveFitDialog/ w[9] = m2
wave background = testData_bg
Make/O/D/N=6 firstFunc, secondFunc
firstFunc[0,4] = w[p]
secondFunc[0,4] = w[p+5]
return VoigtFit(firstFunc,x) + VoigtFit(secondFunc,x) + background(x)
End
Unfortunately the Curve fitting dialoge can not determine the number of coefficients. The "Global Analysis" dialog is able to determine them correctly.
What am I doing wrong?
Thanks,
Thomas
The work-around is to simply select a coefficient wave with the correct number of elements. The dialog then uses the number of wave elements as the number of coefficients. Unfortunately, you still don't get the mnemonic coefficient names. I will have to look into changing the way the dialog works.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
December 21, 2009 at 09:45 am - Permalink