Define a Peak Function for Peak Fitting

In Origin, defining a peak function is very similar to defining an user-defined fitting function, but with two additional requirements to be met:

1. The defined peak function should be placed into PFW category and the Peak Function check box on The Variable and Parameter Page  should be checked.

2. There should be at least four parameters in the defined peak function, that correspond to different peak characteristics, and assigned as attributes Offset/Baseline, Amplitude/AreaX WidthX Center. And the first parameter must be named y0 (Offset).

User_Defined_Peak_Function_Feature_Image

We have put together an Origin Project (OPJ) User_Defined_Peak_Function.zip (5.8KB), you can download this OPJ file to learn how to defined a peak function and fit with it.

In this blog post we will discuss how to:

  • Define a peak function
  • Use defined peak function to fit peaks in Peak Analyzer

 

Define a Peak Function

The peak function to be defined is expressed as below:

y = y0  +  A * exp(w/xc-w/x-(x/xc)^2*exp(-(w/x-w/xc)));

where is independent variable, y is dependent variable and parameters are as following:

y0: Offset/Baseline

A: Peak Amplitude

w: Peak Width

xc: Peak Center

 

There are general 6 steps in defining a peak function:

1. Hit F8 key or go to menu Tools: Fitting Function Builder to open Fitting Function Builder.

2. Click Next to go to Name and Type page, select PFW category from Select or create a Category drop-down list, input MyPeakFunc as Function name.

3. Click Next to go to Variables and Parameters page, input variables and parameters as shown below and check Peak Function check box:

User_Defined_Peak_Function_02

 

4. Click Next to go to Expression Function page. Click on each cell in Peak Attribute column to set peak attributes for each parameter. Enter initial parameter values. Enter function expression in Function Body edit box and do a quick check at x = 100 to make sure the expression is written correctly as shown below:

User_Defined_Peak_Function_03

5. Click Next button twice to go to Bounds and General Linear Constraints page. Double click in cells in < or <= column(s) to toggle operators and then enter lower and upper bounds. Setting bounds for each parameter will confine the fitted results in sensible range as show below:

User_Defined_Peak_Function_04

 

6. Click Finish button and the peak function is created and placed in PFW category.

 

Tip: If you want to make existing fitting functions available for peak fitting, choose Tools: Fitting Function Organizer. Right click the function and choose Move to or Share to and select PFW as the drop-down list option in appeared dialog.

 

Use Defined Peak Function to Fit Peaks in Peak Analyzer

Once you have defined your peak function and it is placed in PFW fitting function category, it is ready to be used for peak fitting. Now open User_Defined_Peak_Function.opj in zip file mentioned earlier, highlight column Amplitude  (Long Name ) and go to menu Analysis: Peaks and Baseline: Peak Analyzer to open the wizard.

To fit peaks using Peak Analyzer, it generally involves 5 steps below:

1. Select Fit Peaks(Pro) as Goal and click Next button 3 times to go to Find Peaks page.

2. Click Find button and three peaks are found. We need to remove x=120 peak since it is redundant. To do it uncheck Enable Auto Find checkbox and click Modify/Del button and hit Delete key in keyboard to remove that x=120 peak. Then click Done to close dialog.

3. Click Next button and you will find the peaks are automatically fitted (using Gaussian function by default), so we have to switch to our newly created peak function. To do so, click Fit Control button to bring up Peak Fit Parameters dialog.

4. Select MyPeakFunc (User) from the drop-down list in middle left and the Peak Type in upper panel will automatically switch accordingly. Now click Fit Till Converge button to make the fitting and click OK to close the dialog. Note: To change peak function for a single peak, you can also click the corresponding function in Peak Type column and change it.

User_Defined_Peak_Function_05

 

5. Click Finish button will output fitted results into a report.

 

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *