| Author |
Topic  |
|
|
fabian-rol
France
Posts |
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!!
|
|
|
easwar
USA
1965 Posts |
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
|
 |
|
|
fabian-rol
France
Posts |
Posted - 05/02/2005 : 03:50:44 AM
|
| Thank you very much, it is working well, now |
 |
|
| |
Topic  |
|
|
|