T O P I C R E V I E W |
ph7klw |
Posted - 10/11/2007 : 02:16:06 AM Origin Version (Select Help-->About Origin): Origin 7.5 Operating System: XP
I have thousands of data to be fitted. I have defined my user-denifed fuction called SED in the Origin. Now I want to do curve fitting via automation and extract the parameters in Origin.c The code is like "#include <Origin.h> //////////////////////////////////////////////////////////////////////////////////// void test() { nlsf.func$ = SED; // select SED fitting function L0 = 1000; //initialize parameter values tau = 1000; beta = 0.5; nlsf.cleanUpFitData(); nlsf.fitdata$ = b; nlsf.iterate(20); nlsf.xmode = 2; nlsf.funcx$ =A; nlsf.funccol$ = B; nlsf.makecurve(func); } " But i dont know why I get error below C:\.....\OriginC\SED.cpp(26) :Error, Variable "SED" not declared C:\.....\OriginC\SED.cpp(26) :Error, general compile error C:\....\OriginC\SED.cpp(23) :Error, error(s) found in compiling function test
any recommendation is welcome |
1 L A T E S T R E P L I E S (Newest First) |
Mike Buess |
Posted - 10/11/2007 : 07:05:13 AM 1. You must define nlsf with using nlsf = LabTalk.NLSF. 2. Parameter names cannot be used in OriginC. Use nlsf.pn instead. 3. All strings must be quoted. 4. Values of nlsf.fitdata$|funcx$|funccol$ must be full dataset names.
void nlsf_test() { using nlsf = LabTalk.NLSF; // define nlsf nlsf.func$ = "SED"; // select SED fitting function nlsf.p1 = 1000; //initialize parameter values nlsf.p2 = 1000; nlsf.p3 = 0.5; nlsf.cleanUpFitData(); nlsf.fitdata$ = "dataset name"; // full dataset name nlsf.iterate(20); nlsf.xmode = 2; nlsf.funcx$ = "dataset2 name"; nlsf.funccol$ = "dataset3 name"; nlsf.makecurve("func"); }
Finally, you can use the MultiFit addon module to fit multiple curves from the same graph or worksheet or collect the parameters for multiple fits in one worksheet.
Mike Buess Origin WebRing Member |
|
|