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
 Origin Forum
 User Defined Curve Fit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Orson1981

USA
1 Posts

Posted - 06/24/2009 :  12:18:56 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR0
Operating System: Windows Vista

I am trying to curve fit my data to the Langevin function of the form y = a[coth(b*x) - 1 / (b*x)]
where a and b are fitting parameters.

Everything I've tried to write a user defined curve fitting function has ended with utter failure, I'm at a complete loss as to how to get user defined functions working, let alone how write this particular function.
Any and all advise would be much appreciated.

Thanks.

easwar

USA
1964 Posts

Posted - 06/24/2009 :  5:45:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The coth() function is not available in Origin C (or in LabTalk), but you can define your function as below (by following how we defined it in the built-in Langevin function shipped with Origin)


double z = b * x;
double cothz = cosh(z)/sinh(z);
y = a * ( cothz - 1/z );


Let us know if that does not work.

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