User Tools

Site Tools


gams:write_only_the_binding_constraints_to_an_external_file

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 i.tl, j.tl, e.slack(i,j) /
     );
gams/write_only_the_binding_constraints_to_an_external_file.txt · Last modified: 2008/05/27 14:47 by support