| Author |
Topic  |
|
|
seta667
Spain
Posts |
Posted - 06/13/2008 : 09:01:31 AM
|
Origin Version (8.0): Operating System: Windows XP
Dear All,
I'm triying to fit a mass spectrum peak that is the sum of to know contributions. So my experimental values are the result of the sum of two known contributions and I would like to now the amount of this contribution (fraction). For each point:
Experimetal = fraction * Data1 + (1-fraction)*Data2
Experimental, Data1 and Data2 are different datasets (Three different columns in my Origin worksheet). Is there any way to know the best value for "fraction".
I now how to do that with Excel solver but I would rather prefer to perform all my calculatons with Origin. |
|
|
Deanna
China
Posts |
Posted - 06/16/2008 : 04:33:04 AM
|
Hi Seta667,
There are various ways to calculate the best value for fraction in Origin. One way is to define a user-defined function and then use it in the NLfit tool. We have an example in this web page.
Another way is rewritting your formula and then using the linear fit tool.
Your formula can be rewritten as follows: (Experimental-Data2)=fraction*(Data1-Data2) Then we set D = Experimental - Data2 and E= (Data1 - Data2) Now we have: D = frac * E
Suppose Data1, Data2 and Experimental are in Column A, B and C of a worksheet. We add two columns to this worksheet to store the values for D and E. To add columns, select Column: Add New Columns from the Origin main menu, and then enter 2 in the edit box in the dialog that pops up and finally click OK.
Highlight the 4th column (Column D). Right-click and select Set Column Values from the short-cut menu. The Set Values dialog opens. Enter the formula col(c)-col(b) and then click OK.

Similarly, highlight the 5th column (Column E). Right-click and select Set Column Values from the short-cut menu. The Set Values dialog opens. Enter the formula col(a)-col(b) and then click OK.
Now we use the Fit Linear tool. Select Analysis: Fitting: Fit Linear to open its dialog. In the Input Data branch, select Col(E) as X and Col(D) as Y in Range1. In the Fit Options branch, select the Fix Intercept check box and then enter 0 in the Fix Intercept At edit box. Click OK.

When the fitting is done, a report sheet should be created. There is a table named Parameters. The value for Slope that is listed in this table is the value for Fraction.

Deanna OriginLab Technical Services
Edited by - Deanna on 06/16/2008 05:35:22 AM |
 |
|
|
larry_lan
China
Posts |
Posted - 06/16/2008 : 05:45:36 AM
|
Like the link Deanna provide, you can also define an Nonlinear Linear Fitting function like this:

where:
Independent Variables: xx1, xx2 Dependent Variables: y Parameters: frac Function Form: Origin C Function: y = frac*xx1 + (1-frac)*xx2;
Then bring up the NLFit dialog from Analysis : Fitting : Nonlinear Curve Fitting. Select dataset for xx1, xx2 and y; Initialize frac as 0.5 and fit.

Since there are two independent variables, we will show two preview graphs in the preview panel. It's not good in your case, but just let it go, fit the curve till converged.
Thanks Larry OriginLab Technical Services |
 |
|
|
seta667
Spain
Posts |
Posted - 06/17/2008 : 1:19:24 PM
|
Thank a million Deanna, it's exactly what I was looking for. It's amazing to see how easy things could be when you know where they are.
Thanks again for yout time and the link.
|
 |
|
| |
Topic  |
|
|
|