Author |
Topic  |
|
tony_lincoln
USA
Posts |
Posted - 06/27/2013 : 11:43:36 AM
|
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
|
Hardly can one tell what's wrong with syntax without the C code. Constraints in Fitting Function Builder needed as well. |
 |
|
greg
USA
1379 Posts |
Posted - 07/01/2013 : 2:17:58 PM
|
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.
|
 |
|
|
Topic  |
|
|
|