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
 NLSF Sigmoidal
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CStorey

Canada
137 Posts

Posted - 11/08/2000 :  8:25:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I'm looking for a little help automating a NLSF (Sigmoidal). What I'd like to do is:

Fit the sigmoide using the same X column for the curve generation object and get the data into a predefined column to plot in another plot. I can get it to do the fit, but not generate the curve (Boltzmann) data. I would appreciate some help!!

The plotting and dataset manipulating I can do, but I'm new to NLSF. Here's what I've tried (some of it was hacked out of Fit.OGS):


[Boltzy]

// %1 is the Y data column to fit
// %2 is the X data column to fit
// %3 where I'd like the data to end up same worksheet as %1, %2.
// Fit function parameters

nlsf.func$="boltzmann"; //NLSF == Boltzman type
nlsf.y$=%1; //Set fitting Column (dep. variable)
nlsf.fitdata$=%1;
nlsf.x$=%2; //Set indep. variable
nlsf.xMode=0; //Use the X column of %1
limit %1; //Get # of Data pts
nlsf.xPoints=limit.size;
nlsf.constr$=""; //No constraints
nlsf.datastep=1; //Use every data point
nlsf.funcCol$=%3; //Results Dataset

//Script hacked from FIT.OGS, [Sigmoidal] Origin 6.1 Pro!

ii=nlsf.tolerance;
nlsf.tolerance=.0005;
nlsf.cleanupfitdata();

if(nlsf.iterate(1)==-1)
return 1;
nlsf.iterate(2);
nlsf.iterate(3);
if(nlsf.datastep > 4)
{
nlsf.datastep/=2;
nlsf.iterate(1);
nlsf.iterate(2);
}
if(nlsf.datastep > 1)
{
nlsf.datastep=1;
nlsf.iterate(2);
}
nlsf.iterate(50);
nlsf.end(8);
legend;
nlsf.tolerance=ii;

queue
{
SaveRedirection=type.Redirection(16,3); // SDB 1/7/99 REPORT_TO_OUTPUTLOG
type.BeginResults(); /// RKM 12/10/98 v6.0141 REPORT_TO_OUTPUTLOG
type $Sigmoidal.SigFit; ///RKM 5/18/99 ADD_ERROR_BAR_WEIGHTING
%B=errof(%C);
if (exist(%B)==1)
type $regression.UsingWeight;
type;
type $Sigmoidal.Chisqr;
type $fit.Rsquare;
type;
Separator 3;
type $Sigmoidal.Init;
type $Sigmoidal.Final;
type $Sigmoidal.XatY50;
if(ScaleType==1) /* log scale, must be logistic */
{
type $Sigmoidal.Power;
Separator 3;
type $Sigmoidal.XatY20Log;
type $Sigmoidal.XatY80Log;
}
else
{
type $Sigmoidal.Width;
Separator 3;
type $Sigmoidal.XatY20;
type $Sigmoidal.XatY80;
}
/* *5 if a formatting statement for 5 significant digits */
type.EndResults();
type.Redirection=SaveRedirection; // restore previous redirection.
delete -v SaveRedirection;
};
//End of hacked script //

return 0;



Craig Storey

PS - Love the new LabTalk Editor!!

CStorey

Canada
137 Posts

Posted - 11/14/2000 :  10:19:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

It works as hoped.
Thanks for the help!

Craig Storey

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