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

nbulcourt

USA
5 Posts

Posted - 02/11/2002 :  6:43:43 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I write a constraint command,

nlsf.constr$="460>p4>=400;";

but it seems that origin doesn't take into account this line. When I write nlsf.nconstr=; the answer is 0.
Someone can help me ?

Mike Buess

USA
3037 Posts

Posted - 02/11/2002 :  7:00:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You must access it as a string...

%A=nlsf.constr$;
%A=;

Mike Buess
Origin WebRing Member
Go to Top of Page

nbulcourt

USA
5 Posts

Posted - 02/11/2002 :  7:14:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It doesn't work
Go to Top of Page

nbulcourt

USA
5 Posts

Posted - 02/11/2002 :  7:15:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you but it doesn't work.
Go to Top of Page

nbulcourt

USA
5 Posts

Posted - 02/11/2002 :  7:16:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you but it doesn't work
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/11/2002 :  7:55:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What do you mean by "It doesn't work"? If you type these lines in the script window...

nlsf.constr$="460>p4>=400;";
%A=nlsf.constr$;
%A=;

don't you get the following response?

460>p4>=400;

If you mean that the constraint is not obeyed during the fitting session then I'd leave out the semicolon...

nlsf.constr$="460>p4>=400";

Mike Buess
Origin WebRing Member
Go to Top of Page

nbulcourt

USA
5 Posts

Posted - 02/11/2002 :  8:13:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
this is exactly the problem. Even I leave the semicolon, it seems that the constraint is not enabled
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/11/2002 :  8:32:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You probably need to break it into two separate conditions. Try this...

nlsf.constr$="p4<460 && p4>=400";

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/11/2002 20:33:15

Edited by - Mike Buess on 02/11/2002 20:34:25
Go to Top of Page

nbulcourt

USA
5 Posts

Posted - 02/12/2002 :  11:36:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think I've found the solution.
When you define your function that you'll use to fit your data, you must define
General linear constraints = ON ?
Is there a command to do it automaticaly ?
Thanks for your help.
Go to Top of Page

jc001

UK
7 Posts

Posted - 03/24/2002 :  11:41:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is the problem I have been experiencing,
(see my post on CONSTRAINTS). The nlsf.constr$ property will only seem to allow you to set the string, I cannot get it to return the currently set string (the Origin help file documents it as a Read-Only
property).

As for forcing a new function to have constraints enabled, I use this macro:

def TurnOnConstr {

ini.file$=%YFitFunc\%1.fdf;
ini.section$=Controls;
ini.key$=General Linear Constraints;
ini.getStr(S,Off);
if(%S=="Off"){
ini.setStr(On);
};

};

Where %1 is the function file name you are
using. This macro must be run before
you initialize the fitter with the fitting function.

Hope this might help.
Go to Top of Page

rtoomey

USA
184 Posts

Posted - 03/26/2002 :  3:12:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Very nice jc001.

A few additional notes:

  • You don't really need to check the value of the General Linear Constraints key since you plan on setting it to "On" in the macro every time.

  • In Origin 7 the syntax is a bit easier since the setstr method takes additional arguments:

    ini.setstr(keyValue,keyName,sectionName,fileName\pathName);

    For example:

    ini.setstr(On,General Linear Constraints,Controls,%YFitFunc\%1.fdf);

  • Finally, I found a suggestion in our database which requests an addition to the nlsf object. If implemented, the new nlsf object property would provide read/write access to the General Linear Constraints check box. I have updated the suggestion with all the names in this post.


Ryan Toomey
Technical Support
OriginLab Corporation

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