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 initialize

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
fabian-rol Posted - 04/29/2005 : 04:41:54 AM
Hi,

I'm trying to fit an “ExpDecay2” curve, and I try to manually set the parameter values in my code, such as:
nlsf.p1=somevalue;
nlsf.p2=somevalue;
But, when the fit begins, the nlsf.pn values are auto initialized with wrong parameters so that the fit doesn’t converge (NLSF.fit(0) to test nlsf.pn values).
How can I choose the initialisation by myself ?

part of the program

void fit2exp (string strCurve)
{
using NLSF = LabTalk.NLSF; // Point to the NLSF object
NLSF.Init(); // Initialize the fitter
NLSF.Func$ = "ExpDecay2"; // Assign fitting function
NLSF.Cleanupfitdata(); // Begin fitting session
NLSF.fitdata$ = "e749bg2_B"; // fit first dataset in layer
NLSF.xmode = 4;
NLSF.funcx$ = "e749bg2_C"; // use as X dataset

NLSF.xBegin = 170; // set up x values
NLSF.xEnd = 820;
NLSF.xPoints = (NLSF.xEnd)-(NLSF.xBegin);

NLSF.p1 = 0; // y0 of first dataset
NLSF.p2 = 168.8; // x0 of first dataset
NLSF.v2 = 0; // x0 is fixed
NLSF.p3 = 972.4; // A1 of first dataset
NLSF.p4 = 33.2; // t1 of first dataset
NLSF.p5 = 197.3; // A2 of first dataset
NLSF.p6 = 358.5; // t2 of first dataset

NLSF.fit(0); // iterate 100 times

// when I test here the values of NLSF.p2 it is : 1 !!!

NLSF.End();


}


I'm grateful for any comment
Thanks a lot!!
2   L A T E S T    R E P L I E S    (Newest First)
fabian-rol Posted - 05/02/2005 : 03:50:44 AM
Thank you very much, it is working well, now
easwar Posted - 04/29/2005 : 11:09:05 AM
Hi,

How are you examining the values? Are you bringing up the dialog? If you bring up the NLSF tool, then it shows the fit page, but in the background it runs the parameter initialization code. This can be changed by going to the Script->Parameter Initialization page and unchecking the "Enable Automatic Parameter Initialiation" check box and then saving the function.

If on the other hand you programmatically examine the values, such as go to script window and type
nlsf.p1=
it should show the values you had set.

Easwar
OriginLab


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