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 for Programming
 Forum for Origin C
 exp and abs not found???
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

federator3000

France
1 Posts

Posted - 02/15/2012 :  06:54:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
I'm using the fitting function organizer (of origin 8.1)and i have a problem when i try to compile in the origin code builder.

This is my code:

#pragma warning(error : 15618)
#include <origin.h>
// 
void _nlsfcfitqhi(
// Fit Parameter(s):
double V0, double popF2q1, double popF2q2, double popF1q1, double popF1q2,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
	// Beginning of editable part
	
	y=(V0*(popF2q2*(exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/6,7)^2))*cos(-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2+3*(-0,00662*x^2)/4+(-0,00018*x^3))+exp(-(((-0,00662*x^2)/6,7)^2))*cos(-0,00662*x^2)+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2+3*(-0,00662*x^2)/4-(-0,00018*x^3))+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/6,7)^2))*cos(1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31)))+popF1q2*(exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2-3*(-0,00662*x^2)/4-(-0,00018*x^3))+exp(-(((-0,00662*x^2)/6,7)^2))*cos(-0,00662*x^2)+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2-3*(-0,00662*x^2)/4+(-0,00018*x^3)))))
	 /(V0*(popF2q1*(exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/6,7)^2))*cos(-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2+3*(-0,00662*x^2)/4+(-0,00018*x^3))+exp(-(((-0,00662*x^2)/6,7)^2))*cos(-0,00662*x^2)+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2+3*(-0,00662*x^2)/4-(-0,00018*x^3))+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/6,7)^2))*cos(1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31)))+popF1q1*(exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2-3*(-0,00662*x^2)/4-(-0,00018*x^3))+exp(-(((-0,00662*x^2)/6,7)^2))*cos(-0,00662*x^2)+exp(-(((1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/(2*6,7))^2))*cos((-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))/2-3*(-0,00662*x^2)/4+(-0,00018*x^3)))))
		
	// End of editable part


Please, don't tell me my fitting function is too long

The error that appears is:
quote:

Linking...
Done!
compiling...
_nlfcfitqhi.fit
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(30) :Error, function or variable abs not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(40) :Error, function or variable not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(30) :Error, function or variable abs not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(40) :Error, function or variable not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(30) :Error, function or variable abs not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(40) :Error, function or variable exp not found
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(40) :Error, general compile error
C:\Users\jonathan\Documents\OriginLab\81\User Files\OriginC\NLSF\_nlfcfitqhi.fit(30) :Error, error(s) found in compiling function _nlsfcfitqhi
Compile Failed!


i was a little bit surprised when i saw that "exp" and "abs" are considered as unknwon functions because i used these into another fitting function without problem.

I need help, pleeeeeeeeeeeeeease

Bye.

greg

USA
1379 Posts

Posted - 02/15/2012 :  10:45:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
While Origin is generally pretty good at handling number systems that use ',' as the decimal point, certain ambiguities can arise in C (and Origin C) when parsing such numbers - particularly when they occur within functions where the parser is looking for ',' as argument separators.

The messages about not finding functions abs and exp are somewhat erroneous in that what Origin really could not find was a prototype for those functions that have multiple arguments - due to the use of ','.

You need to modify your function by putting protective parentheses around all such ambiguous numbers.

Here is one snippet from your function and how it had to be fixed:

cos(-1,43*abs(0,35*x-0,022)-0,43*abs(x-0,31))
needs to be changed to:
cos((-1,43)*abs((0,35)*x-(0,022))-(0,43)*abs(x-(0,31)))

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