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
 Error! Illegal syntax in constraints.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tony_lincoln

USA
Posts

Posted - 06/27/2013 :  11:43:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear Madam/sir,

I downloaded OriginPro from Originlab website with evaluation licencse, to evaluate Origin Ver. 9 in Windows 8 Operating System. I'm trying to fit one exponential curve using a function y = A0 + A * (1- exp(-Tau*x) ). In my C codes, I set parameters as following:
NLSF.Func$ = "FRAP_EXP";
NLSF.p1 = 0.5;
NLSF.p2 = 0.5375;
NLSF.p3 = 0.01;
NLSF.ChiSqrErr = 0;
I built fdf in Fitting Function Builder with the same parameter setting.
When I tried to run this C codes, it shows "Error! Illegal syntax in constraints." I checked many times, but cant find anything wrong with syntax. Can you do me a favor?

Thanks.
Tony

ZanHUNG

20 Posts

Posted - 06/28/2013 :  03:45:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hardly can one tell what's wrong with syntax without the C code. Constraints in Fitting Function Builder needed as well.
Go to Top of Page

greg

USA
1378 Posts

Posted - 07/01/2013 :  2:17:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you really are using Origin C then you should be able to use this example:
http://ocwiki.originlab.com/index.php?title=OriginC:Fit_on_one_data_with_one_explicit_function
with these modifications:

string strFDF = okutil_get_origin_path(ORIGIN_PATH_USER, "FitFunc") + "FRAP_EXP.FDF";

and

int nNumParams = 3;
vector vParams(nNumParams); // this vector should be initialized to the total number of paramaters
// This vector will be used both to set initial paramater values, and to receive the parameter values after fitting:
vParams[0] = 0.5; // y0
vParams[1] = 0.5375; // xc
vParams[2] = 0.01; // w

But it looks to me like you are actually using old LabTalk script to fit which should still work if you are doing everything else right, but we would recommend using the newer nlbegin, nlfit, nlend functions to script any fitting in Origin 9.
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