T O P I C R E V I E W |
nbulcourt |
Posted - 02/11/2002 : 6:43:43 PM 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 ? |
10 L A T E S T R E P L I E S (Newest First) |
rtoomey |
Posted - 03/26/2002 : 3:12:24 PM 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
|
jc001 |
Posted - 03/24/2002 : 11:41:12 AM 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. |
nbulcourt |
Posted - 02/12/2002 : 11:36:44 AM 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. |
Mike Buess |
Posted - 02/11/2002 : 8:32:17 PM 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 |
nbulcourt |
Posted - 02/11/2002 : 8:13:13 PM this is exactly the problem. Even I leave the semicolon, it seems that the constraint is not enabled |
Mike Buess |
Posted - 02/11/2002 : 7:55:18 PM 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 |
nbulcourt |
Posted - 02/11/2002 : 7:16:13 PM thank you but it doesn't work |
nbulcourt |
Posted - 02/11/2002 : 7:15:28 PM Thank you but it doesn't work.
|
nbulcourt |
Posted - 02/11/2002 : 7:14:58 PM It doesn't work |
Mike Buess |
Posted - 02/11/2002 : 7:00:19 PM You must access it as a string...
%A=nlsf.constr$; %A=;
Mike Buess Origin WebRing Member |