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
 LabTalk Forum
 NLSF slows down

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
Malab Posted - 09/14/2005 : 04:52:55 AM
Origin Version 6.0:
Operating System: Win2000

I have to fit over 4000 Datasets! I do it in a loop. In the beginning the fit is very fast, but after a while each reloop slows down.
I suppose that it can get together with the popup window, in which the fit result parameter are shown (after a while, the auto scrolling takes a long time). I don't need this window, but a was not able to dissable this. How can I do this?

Maybe someone knows another reason of my problem!
6   L A T E S T    R E P L I E S    (Newest First)
Malab Posted - 09/19/2005 : 09:17:42 AM
ah ok, this code is ten times faster! Thank you!
Mike Buess Posted - 09/16/2005 : 08:52:51 AM
The Results log report comes from nlsf.end() and I just told you how to suppress it in Origin 7.5. If that doesn't work in Origin 6.0 you can delay the nlsf.end() command until the end. That might be preferable anyway since all of your fits use the same function...

nslf.begin();
nlsf.init();
nlsf.func$="lorentz";
nlsf.pastetoplot=1;
M=999;
for(i=1;i<=M-1;i++)
{
%P="Fitting DataSet $(i) of $(M-1) - $(i/(M-1)*100)%";
type %P;
nlsf.fitdata$=inp_Y$(i);
nlsf.databegin=MyVarStart;
nlsf.dataend=MyVarEnd;
nlsf.datastep=1;
nlsf.numreplica=PEAKS-1;
nlsf.p1=0;
iii=1;
for(iPeak=1;iPeak<=PEAKS;iPeak++)
{
iii++;
nlsf.p$(iii)=MyVarCenter$(iPeak);
iii++;
nlsf.p$(iii)=MyVarWidth$(iPeak);
iii++;
nlsf.p$(iii)=29000;
}
nlsf.xmode=0;
nlsf.xPoints=inp!wks.nRows;
nlsf.iterate(Iter);
nlsf.iterate(Iter);
nlsf.iterate(Iter);
result_ID[i]=i;
result_y0[i]=nlsf.p1;
iii=2;
for(iPeak=1;iPeak<=PEAKS;iPeak++)
{
result_xc$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_w$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_A$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_height$(iPeak)[i]=(2*nlsf.p$(iii-1)/PI)*(1/(nlsf.p$(iii-2)));
}
result_ChiSquare[i]=nlsf.chiSqr;
}
nlsf.end();

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/16/2005 08:54:55 AM
Malab Posted - 09/16/2005 : 07:38:09 AM
I think that's the point! Is there no Labtalk command for this Write Parameters to Results log option?
Mike Buess Posted - 09/14/2005 : 08:30:44 AM
I see nothing wrong with your script so your suspicion about the Results Log might be correct. You should be able to disable Results log reporting. In Origin 7.5 you can do that with the proper argument for nlsf.end()...

nlsf.end(8); // end fitting session but do not paste Fit Label to Results log

That argument is not documented in Origin 6.0 so it might not work. In that case you might try unchecking the Write Parameters to Results log option in the NLSF fitter.

Mike Buess
Origin WebRing Member
Malab Posted - 09/14/2005 : 07:42:05 AM
nothing spectacular :-)
only simple fits with 2 or more lorentz functions

This only will work with 999 column because there are some bugs in V6.0! I have solved this bye switching to another worksheet (this is not applied in the code), but this is not the reason.

M=999;
for(i=1;i<=M-1;i++)
{
%P="Fitting DataSet $(i) of $(M-1) - $(i/(M-1)*100)%";
type %P;
nslf.begin();
nlsf.init();
nlsf.func$="lorentz";

nlsf.databegin=MyVarStart;
nlsf.dataend=MyVarEnd;
nlsf.datastep=1;
nlsf.pastetoplot=1;
nlsf.fitdata$=inp_Y$(i);

nlsf.numreplica=PEAKS-1;
nlsf.p1=0;
iii=1;
for(iPeak=1;iPeak<=PEAKS;iPeak++)
{
iii++;
nlsf.p$(iii)=MyVarCenter$(iPeak);
iii++;
nlsf.p$(iii)=MyVarWidth$(iPeak);
iii++;
nlsf.p$(iii)=29000;
}
nlsf.xmode=0;
nlsf.xPoints=inp!wks.nRows;
nlsf.iterate(Iter);
nlsf.iterate(Iter);
nlsf.iterate(Iter);
nlsf.end();

result_ID[i]=i;
result_y0[i]=nlsf.p1;
iii=2;
for(iPeak=1;iPeak<=PEAKS;iPeak++)
{
result_xc$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_w$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_A$(iPeak)[i]=nlsf.p$(iii);
iii++;
result_height$(iPeak)[i]=(2*nlsf.p$(iii-1)/PI)*(1/(nlsf.p$(iii-2)));
}

result_ChiSquare[i]=nlsf.chiSqr;

}
Mike Buess Posted - 09/14/2005 : 07:07:16 AM
Pls show us your script.

Mike Buess
Origin WebRing Member

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