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
 NLSF Fitting issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Onailime

Italy
Posts

Posted - 02/17/2005 :  05:47:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System: windows 98 se

Hi,

I have a large number of curves that I would like to automate the fitting of with Origin C. I am trying to use the NLSF in Origin C to do this using the following code borrowed from an example somewhere:
NLSFCntrl nlsfMyFit;// create NLSFcntrl - see OC_Types.h for details
initNLSF(nlsfMyFit); // initialize structure with default initial values
nlsfMyFit.imaxIter=1000;
nlsfMyFit.pasteToPlot = true;
nlsfMyFit.pasteToResults = true;
lstrcpy(nlsfMyFit.szYdataName, strYDataName); // assign fit dataset name
lstrcpy(nlsfMyFit.szFuncName, "lorentz"); // assign fitting function name
fitNLSF(nlsfMyFit);

The problem is that when I ask for the Results (i.e. the first parameter using nlsfMyFit.Par[1])
it returns the initialization parameters whereas the results.
Can someone help me?

Mike Buess

USA
3037 Posts

Posted - 02/17/2005 :  09:01:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm afraid you've stumbled across an obsolete Origin C method. The following comment is in the header of OC_Types.h in 7.0SR4...

//LAS, 1/31/03 commented out NLSFCntrl; using NLSF = LabTalk.NLSF can be used instead

Before you can use LabTalk.NLSF you must download/apply the SR4 patch...

http://www.originlab.com/index.aspx?s=9&lm=76


Then download the MultiFit add-on in the File Exchange...

http://www.originlab.com/fileexchange/details.aspx?fid=56

Even if it doesn't do exactly what you need at least you'll find some examples for using LabTalk.NLSF in MultiFit.c.

Mike Buess
Origin WebRing Member
Go to Top of Page

Gary Lane

USA
150 Posts

Posted - 02/17/2005 :  09:15:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ciao!

I think NLSFCntrl is an older method that was developed before LabTalk object access was greatly improved in Origin C. Perhaps you might prefer the following in Origin C.

// After this line you should be able to directly use the LabTalk
// NLSF object in Origin C
using NLSF = LabTalk.NLSF;
NLSF.maxIter = 1000;
// etc.

Hope this helps.

Gary
OriginLab

P.S. As Mike said I would first get the latest patch.

Edited by - Gary Lane on 02/17/2005 09:16:44 AM
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