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

pegor

Germany
Posts

Posted - 02/22/2005 :  10:20:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi Mike,

The error occures during execution.
The error msg is: Error 28037.Likely caused by errors in the user defined formula or poor parameter initialization.

this is the code im using:

using NLSF = LabTalk.NLSF;
NLSF.Init();
NLSF.Func$ = "user6";
NLSF.P4 = 2.50175;
NLSF.FitData$ = crvData.GetName();
NLSF.Execute("parainit");
NLSF.Wtype = 1;
NLSF.W$ = dsErr.GetName();
NLSF.ChiSqrErr = 0;
NLSF.Fit(100);
NLSF.Fit(100);
NLSF.Fit(100);
NLSF.PasteParams("P");
NLSF.End();
}


and this is the user6 function:
y=P1*(1+P2*cos(2*Pi*(x-P3)/P4))

i want to fix P4 to the value 2.50175

Thanks in advance
Best regards,
Pegor

Mike Buess

USA
3037 Posts

Posted - 02/22/2005 :  11:38:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pegor,

Please use the "Reply to Topic" button to keep your posts in one thread. It gets confusing when you scatter the same thread over separate topics.

I suspect that user6 is a function defined by you and that you haven't provided a parameter initialization script. In that case NLSF.Execute("parainit") does nothing and you must initialize all parameters in your Origin C function...

using NLSF = LabTalk.NLSF;
NLSF.Init();
NLSF.Func$ = "user6";
NLSF.P1 = 1.234; // use an appropriate value
NLSF.P2 = 5.678; // ditto
NLSF.P3 = 9.10; // ditto
NLSF.P4 = 2.50175;
NLSF.V4 = 0; // fix parameter 4
NLSF.FitData$ = crvData.GetName();
//NLSF.Execute("parainit");
NLSF.Wtype = 1;
NLSF.W$ = dsErr.GetName();
NLSF.ChiSqrErr = 0;
NLSF.Fit(100);
NLSF.Fit(100);
NLSF.Fit(100);
NLSF.PasteParams("P");
NLSF.End();

Mike Buess
Origin WebRing Member
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