Multipeak User Function Compile Issue
William
I recently upgraded from Igor 6 to Igor 9 for mac. I noticed that Igor 9 cannot recognize my user defined function that uses a convoluted exponential gaussian - even when the Multipeak Fitting analysis package is opened. I used this in Igor 6 for several years and had no problems so long as I loaded in the Multipeak Fitting analysis package.
Were there changes to the Multipeak Fitting package? I'd really appreciate any insights on this. I fit a lot of time-domian data to exponentials convoluted with a Gaussian instrument response. Below is a copy of the function. Unfortunately, I no longer have access to Igor 6 as 32-bit programs no longer run with this mac version.
#pragma rtGlobals=3 // Use modern global access method and strict wave access.
Function TA_2Exp(w,t) : FitFunc
Wave w
Variable t
//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(t)=amp0+(amp1*t1)*fExpGauss(t-t0,1/t1,pw)+(amp2*t2)*fExpGauss(t-t0,1/t2,pw)
//CurveFitDialog/ End of Equation
//CurveFitDialog/ Independent Variables 1
//CurveFitDialog/ t
//CurveFitDialog/ Coefficients 7
//CurveFitDialog/ w[0] = amp0
//CurveFitDialog/ w[1] = pw
//CurveFitDialog/ w[2] = w0
//CurveFitDialog/ w[3] = amp1
//CurveFitDialog/ w[4] = w1
//CurveFitDialog/ w[5] = amp2
//CurveFitDialog/ w[6] = w2
return w[0]+(w[3]*w[4])*fExpGauss(t-w[2],1/w[4],w[1])+(w[5]*w[6])*fExpGauss(t-w[2],1/w[6],w[1])
End
Function TA_2Exp(w,t) : FitFunc
Wave w
Variable t
//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(t)=amp0+(amp1*t1)*fExpGauss(t-t0,1/t1,pw)+(amp2*t2)*fExpGauss(t-t0,1/t2,pw)
//CurveFitDialog/ End of Equation
//CurveFitDialog/ Independent Variables 1
//CurveFitDialog/ t
//CurveFitDialog/ Coefficients 7
//CurveFitDialog/ w[0] = amp0
//CurveFitDialog/ w[1] = pw
//CurveFitDialog/ w[2] = w0
//CurveFitDialog/ w[3] = amp1
//CurveFitDialog/ w[4] = w1
//CurveFitDialog/ w[5] = amp2
//CurveFitDialog/ w[6] = w2
return w[0]+(w[3]*w[4])*fExpGauss(t-w[2],1/w[4],w[1])+(w[5]*w[6])*fExpGauss(t-w[2],1/w[6],w[1])
End
The newer Multipeak Fit no longer loads the Peak Functions procedure file that your function depends on. Add this to the procedure window:
#include <Peak Functions>
Also, best to paste code into the editor's "Code Snippet". That will get you syntax coloring and will prevent html-style interpretation of your code. I have edited your post to do that.
February 18, 2022 at 09:29 am - Permalink
In reply to The newer Multipeak Fit no… by johnweeks
Thanks, John - much obliged!
February 18, 2022 at 10:16 am - Permalink