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
 LabTalk Forum
 Finding good initial values for 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
MurmelMaster Posted - 03/02/2009 : 04:25:20 AM
Im working with Origin 6.0.

I have some troubles finding the right initial values to do a fitting with a script. I get the error message: "Error: 28036. Try setting parameter 't1' as fixed". When i simply used the fitting ExpDec1 and iterate i got this error quite frequently. So i tried to initialize the parameter with the more robust simplex method. But even that doesnt always work. The function doesnt seem to be able to find the optimum then and produces huge values for the parameter.

Here is a section of my code.


nlsf.init();
nlsf.func$=ExpDec1;
nlsf.constr$="";
nlsf.v1=0;
nlsf.P1=0.63;
nlsf.v2=1;
nlsf.v3=1;
nlsf.fitdata$=exp_kWerte;
nlsf.funcx$=exp_Conc;
nlsf.dataBegin=1;
nlsf.dataEnd=N+2;
nlsf.simplex(100000);
nlsf.iterate(2000);
nlsf.xMode=2;
nlsf.funccol$=exp_FITFINAL;
nlsf.makecurve(func);


I have no idea how i can come around this. If i copy the data to be fitted into a seperate work sheet and use the plot-> scatter function and then do a manual fitting with the analyze -> fit exponential decay -> first order everything works just fine. Any help would be appreciated.

Thx,
Mathias
2   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 07/11/2009 : 2:35:11 PM
Hi,

In your code you are initializing only P1, is there some part of the code you did not paste here?

Also move the param assignment etc after all other properties are initialized, such as:


nlsf.init();
nlsf.func$=ExpDec1;
nlsf.constr$="";
nlsf.fitdata$=exp_kWerte;
nlsf.funcx$=exp_Conc;
nlsf.dataBegin=1;
nlsf.dataEnd=N+2;
nlsf.v1=0;
nlsf.P1=0.63;
nlsf.v2=1;
nlsf.v3=1;
nlsf.simplex(100000);
// Call iterate multiple times, equivalent to clicking
// fit button multiple times
nlsf.iterate(500);
nlsf.iterate(500);
nlsf.iterate(500);
nlsf.iterate(500);
nlsf.xMode=2;
nlsf.funccol$=exp_FITFINAL;
nlsf.makecurve(func);


You could then download the version 8.0 demo from our website and try with same data in this new version, we have made improvements to convergence etc since version 6.0

You can view the following topic for examples on fitting from script in 8.0:
http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Curve_Fitting

Easwar
OriginLab
MurmelMaster Posted - 07/09/2009 : 10:46:36 AM
Doesn't anybody has an idea how to intitialize the fitting parameter to a given dataset with Origin 6.0? I worked around this problem but i'm still lacking an full automatic solution for this problem. Any help is appreciated.

thx!

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