T O P I C R E V I E W |
obauer |
Posted - 06/02/2009 : 09:58:02 AM 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 |
3 L A T E S T R E P L I E S (Newest First) |
cpyang |
Posted - 06/04/2009 : 11:45:06 AM 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
|
obauer |
Posted - 06/04/2009 : 10:47:35 AM 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 |
Iris_Bai |
Posted - 06/03/2009 : 03:30:59 AM 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 |