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
 Split Pseudo-Voigt Function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tayyeeyan

Singapore
6 Posts

Posted - 01/08/2008 :  05:09:08 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, I would like to know how do i implement Split Pseudo-Voigt Function in the Advanced Fitting Tool? Is the c-code builder in the Advanced Fitting tool the best method to implement.

i have this code

if (x<xc)

q1 = A * ( mu * (2/PI) * (w1 / (4*(x-xc)^2 + w1^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * w1)) * exp(-(4*ln(2)/w1^2)*(x-xc)^2) );

else

q2 = A * ( mu * (2/PI) * (w2 / (4*(x-xc)^2 + w2^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * w2)) * exp(-(4*ln(2)/w2^2)*(x-xc)^2) );


b = ((2/PI)+(1/w1)*(sqrt(4*ln(2))))/((2/PI)+(1/w2)*(sqrt(4*ln(2))));

y = y0 + 2*(q1 + b*q2)/(1+b);

but somehow like q1, q2, b not not direct variables.

larry_lan

China
Posts

Posted - 01/10/2008 :  01:18:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can define an Origin C fitting function, if you are using Origin 7.5.

The function parameters are: y0, A, mu, w1, w2, xc

And the function body is:


double q1, q2, b;
if (x<xc)
q1 = A * ( mu * (2/PI) * (w1 / (4*(x-xc)^2 + w1^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * w1)) * exp(-(4*ln(2)/w1^2)*(x-xc)^2) );
else
q2 = A * ( mu * (2/PI) * (w2 / (4*(x-xc)^2 + w2^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * w2)) * exp(-(4*ln(2)/w2^2)*(x-xc)^2) );
b = ((2/PI)+(1/w1)*(sqrt(4*ln(2))))/((2/PI)+(1/w2)*(sqrt(4*ln(2))));
y = y0 + 2*(q1 + b*q2)/(1+b);


Thanks
Larry
OriginLab Technical Services
Go to Top of Page

tayyeeyan

Singapore
6 Posts

Posted - 01/21/2008 :  11:50:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
sorry for the late reply. Larry, thanks your help! It works now!
Go to Top of Page

kaufparkangucker

Germany
1 Posts

Posted - 05/19/2016 :  10:01:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Origin Community,

I found this topic because I was searching for Split Pseudo Voigt function type 2. So I coppied the code from lary and adapt the both first formulas to Psd-Voigt2 like that:

double q1, q2, b;
if (x<xc)
q1 = A * ( mu * (2/PI) * (wL1 / (4*(x-xc)^2 + wL1^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * wG1)) * exp(-(4*ln(2)/wG1^2)*(x-xc)^2) );
else
q2 = A * ( mu * (2/PI) * (wL2 / (4*(x-xc)^2 + wL2^2)) + (1 - mu) * (sqrt(4*ln(2)) / (sqrt(PI) * wG2)) * exp(-(4*ln(2)/wG2^2)*(x-xc)^2) );

But I do not understand how to adapt b = ... and y = ... für Psd-Voigt 2 (wL1, wG1 and wL2, wG2 should be in this formula).

b = ((2/PI)+(1/w1)*(sqrt(4*ln(2))))/((2/PI)+(1/w2)*(sqrt(4*ln(2))));
y = y0 + 2*(q1 + b*q2)/(1+b);

Thanks for help.

Kauf
Go to Top of Page

Chris D

428 Posts

Posted - 05/19/2016 :  10:49:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi kaufparkangucker,

Can you send an email to tech@originlab.com with these details along with a small sample dataset for us to test with?

And please include your Origin version and serial number in the email.

Thanks,
Chris Drozdowski
Originlab Technical Support
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