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
 LabTalk Forum
 LabTalk 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

Belsinga

Netherlands
28 Posts

Posted - 06/08/2010 :  03:03:24 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8 SR 6
Operating System: Win Xp

Hello,

I can not seem to get my simple fitting-script to work. Can anyone help? (he doesnt seem to understand my dataset or something?

regards,
Boudewijn

*****************
dataset DS1=col(Q9);

LR -b DS1

type "Slope is $(lr.b)";
type "Quality is $(lr.r)";

Belsinga

Netherlands
28 Posts

Posted - 06/08/2010 :  03:14:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Obviously, the ";" was missing, but that was not the problem

*****************
dataset DS1=col(Q9);

LR -b DS1;

type "Slope is $(lr.b)";
type "Quality is $(lr.r)";
[/quote]
Go to Top of Page

larry_lan

China
Posts

Posted - 06/08/2010 :  04:47:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

Did you see any Error Message? We tried and the script have no problem. If the issue still exist, maybe you can send us your OPJ and we can try again.

Thanks
Larry
OriginLab Technical Services
Go to Top of Page

Belsinga

Netherlands
28 Posts

Posted - 06/10/2010 :  08:02:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I get no apparent errors.

The code doesn't seem to get to "TST2"
(when I removed the '=' sign in "dataset DS=col(Q9)", the errors dissapeared).

*****************************
type "TST1";

dataset DS col(Q9);

type "TST2";

LR -b DS [0,50];
//lr.maxLRange = 50;

type "Slope is $(lr.b)";
type "Quality is $(lr.r)";
Go to Top of Page

larry_lan

China
Posts

Posted - 06/10/2010 :  10:45:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

It's weird. dataset DS col(Q9) (no '=' sign) is invalid and should return error in 8.0 SR6. How about the following script:

newbook;
col(a) = data(1, 30);
dataset ds = col(a);
stats ds;
ty "The sum of column a is $(stats.sum)!";


Thanks
Larry
Go to Top of Page

Belsinga

Netherlands
28 Posts

Posted - 06/11/2010 :  03:40:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you,

This one works, but I don't understand why it only works with "newbook;" Can't you call on existing workbooks?

Secondly, I am now working with non linear fits. I would like to edit the x-range of the fitted curve and I tried the following, but somehow it still fits the entire curve, could you comment on that?

Thanks

/******************/

nlsf.func$ = Allometric1;
a=1;
b=1;

nlsf.cleanupfitdata();
nlsf.numfitsets = 1;
nlsf.fitdata$ = Book5_F;

double Vxmin = 0.02;
double Vxmax = 0.03;


nlsf.xBegin = Vxmin; nlsf.xEnd = Vxmax;

// WHY DOESNT IT CHANGE ACCORDINGLY IN THE PLOT?

type $(Vxmin);
type $(Vxmax);

//nlsf.xPoints = 201;
nlsf.fit(100);

nlsf.funcx$ = Book5_A;
nlsf.funccol$ = Book5_R1; nlsf.makecurve(func);
Go to Top of Page

Belsinga

Netherlands
28 Posts

Posted - 06/11/2010 :  05:44:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Never mind, I allready found it:

it should be "slsf.dataBegin"

Regards,
Go to Top of Page

larry_lan

China
Posts

Posted - 06/11/2010 :  08:46:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

I doubt you didn't active the worksheet that contains Q9. When using dataset ds=col(Q9), it will refer to the Active Worksheet. Or, you should specify the full data range.

Now that you are using Origin 8, I suggest you can use our new X-Functions to do nonlinear fitting. Please search nlbegin in the programming help. There are examples for how to use these X-Functions. And you can specify a range to fit part of the curve.

Thanks
Larry
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