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

artem

USA
Posts

Posted - 11/29/2007 :  01:12:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): Origin 7.5 SR 5
Operating System: windows vista

Hi,


I am a beginner of orgin C and trying to calculate a dataset from NLSF using nlsf.makecurve. Some how after I run the program, I got nothing other than a new graph layer. ( I have a new blank worksheet layer before I run the code.) Any advice/help is welcome. Many thanks.

Below is the small program I wrote:

void nlsf_test()
{
using nlsf = LabTalk.NLSF; // define nlsf
nlsf.func$ = "Gauss"; // select fitting function
nlsf.p1 = 1; //initialize parameter values//p1 is c, p2 is q, p3 is p(ower), p4 is F1, p5 is ig//
nlsf.p2 = 1;
nlsf.p3 = 1;
nlsf.p4 = 1;
//nlsf.p5 = 0;

nlsf.makecurve("func");
nlsf.xbegin = 0.5;
nlsf.xstep = 0.5;
nlsf.xend = 20;
nlsf.xmode = 5;

nlsf.funcx$ = "data1_a";
nlsf.funccol$ = "data1_b";

}



Edited by - artem on 11/29/2007 01:21:36 AM

Mike Buess

USA
3037 Posts

Posted - 11/29/2007 :  4:50:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
First, you should wait until its parameters (nlsf.xbegin, nlsf.funccol$, etc.) have been defined before you execute nlsf.makecurve(). Second, using makecurve with xmode=4 or 5 can yield unpredictable results. I find that it's more reliable to use xmode=2 and create the X values myself...

Dataset ds("Data1_A"); // declare column A as dataset
ds.Data(0.5,20,0.5); // create X values
nlsf.xmode = 2;
nlsf.funcx$ = "data1_a";
nlsf.funccol$ = "data1_b";
nlsf.makecurve("func");

Mike Buess
Origin WebRing Member
Go to Top of Page

artem

USA
Posts

Posted - 11/30/2007 :  01:18:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much, Mike. I emailed their tech support this moring and got their reply late this afternoon. They said the same thing. Thank you very much for your support.

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