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

thamizh

India
3 Posts

Posted - 01/13/2015 :  06:57:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin Pro 9.0.0 (32 bit) SR2 b87
Operating System: Windows XP

How to use the origin C command "Curve_derivative" in the NLSF function? My fitting parameters will generate two Datasets, I need to differentiate the two Datasets with respect to independent variable "x" and then use these differentiated datasets further in my program.

I have the Code in Origin C. But I have to change the fitting parameters manually, which is a very cumbersome process..?

I got stuck about how to use the "Curve_derivative" in NLSF..!

Let me thank you in advance for your help in this regard.

-Thamizhavel

Echo_Chu

China
Posts

Posted - 01/14/2015 :  04:48:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Thamizhavel

You can look at the document of curve_derivative in this page
http://www.originlab.com/doc/OriginC/ref/Curve-Derivative-GlobalFunction

However, I assume your question is how to output the result of curve_derivative in a worksheet during the fitting. If yes, here is an example to create worksheet and then output an internal result to the worksheet


void _nlsfMyGaussian(
// Fit Parameter(s):
double y0, double xc, double A, double w,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
	// Beginning of editable part
	y = y0 + A/(w*sqrt(PI/(4*ln(2)))) * exp(-4*ln(2)*(x-xc)^2/w^2);
	double lnxc = ln(xc);
	//Generate a worksheet and output the internal result,lnxc, to the worksheet
	Worksheet wks("[Book1]Sheet1");
	if (!wks)
	{
		wks.Create("Origin.otw");
	}
	 wks.SetCell(0, 0, "lnxc");
	wks.SetCell(0,1,lnxc);
	
	// End of editable part
}


Echo
OriginLab Corp.
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