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
 All Forums
 Origin Forum
 Origin Forum
 Fitting multiple datasets with system of equations

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
KrisLevchenko Posted - 02/25/2021 : 09:45:36 AM
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
11   L A T E S T    R E P L I E S    (Newest First)
KrisLevchenko Posted - 03/02/2021 : 12:46:35 PM
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

YimingChen Posted - 03/01/2021 : 11:08:35 AM
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
KrisLevchenko Posted - 03/01/2021 : 10:28:26 AM
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
YimingChen Posted - 02/25/2021 : 5:09:21 PM
No need to set as Global fit. Try set to Independent Fit.

James
KrisLevchenko Posted - 02/25/2021 : 2:40:55 PM
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

YimingChen Posted - 02/25/2021 : 1:44:04 PM
See attached figure showing two equations with x1y1 and x2y2.



James
KrisLevchenko Posted - 02/25/2021 : 11:12:55 AM
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

KrisLevchenko Posted - 02/25/2021 : 11:03:45 AM
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

KrisLevchenko Posted - 02/25/2021 : 11:01:25 AM
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(

YimingChen Posted - 02/25/2021 : 10:48:08 AM
Please also try this app on global fitting with sharing parameters.
https://www.originlab.com/fileExchange/details.aspx?fid=475

James
YimingChen Posted - 02/25/2021 : 10:09:22 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000