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
 Forum for Origin C
 Accessing the NLSF data output
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

obauer

Germany
15 Posts

Posted - 06/02/2009 :  09:58:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR4
Operating System: Windows XP

Hello everyone!

I am having a maybe very simple question: How do I access the output of a NLSF fit in Origin C? By output I do not mean the fit parameters but the actual data points which make up the fitted curve displayed in the graph.

In my case I use the user-defined fitting function "XSW_reflectivity" which fits a theoretical curve to data which is contained in Book_2, column B(Y) (the worksheet is named "ExpReflectivity" and column B is labelled "Exp. Reflectivity"; column A(X) holds the corresponding X values). Now when I run the Origin C routine which calls the above mentioned function the NLSF creates a new workbook named "XSW_reflectivity fit of Book2_B" with two columns that contain both X and Y data of the fit curve. All I want to do now is to copy these two columns to the very workbook that already holds the data which is fitted, i.e. Book_2 = "ExpReflectivity", since I need them for further computation. I just cannot find a solution to do that although I have the feeling it shouldn´t be too difficult...

Can you help me? I really accomplish your advises. Thank you very much in advance!!!

Best regards,
Oliver

Iris_Bai

China
Posts

Posted - 06/03/2009 :  03:30:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oliver,

There is an example in the following wiki page about how to do Gauss fit and output fit staticstics result, fit parameters and fit data in Origin C.

http://ocwiki.originlab.com/index.php?title=Category:NLFitSession_%28class%29#Examples

Iris
Go to Top of Page

obauer

Germany
15 Posts

Posted - 06/04/2009 :  10:47:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Iris!

Thank you for your rapid answer. Unfortunately I do not see a clear connection between the wiki page which you posted and my problem: the link deals with NLfitsessions while I use NLSF which I call from Origin C via

using NLSF = LabTalk.NLSF;

I tried to get access to the dataset which is generated by the NLSF with the NLSF.xmode = 0, NLSF.funccol$ = str... and NLSF.makecurve("func") commands. This works well with those fit functions which come with ORIGIN. Yet in my case - with a user defined fitting function including a convolution - the simulated dataset looks similar but is different from the actual fit result; namely it is shifted in X and scaled differently in Y. Have you got an idea what could be the problem here?

Another question which arose is: What is the default worksheet / column where the dataset generated by the NLSF.fit(n) command is stored? According to the LabTalk help files it should be right next to the original input data:

"In the default case the curve is generated and the data is placed in the original worksheet next to the independent variable."

Yet in my case a new worksheet is created - like I already described in my above post. Why is this? How to I address that freshly created worksheet in ORIGIN C.

Sorry for bothering you again. I am looking forward to your answer.

Best regards and thanks in advance,
Oliver
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 06/04/2009 :  11:45:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oliver,

Is there a reason that you must use the old fitting engin from earlier version?

using NLSF = LabTalk.NLSF;


This is using the old fitting via LabTalk and we are providing that for backward compatibility support only. Best if you can use the new Origin 8 fitter which is much more flexible and much faster. The NLFitSessionBase class Iris mentioned is the best way to use the new fitter.

CP
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