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