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
 Help inputting constraints into a nlsf in ver 8.0

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
andrewdsto Posted - 10/13/2009 : 03:44:13 AM
Origin Ver. 8.0 and Service Release 5(Select Help-->About Origin):
Operating System: XP

Hi I am trying to input constraints into a NLSF fit
but am having trouble making the fitt take note of them.

This is in response to my initial post:
http://www.originlab.com/forum/topic.asp?TOPIC_ID=7809

and I have looked at the following about accessing errors and values:
http://www.originlab.com/forum/topic.asp?TOPIC_ID=7259

my code which is a simple variation of your example in the help files is

range fitx=1, fity=4;
nlbegin (1,2) expDecay2 tt ; // initialize fitting session for the first 2 columns using Expdecay2 function;

tt.constraints=1;
tt.constr$="tt.A1 + tt.A2 <= $(limit.ymax);";

tt.x0=xvalue(limit.imax,%(activedataset$));tt.f_x0=1; // first fix the x0 value
tt.y0=0;tt.f_y0=1; // also fix y0
tt.A1=(0.9*limit.ymax); // initialise A1, T1, A2, & T2
tt.T1=1;
tt.A2=(0.1*limit.ymax);
tt.T2=4;
nlfit;
fity=fit(fitx); //now we can generate the fit curve
nlend; // all done with fitting, can terminate it now

tt.constraints=;
tt.constr$=;
tt.a1+tt.a2=;
limit.ymax=;

this code produces the following output:

TT.CONSTRAINTS=1
tt.A1 + tt.A2 <= 2.62809;
TT.A1+TT.A2=2.8588549224227
LIMIT.YMAX=2.6280916666667

clearly the constraint that tt.A1 + tt.A2 <= 2.62809; has not been followed?

Please let me know what I am doing wrong. I have tried various scenarios with the constraints. Running lnpara after the constraints commands show no constraints in the command.

however tt.=; produces
.
.
.
func = expDecay2
nfuncparams = 6.
nderivparams = 0.
nsets = 1.
replica = 0.
confc = 95.
confp = 95.
constr = tt.A1 + tt.A2 <= 2.62809;
constraints = 1.
maxiter = 400
tolerance = 1E-9


2   L A T E S T    R E P L I E S    (Newest First)
andrewdsto Posted - 10/14/2009 : 10:45:22 PM
Hi Easwar,

thanks for the quick reply.

I had originally tried with "A1 + A2 ..." as well and figured there must be something wrong.

I will stick with the old method if I need to put in constraints for the time being and look forward to the patch.


thanks Andrew
easwar Posted - 10/14/2009 : 10:13:55 PM
Hi,

The syntax for constraint should be "A1+A2..." and not "tt.A1+tt.A2...".

However setting constraints from script is not currently working, so this is something we will need to fix.

In the mean time the only workaround appears to be for you to add the constraint to the fitting function file itself. You can do this by using the Fitting Function organizer.

Then you can access the function to fit from script and the constraint will take effect. This of course means you have to edit the function with Function Organizer every time you need to change the constraint.

Again, we are looking into fixing this, thanks for reporting the problem.

Easwar
OriginLab

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