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
 invalid term
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jmb22

USA
Posts

Posted - 07/23/2005 :  3:10:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Mike Buess

USA
3037 Posts

Posted - 07/24/2005 :  07:03:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

jmb22

USA
Posts

Posted - 07/25/2005 :  09:42:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The exponent should be -1 and not (-1*2.36^2).

Thanx for your help.
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