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
 User defined function: code builder

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
yjiean Posted - 11/03/2011 : 2:57:32 PM
Hi

I am trying to create a user defined equation to fit my data points. The equation is
F=F0/((1+Kd*Q)(exp(Q*v*6.02E23/1000)))+sc*Q
where F is the dependent variable, Q the independent variable and the rest are parameters. I have having trouble compiling the equation in code builder: it returns 'Error, function or variable (1+Kd*Q) not found'. The aim is to get a value for the parameter Kd, v and sc.

I would be grateful if someone could point out what I am doing wrong. Or if there is another easier way of doing this. Thanks in advance.
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 11/03/2011 : 4:29:58 PM
Hi yjiean,

I suspect that when the fitting process started, the parameter(A's) value was not given as "missing". If you created the user-defined function by Fitting Function Builder, all parameters are given the value 1.0 as default. If you created the function by Fitting Function Organizer, say as you are using an old Origin version which don't provide the Builder, you can give the initial values by pressing the "sheet with a red pointer" button at the Parameter Settings field in the Organizer. Or, when you start NLFit, choose the "Parameters" tab, and give the "reasonable" parameter initial values manually.

I hope my suggestion is helpful.

--Hideo Fujii
Originlab
yjiean Posted - 11/03/2011 : 4:06:20 PM
Hi Hideo

Thank you for your help.
The function compiled but I am still not able to get it to work.
I am now trying with a simple y=x+A to find the problem. When I tried to Analysis>Fitting>Nonlinear Curve Fit, the user defined y=x+A did not fit to the points. Am I doing something wrong?

Under the fitting function organizer, the function type: user defined; Function form: Origin C. Is there something I should be doing with the parameter initialization? Many thanks.

yjiean

quote:
Originally posted by Hideo Fujii

Hi yjiean,

At least, I see that a multiplication * between ...Kd*Q) and (exp(Q... is missing.

--Hideo Fujii
OriginLab

Hideo Fujii Posted - 11/03/2011 : 3:36:49 PM
Hi yjiean,

At least, I see that a multiplication * between ...Kd*Q) and (exp(Q... is missing.

--Hideo Fujii
OriginLab

P.S. exp(Q*v*6.02E23/1000) part may quite easily overflow the range of double variable, though this is not a mathematical issue, but rather practical. Exp(666) results overflowing.

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