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
 Forum for Origin C
 Parameter Initialization in NLCF
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kevinmay

Germany
Posts

Posted - 11/25/2004 :  2:15:39 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am doing NLCF. Please explain me what this Parameter Initialization mean:

sort( x_y_curve );
smooth( x_y_curve );
Dataset dx;
x_y_curve.AttachX(dx);
dx = ln(dx);
x_y_curve = ln( x_y_curve );
double coeff[2];
fitpoly( x_y_curve, 1, coeff);
a = exp( coeff[0] );
b = coeff[1];

Many thanks!

easwar

USA
1965 Posts

Posted - 11/26/2004 :  2:02:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Comments added below to code. You can see details of functions such as sort() by looking under the Origin C Lanaguage Reference help file, under the section Global Function->Analysis.

Easwar
OriginLab


// curve here referes to the pair of x,y fit dataset
// note that the x_y_curve is a copy of the original fit data set
// so any such change made to the curve does not change the original data
//
// sort the curve so that x values are in ascending order
sort( x_y_curve );
// smooth the curve using adjacent averaging to remove noise
smooth( x_y_curve );
// declare a dataset to obtain the x values of the curve
Dataset dx;
// and attach it to the x part of the fit data curve
x_y_curve.AttachX(dx);
// convert x to log of x to change the scale
dx = ln(dx);
// convert the y values of curve to log of y
x_y_curve = ln( x_y_curve );
// now perform a linear fit of the transformed x,y curve
double coeff[2];
fitpoly( x_y_curve, 1, coeff);
// assign the offset value of the linear fit to parameter a
a = exp( coeff[0] );
// assign the intercept value of the linear fit to parameter b
b = coeff[1];
// end of initialization - now parameter a and b have values



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