najm1,
In order to perform a nonlinear curve fit on one dataset which contains a Gaussian peak and a LogNormal peak, define a new fitting function which contains a Gaussian term and a LogNormal term. To speed up the fitting process and reduce the amount of typing you need to do, define the Gaussian and LogNormal terms using Origin's built-in multi-parameter function notation as shown below:
y = Gauss(x,y0,xc,w,A) + LogNormal(x,y0,xc_2,w_2,A_2)
Note: y is the dependent variable (the Y dataset containing the two peaks), x is the independent variable (the X dataset), and y0 is the baseline (assumed to be the same for both peaks). Furthermore, the notation above can be seen in the Built-in Function Reference in the Origin 5.0 LabTalk manual.
To properly define this function in the nonlinear curve fitter, first edit the LogNormal function so that the parameter names it uses are the same as the parameter names above. To do that, follow these steps:
- Select Analysis => Nonlinear Curve Fit.
- Click the More button to proceed to the advanced mode of the fitter. If the More button is not visible you are already in the advanced mode.
- Select Function => Select from the fitter menus.
- Select Peak Functions from the Categories list and then LogNormalfrom the Functions list.
- Select Function => Edit from the fitter menus.
- Add _2 to xc, w, and A in the Parameters list and the Description text box.
- Click the Save button, but do not close the nonlinear curve fitter.
Once the LogNormal function has been edited, define a new function as shown above. To do so, follow the steps below:
- Select Function => New. This will create a new user-defined function definition file (*.FDF) in the FitFunc folder of your Origin installation and will list it in the Peak Functions category (since this was the last category selected).
- Enter a name for the new, user-defined function in the Function Name text box. This step is optional. If you choose to leave it as is, please note the name in the event that you have similar data in the future.
- Enable the use of user-defined parameter names by checking the User Defined Param. Names check box.
- Enter the following list of parameters (exactly as you see it here) in the Parameter Names text box:
y0,xc,w,A,xc_2,w_2,A_2
- Enter the fitting function into the Definition text box. If you forgot what the fitting function is supposed to look like, here it is:
y = Gauss(x,y0,xc,w,A) + LogNormal(x,y0,xc_2,w_2,A_2)
- Select the appropriate form from the Form drop-down list. I have found the Y-Script works, but it may only be necessary to set it to Equations.
- Click the Save button, but do not close the nonlinear curve fitter.
After defining the new function assign the datasets to be fitted, initialize the parameters, and perform some iterations. To do so, follow the steps below:
- Select Action => Dataset from the fitter menus.
- Select the line that reads "Y Dep ??? (1...0" in the top window.
- Select the Y dataset to be fitted from the Available Datasets list.
- Click the Assign button to assign the Y dataset to the dependent variable, y.
- Do the same for the X dataset if necessary by selecting the line that reads "X Indep ??? (1...0)" and following steps 16-17.
- Select Action => Fit from the fitter menus.
- Enter initial values into the corresponding text boxes for each of the 7 parameters. Note: You may have to use the scroll bar to initialize all 7 parameters.
- Click the Chi-Sqr button.
- - If you do not see a value for Chi-sqr in the window (i.e. it lists "--" as the value), the fit is not working properly. Select Function => Edit from the fitter menus and follow through steps 10-14 again to make sure there are no errors in the definition of your function.
- If you do see a value for Chi-sqr, the fit is fine. Click
the 10 Iter. button until the fit looks good. - Click the Done button when you are satisfied with the appearance of the fit curve.
This completes the entire fitting operation. Please note that the fitting function I have had you define will be available whenever you have similar data by selecting Analysis => Nonlinear Curve Fit, proceeding to the advanced mode (see step 2), selecting the Peak Functions category (see step 4), and then selecting the name of the function entered in step 9 (see step 4).
I hope that this information proves helpful!
Sincerely,
Ryan Toomey