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.iterate(1) error message - OriginC

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
srosekra Posted - 08/23/2005 : 4:29:30 PM
Origin Version 7.0382:
Operating System: win2000Pro

I have the following code:
...
using NLSF = LabTalk.NLSF;
NLSF.Init();
//NLSF.PasteToPlot = 1;
NLSF.Func$ = "Lorentz";
NLSF.numReplica = 0;
NLSF.wType=0;
NLSF.w$="";
NLSF.chisqrerr=1;
NLSF.dataBegin = 646;
NLSF.dataEnd = 754;
NLSF.cleanupfitdata();
NLSF.FitData$ = "junkd10_B";
//NLSF.Execute("parainit");
if(NLSF.iterate(1)==-1) //ERROR MESSAGE OCCURS HERE
return 1;
NLSF.iterate(2);
NLSF.iterate(3);
...

I am basically using the call
LT_execute("run.section(fit,Fit1Peak,Lorentz)");
but I call it the long way above to avoid any graphical presentation, which slows my program. When using either method (LT_execute or the long version above) the first iterate sometimes causes an error message to be displayed -> "The fitting process has stopped as requested".
What causes this? It is hit or miss. Sometimes it will happen the first time I run it and I will not change anything run it again and it will not occur. How can I prevent it?
5   L A T E S T    R E P L I E S    (Newest First)
srosekra Posted - 08/24/2005 : 2:49:36 PM
Mike,
Thanks for the tips and help.
srosekra Posted - 08/24/2005 : 2:47:10 PM
It happended when I put in 10 or 100, but while trying your suggestion I think I may have stumbled upon the reason it occurs:

While debugging my code I would use the "Stop Debugging" button (Alt+F5) and upon returning to the code or any fitting routine it would display the error message. I stopped using Alt+F5 and haven't seen the error since. I can't think of any other reasons why the error message would occur.
Mike Buess Posted - 08/23/2005 : 9:18:40 PM
From the nature of the message I'm guessing that it's merely an artifact of requesting a single iteration. I bet NLSF.iterate(10) or NLSF.iterate(100) doesn't give the error. Shouldn't take that much longer either.

...From the programming guide NLSF.iterate() topic
quote:
If the tolerance value (see the Origin Help file) is satisfied, the fitter stops before the specified number of iterations are finished.
So you don't gain anything by iterating once, then twice, then three times as you have done. Better off asking for several iterations at once.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/23/2005 9:29:02 PM
srosekra Posted - 08/23/2005 : 6:51:31 PM
That is a great find and I will definetely be using it to keep the message window from disturbing the flow of the program. I still need to fit it though. I was wondering what causes it, so that I can make sure the fit is successful. Is there somewhere where the method .iterate() is documented, I am not quite sure what it does, what the return value means, except what little is in the NLSF help file.
Mike Buess Posted - 08/23/2005 : 5:22:03 PM
If you just want to suppress the error message try adding NLSF.msgPrompt=0; after NLSF.init();

Mike Buess
Origin WebRing Member

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