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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 NLSF Fitting issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Onailime Posted - 02/17/2005 : 05:47:12 AM
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?
2   L A T E S T    R E P L I E S    (Newest First)
Gary Lane Posted - 02/17/2005 : 09:15:03 AM
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
Mike Buess Posted - 02/17/2005 : 09:01:32 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000