User Tools

Site Tools


How do I write only the binding constraints to an external file?

To find out if a constraint is binding you just need to look at equation_name.slack.

Assume you have that constraint:

e(i,j)$(ord(i)<ord(j)).. ... =l= ...;

Now you solve and afterwards you could selectively write only those instances of constraint e, which are binding:

file fx /binding.txt/; put fx; 
loop((i,j)$(ord(i)<ord(j) and e.slack(i,j)<1e-6), 
     put,, e.slack(i,j) /
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/write_only_the_binding_constraints_to_an_external_file.txt · Last modified: 2008/05/27 16:47 by support