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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 NLSF fit

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
pegor Posted - 02/22/2005 : 10:20:54 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 02/22/2005 : 11:38:01 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000