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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Finding good initial values for fitting
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MurmelMaster

Germany
2 Posts

Posted - 03/02/2009 :  04:25:20 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

MurmelMaster

Germany
2 Posts

Posted - 07/09/2009 :  10:46:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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!
Go to Top of Page

easwar

USA
1965 Posts

Posted - 07/11/2009 :  2:35:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000