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 datasets with system of equations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

KrisLevchenko

Austria
7 Posts

Posted - 02/25/2021 :  09:45:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin version: 2018 (64bit), Academic

Greetings,
Sorry to bother with trivial question, I'd be very grateful for every help.

I want to fit two different dataset with different x and y each (x1 & y1), (x2 & y2). Fit(non-linear curve fit) is suppose to be with system of equations, where each of the equations is corresponding to specific data set:

y1=2.81*sqrt(x1*(x1-Hc+Four_Pi_Meff)); (for x1y1 only)
y2=2.81*(x2+Hu2-4/3*Hc-Four_Pi_Meff); (for x2y2 only)

y1,x1 and y2,x2 are independent input values. Hc,Four_Pi_Meff,Hu2 - shared variables by both of the equations that I want to obtain from fit.

Now, trouble occur while selecting data. Global fit with 2 data ranges allows to share variables, but requires x1,y1 and x2,y2 for each of the ranges. Basically trying to use BOTH formulas for x1y1 and x2y2. Result is all combinations of x1, y1, x2, y2 (x1y2, x2y1,x1y1 and x2y2). Independent fitting has 1 range, where I specify x1, y1, x2, y2, but the fit still includes those weird combinations of x1y2, x2y1.. in the result. There's no option to share parameters between equations in the Independent fitting option.

In the result, there're plots using proper inputs x1y1 and x2y2 and some fit curves, but I'm not sure whether the right corresponding equation was used to fit and whether variables were really shared. Obtained error in fitted values is large.

Note: x1y1 and x2y2 datasets are in the same Sheet, four columns in a row, x1 is defined as x1, while x2 - as x2. Same for y1 and y2.

Question: how to get a fit to two different datasets with two equations that share several variables?

Thanks in advance,
Kris

YimingChen

1593 Posts

Posted - 02/25/2021 :  10:09:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please check this tutorial on fitting with equations. You can modify the equations to have two independent variables. See if it works.
https://www.originlab.com/doc/Tutorials/Fitting-NLFit-MultiVar

James
Go to Top of Page

YimingChen

1593 Posts

Posted - 02/25/2021 :  10:48:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Please also try this app on global fitting with sharing parameters.
https://www.originlab.com/fileExchange/details.aspx?fid=475

James
Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 02/25/2021 :  11:01:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Yiming,

Thank you for the swift reply! Yes, I've checked this tutorial earlier. Here, we have 1 dataset fitted by two equations. I'm following the same procedure, basically, but need two different datasets to be fitted with two different equations. The only common point between them should be shared variables like Hc, Hu2, Four_Pi_Meff. My task is to find them from this fit. In other words, two equations, 3 unknowns. As of now, I do get the right(?) fits, but only together with unrequired fits to mixed data combinations. Also, the uncertainty of the result, even with specified limits and initial values, is very high, which additionally leads me to think that there's smth wrong with an this approach.

All tutorials are either for 1 equation and multiple datasets or 1 dataset and multiple equations. I know it should be easy, but it just keeps getting away from my grasp(


Edited by - KrisLevchenko on 02/25/2021 11:04:17 AM
Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 02/25/2021 :  11:03:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, thanks! I'll try this app.

quote:
Originally posted by YimingChen

Please also try this app on global fitting with sharing parameters.
https://www.originlab.com/fileExchange/details.aspx?fid=475

James

Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 02/25/2021 :  11:12:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, this app requires Origin version 9.6, and I have version 9.5. Either way, thank you =)

quote:
Originally posted by YimingChen

Please also try this app on global fitting with sharing parameters.
https://www.originlab.com/fileExchange/details.aspx?fid=475

James

Go to Top of Page

YimingChen

1593 Posts

Posted - 02/25/2021 :  1:44:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
See attached figure showing two equations with x1y1 and x2y2.



James
Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 02/25/2021 :  2:40:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear James,

Awesome, I've got the same result. Thank you) But the issue is in Data Set selection and further fitting. See the image below



In fitting preview window, you see at the top four data sets and corresponding fits. 2 of them are as planned and correspond to x1y1 and x2y2 fitted (I hope) with eq.1 and eq.2, two of them - weird mix of input data (x1y2, x2y1). Fitting is global, all variables are shared. What am I doing wrong or this is how it supposed to be?

quote:
Originally posted by YimingChen

See attached figure showing two equations with x1y1 and x2y2.



James

Go to Top of Page

YimingChen

1593 Posts

Posted - 02/25/2021 :  5:09:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
No need to set as Global fit. Try set to Independent Fit.

James
Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 03/01/2021 :  10:28:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear James,

Thank you for a great tip) I've tried this approach as well, yet those residual fit graphs persist to be present. High chi-square and error margin are a persistent problem, but I can leave with it. Why independent fit is better if I want fitted terms to be shared? Or are they by default shared via the equation expression?




Have a great day,
Kris

quote:
Originally posted by YimingChen

No need to set as Global fit. Try set to Independent Fit.

James
Go to Top of Page

YimingChen

1593 Posts

Posted - 03/01/2021 :  11:08:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When you define a system of equations to fit, the parameters of same name in two equations automatically shared its value during fitting. It fits two sets of xy datasets all together. If you think the fitting still has problem, please use the link below to contact us.
https://www.originlab.com/restricted/support/index.aspx

James
Go to Top of Page

KrisLevchenko

Austria
7 Posts

Posted - 03/02/2021 :  12:46:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Aha.. it's a bit different from other platforms I used to work with, therefore initial uncertainty in the result. Thank you for the explanation! =)

quote:
Originally posted by YimingChen

When you define a system of equations to fit, the parameters of same name in two equations automatically shared its value during fitting. It fits two sets of xy datasets all together. If you think the fitting still has problem, please use the link below to contact us.
https://www.originlab.com/restricted/support/index.aspx

James

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