T O P I C R E V I E W |
jmb22 |
Posted - 07/23/2005 : 3:10:51 PM Origin Version (Select Help-->About Origin): 7.5 Operating System:XP
Hey,
I am trying to compile the following function in code builder to be used as a fitting function:
y = P1+2*(1+P2*1.865E-2*(1/(1.865E-2*P3)))^-1*((2.36)^2)*6.4899*1/x; There are 3 fitting parameters: P1, P2 and P3.
When I try to compile the function, I get the following:
compiling... _nlfspinpumpfnn.fit C:\Program Files\OriginLab\OriginPro75\Jean-Marc Beaujour\OriginC\NLSF\_nlfspinpumpfnn.fit(40) :Error, invalid term C:\Program Files\OriginLab\OriginPro75\Jean-Marc Beaujour\OriginC\NLSF\_nlfspinpumpfnn.fit(40) :Error, general compile error C:\Program Files\OriginLab\OriginPro75\Jean-Marc Beaujour\OriginC\NLSF\_nlfspinpumpfnn.fit(31) :Error, error(s) found in compiling function _nlsfspinpumpfnn
i checked the parenthesis and all the terms ... it seems to be alright. I used Mathematica to fit the experimental data and that works. So what's the problem??
Thanx. |
2 L A T E S T R E P L I E S (Newest First) |
jmb22 |
Posted - 07/25/2005 : 09:42:14 AM The exponent should be -1 and not (-1*2.36^2).
Thanx for your help. |
Mike Buess |
Posted - 07/24/2005 : 07:03:07 AM Hi,
It compiles if you bracket what appears to be the entire exponent...
y = P1+2*(1+P2*1.865E-2*(1/(1.865E-2*P3)))^(-1*((2.36)^2)*6.4899*1/x);
However, if that is correct then your equation is somewhat simpler than you have written it...
double C1 = 6.4899 * 2.36^2; double C2 = 1.865E-2; y = P1 + 2*(1 + P2*C2*(1/(C2*P3)))^(-1*C1*1/x); - which reduces to - y = P1 + 2*(1 + P2/P3)^(-C1/x);
In other words, you only need two fitting parameters.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/24/2005 07:31:42 AM |
|
|