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.simplex

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
Dominik Paulkowski Posted - 04/18/2007 : 10:35:36 AM
Origin Version (Select Help-->About Origin): Origin7.5G SR6 (v7.5886)
Operating System: Windows XP

Hi there!

How can I use the simplex method in the NLSF-fitting procedure of Origin C?

I tried:
if( iFitAlgorithm == 0 ) // Default Levenberg-Marquardt method (default)
{
NLSF.Fit(iIterationsAreaFunc); // perform fit
}
else if( iFitAlgorithm == 1 ) // Simplex method (Nelder and Mead)
{
NLSF.simplex(iIterationsAreaFunc); // perform fit
}

in my fit script. NLSF.Fit(n) creates fit-data/graph with the desired NLSF.xmode = 0. But NLSF.simplex(n) do nothing.

How I have to use NLSF.simplex correctly?

Ciao,
Dominik

-------------------
:-Dipl.-Phys. Dominik Paulkowski
Fraunhofer Institute for Surface Engineering and Thin Films (IST)
Braunschweig
Germany
4   L A T E S T    R E P L I E S    (Newest First)
Dominik Paulkowski Posted - 04/20/2007 : 04:07:54 AM
Thanks a lot, Mike!




-------------------
:-Dipl.-Phys. Dominik Paulkowski
Fraunhofer Institute for Surface Engineering and Thin Films (IST)
Braunschweig
Germany
Mike Buess Posted - 04/19/2007 : 08:22:14 AM
In OriginC you must quote the func argument...

nlsf.makecurve("func");

Mike Buess
Origin WebRing Member
Dominik Paulkowski Posted - 04/19/2007 : 03:02:38 AM
I don't know, how to use nlsf.makecurve(func). I tried:

using NLSF = LabTalk.NLSF;

// Perform nonlinear fit to plotted data
NLSF.cleanUpFitData();
NLSF.Init(); // initialize fitter

NLSF.xBegin = 1;
NLSF.xEnd = iLastFilledRow;
NLSF.xPoints= (NLSF.xEnd)-(NLSF.xBegin);
NLSF.xmode = 0; // use original x-dataset for fitfunction

NLSF.PasteToPlot = 1; // turn on pasting results to graph

NLSF.Func$ = "AreaFunctionPolynomN5"; // assign fitting function

NLSF.isBadFunc = 1; //Check the function selected for fitting: 1 = enable, 0 = disable.

NLSF.FitData$ = strYDataNameAreaFuncNanoMeter; // assign fitting dataset in a graph

// Set parameters NLSF.Pn = doubleValuen;
// ...


if( iFitAlgorithm == 0 ) // Levenberg-Marquardt method (default)
{
NLSF.Fit(iIterationenAreaFunc); // perform fit
}
else if( iFitAlgorithm == 1 ) // Nelder and Mead (Simplex) method
{
NLSF.simplex(iIterationenAreaFunc); // perform fit

wks.AddCol();
// Format new column correctly
string strLabelFitSimplex = strFitMethode + " " + strFitAlgorithm + " C0 " + strKoeffC0VarJaNein;
BOOL bDestFitSimplex = wks.Columns(iCols+1).SetLabel(strLabelFitSimplex);
Dataset colFitAreaFuncNanoMeterSimplex(wks, iCols+1);
wks.Columns(iCols+1).SetFormat(OKCOLTYPE_NUMERIC);
wks.Columns(iCols+1).SetType(OKDATAOBJ_DESIGNATION_Y);
colFitAreaFuncNanoMeterSimplex.SetSize(iRows);

string strFitXValues;
colhc.GetName(strFitXValues);
string strFitSimplexCol;
colFitAreaFuncNanoMeterSimplex.GetName(strFitSimplexCol);

NLSF.funcx$ = strFitXValues;
NLSF.funcCol$ = strFitSimplexCol;

NLSF.makecurve(func);

wks.Columns(iCols+1).SetWidth(-1);
}




// Write fit parameters to double variables
// ...

NLSF.unInit(); // Un-initialize the fitting module and free up all memory that was allocated during various fitting operations.

The error message is:
(4581) :Error, Variable "func" is not declared

What's wrong?

Ciao,
Dominik


-------------------
:-Dipl.-Phys. Dominik Paulkowski
Fraunhofer Institute for Surface Engineering and Thin Films (IST)
Braunschweig
Germany

Edited by - Dominik Paulkowski on 04/19/2007 03:04:51 AM
Mike Buess Posted - 04/18/2007 : 11:35:34 AM
Hi Dominik,

Like nlsf.iterate(), nlsf.simplex() does not create the fit curve. You need to follow nlsf.simplex(n) with nlsf.makecurve(func).

Mike Buess
Origin WebRing Member

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