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 for Programming
 LabTalk Forum
 nlfit x-functions with independent fits
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

monoprotic

USA
3 Posts

Posted - 09/10/2009 :  2:29:15 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR 6
Operating System: Windows XP

I am trying to fit multiple independent curves through the nlbegin/fit/end x-functions. In the help file, it says the specified tree structure has values for "codn" and "chisqrn", presumably for each curve; however, the tree only contains a single "cod" and "chisqr" node, which seems to correlate to the first dataset being fit. When iterations are done through the nlpara dialog, the cod and chi squared values for each curve are displayed independently, and I would like to access these through the LabTalk interface. Is there a way to do this?

easwar

USA
1964 Posts

Posted - 09/11/2009 :  10:21:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

When fitting multiple curves in the independent fit mode, performing iterations on each does not work, this is the same limitation in GUI tool where if you select Independent Fit, only the Fit button is enabled and the iteration buttons are not enabled.

Did you want to get the cod and chi-sqr values for each curve "during" the fitting? If yes, that is not possible right now. However if you want them at the end, "after" the fitting is done, you can issue the command:
nlend out:=1;
This creates a report sheet, and THEN your tree will have cod and chi-sqr for each curve.

So if you really want the values during fitting, the only way right now is to loop over each curve and fit one at a time, so this would be the approach to take if you do not want a report sheet and just want to fit each one separately with full control during fitting.

If you need further help I suggest you send your opj and details to tech support and reference this post.

Easwar
OriginLab
Go to Top of Page

easwar

USA
1964 Posts

Posted - 09/11/2009 :  10:55:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

If you want to get the individual chi-sqr, code etc values at the end of fitting, and don't want report, you can use a workaround of creating the report to get updated tree and then deleting the report, such as in the example below.

Easwar
OriginLab


// import data
newbook;
string fname$=system.path.program$+"Samples\Curve Fitting\Exponential Decay.dat";
impasc;

// begin fit
nlbegin iy:=(1, 2:4) func:=gauss nltree:= mytree mode:=cons;

// iterate till convergence;
nlfit;


// end fit and make a report to get updated tree
nlend out:=1;

// now separate values such as chi-sqr should be available
mytree.chisqr1=;
mytree.chisqr2=;
mytree.chisqr3=;

// now delete the report if you don't want it
layer -d %(__report$);
layer -d %(__fitcurve$);
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