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
 All Forums
 Origin Forum
 Origin Forum
 Split Pseudo-Voigt Function

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tayyeeyan Posted - 04/12/2008 : 07:21:19 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

Hi, I am trying to customize my peak fitting function in the advanced fitting wizard of the non-linear fitting. My code goes like this

if (x<xc)

y = y0 + (2/(1+ ((n1*2*sqrt(ln(2)/PI)/w1) + (1-n1)*(2*w1/PI))/((n2*2*sqrt(ln(2)/PI)/w2) + (1-n2)*(2*w2/PI))))*(n1*(((2*(sqrt(ln(2)/PI))/w1)*exp((-4*ln(2)*(x-xc)^2)/(w1^2)))) +(1-n1)*(2*w1/PI)*(1/(1+4*(x-xc)^2)));

else

y = y0 + ((2*((n1*2*sqrt(ln(2)/PI)/w1) + (1-n1)*(2*w1/PI))/((n2*2*sqrt(ln(2)/PI)/w2) + (1-n2)*(2*w2/PI)))/(1+((n1*2*sqrt(ln(2)/PI)/w1) + (1-n1)*(2*w1/PI))/((n2*2*sqrt(ln(2)/PI)/w2) + (1-n2)*(2*w2/PI))))*(n2*(((2*(sqrt(ln(2)/PI))/w2)*exp((-4*ln(2)*(x-xc)^2)/w2^2))) +(1-n2)*(2*w2/PI)*(1/(1+4*(x-xc)^2)));

n1, n2, w1, w2, y0 is the variable.
When i compile, i got an error that says
'Variable "(2*(sqrt(ln(2)/3.1415926535897932384626))/w1)*exp((-4*ln(2)*(x-xc)^2)/(w1^2))" not declared"

may i know what does it means and how can i solve this problem?

Thanks a lot in advance first!

;)


1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 04/14/2008 : 05:49:10 AM
Hi:

You'd better define some temporary variables and use short expressions in your function, such as:


double temp1 = sqrt(ln(2)/PI)/w1;
double temp2 = 4*pow( (x-xc), 2 );
if(xc<0)
{
y = temp1 + temp2;
}
else
{
y = temp1 * temp2;
}


Or, it's very easy to make mistakes.

Thanks
Larry
OriginLab Technical Services

Edited by - larry_lan on 04/14/2008 05:59:00 AM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000