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
 Multiple Data Range Linear Fitting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

onesun

USA
1 Posts

Posted - 01/08/2010 :  7:58:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello!
I am seeking an elegant way to linearly fit two different data ranges on the same set of (x,y) data, with the end goal of determining the x value at their intercept. At best right now all I can do is go through two separate linear fitting processes using the data range selector tool and then finding the intercept by hand after Origin provides me with the slopes and y-intercepts. Any suggestions? Thanks!
Yours in data processing,
-Kevin

larry_lan

China
Posts

Posted - 01/11/2010 :  02:22:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kevin:

You can only add another data range in the fitter, and fit at the same time. However, you still need to select the data from each range manually.



As for calculating the intercepts, you can use Derived Parameters to calculate that, which was supported in Nonlinear Curve Fitting dialog only.

Thanks
Larry
OriginLab Technical Services
Go to Top of Page

easwar

USA
1965 Posts

Posted - 01/11/2010 :  11:05:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kevin,

If you just want to compute/print out the x value for the intersection (and not necessarily want it as part of the fit report), you could use a script solution such as below:

First plot your data and use the Regional Data Selector tool from the Tools menu to select/mark two ranges on your data.

Then run the following script:


nlbegin func:=line nlt:=mytree;
nlfit;
nlend 1;
double a1,b1,a2,b2;
a1=mytree.a;
b1=mytree.b;
a2=mytree.a_2;
b2=mytree.b_2;
double myx=(a2-a1)/(b1-b2);
type "The two lines intersect at x=$(myx)";


You can look up documentation on nlfit, nlend etc in the LT Guide for version 8.1 in the product, or from this wiki area:
http://wiki.originlab.com/~originla/wiki/index.php?title=Category:LabTalk_Programming

Also once a fit has been done, there is a getnlr X-function that can be used to programmatically get all information from a report sheet.

Easwar
OriginLab
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