The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Fitting multiple peaks with nonconstant background
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Cormac

Ireland
1 Posts

Posted - 02/22/2002 :  11:08:44 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, I have been trying the Origin 6.1 Demo, and what I want to do is fit multiple lorentz (or voigt) peaks to a dataset with a non-constant background that can be approximated by a sigmoidal function.Can this be done ?
I have tried without success but it appears that origin's basic functions can only cope with constant backgrounds. Even my attempts at writing my own function for a simple linear background with multiple peaks have failed - error messages are either nonexistant or simply not helpful.

Has anyone had similar experiences, or know of good solutions ?

easwar

USA
1964 Posts

Posted - 02/22/2002 :  2:55:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

This can be done rather easily by defining a custom fitting function in NLSF.

Do the following in NLSF
1> Create a new Function: menu item Function | New
2> Set "Type" as User-Defined (default for new functions)
3> Check "User Defined Param. Names" box
4> In the Parameter Names box, type:
L1,L2,x0,dx,xc1, w1, A1, xc2, w2, A2, xc3, w3, A3
5> Leave Indep and Dep var as x and y
6> In the Edit box for the function definition, type:
Bgnd = Boltzmann(x, L1, L2, x0, dx);
Peak1 = Lorentz(x, 0, xc1, w1, A1);
Peak2 = Lorentz(x, 0, xc2, w2, A2);
Peak3 = Lorentz(x, 0, xc3, w3, A3);
y = Bgnd + Peak1 + Peak2 + Peak3;
7> Change the Form dropdown list to Y-Script
8> Click the Save button

You can now use this function to fit your data. If you have already plotted your data, you can now go to Action | Fit menu item and accept "ACtive Dataset" as the dataset to be fit.

Note that you will need to provide initial parameter estimates.

As you can see, this function is built as a combination of existing built-in functions in Origin. The Boltzmann function is one of the Sigmoidal functions available and this is used for the background. The Loretnz function takes an offset parameter, but this has been set to 0 for all the three peaks since the background is dealt with in the Boltzmann function. You can of course type in equations to define your own custom function, but using cobminations of built-in functions when possible makes the fitting go faster.

If your work involves fitting multiple peaks with non-constant backgrounds, you may want to take a look at our Peak Fitting Module. Visit the following page for more information on the PFM:
http://www.originlab.com/www/products/pfm/index.asp

A new version of Origin, ver 7.0, will be released around 1st of March. This version has a built-in C compiler that is integrated into NLSF, making it easy to define custom functions and fit at higher speeds than possible by the script mechanism used in the above example. For more information on ver 7.0, visit:

http://www.originlab.com/www/products/origin7/index.asp

Easwar
OriginLab.

Edited by - easwar on 02/22/2002 15:01:45
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000