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
 Curve fitting using two user-defined functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ghorycon

China
4 Posts

Posted - 01/08/2012 :  10:04:32 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version : 6.1
Operating System: Win7
I am trying very hard to fit a curve with two user-defined functions. one is a symmetrical Breit-Wigner function.
the other has a asymmetrical lineshape; called the Breit-Wigner-Fano (BWF) function.
I use the following equations for multi-peak fitting:
Fit Parameter(s):
double yl, double A, double w1, double xc1, double xc2, double w2, double Q, double yb,double PI,
Independent Variable(s):double x,
Dependent Variable(s):double& y)

peak1=yl+(2*A/PI)*(w1/(4*(x-xc1)^2+w1^2));
peak2=(yb*(1+2*(x-xc2)/(Q*w2))^2)/(1+(2*(x-xc2)/w2)^2);
y=peak1+peak2;
the compile cannot be done!
Please advice!!! Really need the help!!!

Hideo Fujii

USA
1582 Posts

Posted - 01/09/2012 :  1:42:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Origin 6.1 is old, and had no Origin C compiler inside, therefore no compilation process regardless what you wrote. I suggest that the fit function type was set to "Y-Script" (equivalent to "Script" in the later versions), and the initial parameter values before starting the fir process. If you still encounter the problem, and consider that your function definition has a kind of syntactical mistake, you can download the evaluation version of the latest version (Origin 8.6), and try the new fitting tool:
http://www.originlab.com/index.aspx?go=Downloads/OriginEvaluation

This new curve fit tool, NLFit allows you actually to compile the function to see the compilation error (when you set the function type to "OriginC"), if any.

--Hideo Fujii
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