Author |
Topic |
|
yjiean
USA
10 Posts |
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. |
|
Hideo Fujii
USA
1582 Posts |
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. |
Edited by - Hideo Fujii on 11/03/2011 3:54:00 PM |
|
|
yjiean
USA
10 Posts |
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
USA
1582 Posts |
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 |
|
|
|
Topic |
|
|
|