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

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
jc001 Posted - 03/20/2002 : 11:57:05 AM
I'm writing an iterative fitting tool, and
need to update other parts of the project as the user edits any constraints in the NLSF object.

Is there anyway to read the constraints
string out from the NLSF object?
Nlsf.constr$ only works one way.

I wrote a script to read the constraints string from the .fdf file, but this file doesn't get updated as the constraints are edited in the dialog box.

Could there be some script way to force the fitter to save the fitting function file without requiring the user to hit save?

Thanks

5   L A T E S T    R E P L I E S    (Newest First)
rtoomey Posted - 03/25/2002 : 11:46:28 AM
I should note that you should clear any previous constraints before setting new ones (even if the constraints were empty before).

For instance:

nlsf.constr$="";
nlsf.constr$="A1>=0.00234";
%A=nlsf.constr$;
%A=;

Does that help?

- rtoomey

jc001 Posted - 03/25/2002 : 10:48:24 AM
That is strange?...

I have hit upon a work around though using a macro that calls the nlsf.cMatrix property to access the constraint data and then rebuilds the original constraint string from this!
Mike Buess Posted - 03/24/2002 : 5:53:02 PM
I copied the script from your last message and pasted it into both the Origin 6.1 and 7.0 script window. It returned

A1>=0.00234

in both cases. I'm running Win2k, but I doubt if that matters.

Mike Buess
Origin WebRing Member
jc001 Posted - 03/24/2002 : 11:52:39 AM
Thanks

But I still have no joy returning the constraints string from nlsf.Constr$. I wondered if this might be because I'm setting multiple constraints separated with semi-colons or because I'm using a string variable to set them, but even using no semi-colons with only one literal constraints string:

nlsf.constr$="A1>=0.00234";
%A=nlsf.constr$;
%A=;

returns an empty string.

I'm using NT4, could this be the problem?
rtoomey Posted - 03/22/2002 : 10:33:51 AM
You should be able to read the General Linear Constraints into a string variable as follows:

%A=nlsf.constr$;

Since you wrote a script to read the constraints, why not then reverse the process and write to the FDF file after setting the constraints. That way you effectively update both the interface and FDF at the same time.

New ini object methods in Origin 7 should allow you to do this very easily. For instance, the ini.setstr() method now accepts the following arguments:

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

Translate this into setting the constraints and you get something like:

ini.setstr(b2;a2!=b2;,a1!,Constraints,%Yfitfunc\user1.fdf);



Of course, the constraints I have entered aren't really valid. They are just for illustrative purposes.

- rtoomey




Note: In earlier versions of Origin you would need to execute something like:

ini.get.fileName$=%Yfitfunc\user1.fdf;

ini.section$=Constraints;

ini.setstr(b2;a2!=b2;,a1!);






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