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
 automation of curve fitting

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

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